- Fri Oct 28, 2016 1:54 pm
#57296
since we are tied to the esp8266 (for now) we only have one radio to work with. the STA and AP are always set to be the same channel. if the STA changes the channel to connect to another AP ... it's AP channel is also changed. for now ... we have only one radio to work with. so, when we scan all 14 wifi channels we are switching the radio away from the current channel (the one we are messaging over) to the other channels to scan for APs ... when done ... we return back to our current (mesh) channel and try to catch up with the incoming messages we missed ... and the outgoing messages that were queued up ... it's during this period in the protocol that things don't always catch-up ... timing out connected STAs ... and it breaks. as of right now the protocol dictates that any node connected as a STA to another node's AP ... doesn't re-scan the wifi network ... yet if a node doesn't have a STA connection to another node's AP ... it will re-scan the wifi network every 5 sec (SCAN_INTERVAL) ... looking for a node that is not already part of the mesh to connect to. this means that at least one node of any easymesh mesh will perpetually be in this scanning loop ... doomed to fail. so we need to add some controls into the protocol to handle messaging during wifi scanning.
I feel that once this problem is addressed ... we will finally be able to create something stable. here is a list of mechanisms i'm playing with to try and address this issue ... all feedback is welcome ...
- limit scans to mesh wifi channel & ssid (already in devel branch)
- scan one channel at a time ... returning back to the mesh channel in between each scan
- stop outgoing message sending before scans
- handle timeouts (incoming) messages during scans
- notify other nodes about scans