No big deal but I'm partial to the style where dependencies are disclosed via #includes in the main ino file.
The mesh seems to be working ( after some testing taking devices offline and back to see if the network survives) in that if there is an issue it will succeed in re-establishing itself.
This is a very nice alternative to MQTT for sensor networks that can be independent of routers and brokers since they only need to share data with each other.
The "start here" simple example makes the learning threshold very very easy compared to the more complex demo example that is tied to a specific circular led display.
The issue is after about an hour the mesh breaks apart and devices start only sending messages to themselves
startHere: Received from 796707 msg=Hello from node 796707
startHere: Received from 796707 msg=Hello from node 796707
startHere: Received from 796707 msg=Hello from node 796707
startHere: Received from 796707 msg=Hello from node 796707
startHere: Received from 796707 msg=Hello from node 796707
startHere: Received from 796707 msg=Hello from node 796707
startHere: Received from 796707 msg=Hello from node 796707
startHere: Received from 796707 msg=Hello from node 796707
startHere: Received from 796707 msg=Hello from node 796707
startHere: Received from 796707 msg=Hello from node 796707
startHere: Received from 796707 msg=Hello from node 796707
startHere: Received from 12593318 msg=Hello from node 12593318
startHere: Received from 12593318 msg=Hello from node 12593318
startHere: Received from 12593318 msg=Hello from node 12593318
startHere: Received from 12593318 msg=Hello from node 12593318
startHere: Received from 12593318 msg=Hello from node 12593318
startHere: Received from 12593318 msg=Hello from node 12593318
startHere: Received from 12593318 msg=Hello from node 12593318
picstart wrote:The "start here" simple example makes the learning threshold very very easy compared to the more complex demo example that is tied to a specific circular led display. The issue is after about an hour the mesh breaks apart and devices start only sending messages to themselves
Do you think this is being caused by a bug in the example ino code or in the core src code? Maybe you should open an issue on the developer’s github site https://github.com/Coopdis/easyMesh/issues
Anyone out there read any of the easyMesh code? (Anyone out there at all?)
I am currently trying to modify the way the mesh sets up unique identifiers for each node. currently the code uses the esp8266 chipID ... and appends it to the end of the ssid ... making every node have a unique ssid for it's AP. This is an issue (to me) when it comes to connecting client devices (wifi connected smart phone ... android) to the mesh ... I want to change to using the "AP bssid" of each node as the unique identifier ... and change to each node AP having the same ssid ...
but I am having a problem following the code out to where and when the connecting STA tells the AP what it's chipID is ...
any help would be really appreciated ... the developer seams to ignore questions ... guess he misses the question marks ?
UPDATE: It looks like the chipID gets set in handleNodeSync() ...
if ( conn->chipId != remoteChipId ) {
debugMsg( SYNC, "handleNodeSync(): conn->chipId updated from %d to %d\n", conn->chipId, remoteChipId );
conn->chipId = remoteChipId;
}
LATEST UPDATE: damn! I over looked the "already connected" check done in connectToBestAP() ... guess i'm back to using the bssid ... stay tuned!
String apChipId = (char*)ap->ssid + _meshPrefix.length();
if ( findConnection( apChipId.toInt() ) != NULL ) {
ap = _meshAPs.erase( ap );
}
else {
ap++;
UPDATE: I haven't had a chance to test any of this ( anyone?? I'll get to later) ... but it should allow all nodes to use the same ssid ... and maybe all APs having the same ip ...
the chipId from within the SSIDs are used to distinguish between the AP's when making a wifi STA connection only ... and does not pass the chipId on to the STA ... the AP and STA both tell each other about their chipId's by sending their first NodeSync message(s) ...
From handleNodeSync()
if ( conn->chipId != remoteChipId ) {
debugMsg( SYNC, "handleNodeSync(): conn->chipId updated from %d to %d\n", conn->chipId, remoteChipId );
conn->chipId = remoteChipId;
}
changes to connectToBestAP() (easyMeshSTA.cpp) in how it sets up the struct station_config to allow targeting specific APs by using the bssid instead of the ssid ...
From:
struct station_config stationConf;
stationConf.bssid_set = 0;
memcpy(&stationConf.ssid, bestAP->ssid, 32);
To:
struct station_config stationConf;
stationConf.bssid_set = 1;
memcpy(&stationConf.bssid, bestAP->bssid, 6);
memcpy(&stationConf.ssid, bestAP->ssid, 32);
and modifing init() (easyMesh.cpp) to not add the chipId to the ssid ...
From:
_mySSID = _meshPrefix + String( _chipId );
To:
_mySSID = _meshPrefix;
and the strncmp() test in stationScanCb() should hold up since they'll still match ...
if ( strncmp( (char*)bssInfo->ssid, staticThis->_meshPrefix.c_str(), staticThis->_meshPrefix.length() ) == 0 ) {
I like the fact that the exchange of chipId isn't being done at the wifi level ... this keeps it to basic wifi function and allow to port to other platforms ... After further thought about all APs having the same IP (192.168.1.1) might actually work ... since both the IF_STA and the IF_SoftAP have different MAC address ... it should tolerate it since there is no ip routing and both networks are separate ... modifing apInit() (easyMeshAP.cpp) as follows ...
From:
IP4_ADDR( &ip, 192, 168, ( _chipId & 0xFF ), 1);
To:
IP4_ADDR( &ip, 192, 168, 1, 1);