Project for an Autonomous Sailing Boat





  • @neoniousTR
    Hi Thomas,
    These months, waiting deepSleep, I continue to develop with MacOS/Nodejs.

    before testing deepSleep, I first tried to run my las software version without deepSleep and I am locked with AXIOS trouble.

    With the lowjs-darwin version it works but not on ESP32.

    If I run :

        "use strict";
        const axios     = require('axios').default;
    
        const url = "http://192.168.1.49:8089/wind?latitude=46.97&longitude=-2.27";
        console.log(url);
        axios.get(url)
        .then(function (response) {
          console.log(JSON.stringify(response));
        })
        .catch(function (error) {
          console.log(error);
        });
    

    I catch always the error :

    TypeError: null not callable
        at [anon] internal
        at light_401c0e6c_0011 light strict preventsyield
    


  • In the very last version (this version) I also rewrote the Promises to plain C++ so it runs much faster as before.

    Looks like you found a case where the new version is not functioning well yet.

    Will fix asap, today or tomorrow.

    Thomas



  • You may try the newest version 1.5.3.1. lowsync will flash it already now to ESP32, the Mac version to download will show latest tonight.



  • @neoniousTR
    My error is now :

    TypeError: cyclic input
        at [anon] internal
        at stringify () native strict preventsyield
        at [anon] (/communicateurFEED.js:1) strict preventsyield
        at light_401c0e70_0011 light strict preventsyield
    


  • @neoniousTR I have also on other Axios instances :

    TypeError: not object coercible
    


  • The first error is your program:
    You cannot JSON.stringify the response. The response is more than just the data. It is a cyclic object.
    JSON.stringify just the data in the response if you wish.

    Regarding the second error: I need more info. How does the program look like? Is there a stack with the error?



  • @neoniousTR

    With Axios you can try to access : [http://lepine.freeboxos.fr:8089/wind?latitude=46.97605&longitude=-2.2783](url du lien)

    and obtain json response like

    {"self":{"environment":{"wind":{"directionTrue":5.6199601914217405}}}}
    

    but the wind direction can change and be different ...



  • @ygageot Hope you are not waiting for my answer, I wrote maybe a minute before you did 🙂 So I am waiting for your answer.



  • @neoniousTR Thanks Thomas !

    Now the Axios/Promise part works well.

    I have other problems on the ESP32 but no time to explore for 2 days.
    I will continue on Thursday with deepSleep activation.



  • @neoniousTR some news :
    the deepSleep action works for me.
    I am happy to see after sleep an automatic reconnecting to monitor :

    *** The connection has been lost. We will retry connecting to the microcontroller. In the meantime, please check your connection ***
    *** The connection to the microcontroller has been re-established ***
    

    I have other functional problems with this mode.
    I will check the different power consumptions 3.3V with my CurrentRanger as it is possible.



  • I founded some trouble with the deepSleep mode.
    To understand I wrote this small test program :

    "use strict";
    
    const lowsys = require("lowsys");
    
    const SECOND = 1000;
    const pingDuration  =  2 * SECOND;
    const awakeDuration = 10 * SECOND;
    const sleepDuration = 30 * SECOND;
    
    console.log('hello');
    
    setInterval(function() {
       console.log('.');
    }, pingDuration);
    
    setTimeout(function() {
       console.log('going in deepSleep for ' + sleepDuration + 'msec');
       lowsys.deepSleep(sleepDuration);
    }, awakeDuration);
    

    The result :

    lowsync monitor --restart
    --- User program's output: ---
    hello
    .
    .
    .
    .
    .
    going in deepSleep for 30000msec
    *** The connection has been lost. We will retry connecting to the microcontroller. In the meantime, please check your connection ***
    *** The connection to the microcontroller has been re-established ***
    hello
    .
    .
    .
    .
    .
    going in deepSleep for 30000msec
    --- Program exited. ---
    
    1. the sleep action seems to works only once and after the program exited
    2. in deep sleep mode the power consumption is 7mA (the data sheet show 10𝜇A with RTC+ULP and 2.5𝜇A with RTC only )
      NB : I measure the power consumption with a CurrentRanger, powering directly the WROVER with 3.3V and able to mesure very low currents.


  • I don't understand the power consumption : 7mA

    on WROVER I red the special usage of GPIO12 with internal resistors, and the need to desactive it with

    rtc_gpio_isolate(GPIO_NUM_12);
    

    In fact I use this board for my tests.
    I accept the possible impact of the 2 resistors EN+RST but a simple calculus for a 10kΩ resistor: 3.3V/10kΩ = 0.33mA = 330𝜇A.
    To obtain 7mA we need a large number of resistors ! Are they all actived ?

    IMG_9302.jpeg



  • Regarding deep sleep: Looks like the problem is the lowsync monitor. I do not think that will be improved soon. I think it is OK if the monitor stops during deep sleep. But, yes, it is weird that the first time it reconnects, the second time it does not. I will put it on the long term fix list.

    Regarding power consumption in deep sleep:

    Yes we can optimize with rtc_gpio_isolate, but I think that is it. lowsys.deepSleep disables Wifi and file system, then calls esp_deep_sleep. Not much more we can do.

    As this has nothing to do with low.js, maybe you want to ask in the espressif board about power consumption?



  • @neoniousTR For the monitor impact, you are right.
    If I build with auto-start and don't use lowsync monitor, I can observe with a small test program, the power consumption and an external LED activity.
    The sleep period and the automatic restart works well.



  • @neoniousTR Did you tried deepsleep mode on Neonious One ?



  • No but I do not expect it to be better. Many more chips.

    You measured the power usage of the whole module. So the USB2UART chip is also measured. Did you check how much power that chip uses?

    Thomas



  • @neoniousTR nothing is connected on the USB port of the board. Only 3.3v input pin and ground from external LDO.
    Tomorrow I will write a test program with Arduino IDE to compare with the same board and same power



  • The USB2UART chip draws power no matter whether USB is connected or not.



  • @neoniousTR
    With my flashing board, if I press the power button off. The deep sleep consumption is now 1800𝜇A.
    I did not found schematic of this board also I don't know where the circuit is opened.

    Do you know if the 2 external resistances in // with EN and GPIO0 buttons can be suppressed in production environment ?


Log in to reply