ESP32 Slow networking occurs when using stationManual
What happens when I try to use WIFI mesh & stationManual AP at the same time
Code based on arduino painlessMesh example "mqttbridge" expand
Partial code
#define WIFI_CHANNEL 6 //Check the access point on your router for the channel - 6 is not the same for everyone
#define MESH_PREFIX "wifiMesh"
#define MESH_PASSWORD "xxxxx"
#define MESH_PORT 5555
#define HOSTNAME "MQTT_Bridge"
#define STATION_SSID "yx_test"
#define STATION_PASSWORD "xxxxx"
mesh.init(MESH_PREFIX, MESH_PASSWORD, MESH_PORT, WIFI_AP_STA, WIFI_CHANNEL);
mesh.stationManual(STATION_SSID, STATION_PASSWORD);
mesh.setHostname(HOSTNAME);
When I enable mesh WIFI & connect external AP for Bridge at the same time, when I start the master node ESP32, there will be a long wait, and the scanning is always as follows:
CONNECTION: stationScan(): yx_test
CONNECTION: eventScanDoneHandler: ARDUINO_EVENT_WIFI_SCAN_DONE
CONNECTION: scanComplete(): Scan finished
CONNECTION: scanComplete():-- > Cleared old APs.
CONNECTION: scanComplete(): num = 1
CONNECTION: Found 0 nodes
Only after connecting to the external AP, it will enter the creation of WIFI mesh AP, otherwise other nodes cannot access the master node, is this normal?
another question: After successfully connecting to the external AP, get your own IP address and create a mesh ap. At this time, other child nodes will also connect to the master node normally, but if the external AP WIFI of the master node is offline, the master node will always perform the following tasks , and it will also fail to receive other node send msg, which will cause the entire mesh network to fail, but when I restart the external AP WIFI, the master node still cannot automatically recover normally, is this normal?
CONNECTION: eventSTADisconnectedHandler: ARDUINO_EVENT_WIFI_STA_DISCONNECTED
MESH_STATUS: Dropped connection 0, station 1
CONNECTION: eraseClosedConnections():
CONNECTION: eventSTADisconnectedHandler: ARDUINO_EVENT_WIFI_STA_DISCONNECTED
MESH_STATUS: Dropped connection 0, station 1
CONNECTION: eraseClosedConnections():
CONNECTION: eventSTADisconnectedHandler: ARDUINO_EVENT_WIFI_STA_DISCONNECTED
MESH_STATUS: Dropped connection 0, station 1
CONNECTION: eraseClosedConnections():
CONNECTION: eventSTADisconnectedHandler: ARDUINO_EVENT_WIFI_STA_DISCONNECTED
MESH_STATUS: Dropped connection 0, station 1
CONNECTION: eraseClosedConnections():
My idea is that if the external AP connected to my master node goes offline, AP reconnect should not be performed all the time, and the internal network structure of the wifi mesh should be kept stable during reAP connect, and the child nodes are transmitted to the root interface. The data is normal, and when the root node rediscovers the external AP WIFI, it can automatically reply to the connection immediately, but the current results seem to be impossible. Can you tell me how to improve it? Any way, thanks;