Project for an Autonomous Sailing Boat



  • We also have ESP32-WROVER with 16 MB on stock (as many other things). Wanted to build up the store later, but just added the ESP32-WROVER with 16 MB right now, in case you want to get that.

    If you opt for this, I will give you low.js Professional for free on that because of this problem.

    No IDE, no OTA => low.js Pro will need 3 MB of flash => 13 MB for you.



  • @neoniousTR OK Thanks, I just ordered on your shop with basic breakout-boards

    Do you known a good FTDI converter with a good power 3.3V output to flash easily the ESP ?



  • Your testing is beneficial for me, too, so I'll add one in the package for free.



  • I worked around memory optimization and prepared my software for deep sleep/hibernate mode.
    I updated my software to check periodically the free memory, run a garbage collector eventually and if there is not enough memory, save the context and throw a "fatal error" to benefit of the automatic restart.

    With a soft process.exit, I did not succeed to benefit of the watchdog.

    It is the first time the ESP32 succeed to run the software and cross the Atlantic !!!
    (In fact the ESP32 is always at home, and I use a software stimulator pushing faked GPS positions with actual weather conditions....)

    ForNeo.png



  • It was a pleasure for me to note on the ESP32 a periodic load : 0,4 seconds.

    For my tests I generate this calculus load every 30 seconds and send message to "ground" every 30 seconds also.

    During the challenge the boat will execute the calculus perhaps every 5 minutes and will send message to ground every 6 hours.

    The frequency to inform "ground" depends of the importants Iridium SBD satellite costs, but when I see all the projects with LoRa style nano satellites; Perhaps I will have the opportunity to have a higher frequency with lower costs and lower emitting power consumption

    I do not know how you plan to implement access to ESP32 sleep modes.

    For my usage, it is sufficient to hibernate the processor and reboot all.

    My JS program can execute :

    • awake the processor in 5 minutes (for example)
    • go to hibernate mode


  • Great! I'll stay in touch with you to continue to optimise...



  • Hi!
    Just wanted to let you know that in the last 3 weeks several fixed were done to get the system more stable. Please see https://neonious.com/documentation/changelog
    What I have to admit however is that because of this I could not work on hibernation. When do you actually need this?
    Thank you,
    Thomas



  • @neoniousTR For periodic hibernation/restart I can wait 3/4 months if I am sure it will be possible.



  • @neoniousTR
    Some news :
    I investigate the possibility to suppress an ESP32/WROOM in C++ just driving peripherals by a version with lows software, the peripherals are :

    • nRF24L01 via SPI
    • IMU BNO0780 via I2C
    • GNSS NEO-M9N via I2C
    • Iridium 9603N via I2C

    In C++ environment there are existing libraries easy to use but in Nodejs environment it is difficult to find or a long job to convert.

    For the moment I have no time to do that also I will keep an ESP32/C++ to drive these peripherals.

    A wakeup from deep sleep is done by the main ESP32/LOWJS via external gpio signal.
    Actually the communication data is done via Wifi/http or serial cables but I will move it probably to I2C.

    Next week I plan to test ESP32/WROVER 16Mb in place of Neonious One with bulk firmware.



  • Regarding hibernation:

    Oh, it will be faster than 3/4 months. Right now hibernation is todo 5 on my TODO list, so I would expect it to be done in March.

    Possibile it is definitly, already checked the ESP-IDF API. It is just a simple API wrapping to JavaScript.



  • @neoniousTR
    Some bad news and some good news :

    Bad : I did not succeed to solder by hand an WROVER correctly
    Bad : For the moment I have no access to a reflow oven
    Good : I bought a small board without soldering https://www.amazon.fr/gp/product/B07C3R7Q1S/ref=ppx_yo_dt_b_asin_title_o01_s00?ie=UTF8&psc=1
    Good : with this board, less trouble !!
    Good : I succeeded to init&install with sync my software
    Bad : I did not succeeded to flash all the software

    lowsync build --firmware-config=lowbuild.config.json    firmware
    Downloading data from neonious servers...
    Building firmware...
    ****** Used flash space: ******
    low.js code       2097152 bytes
    low.js data        793560 bytes
    Static files            0 bytes
    Factory files           0 bytes
    Modules            287905 bytes
    Settings             1121 bytes
    Reserved          5208870 bytes
    -------------------------------
    Total             8388608 bytes
    Written firmware file firmware (3114330 bytes)
    
    lowsync flash --port=/dev/cu.SLAB_USBtoUART --firmware-file=firmware
    *** Step 1/3: Probing ESP32 microcontroller
    *** Step 2/3: Signing image
    Error: Current firmware on microcontroller is not compatible to the one being flashed, check firmware config for differences
    

    lowbuild.config.json

    {
      "lowjs": {
        "version": "latest",
        "pro": false,
        "system_flash_size": 8388608,
        "ide_support": false,
        "ota_update_support": false
      },
      "static_files": null,
      "factory_files": "datas/",
      "modules": {
        "async": "^3.1.1",
        "axios": "^0.19.2",
        "kalmanjs": "^1.1.0"
      },
      "settings": {
        "code": {
          "main": "/dist/index.js",
          "auto_restart_on_fatal": false,
          "console_kb": 0,
          "only_static_files": false
        },
        "wifi": {
          "ssid": "Wi-Fi de Yves",
          "password": "xxxxxxxxx"
        },
        "web": {
          "http_enabled": false,
          "https_enabled": false
        }
      }
    }
    

    I also tried also with RAM memory size 16MB :

    lowsync build --firmware-config=lowbuild.config.json    firmware
    Downloading data from neonious servers...
    Building firmware...
    ****** Used flash space: ******
    low.js code       2097152 bytes
    low.js data        793560 bytes
    Static files            0 bytes
    Factory files           0 bytes
    Modules            287905 bytes
    Settings             1121 bytes
    Reserved         13597478 bytes
    -------------------------------
    Total            16777216 bytes
    Written firmware file firmware (3114330 bytes)
    

    Save response during flash.

    Can you help me ?



  • You have to add the --init parameter on the first flash. Without it it just tries to update and keep the file system partition, and shows an error if what is on the chip already is not compatible.



  • @neoniousTR

    I succeeded to flash the WROVER with 16MB

    ****** Used flash space: ******
    low.js code       2097152 bytes
    low.js data        793444 bytes
    Static files            0 bytes
    Factory files        3213 bytes
    Modules            287905 bytes
    Settings             1119 bytes
    Reserved         13594383 bytes
    -------------------------------
    Total            16777216 bytes
    

    But after I tried to communicate.

    lowsync settings show
    lowsync monitor
    

    and lowsync try to connect the ESP with HTTP without success.

    The ESP in not seen on the Wifi network.

    I added to my software a simple http server on 8082 but nothing more visible on the network.

    After flashing, how to connect the ESP to monitor a minimum ?

    My files :

    {
      "lowjs": {
        "version": "latest",
        "pro": false,
        "system_flash_size": 16777216,
        "ide_support": false,
        "ota_update_support": false
      },
      "static_files": null,
      "factory_files": "datas/",
      "modules": {
        "async": "^3.1.1",
        "axios": "^0.19.2",
        "kalmanjs": "^1.1.0"
      },
      "settings": {
        "code": {
          "main": "/dist/index.js",
          "auto_restart_on_fatal": true,
          "console_kb": 0,
          "only_static_files": false
        },
        "wifi": {
          "ssid": "Wi-Fi de Yves",
          "password": "xxxxxx"
        },
        "web": {
          "http_enabled": true,
          "https_enabled": false
        }
      }
    }
    
    {
        "ip": "192.168.1.122",
        "useHttp": true,
        "port": 8080,
        "transpile": false
    }
    

    In the build configuration file there is no setting like wifi.mode=station wifi.dhcp=client.

    Is it a problem ?



  • I made some progress adding mode and dhcp parameters in build configuration file :

    "wifi": {
        "ssid": "Wi-Fi de Yves",
        "password": "xxxxxxxxxx",
        "mode": "station",
        "dhcp": "client"
      },
    

    Now I can connect lowsync.

    But the starting process doesn't work.

    lowsync start
    Reminder: No password set! Please set one via the lowsync settings set web.password="..." command. Continuing...
    Error: The file to start does not exist.
    
    lowsync settings show code.main
    Reminder: No password set! Please set one via the lowsync settings set web.password="..." command. Continuing...
    Unknown key code.only_static_files for value false, ommiting key/value pair
    Unknown key network.hostname for value lowjs-B4E62DB3C1E5, ommiting key/value pair
    Unknown key sdcard.clockSpeed for value 10000000, ommiting key/value pair
    code.main="/index.js"
    

    the /index.js starting file is very simple to be tested easily with lowsync monitor :

    console.log('Hello World');
    
    setInterval(function () {
        console.log('Hello');
    }, 1000);
    

    To verify the web, I tested :
    http://192.168.1.122:8000 with the response :

    low.js / lowsync endpoint
    This is the HTTP(S) server which handles lowsync requests.
    

    and http://192.168.1.122:8000/fs is a blank page

    How to verify if all the files are compiled/pushed in the firmware ?



  • Did you try a lowsync sync ? This should copy your files.



  • @neoniousTR
    I tried before but obtained :

    lowsync  sync
    Fetching file system listings...
    Reminder: No password set! Please set one via the lowsync settings set web.password="..." command. Continuing...
    Unexpected error: Http error: PROPFIND /fs.  Returned status code 500. Error: Http error: PROPFIND /fs.  Returned status code 500.
        at /usr/local/lib/node_modules/lowsync/build/webpack:/common/src/http/mcHttp.ts:160:39
        at Generator.next (<anonymous>)
        at fulfilled (/usr/local/lib/node_modules/lowsync/build/index.js:550:58)
        at processTicksAndRejections (internal/process/task_queues.js:97:5)
    

    The http communication works if I try

    but

    lowsync start
    Reminder: No password set! Please set one via the lowsync settings set web.password="..." command. Continuing...
    Error: The file to start does not exist.
    

    During build I have "main": "/index.js",
    During the build, I thought the source code was compiled with the bytecode stored somewhere.
    I thought the sync of the files was not necessary.

    During build I have a "factory_files": "datas/", with just inside a very small file.

    NB :

    • I tried the file names with a slash before or not, idem for directory name with slash after... no difference...
    • I did not succeed to work with a web.password (it was always bad) also I leave it without


  • Do you still have "system_flash_size": 16777216, ?
    If so, there is no space left for the file system which results in the 500.

    (FYI adding on my list to change the status code here)



  • I changed the flash size parameter.

    (base) Mac-mini:microtransat-lowsync yvesgageot$ lowsync build --firmware-config=lowbuild.config.json    firmware.dat
    Downloading data from neonious servers...
    Building firmware...
    ****** Used flash space: ******
    low.js code       2097152 bytes
    low.js data        793444 bytes
    Static files            0 bytes
    Factory files        3213 bytes
    Modules            287905 bytes
    Settings             1129 bytes
    Reserved          5205765 bytes
    -------------------------------
    Total             8388608 bytes
    Written firmware file firmware.dat (3117435 bytes)
    
    (base) Mac-mini:microtransat-lowsync yvesgageot$ lowsync flash  --init --port=/dev/cu.SLAB_USBtoUART --firmware-file=firmware.dat --baud=460800
    *** Step 1/3: Probing ESP32 microcontroller
        now checking if it is an ESP32-WROVER... (takes a while)
    *** Step 2/3: Erasing flash and signing image in parallel
    esptool.py v2.6-beta1
    Serial port /dev/cu.SLAB_USBtoUART
    Connecting........_
    Detecting chip type... ESP32
    Chip is ESP32D0WDQ6 (revision 1)
    Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, BLK3 partially reserved, Coding Scheme 3/4
    MAC: b4:e6:2d:b3:c1:e5
    Uploading stub...
    Running stub...
    Stub running...
    Changing baud rate to 460800
    Changed.
    Erasing flash (this may take a while)...
    Chip erase completed successfully in 7.1s
    Hard resetting via RTS pin...
    *** Step 3/3: Flashing firmware
    esptool.py v2.6-beta1
    Serial port /dev/cu.SLAB_USBtoUART
    Connecting........_____.....__
    Detecting chip type... ESP32
    Chip is ESP32D0WDQ6 (revision 1)
    Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, BLK3 partially reserved, Coding Scheme 3/4
    MAC: b4:e6:2d:b3:c1:e5
    Uploading stub...
    Running stub...
    Stub running...
    Changing baud rate to 460800
    Changed.
    Configuring flash size...
    Auto-detected Flash size: 16MB
    Flash params set to 0x024f
    Compressed 3178748 bytes to 1865527...
    Wrote 3178748 bytes (1865527 compressed) at 0x00001000 in 45.0 seconds (effective 564.9 kbit/s)...
    Hash of data verified.
    
    Leaving...
    Hard resetting via RTS pin...
    *** Done, low.js flashed. Please give your device a few seconds to reset to factory state
    
    (base) Mac-mini:microtransat-lowsync yvesgageot$ rm firmware.dat
    
    (base) Mac-mini:microtransat-lowsync yvesgageot$ lowsync sync
    Fetching file system listings...
    Reminder: No password set! Please set one via the lowsync settings set web.password="..." command. Continuing...
    ? The filesystem of the microcontroller has not been synced before, however the repository on your PC has been synced with another device. How would y
    ou like to continue? Discard sync history and do an initial sync. This will ask you how to proceed where files exist both locally and remotely and dif
    fer. NO existing files or folders will be automatically overridden.
    ? The microcontroller has files in his file system (probably preinstalled example application), the repository on your PC also. How would you like to 
    continue? Delete files on microcontroller and copy local files to microcontroller.
    Synchronization complete |██████████████████████████████| 100%
    PC => MC: +File README.md
    PC => MC: +Folder datas
    PC => MC: +File datas/logPositions.csv
    PC => MC: +Folder dist
    ...
    PC => MC: +File dist/index.js
    PC => MC: +File dist/indexTest.js
    ...
    PC => MC: +File dist/webserver.js
    PC => MC: +File lowbuild.config.json
    PC => MC: -File/Folder logPositions.csv
    ? Would you like to show the output of the microcontroller? (Use the --monitor command line option to remove this prompt and enable/disable showing of
     the output after sync.) Yes
    Restarting program...
    Error: The file to start does not exist.
    

    NB :
    PC => MC: -File/Folder logPositions.csv
    it seems the build process copied the content of "factory_files": "datas/", in root, not in datas/

    (base) Mac-mini:microtransat-lowsync yvesgageot$ lowsync settings show code.main
    Reminder: No password set! Please set one via the lowsync settings set web.password="..." command. Continuing...
    Unknown key code.only_static_files for value false, ommiting key/value pair
    Unknown key network.hostname for value lowjs-B4E62DB3C1E5, ommiting key/value pair
    Unknown key sdcard.clockSpeed for value 10000000, ommiting key/value pair
    code.main="dist/indexTest.js"
    
    (base) Mac-mini:microtransat-lowsync yvesgageot$ lowsync status
    Reminder: No password set! Please set one via the lowsync settings set web.password="..." command. Continuing...
    Current status: stopped
    
    (base) Mac-mini:microtransat-lowsync yvesgageot$ lowsync start
    Reminder: No password set! Please set one via the lowsync settings set web.password="..." command. Continuing...
    Error: The file to start does not exist.
    

    NB:
    dist/indexTest.js is a very simple program writing periodicly on console

    lowbuild.config.json

    {
      "lowjs": {
        "version": "latest",
        "pro": false,
        "system_flash_size": 8388608,
        "ide_support": false,
        "ota_update_support": false
      },
      "static_files": null,
      "factory_files": "datas/",
      "modules": {
        "async": "^3.1.1",
        "axios": "^0.19.2",
        "kalmanjs": "^1.1.0"
      },
      "settings": {
        "code": {
          "auto_start" : true,
          "main": "dist/indexTest.js",
          "auto_restart_on_fatal": true,
          "console_kb": 1000,
          "only_static_files": false
        },
        "wifi": {
          "ssid": "Wi-Fi de Yves",
          "password": "xxxxxxx",
          "mode": "station",
          "dhcp": "client"
        },
        "web": {
          "http_enabled": true,
          "https_enabled": true
        }
      }
    }
    


  • OK, so this one is difficult.
    Can you try setting code.main to /dist/indexTest.js instead of dist/indexTest.js ?



  • (base) Mac-mini:microtransat-lowsync yvesgageot$ lowsync settings set code.main=/dist/indexTest.js
    Reminder: No password set! Please set one via the lowsync settings set web.password="..." command. Continuing...
    
    (base) Mac-mini:microtransat-lowsync yvesgageot$ lowsync settings show code.main
    Reminder: No password set! Please set one via the lowsync settings set web.password="..." command. Continuing...
    Unknown key code.only_static_files for value false, ommiting key/value pair
    Unknown key network.hostname for value lowjs-B4E62DB3C1E5, ommiting key/value pair
    Unknown key sdcard.clockSpeed for value 10000000, ommiting key/value pair
    code.main="/dist/indexTest.js"
    
    (base) Mac-mini:microtransat-lowsync yvesgageot$ lowsync status
    Reminder: No password set! Please set one via the lowsync settings set web.password="..." command. Continuing...
    Current status: stopped
    
    (base) Mac-mini:microtransat-lowsync yvesgageot$ lowsync start
    Reminder: No password set! Please set one via the lowsync settings set web.password="..." command. Continuing...
    
    (base) Mac-mini:microtransat-lowsync yvesgageot$ lowsync status
    Reminder: No password set! Please set one via the lowsync settings set web.password="..." command. Continuing...
    Current status: running
    
    (base) Mac-mini:microtransat-lowsync yvesgageot$ lowsync monitor
    ? Restart the program before running monitor? (Use the --restart command line option to remove this prompt and enable/disable restarting before monito
    r.) No
    Reminder: No password set! Please set one via the lowsync settings set web.password="..." command. Continuing...
    --- User program's output: ---
    Hello World
    Hello
    Hello
    Hello
    Hello
    

    Super, the test works, I continue... Thanks !


Log in to reply