I have a problem uploading a program to the ESP8266. I have written a program in micropython. Everything is ok until I don't use interrupts, then errors pop up when trying to upload the program:
.
My program looks like this:
.
In general it looks like these interrupts are blocking the upload of the software. They interrupt it, because when I turn off the timer or set the period to about 15 seconds, the program uploads. For now, the way I cope is that every time I erase the e esp memory with esptool and re-upload the NodeMCU, but it takes a long time and is annoying.
I use pycharm and the Micropytchon plugin, but it is unlikely to make a difference.
Code: Text
My program looks like this:
from utime import sleep_ms
from machine import Timer
import micropython
micropython.alloc_emergency_exception_buf(100)
[inContentAd]
timer1s = Timer(-1)
timer1s.init(mode=Timer.PERIODIC, period=500, callback=lambda t: print("INTERRUPT"))
def main():
while True:
print("MAIN")
sleep_ms(300)
if __name__ == '__main__':
main()
In general it looks like these interrupts are blocking the upload of the software. They interrupt it, because when I turn off the timer or set the period to about 15 seconds, the program uploads. For now, the way I cope is that every time I erase the e esp memory with esptool and re-upload the NodeMCU, but it takes a long time and is annoying.
I use pycharm and the Micropytchon plugin, but it is unlikely to make a difference.