Chat freely about anything...

User avatar
By picstart
#57151 Yes the now time to last time comparison that presumes now time has a greater tick count then last time fails with modulo 2^32 math. All unsigned 32 bit values must obey this modulo math.The comparison operator assumes a boundless real number set. It is correct that the subtraction operator modulo 2^32 retains valid math. In the original code this invalid comparison mathematics caused the mesh to fail after 2^32 ticks or approximately 71 minutes.
User avatar
By sfranzyshen
#57156 the no-timing build is built from the original code ... plus the fixes discussed in this thread only ... so NO major changes have been done ... I ran this code for 9 hours on two node ... NodeA starts first and doesn't try to connect to anything ... NodeB starts and connects as a STA to nodeA's AP ... they handle nodesync messages back and forth and nothing else ... The STA only dropped once (in 9 hours) ... but it was correctly in a TIMEOUT state ... so the rollover problem seams to be gone ... at least in the nodesync ...
Code: Select allmanageConnections(): dropping 10417291 now= 2054447821 - last= 2051447248 ( 3000573 ) > timeout= 3000000

but when I run this code with the AP constantly scanning the wifi ... I get more timeouts and at least one wdt reset was observed ... So I am now convinced that the wdt reset and remaining timeouts are being caused by wifi scanning and/or os_timer stuff ... I have noticed that the timer seams to stay set across resets ... I am thinking about splitting the call to connectToBestAP() function out of the stationScanCb() function so that program flow is returned faster (so that other things can get done ... like process nodesync messages ...) also ... I'm going to eliminate the os_timer and use a loop counter instead ... the timer interrupt is firing off at a bad time (place in code) ... might also have to add for checks if we are scanning before dropping connections ...

making progress :D :D
User avatar
By Nikhil J
#57164 @Sfranzyshen: Oh I didn't notice that change in comparison equation. You're right. Making the comparison roll-over proof is surely a better way to do it.

On a side note, did you have any luck with the BSSID approach and in trying to make all SSIDs the same?
User avatar
By sfranzyshen
#57166
Nikhil J wrote:@Sfranzyshen: Oh I didn't notice that change in comparison equation. You're right. Making the comparison roll-over proof is surely a better way to do it.

On a side note, did you have any luck with the BSSID approach and in trying to make all SSIDs the same?

Yes I have a devel version of this code located here: https://github.com/sfranzyshen/easyMesh/tree/devel
It use a single ssid for the mesh ... and I still have to follow through with the client wifi device roaming and the captive dns portal ... to kick off a "login to network" popup ... and also ... so that we don't need to know the AP's IP address from the client wifi device web browser ... and will work across all mesh APs wifi connections ... but I took a break from expanding things to fixing the core (keeps crashing :( ) but I will be merging what I have learned from the past two days ... into the devel branch today ... so you might want to wait awhile to pull it ... so you can get the lattest greatest ... I'll let you know when it's up here :)