• Running an esp32 wroom with latest firmware. I am using the cli not the webide.

    I seem be running into an issue that involves my ignorance of how the espurino firmware manages the running js script process.

    I've been uploading my code via the cli and just assumed that there can be only one js process running at a time so after upload I assumed that the current running js scripts is killed and the newly uploaded one is started. That doesn't seem to be the case (e.g. all the callbacks for the newly upload code are never called). Note: when programming with arduino or espessif firmware/framework via platformio when I upload a new ccp program the old one is killed.

    So I tried to first upload a simple reset() script which supposedly purges the script in RAM then upload my code, nope that doesn't work either.

    So then I wiped the flash by uploading reset(true). Then I did a hard reset (button of esp dev board) so I know (via terminal) no script is running then upload my code and it works fine.

    So now I am forced to press the hard reset every time before uploading a new version of my code to RAM (during development). BTW if I then save code to flash and press hard reset it runs fine each time (because there was no already running js script).

    Thus it seems the former js code is still running even after a new upload, even after a soft reset?? Many times when programming in node the node process doesn't get killed (with cntrl-c) when script is exited and either have to include some shutdown code when SIGTERM is called (like stopping listeners) or I have to use the linux 'kill' command but. There is no process 'kill' nor linux SIGTERM for the esp32 (i.e. via espurino 'os') as far as I know

    So how does one manage (kill) the running js script during development? I suppose I just need a better explanation about how the espruino firmware manages RAM and running the running js process(es ?) therein. I just assumed given the limited resources that only one js script process at a time can be run.

  • reset(1) should erase all saved code and kill all running code as well. The only thing that stays the same should be wifi connection status.
    Can you create a minimal repro that shows this behaviour?


Avatar for dgk @dgk started