gmag11 / EnigmaIOT

Secure sensor and gateway platform based on ESP8266 and ESP32
https://gmag11.github.io/EnigmaIOT
MIT License
240 stars 46 forks source link

Wrong use of searchForGateway (&rtcmem_data) ? #27

Closed arihantdaga closed 3 years ago

arihantdaga commented 3 years ago

Hi @gmag11 , I came across these if conditions if (searchForGateway (&rtcmem_data), true) in lines https://github.com/gmag11/EnigmaIOT/blob/db1feacc9287ae786eba8caf87142d031d123706/src/EnigmaIOTNode.cpp#L752 https://github.com/gmag11/EnigmaIOT/blob/db1feacc9287ae786eba8caf87142d031d123706/src/EnigmaIOTNode.cpp#L761

was it meant to be - if (searchForGateway (&rtcmem_data, true)) I noticed this problem because by node was always trying to conenct to the gateway even when it could not find the gateway. It would print this in the logs.

 Gateway SMART_S not found
Found gateway. Storing
gmag11 commented 3 years ago

I guess you are right. Would you mind to do a pull request over dev branch? Thank you!

arihantdaga commented 3 years ago

Sure, yeah. Will do.

gmag11 commented 3 years ago

Merged. Will be published in next release