Fatal error, restarting program...



  • Often, after some modifications... I have a message
    Fatal error, restarting program...
    (looping because I choose the automatic restart)

    Is it possible to obtain a better diagnostic error ?
    With the IDE is it possible to obtain something ?



  • I don't understand why there is a fatal error on my ESP32.

    This morning it was working.
    The exact same version does not work now.

    I tried something else :

    I updated the lowjs npm version on my Mac.
    I downloaded the last binary version of lowjs for MacOS.
    low -v => 20200303_9012d61
    lowsync --version => 1.4.7

    On my Mac, the low execution exit with a better trace :

    TypeError: cannot resolve module 'uart', parent '/Users/yvesgageot/PI/microtransat/src/TOOLS/myserialport.js'
        at [anon] (src/low_module.cpp:319) internal
        at require () native strict preventsyield
        at [anon] (/Users/yvesgageot/PI/microtransat/src/TOOLS/myserialport.js:30) strict preventsyield
        at require () native strict preventsyield
        at [anon] (/Users/yvesgageot/PI/microtransat/src/feeds/instruments.js:6) strict preventsyield
        at require () native strict preventsyield
        at [anon] (/Users/yvesgageot/PI/microtransat/src/infrastructure.js:12) strict preventsyield
        at require () native strict preventsyield
        at [anon] (/Users/yvesgageot/PI/microtransat/src/index.js:20) strict preventsyield
    

    I don't understand why and I don't know how to download 20200305 binary version



  • I tried a very simple program with :

    const uart = require("uart");
    

    or

    import uart from "uart";
    

    same thing :

    TypeError: cannot resolve module 'uart', parent '/Users/yvesgageot/PI/microtransat/src/indexTest.js'
        at [anon] (src/low_module.cpp:319) internal
        at require () native strict preventsyield
        at [anon] (/Users/yvesgageot/PI/microtransat/src/indexTest.js:3) strict preventsyield
    


  • same import problem with GPIO



  • Not a bug. gpio + uart are part of the low.js for ESP32 API (see https://neonious.com/lowjs/documentation/lowjs-for-esp32-api.html). So they are missing on the PC.

    But regarding the fatal error:

    Can you reduce your program as much as possible so the problem still happens and I can reproduce it on my board? Then I would be able to fix it, if it is a low.js problem.



  • Thank you to remember me the ESP32 specials. I will change my configuration.

    With the Fatal error message.

    I made first a git checkout to go back in a morning version.
    I was sure it was clean with my comments in GIT.

    But the problem persist.

    After your message, I power off the WROVER and refresh the software with --init

    Now it runs again...

    I have a small idea of what was the modification generating the problem.

    Tomorrow afternoon, I will work on it and if I can reproduce, I will inform you.

    Thanks a lot



  • @ygageot said in Fatal error, restarting program...:

    Fatal error, restarting program...

    I came back on this problem.

    I had continuously : Fatal error, restarting program...
    with no more details.

    I fact in these software version, introducing for the first time gpio, I made a mistake in source code. texte en grasI wrote :

    ...
    if(os.platform() == 'esp32') {
      const gpio = require('gpio');
      ...
    }
    ...
    if(os.platform() == 'esp32') {
      gpio.xxxxxx;
      ...
    }
    
    

    With all my software, I had only the message Fatal error, restarting program...

    I rewrote after like :

    ...
    var gpio;
    if(os.platform() == 'esp32') {
      gpio = require('gpio');
     ...
    }
    ...
    if(os.platform() == 'esp32') {
      gpio.xxxxxx;
      ...
    }
    

    And it was running well with the scope of gpio variable outside the block.

    I wrote a small source to try to reproduce this behavior for you.

    const os = require('os');
    
    if(os.platform() == 'esp32') {
      const gpio = require('gpio');
    }
    
    console.log(gpio.LOW);
    

    In theses case, I have the complete good diagnostic error :

    ReferenceError: identifier 'gpio' undefined
        at [anon] internal
        at [anon] (/indexTest.js:1) strict preventsyield
    Fatal error, restarting program...
    

    Why not with my full software ?



  • Ah, ok, interesting.. Could have to do with what happens during transpiling. Will look at this soon, but currently on vacation till 26th, and as you can continue developing, it is not urgent :-)!


Log in to reply