Hi,
I have D1 mini ESP8266 with Micropython firmvare and I dont know if there is bug...
My program is created for button socket with mqtt and works. I have one led to indicate button pressed and can be operate with the button or mobile phone as mqtt client. But I discover that if the button is pressed several times quickly it resets whole program and blocks its firmware. I can even upload new script to it with uPyCraft IDE. If reboot, it opens couple of times on my laptops port and can see that script in it is broken, it is empty. It somehow erase main script and one thing that can be done is to flash firmware again and upload scripts again. My debounce function opens txt file and writes text ON or OFF in it (I use with statement to open file with no close while this statement closes file automatically). Yesterday I refleash 6 times
Anyone have this strange problem?
Thanx,
Jadro
Reset on debounce
Re: Reset on debounce
I think it might be helpful if you can share your code and we can take a look.
Why does your debounce function need to write to the filesystem?
It sounds like something is going wrong while this function is writing to the filesystem. If the device resets mid-write then that can cause corruption.
Why does your debounce function need to write to the filesystem?
Re: Reset on debounce
I will share my code sun as possible...
I use txt file because my switch will work for socket in my house. When current or even my provider internet goes down then I have to look inside to see last state od pin (ON or OFF) and according to this I need last state to start with... But this does not work as well and I think of comment this in my code...
I use txt file because my switch will work for socket in my house. When current or even my provider internet goes down then I have to look inside to see last state od pin (ON or OFF) and according to this I need last state to start with... But this does not work as well and I think of comment this in my code...
Re: Reset on debounce
Remove unnecessary code and function that reads/writtes to the file has resolve my problem.
Thanx jimmo for help,
Jadro
Thanx jimmo for help,
Jadro