Project for an Autonomous Sailing Boat



  • I just made a first test with the configuration file :

    {
      "lowjs": {
        "version": "20200105",
        "pro": true,
        "system_flash_size": 8388608,
        "ide_support": false,
        "ota_update_support": false
      },
      "static_files": null,
      "factory_files": null,
      "modules": {
        "async": "^3.1.0",
        "axios": "^0.19.0",
        "kalmanjs": "^1.1.0",
        "pako": "^1.0.10"
      },
      "settings": {
        "code": {
          "main": "/dist/index.js",
          "auto_restart_on_fatal": false,
          "console_kb": 0,
          "only_static_files": false
        },
        "wifi": {
          "ssid": "****************",
          "password": "*********"
        },
        "web": {
          "http_enabled": false,
          "https_enabled": false
        }
      }
    }
    

    I obtained

    Building firmware...
    ****** Used flash space: ******
    low.js code       2097152 bytes
    low.js data       3365605 bytes
    Static files            0 bytes
    Factory files           0 bytes
    Modules            498505 bytes
    Settings             1148 bytes
    Reserved          2426198 bytes
    -------------------------------
    Total             8388608 bytes
    

    and during the flash step :

    Error: No port specified. Please use --port=.. to specify the port.
    

    What port is it ?



  • Sorry ! I looked only the doc on the blog.
    Reading the full documentation and Github, I red it was necessary to connect the Neonious One via USB port.
    I continue...



  • Let me stop you right here!

    I did a mistake! neonious one is still based on the idea that the user will never need to flash low.js. Just update over Wifi/Ethernet and add user data via lowsync. So it does not have an USB/UART adapter! And I forgot that you are working with the neonious one. With the "C/C++ Hacking Kit" you can Flash, but the neonious one needs a special low.js version because of the LPC coprocessor, so the custom firmware will not work this way either.

    I guess you like the neonious one because of the Ethernet port and the additional Flash? In that case.. we are working on the successor of the neonious one, to streamline everything and have the same possibilities with all hardware. Till mid February we should have a new board - same size, still with Ethernet, 4 MB more Flash, and Custom Firmware will work here, too.

    If you do not care about Ethernet/the amount of ports, a third-party ESP32-WROVER board with 16 MB Flash might be another option. Here the custom firmware would work right now.

    Second thing: Your configuration

    The config file you show above has no static files, no factory files, so no user files at all => no user program will run. Also no port for lowsync or neonious IDE enabled (web.http_enabled/web.https_enabled). So, it would show a Wifi access point, but there will be now way to interact with the board after connecting to the AP.



  • In fact I bought a Neonious One to save time to check the possibility to run my Nodejs software on ESP32.

    I used the Neonious One ethernet port only to set the Wifi network and after it was easier for me to work via Wifi and have the processor near my desktop.

    My final goal is to use an ESP32 with minimum power usage. It means :

    • no extra hardware.
    • a solar power management
    • deep sleep or hibernate management

    For the moment my target configuration :

    In the hull :

    • 1 large ESP32 running lowjs as the main brain with no sensors.
    • 1 small ESP32 with sensors IMU,GPS,RF24 and servo written in C++ using deep-sleep, wakeup via timer&gpio
      interconnected actually via Wifi, tested BLE but it can be no Serial.
    • a satellite gateway

    In the independant wingsail :

    • 1 small ESP32 with servo written in C++ using deepsleep, wakeup and data via RF24, solar management.

    I have to find a minimum ESP32-WROVER but with large Flash memory



  • @neoniousTR I don't know our mapping of the flash memories.

    If I use a standard ESP32-WROVER with 4Mb flash as in your store : How the flash memory is used ?

    If fact I need only the place for the firmware and a place to store and update 2/3 Kb of permanent data.
    No IDE, no ETA for the final configuration.

    Is it possible ?



  • 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.


Log in to reply