Updating a repeater: Difference between revisions

From NodeNet
Jump to navigationJump to search
Created page with "= How to update your node == == Physical update == Connect to your computer and update. == Over the Air update == OTA = Over the air Unfortunately, we first need to flash all the sensecaps with different bootloader firmware. == Adafruit Bootloader == [https://github.com/oltaco/Adafruit_nRF52_Bootloader_OTAFIX Adafruit Bootloader Repository] === Install adafruit-nrfutil === To install the utility, run the following command: <pre> pip3 install adafruit-nrfutil </p..."
 
 
(15 intermediate revisions by the same user not shown)
Line 1: Line 1:
= How to update your node ==
== Physical update ==
Connect to your computer and update using [https://flasher.meshcore.co.uk/ the flasher]
 
== Over the Air update ==
 
''The node needs to have the Adafruit_nRF52_Bootloader_OTAFIX in order to do this. If that is not yet flashed, scroll down for an how-to''
 
=== Preperation ===
Prepare the node to receive the new firmware by bringing it into DFU mode. For this you have to connect your companion node to the repeater node.
 
* Open meshcore client (phone)
* Connect companion device
* Select in the device list the solar node (if not in the list, you need to add it first)
* Open "Remote Managment"
* go to "Command Line"
* on the prompt type: <pre>Start ota</pre>
 
Now the solar node is ready to receive a firmware upgrade over Bluetooth directly from your phone.
 
=== Flash new firmware ===
* Download the [https://flasher.meshcore.dev/releases/download/repeater-v1.14.0/SenseCap_Solar_repeater-v1.14.0-9f1a3ea.zip latest firmware] to your phone. (currently 1.14.0)
* Open the "Nordic Semiconductor DFU" app.
* Select the ZIP file containing the firmware you want to update.
* Select the device.
* Bluetooth will be turned on.
 
* Select the Solar P1 (check if the MAC address corresponds with the MAC address you got from the Remote Management command).
* Press "Start".
 
=== Retry the Upgrade ===
''Mostly, the first attempt fails... When you try again, it works''


== Physical update ==
* Open the DFU app again.
Connect to your computer and update.  
* Select the device (which is now called "XIAO-DFU").
* Press "Start".
* Wait and monitor the progress until it says "Completed".
* The node will reboot into the freshly installed firmware.


== Over the Air update ==  
== Preparing a Solar P1 Node for OTA ==  


OTA = Over the air
=== Stuff you'll need to do this: ===


Unfortunately, we first need to flash all the sensecaps with different bootloader firmware.
* A computer running MacOS (linux and windows how to not yet complete)
* A phone with the Meshcore app and the [https://play.google.com/store/apps/details?id=no.nordicsemi.android.dfu&hl=en-US Nordic Semiconductor DFU app] installed
* A Meshcore node that you want to use as repeater.
* A Meshcore node that you use as companion.


== Adafruit Bootloader ==
=== Why do we need to do what? ===
With Over The Air (OTA) updates you can flash the lates MeshCore firmware to your node using Bluetooth.


[https://github.com/oltaco/Adafruit_nRF52_Bootloader_OTAFIX Adafruit Bootloader Repository]
Unfortunately, you probably first need to flash your node with different bootloader firmware. In this case we do this for the Sensecap Solar P1. But you can find this firmware for other nodes in the [https://github.com/oltaco/Adafruit_nRF52_Bootloader_OTAFIX Adafruit Bootloader Repository] on Github.


=== Install adafruit-nrfutil ===
=== Install adafruit-nrfutil ===
To install the utility, run the following command:
In order to install the firmware, you first need to install `adafruit-nrfutil` on your computer.
 
To install this utility, run the following command:
 
<pre>
<pre>
pip3 install adafruit-nrfutil
pip3 install adafruit-nrfutil
</pre>
IF all is fine you should see:
<pre>
Successfully installed adafruit-nrfutil-0.5.3.post16 ecdsa-0.19.1
</pre>
</pre>


=== Download the Firmware ===
=== Download the Firmware ===
Download the firmware for the Solar P1. Note: the file is named: ''Seeed Studio XIAO nRF52840 BLE (and Seeed SenseCAP Solar Node)''. Currently available here:
After that you need to download the firmware for the Solar P1.  
 
It is currently available here:
 
https://github.com/oltaco/Adafruit_nRF52_Bootloader_OTAFIX/releases
 
(https://github.com/oltaco/Adafruit_nRF52_Bootloader_OTAFIX/releases/download/0.9.2-OTAFIX2.2-BP1.3/sensecap_solar_p1_bootloader-0.9.2-OTAFIX2.2-BP1.3_s140_7.3.0.zip)
 
=== Flash the bootloader ===


[https://github.com/oltaco/Adafruit_nRF52_Bootloader_OTAFIX/releases/download/0.9.2-OTAFIX2.1-BP1.2/xiao_nrf52840_ble_bootloader-0.9.2-OTAFIX2.1-BP1.2_s140_7.3.0.zip xiao_nrf52840_ble_bootloader-0.9.2-OTAFIX2.1-BP1.2_s140_7.3.0.zip]
After downloading, you don't need to unzip it.  
Navigate your terminal to the folder where you saved the firmware using cd.  


Run the following command to flash the firmware:
For example
<pre>
<pre>
adafruit-nrfutil --verbose dfu serial --package xiao_nrf52840_ble_bootloader-0.9.2-OTAFIX2.1_s140_7.3.0.zip -p /dev/ttyACM0 -b 115200 --singlebank --touch 1200
$ cd ./Downloads/
</pre>
</pre>


[[File:adafr_dfu.png|thumb|center|adafruit-nrfutil]]
<pre>
ls /dev/cu.usb*
</pre>


=== Flashing Steps ===
Note the number of the USB connection.
* Open [https://flasher.meshcore.co.uk Meshcore Flasher].
* Select the "Sensecap Solar P1".
* Put the Solar P1 in DFU mode.
* ERASE FLASH (Unfortunately, settings and history are lost).
* [https://flasher.meshcore.co.uk Flash] the (pre-last, not the newest) Meshcore firmware.
* The device will reboot.


== OTA (Over the Air - Using Bluetooth to Upgrade Firmware) ==
Now run the following command to flash the firmware:


* Open the Meshcore client (on your phone).
NOTE! Make sure that the file name of the zip is identical to the one you downloaded and replace the XXXX string of the usbmodem with the number of the USB connection (for me it is always 1011).
* Connect the companion device.
* Select the Solar Node in the device list.
* Open "Remote Management".
* Go to "Command Line".
* At the prompt, type: <code>Start ota</code>.


[[File:ota_img.png|thumb|center|Start OTA]]
<pre>
adafruit-nrfutil --verbose dfu serial --package sensecap_solar_p1_bootloader-0.9.2-OTAFIX2.2-BP1.3_s140_7.3.0.zip -p /dev/cu.usbmodemXXXX -b 115200 --singlebank --touch 1200
</pre>


* It will respond: <code>OK - mac: xx:xx:xx:xx:xx:xx</code>.
If all is correct you should see this:
* Now open the "Nordic Semiconductor DFU" app.
* Select the ZIP file containing the firmware you want to update.
* Select the device.
* Bluetooth will be turned on.


[[File:dfuapp.png|thumb|center|DFU App]]
<pre>
Upgrading target on /dev/cu.usbmodem101 with DFU package /Users/douwe/Downloads/xiao_nrf52840_ble_bootloader-0.9.2-OTAFIX2.1-BP1.2_s140_7.3.0.zip. Flow control is disabled, Single bank, Touch 1200
Touched serial port /dev/cu.usbmodem101
Opened serial port /dev/cu.usbmodem101
Starting DFU upgrade of type 3, SoftDevice size: 152728, bootloader size: 39000, application size: 0
Sending DFU start packet
Sending DFU init packet
Sending firmware file
########################################
###############
Activating new firmware


* Select the Solar P1 (check if the MAC address corresponds with the MAC address you got from the Remote Management command).
DFU upgrade took 20.776023864746094s
* Press "Start".
Device programmed.
</pre>


[[File:fwupfault.png|thumb|center|Firmware Upgrade - First Attempt]]
NOTE: If the device no longer shows up on your Computer, quickly tap the RST button twice on the node.


* Mostly, the first attempt fails...
=== Flash fresh firmware ===
* Open [https://flasher.meshcore.co.uk Meshcore Flasher].
* Select the "Sensecap Solar P1".
* Put the Solar P1 in DFU mode.
* ERASE FLASH (Unfortunately, settings and history are lost).
* [https://flasher.meshcore.co.uk Flash] the (pre-last, not the newest) Meshcore firmware.
* The device will reboot.


=== Retry the Upgrade ===
Go to the [https://config.meshcore.dev/ config settings] of your newly flashed node and give it a nice name, make a copy of it's public key and make sure the radio settings are the same as on your companion node (in our case: EU/UK Narrow)
* Open the DFU app again.
* Select the device (which is now called "XIAO-DFU").
* Press "Start".
 
[[File:fwupgrade.png|thumb|center|Firmware Upgrade Progress]] [[File:fwup.png|thumb|center|Firmware Upgrade Complete]]
 
* Wait and monitor the progress until it says "Completed".
* The node will reboot into the freshly installed firmware.

Latest revision as of 06:55, 10 May 2026

Physical update

Connect to your computer and update using the flasher

Over the Air update

The node needs to have the Adafruit_nRF52_Bootloader_OTAFIX in order to do this. If that is not yet flashed, scroll down for an how-to

Preperation

Prepare the node to receive the new firmware by bringing it into DFU mode. For this you have to connect your companion node to the repeater node.

  • Open meshcore client (phone)
  • Connect companion device
  • Select in the device list the solar node (if not in the list, you need to add it first)
  • Open "Remote Managment"
  • go to "Command Line"
  • on the prompt type:
    Start ota

Now the solar node is ready to receive a firmware upgrade over Bluetooth directly from your phone.

Flash new firmware

  • Download the latest firmware to your phone. (currently 1.14.0)
  • Open the "Nordic Semiconductor DFU" app.
  • Select the ZIP file containing the firmware you want to update.
  • Select the device.
  • Bluetooth will be turned on.
  • Select the Solar P1 (check if the MAC address corresponds with the MAC address you got from the Remote Management command).
  • Press "Start".

Retry the Upgrade

Mostly, the first attempt fails... When you try again, it works

  • Open the DFU app again.
  • Select the device (which is now called "XIAO-DFU").
  • Press "Start".
  • Wait and monitor the progress until it says "Completed".
  • The node will reboot into the freshly installed firmware.

Preparing a Solar P1 Node for OTA

Stuff you'll need to do this:

  • A computer running MacOS (linux and windows how to not yet complete)
  • A phone with the Meshcore app and the Nordic Semiconductor DFU app installed
  • A Meshcore node that you want to use as repeater.
  • A Meshcore node that you use as companion.

Why do we need to do what?

With Over The Air (OTA) updates you can flash the lates MeshCore firmware to your node using Bluetooth.

Unfortunately, you probably first need to flash your node with different bootloader firmware. In this case we do this for the Sensecap Solar P1. But you can find this firmware for other nodes in the Adafruit Bootloader Repository on Github.

Install adafruit-nrfutil

In order to install the firmware, you first need to install `adafruit-nrfutil` on your computer.

To install this utility, run the following command:

pip3 install adafruit-nrfutil

IF all is fine you should see:

Successfully installed adafruit-nrfutil-0.5.3.post16 ecdsa-0.19.1

Download the Firmware

After that you need to download the firmware for the Solar P1.

It is currently available here:

https://github.com/oltaco/Adafruit_nRF52_Bootloader_OTAFIX/releases

(https://github.com/oltaco/Adafruit_nRF52_Bootloader_OTAFIX/releases/download/0.9.2-OTAFIX2.2-BP1.3/sensecap_solar_p1_bootloader-0.9.2-OTAFIX2.2-BP1.3_s140_7.3.0.zip)

Flash the bootloader

After downloading, you don't need to unzip it. Navigate your terminal to the folder where you saved the firmware using cd.

For example

$ cd ./Downloads/
ls /dev/cu.usb*

Note the number of the USB connection.

Now run the following command to flash the firmware:

NOTE! Make sure that the file name of the zip is identical to the one you downloaded and replace the XXXX string of the usbmodem with the number of the USB connection (for me it is always 1011).

adafruit-nrfutil --verbose dfu serial --package sensecap_solar_p1_bootloader-0.9.2-OTAFIX2.2-BP1.3_s140_7.3.0.zip -p /dev/cu.usbmodemXXXX -b 115200 --singlebank --touch 1200

If all is correct you should see this:

Upgrading target on /dev/cu.usbmodem101 with DFU package /Users/douwe/Downloads/xiao_nrf52840_ble_bootloader-0.9.2-OTAFIX2.1-BP1.2_s140_7.3.0.zip. Flow control is disabled, Single bank, Touch 1200
Touched serial port /dev/cu.usbmodem101
Opened serial port /dev/cu.usbmodem101
Starting DFU upgrade of type 3, SoftDevice size: 152728, bootloader size: 39000, application size: 0
Sending DFU start packet
Sending DFU init packet
Sending firmware file
########################################
###############
Activating new firmware

DFU upgrade took 20.776023864746094s
Device programmed.

NOTE: If the device no longer shows up on your Computer, quickly tap the RST button twice on the node.

Flash fresh firmware

  • Open Meshcore Flasher.
  • Select the "Sensecap Solar P1".
  • Put the Solar P1 in DFU mode.
  • ERASE FLASH (Unfortunately, settings and history are lost).
  • Flash the (pre-last, not the newest) Meshcore firmware.
  • The device will reboot.

Go to the config settings of your newly flashed node and give it a nice name, make a copy of it's public key and make sure the radio settings are the same as on your companion node (in our case: EU/UK Narrow)