This repository has been archived by the owner on May 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 166
timeoutWait function doesn't work with ESP8266 #23
Comments
Yes I noticed the same when the printer printed: "Soft WDT reset ctx: cont, followed by a stack dump" after running throe a couple of lines from the example program provided. This is because hardware serial on the ESP8266 sends out debug information 'as a last will' ;-) A (barley working) workaround is to use 'yield();' in the example program but any longer transmission (like the picture) still fails. |
digidigital
added a commit
to digidigital/Adafruit-Thermal-Printer-Library
that referenced
this issue
May 25, 2017
Basic fix for issue adafruit#23
digidigital
added a commit
to digidigital/Adafruit-Thermal-Printer-Library
that referenced
this issue
May 25, 2017
Adding yield() enables the ESP8266 to do other things while waiting and prevents reboots due to watchdog timer timeouts.. I had a hard tme to find out that the while-loop was the cause for the reboots.... That´s exactly what yield() is for -> Passes control to other tasks when called. Ideally yield() should be used in functions that will take awhile to complete.
r734
added a commit
to r734/Adafruit-Thermal-Printer-Library
that referenced
this issue
Sep 29, 2018
Closed
Merged
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The timeoutWait function uses:
while((long)(micros() - resumeTime) < 0L); // (syntax is rollover-proof)
This won't work with ESP8266 because it leaves the processor no time to do other things.
For ESP8266 it should be changed to a delay() call.
I use delay(10) and that works fine.
The text was updated successfully, but these errors were encountered: