Update from a file on the device
From the Nerves application project directory, build the firmware.
Connect to the device with SFTP and transfer the firmware bundle (.fw
) onto the device. Modify the lines below to match your project.
Connect to the device's console and run fwup
from IEx to apply the firmware update. Reboot once the update is complete. The device will come back up with the new firmware running.
The firmware bundle can be removed from the device if it is no longer needed.
🛈 Tip
scp
is an alternative tosftp
. However, on some systemsscp
responds withlost connection
and fails to transfer the file. The tool used for the file transfer is not important as long as the firmware file makes it onto the device.
Finding the disk
The fwup -d
flag specifies the disk to apply the update to. This is documented by the NERVES_FW_DEVPATH
property in your Nerves system fwup config.
If you need to find the disk without being able to reference the config, run fwup on the device without the -d
flag.
This will attempt to auto-detect the disk and will print what it has discovered. However, the console will hang when doing so.
Break out of the command with Ctrl+C. Copy the path to the disk and paste it after the -d
flag in the full fwup command above.
Background
A Nerves device doesn't have to receive a firmware update command remotely. fwup is used to manage firmware updates, and can be run directly on a Nerves device. This is actually how the OTA update process works under the hood.
In this runbook we manually place a firmware file on the device, and then call fwup
on the device to perform the firmware update. Once the device is rebooted, it will come up with the new firmware.
Last updated