Wifi Setup for MB03+, version 1.3
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

released: 11.11.2021



   



What's new in 1.3?
~~~~~~~~~~~~~~
- added: user speed selection
- speed management rewritten from version 1.0 to 2.0- should work better (better at startup, newly it allows to change speeds)



Bugs in version 1.3
~~~~~~~~~~~~~~~
- if speed 0 selected (2400 Bd), default AP speed info is distorted



Words about speed selection
~~~~~~~~~~~~~~~~~~~~~
Some may say more speeds are not needed, but I feel since WSetup is a setup, it should enable the user to choose speeds of their wish. New speed management 2.0 (SM20) detects your installed firmware in MB03+ (MBFW). Basically, there can be 3 MBFWs: supporting 7, 12 or 23 speeds. As for 23 speeds, the wifi module does not work with all of them. With speeds 13, 14 and >16, your module will not communicate. However, WSetup allows to set them in, but then you will most probably get stuck. Still you can control WSetup. Wifi reset helps to realign in case of speeds >16, but not with 13 and 14, in such case you have to press W to turn module OFF when quitting, and then press Q for quit. Thus, module has been turned off and upon new start of WSetup, it should automatically connect to the ideal speed.

Now, what is ideal speed? On start, WSetup and its SM20 seeks if there is already alignment in speeds. If yes, it checks what speed it is and sets either maximum or user defined speed. If not, it again aligns to user defined or maximum speed for a given MBFW (can be 7, 12 or 16. Yes maximum speed of 23 is automatically lowered to 16 so that speeds work properly from the beginning). SM20 can also align to the user defined speed, that a user can select directly in WSetup.

You may notice, that for speeds under 8, border starts flickering magenta. The lower the speed, the more magenta. Every magenta flicker means TX line is busy.

I still think chossing betweens speeds has a meaning. Eg. my http downloader works with max speed of 12 (1152000 Bd.) for the moment.

Instructions for the wifi module says maximum communiaction speed can be up to 40x base speed (115200 Bd)= 4096000 Bd= speed 17 in WSetup. Oddly, we never made the module communicate at that speed. Max is 16 (3456000 Bd.).

SM20 is a very useful piece of code and if extracted can be used on its own. It ensures communication speed with your wifi module automatically.






WiFi setup for MB03+, version 1.0
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

released: 28.10.2021


   

   

   





Author: Hood
Acknowledgements: Lanex, LMN, Busy, Shrek, Peg7g, Nihirash, and others from Slack discussion.
version 1.0

It is distributed in two versions. One as a binary and the second as a standalone. The binary one is to be flashed with Reflasher utility, under letter F. Once flashed, press "W" to run the application In MB03+ boot menu after reset. The standalone one works isolated in BS-DOS as well as in Esxdos. Both versions behave same way and have same functionality.



General
~~~~~~~
WiFi setup for MB03+ (further reffered to as "WSetup") does the same job as Wifi configurations utilities on PC or mobile devices- it connects your WiFi module to the internet. It is distributed in two forms.

Its main purpose is to serve to the user as a tool to setup essential functions of their WiFi module. Thus WSetup can be used as a base for user's own WiFi programs and utilities. WSetup 1.0 is self sufficient and should not need outer interventions for its work (like typing AT commands from a terminal, typing OUTs from BASIC, etc.). WSetup uses the latest WifiBios ver. 1.8.



Functions/ features
~~~~~~~~~~~~~~~~~~~
- displays information/ screen organisation
- constant monitoring of WiFi state
- speed management 1.0
- set time& date
- run terminal
- leave WiFi module ON/OFF on exit
- connect to selected AP (Access Point)
- disconnect from AP
- constant monitoring of signal strength
- reset WiFi module



I tried to write the WSetup as user friendly as possible but for sure, let's have a closer look at individual features.

Display information/ screen organisation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Upon start, WSetup always turns WiFi module on. Then speed management is called, set speed is displayed on a second line (always maximum UART speed given for your MB03+ firmware, so with the latest one you get speed 16= 3456000 Bd at the moment). After set speed comes "MBFW=" followed by a number. The number indicates number of UART speeds allowed by your MB03+ firmware. First line is also showing a connection status and will tell you detailed description of connection. Third line shows AP, to which you are currently connected to plus its signal strength. Line 4 shows default AP, line 5 shows Auto AP, it means if module should automatically connect to default AP or not after it's power up. Line 6 is showing default speed set in WiFi module.

