If you want to rollout updates to your embedded devices remotely, Eclipse Hawkbit is undoubtedly one of the best options to start. It is one of the best open-source frameworks to send updates to microcontrollers, connected to IP based network protocols.
However, many people remain stuck in using Hawkbit properly. The reason is that documentation doesn’t provide much help in configuring hawkbit appropriately. In this article, we will tell you how to setup OTA updates on Hawkbit easily in 10 simple steps.
So, Let’s get started
How to Configure Hawkbit for OTA Updates:
You should follow the below steps to send firmware updates to your remote devices via Hawkbit!
1. Open the terminal and run the command given below. This command will start a hawkbit server for you at the port 8080.
sudo docker run -p 8080:8080 hawkbit/hawkbit-update-server:latest
2. Now go your favorite browser. Run the following command in your browser. Your_ip:8080 (like 192.168.xxx.xxx:8080). If you don’t know your IP, simply run “ifconfig”command in your terminal and it will show you network configurations.
3. Now, you will see the below screen in your browser. Simply use admin as username and password. Now, you are officially inside the Hawkbit server. You can now configure Hawkbit to send updates to your remote embedded devices.
4. First of all, you need to define authentication configuration for receiving updates from Hawkbit. Go to System Config tab in the left pane of the server. It will show you 4 types of authentications for target devices to receive updates. The most common authentications used are gateway authentication and target authentications. In gateway authentication, the hawkbit provides a gateway token. Every device coming from the same gateway can get updates from Hawkbit. However, in target authentication token, remote server provides authentication token for every single device that wants to receive updates from Hawkbit. Simply select one option and give that token to Rauc-Hawkbit-Updater configuration that want to receive updates from the hawkbit. Don’t be confused here. We will see that step later on.
In this tutorial, we are selecting Target authentication option. Don’t forget to press save button at the bottom after selecting authentication.
5. After selecting the authentication configuration, press the deployment button in the left panel. In the target stab, click on + icon to make a new target. Once you will click this icon, the following screen will pop up. Simply give any controller id and name to your target. Keep in mind that this controller id should be unique for every target.
You will notice that a new target will be shown on the screen as shown in the image below. Simply copy the security shown at the very last of target section and save it somewhere. We will use it later on.
6. Now press the upload button in the left panel. Here, you will upload the software module that you want to send to your remote device. In order to upload new software, you have to make a new Software Module in Hawkbit. Simply press the +icon in Software module, the following window will pop up. Create a new software module and click on “Upload File” in the bottom right to upload new software.
7. After that, press the Distribution button in the left panel. Create a new distribution by clicking the +icon in distribution section. Drag and drop the software module in the distribution you created.
8. Now click the Target Filters button in the left panel. Enter the +icon in the custom filters option and enter the following query (name=IN=Deployment_device_name).As we have created a device named rpi in the deployment stage. Therefore, we are using name=IN=rpi as shown in figure below.
9. Now Go to Rollout section in the left panel. Make a new rollout by clicking the + icon and filling all the fields as shown below. Now you are done with server configuration. Press the run button. Now hawkbit is waiting for the device to receive updates.
10. On targets, you mostly use rauc-hawkbit-updater to receive updates. Simply put the controller_Id (in front of target name) and security token (in front of auth_token) that we copied in step 5 in the configuration of rauc-hawkbit-updater. Besides, also insert your server IP address here. Run that instance of rauc-hawkbit-updater on your target device. The target device is now ready to receive updates from the remote server.
If you don’t know how to setup Rauc-Hawkbit-Updater on your target, you can take help from official documentation to deploy the client.
That’s all for today. If you are facing any problem in setting Hawkbit, feel free to ask in comments section.