Module Integration Guides
...
Linux
Integrate Over The Air Updates

App Update

10min

This guide talks about how to update an application binary of the remote device from the Bytebeam cloud. App update replaces the existing binary on the system with the binary uploaded on the Bytebeam cloud. We have provided an example application on our Github page. There are four files in the example.

  • hello_app - Prints "Hello from Bytebeam" every 3 seconds.
  • app_update.sh - This script replaces the old application with new application.
  • update.sh - This is a wrapper script for app_update.sh script.
  • make_firmware_update.sh - It creates the update tar file.

Step1: Prepare update tar

Firstly on your Linux system, we need to create an update tar file for Raspberry Pi. For that, Download all the files mentioned above from GitHub. Next, we need to change the permissions for all these files using chmod command

Shell


Next run make_firmware_update.sh to create a tar.gz file.

Shell


Step 2: upload update Tar

Next, we need to upload the tar to bytebeam cloud. For that go to device management panel and click on the Firmware Versions tab.

Document image


Under the Firmware version tab, you will find an option to create a firmware version number and upload your updated tar file.

Enter the new Firmware version number and click on choose file to upload tar file. Then click on Create.

Document image


Step 3: Set the application path

In step 1 we have already assumed that you want to update the hello_app that exists on your remote device and we created an update tar accordingly. On the remote device, the app is expected to be in /usr/local/bin location. If it's not there then create a new hello_app in /usr/local/bin.

hello_app


If the application location and app name are different, set the path in app_update.sh script in Step 1.

app_update.sh


Step 4: Create systemctl service to debug update changes

To debug your changes after the app update, Let's create a service that runs hello_app. So, create this service named <App Name>.service and place it in /etc/systemd/system.

hello_app.service


Reload systemctl daemon and start the service.

Shell


Step 5: Trigger "update firmware" action from bytebeam cloud

Now let's proceed with our OTA update. For that, Go to the Device Management panel and select the device

Next, Click on the update firmware

Document image


In the next prompt choose the firmware version and click on next

Document image


Monitor the progress of firmware updates in the action panel. and on your remote device, you can see updated hello_app

Document image

Document image


Update uplink

Using these steps we can update the uplink as well.

Steps to follow

Step 1: In the example, replace the hello_app with the uplink binary.

Step 2: Change the uplink path and application name in app_update.sh

Step 3: Run make_firmware_update.sh.

Step 4: Upload the generated update tar file to Bytebeam cloud.