Post topics, source code that relate to the Arduino Platform

User avatar
By martinayotte
#63615 First, why are you using GPIO16 if your code doesn't use any deepSleep() ?
Second, why your code doesn't do the STA connection along with WIFI_AP_STA in setup instead of setupStMode() function ? That would make STA connected permanently ...
Why this setupStMode() function is doing Esp.restart() each time it is been called ?
(That is maybe why your AP because invisible each time this function is called)
User avatar
By Lucas neill
#63634
martinayotte wrote:First, why are you using GPIO16 if your code doesn't use any deepSleep() ?
Second, why your code doesn't do the STA connection along with WIFI_AP_STA in setup instead of setupStMode() function ? That would make STA connected permanently ...
Why this setupStMode() function is doing Esp.restart() each time it is been called ?
(That is maybe why your AP because invisible each time this function is called)


1- isn't esp. Reset or restart same as deepsleep because it will restart itself so GPIO16 isn't required for this?
2-i don't know i didn't write the code this is a quote from somebody else. So what is your advice? What code should I insert what part in the sketch? You know this code gets dht22 data from client and send it to server in ap mode and I think it sends it to thingspeak in St mode

For your last question maybe it restarts itself to turn back to ap mode, what do you think? This is just a beginner guess
User avatar
By martinayotte
#63643 Yes, there is no need for GPIO16 circuit if no deepSleep() are done.
Plain Reset doesn't need other thing than simple pullup.
For the code, there is no need for ESP.restart() or ESP.reset() if the STA and AP are initialized in setup().
Only the thingspeak connection should stay in it function, without any restart at the end.