As the title says... Chat on...

User avatar
By goliatone
#28930 Im in a bit of a situation here. There seems to be an issue in my source code pretty early on, when the interpreter reaches that point the node restarts.

It all happens pretty fast. Im using the ESPlorer IDE, im trying to either update the init file with a new one, send a file.remove("init.lua") command, or use the Format button but all seem to fail due to the node rebooting before any of the commands execute.

Is there any tool/command to abort the current script? or to erase the file system?

I tried to flash the node with new firmware but that did not affect current behavior.
using nodemcu amica, if that makes a difference
User avatar
By goliatone
#28976 hey @onlyindian, I could post the code. In fact i'm pretty sure i know what is causing the issue in the code. However, the problem I have is the board is resetting so fast I can't send any commands to it.

I dont know of a way to stop executing the running code, say an imaginary node.stop(), so what i was doing before was removing the init.lua file by sending a file.remove("init.lua") command. But like I wrote the command doesnt get delivered before the error and the board reboots.

Thats why I wanted to know if there is something like a command for the esptool.py to remove files or a way to force delete files, or generally what people do in similar situations...
User avatar
By TerryE
#29195 Have a read of my]Unofficial FAQ (see link below). Keep your unit.lua to a simple one-shot timer which starts your app after a few second delay. That way if you get stuck in a reboot loop, then you have time to inject a remove your int.lua or even put a
Code: Select allif not H==nil then return end
as the first line in your app, as simply injecting H=0 immediately after reboot will have the same effect.