Replies: 3 comments 2 replies
-
Print through UBS/Serial is pretty straight forward at the ESP8266. Once a print started, it will block until all characters are sent. So it might be that the print which block an event is resulting from a previous event, depending on how fast the events arrive. But not knowing your code that's just guessing. I do not know of you process the input event by a Pin IRQ or by polling. In any case, the time to print the debug messages must be shorter that the time between events. |
Beta Was this translation helpful? Give feedback.
-
Hi Robert, |
Beta Was this translation helpful? Give feedback.
-
Which pin do you output a signal on? Search for POWERON_RESET in the Ideas sub-forum ... I had some fun doing that on an ESP32. |
Beta Was this translation helpful? Give feedback.
-
I have a simple micropython program that begins execution when an external device enables the ESP8266 chip. Because the external signal only lasts for 2 seconds, one of the first things the code does is output a signal to maintain the "EN" pin during code execution. There are several debugging print statements that follow the ENable-hold signal. When the code completes it's task, it signifies by flashing a LED. In standalone (no IDE), it sporadically responds to the external signal; sometimes flashing the LED, sometimes not, indicating that for some reason the ENable-hold wasn't holding. I noticed when used in the IDE there's was a delay before any execution of 500-1000ms, I suspected the print statements and commented them out. With the print statements commented out, code execution was immediate, and in standalone the LED flashed with every external signal; the ENable-hold was working every time.
Given that the ENable-hold was executed before any print statement, does anyone have any thoughts as to why it's affected by the print statement, and why the print statements appear to delay code execution?
Beta Was this translation helpful? Give feedback.
All reactions