[SYS] Configuration portal for Ethernet board and HA link to config (#1761)

* [SYS] Configuration portal for Ethernet board

Enable Wifi Manager as a configuration portal for Ethernet boards, also leverage the Wifi Access point as a fallback connectivity method

Add link to the WebUI from HA and reduce key length

* Remove unnecessary environment

Now that one environment cans support wifi and ethernet, merge the 2
This commit is contained in:
Florian authored and GitHub committed 2023-10-03 07:33:47 -05:00
1 parent f3216171e3
commit dd5e565788
7 files changed
+129 -128

No files matched your search

+16 -8
View File
@@ -1,15 +1,19 @@
# WiFi and MQTT configuration
# Wifi and MQTT configuration
## WiFi and MQTT configuration portal for WiFi boards
## Configuration portal
Once loaded into your ESP, and if you don't use the manual configuration, you have to set your network parameters with WiFi Manager portal.
From your smartphone, search for  OpenMQTTGateway or OMG WiFi network and connect to it with the `WifiManager_password` you have defined (the default password is **"your_password"**), or if you are using a device sold by Theengs or the macro `-DWM_PWD_FROM_MAC=true`, the password will be the last eight digits of the device MAC Address with upper case.
From your smartphone, search for  OpenMQTTGateway or OMG_ WiFi network and connect to it with the `WifiManager_password` you have defined (the default password is **"your_password"**), or if you are using a device sold by Theengs or the macro `-DWM_PWD_FROM_MAC=true`, the password will be the last eight digits of the device MAC Address with upper case.
Example, the password would be `CCDDEEFF` for a MAC Address `AABBCCDDEEFF`.
For Theengs devices, the MAC Address can be found on the device sticker, and for all the devices, it is printed on the serial monitor logs.
For the Theengs Plug, the MAC Address can be found on the device sticker, and for all the devices, it is printed on the serial monitor logs.
Once connected to the WiFi, a web page should appear. On Android, you may also have a popup asking you if you want to connect to it without an internet connection. Answer yes always/all the time. If the web page doesn't appear, click on the WiFi Access Point and "Manage router".
::: tip
For boards with an ethernet port you can also access to the Wifi Manager portal through the LAN board IP address.
:::
![WiFi manager menu](../img/OpenMQTTGateway_Wifi_Manager_menu.png)
* Click on Configure WiFi
@@ -17,7 +21,12 @@ Once connected to the WiFi, a web page should appear. On Android, you may also h
![WiFi manager parameters](../img/OpenMQTTGateway_Wifi_Manager_enter_parameters.png)
* Select your WiFi
* Set your WiFi password
* Set your WiFi password
::: note
If the board is connected by ethernet, the Wifi and password can be empty. If you fill them the board will use this wifi as a fallback connectivity method.
:::
* Set your MQTT Server IP
* Set your MQTT Server Port (default: 1883)
* Set the MQTT secure connection box to select whether or not the connection should be secure
@@ -37,12 +46,11 @@ The ESP restart and connect to your network. Note that your credentials are save
Once done the gateway should connect to your network and your broker, you should see it into the broker in the form of the following messages:
```
home/OpenMQTTGateway/LWT Online
home/OpenMQTTGateway/version
```
Note that the web portal appears only on first boot, if you want to configure again the setting you can do a long press on TRIGGER_GPIO or [erase the settings](../use/gateway.md#erase-the-esp-settings).
Note that the web portal appears only on first boot, if you want to configure again the setting you can do a long press on TRIGGER_GPIO, [erase the settings](../use/gateway.md#erase-the-esp-settings) or Reset the configuration from the WebUI.
## MQTT and network configuration for Ethernet and WiFi boards
## Build time configuration
You can configure your MQTT server credentials and network configuration before building the application. It can be done either in Arduino or in Platformio IDE thought the User_config.h file. Note that with Platformio IDE you can also set your credentials into the platformio.ini file or an *_env.ini file, here is an example with the Olimex ESP32 gateway: