Search This Blog

Sunday 19 August 2018

Esparto V2 almost ready! The new web UI part 2

The lower panel(s)

WiFi configuration


Recall the original web server UI image:

Starting on the top row (but right-to-left) the Reboot and Factory Reset buttons should be fairly self-explanatory: reboot "does what it says on the tin". Factory Reset erases all WiFi configuration,  all user-defined configuration data (to be covered in more detail in the future) and reboot completely "clean".

Before we go on to the main panel selector button, a quick word about "system health". While ever the ESP8266 is running the heart icon will throb once per second (using some nifty - but quite complex - CSS). The LED to its left shows green while a connection to your MQTT server exists and red if it goes offline for any reason.

The main set of icons are the panel selectors. Clicking on each causes a new panel to open and the rest of this series will cover each panel individually, starting here with the default WiFi configuration panel. Again this is reasonably self-evident, with a couple of important points regarding how Esparto works.

If your code does not define the SSID / PSK then the device will fall back to AP mode with a captive portal allowing you to configure them dynamically, Once configured and connected, they can be changed at any time and the device will continue to run without rebooting, using the new credentials.

If on the other hand you compile the credentials in, then it will connect immediately to your router in STA mode. Once connected, if you subsequently change the credentials, the new values are stored, and will be used in preference to the compiled defaults until you perform a Factory Reset.

Similarly, if you do not compile in a device name, it will default to ESPARTO-<chip ID> where chip ID is the last 6 digits of the device MAC address. You can rename it to something more sensible using this panel once it has booted into STA mode. Again, once changed via this panel, the new name will take precedence over both the default chip ID option and / or any compiled-in value.

Choose the name carefully - NO SPACES! - as it is the name by which it will be known on the local network: "testbed.local" in the above example. More importantly, it is the name by which all MQTT commands are prefixed: sending testbed/cmd/reboot from your broker will...you guessed it.

Incidentally if you have many devices, you can also send all/cmd/reboot to...well, you can probably guess that one too.

No comments:

Post a Comment