You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using platformio via vscode on macos.
Device: Wemos D1 mini naked (nothing connected to the GPIO ports).
I used to use @simone1999's fork with no problem until today as I needed to flash some additional MQTT mesh nodes, and encountered the following problem:
Wifi scanning works fine.
The designated AP is found ('Matched')
Then the program outputs 'Scheduling reconnect for 0.5 seconds from now' and nothing else happens.
I was able to reproduce the issue: "toto" gets printed only once. Substituting once with once_scheduled fixed the problem and "toto" gets printed every second (indeed you are not supposed to do IO in Ticker's callbacks unless you use once_scheduled which will run them in loop() context.
From Ticker.h:
// callback will be called at following loop() after ticker firesvoidonce_scheduled(floatseconds, callback_function_tcallback)
Substituting every call to schedule.once with schedule.once_scheduled in ESP8266MQTTMesh.cpp, I was able to finish connecting to the AP and connect to the MQTT broker.
Versions:
Using platformio via vscode on macos.
Device: Wemos D1 mini naked (nothing connected to the GPIO ports).
I used to use @simone1999's fork with no problem until today as I needed to flash some additional MQTT mesh nodes, and encountered the following problem:
Using the following code on an empty project:
I was able to reproduce the issue: "toto" gets printed only once. Substituting
once
withonce_scheduled
fixed the problem and "toto" gets printed every second (indeed you are not supposed to do IO in Ticker's callbacks unless you use once_scheduled which will run them inloop()
context.From Ticker.h:
Substituting every call to
schedule.once
withschedule.once_scheduled
in ESP8266MQTTMesh.cpp, I was able to finish connecting to the AP and connect to the MQTT broker.Original lines:
Fixed with:
I was about to file a PR, but realized the ESP32 version of Ticker.h doesn't come with once_sheduled (or Schedule.cpp for that matter).
References:
ESP8266
ESP32
What do ?
The text was updated successfully, but these errors were encountered: