These are chat archives for esp8266/Arduino

28th
Sep 2017
Bryce Schober
@bryceschober
Sep 28 2017 14:03
@me-no-dev @igrr @devyte Are there ways of the user yielding to the network stack that are less minimum time away than delay(1)? Are there more specifics that I could read about the network stack's need for time?
Develo
@devyte
Sep 28 2017 15:45
yield(), which is supposed to be equivalent to delay(0).
Depending on your code, even yields and delays may not be enough. They allow servicing the wifi stack, but not passing data out to the app layer, so if you take too long you could still blow up
Yield and delay can only be called from the loop, or functions called from the loop. Can't be called from e.g. a Ticker callback, and ISR
There are specific time specs defined by espressif about how long you can be away in your own code, bow long an ISR should take max, and so on.
Develo
@devyte
Sep 28 2017 15:52
I don't remember the specifics for each case, but they should be in the espressif sdk docs
Bryce Schober
@bryceschober
Sep 28 2017 17:22
Thanks for your help on this channel, all of you! I know it can seem like a thankless task sometimes, with users complaining about the problems they're usually causing themselves.
Bryce Schober
@bryceschober
Sep 28 2017 17:38
@riataman @brutzler FYI, just ran across ESP.getSketchMD5() as declared in ESP.h. It would only help identify a particular build binary to match against the firmware on the ESP, but that would be easy to search for in the continuous-integration build job that produced that artifact and the source revision that it came from. You're doing all that, right? ;-)
Develo
@devyte
Sep 28 2017 19:04
In case anyone is interested, I implemented an async dns server. It uses AsyncUDP instead of WifiUDP, and there is no need to call a function within the loop.
Bryce Schober
@bryceschober
Sep 28 2017 20:43
Nice! Now we just need an AsyncDHCPServer and AsyncMDNSResponder to go with it. ;-)
Develo
@devyte
Sep 28 2017 21:39
@bryceschober I think esp8266mdns is already async, although it doesn't use asyncudp
The dhcpserver for the softap is also async, I think. You don't need to call a handler from the loop