Blank area beneath displays list of AP in your surroundings if chosen. Then list of program functions follows. Bottom two lines serve as a communication interface. Here display of reports or user data input take place. In the lower right corner a blue square appears if the program waits for the module.



Constant monitoring of WiFi state
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This feature gives the user constant overview about the state of WiFi module, so that the user knows if any action is neccesary.



Speed management 1.0
~~~~~~~~~~~~~~~~~~~~
One of the trickiest parts to sort out. It goes as low as to MB03+ firmware detection up to WiFi speed detection. This part ensures that communication between internal UART and WiFi module is aligned. No matter what state module and UART were in, Speed management 1.0 should be able to always align them in the same speed and thus ensure communication with AT commands can take place. Version 1.0 sets automatically maximum speed for given MB03+ firmware. The best one is 3456000 Bd. Other speeds do not work as yet. In future versions of Speed management, I plan to add possibility to set all speeds which MB03+ UART offers.



Set time& date
~~~~~~~~~~~~~~
Press S to set time& date on your MB03+. Both are then set sharp precisely from available internet servers. Important notice: you may influence the time by setting appropriate time zone in MB03+ setup. This way you may also influence winter and summer times (by adding or substracting +1 to our time zone). I think about how winter/summer time could be set automatically, but at the moment have no idea.



Run terminal
~~~~~~~~~~~~
Press T to run terminal. It was written by ZX Next authors (eg. Victor Trucco, Bill Gilberts..) and slightly adapted for MB03+ by LMN and me. The terminal is very handy if you need to work with WiFi module in detail. Speed 115200 Bd is set upon terminal start. Quit it with SS+ SPACE.



Leave WiFi module ON/OFF on exit
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Press W to toggle ON/OFF. WSetup will leave Wifi module on/off according to this toggle.



Connect to selected AP (Access Point)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Press A to connect you to Access Point in your surroundings. A list of found APs is displayed, starting with ones with strongest signal. You may browse among them with up/ down arrows, edit key will cancel selection, Enter key proceeds to selected AP login as default AP. SS+ Enter proceeds to select AP login as current AP. Press TRUE VIDEO to exit from password input. If login was successful, then selected AP will become default or current AP. If you are already connected to an AP and you want to change the AP, you do not have to disconnect from the old one. Just select the new one and log in to it. Default AP is the one that WiFi module connects to after its power up (supposing autoconnection is set to ON). Proper AP connection is a gateway to the absolute world of internet:-)



Disconnect from AP
~~~~~~~~~~~~~~~~~~
Press D to disconnect from AP. From some reasons you may want to disconnect from AP.



Reset WiFi module
~~~~~~~~~~~~~~~~~
Press R to reset WiFi module. It can happen, that you got stuck. Eg. you are unable to connect to AP even though your password is correct. Then WiFi module reset could help.



Overall functionality of WSetup
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...depends quite a lot on the firmware that your module holds. I recommend to use the latest one. WSetup was tested with FW AT version: 1.7.4.0 from May 11, 2020. SDK version is 3.0.4(9532ceb). You find out your FW version if you switch to terminal and type command "AT+GMR". If you have older version, try updating your FW with AT command "AT+CIUPDATE". If this command returns "ERROR" your FW is too old and does not know update over internet. So you have to upgrade (flash) FW in your module with a special hardware.



Bugs in version 1.0
~~~~~~~~~~~~~~~~~~~~
Some errors occur from time to time, and I plan to fix them. You may report them to me, either on Slack, or ony Telegram, WhatsApp, Facebook. Or mstava01(at)gmail.com.



to-do list
~~~~~~~~~~
- Speed management- to work with user defined speed- priority
- show IP address ??
- ping ??
- module name change
- auto AP change
- display module FW version ??

It all depends on my time and free memory. Total WSetup length mustnot exceed 16384 bytes in order to hold in one 16 kb page.