First thing first. Loving Homie. Great job!
This is more a question than anything else. I am using platformio and v2.0.0 on top of a wemos d1 that has the arduino shield compatibility. I was having a really hard time having the Homie connected to WiFi in normal mode. I debugged the code and found that for some reason the callback BootNormal::_onWifiGotIp was not getting invoked even though I could see in my router
the IP being assigned as well as the board replying to ICMP ping. I got it working by calling WiFi.begin on the setup function in my main.cpp ...
void setup(){
/********************* HOMIE *********************/
// The underscore is not a typo! See Magic bytes
Homie_setFirmware("liquid-probe", "1.0.0");
Homie.setSetupFunction(setupHandler).setLoopFunction(loopHandler);
temperature_node.advertise("unit");
temperature_node.advertise("degrees");
Homie.onEvent(onHomieEvent);
Homie.setup();
WiFi.begin(
HomieInternals::Interface::get().getConfig().get().wifi.ssid,
HomieInternals::Interface::get().getConfig().get().wifi.password);
/*************************************************/
}
Haven't been able to figure out why the WiFi.begin in BootNormal::_wifiConnect isn't working.
My intuition says it has to do with some race condition between events in the event loop. But
just a hunch.
Has anybody experienced this ? Any ideas on where to dig ?
Hi All,
First thing first. Loving Homie. Great job! This is more a question than anything else. I am using platformio and v2.0.0 on top of a wemos d1 that has the arduino shield compatibility. I was having a really hard time having the Homie connected to WiFi in normal mode. I debugged the code and found that for some reason the callback BootNormal::_onWifiGotIp was not getting invoked even though I could see in my router the IP being assigned as well as the board replying to ICMP ping. I got it working by calling WiFi.begin on the setup function in my main.cpp ...
Haven't been able to figure out why the WiFi.begin in BootNormal::_wifiConnect isn't working. My intuition says it has to do with some race condition between events in the event loop. But just a hunch.
Has anybody experienced this ? Any ideas on where to dig ?
Thanks!