
SysSync – Remote update library
Making remote updates (OTA) – step by step
In this tutorial we will learn how to include the SysSync library into an application and to do a remote update using the SysSync server. We will create two applications (AppA/AppB) that include the SysSync library, create an user account on the cloud server, register our device and create an update job that remotely updates from application A to the application B.
1 – What do we need for this tutorial
- Arduino installation including the dice-package
- Dice standalone tools (diceConfig) installed

2 – Create and flash a basic application
- Open the Arduino IDE
- Create a new Sketch and call it ‘Application_A‘
- Write a simple application that welcomes the user and let the LED blink:
// Application A
void setup() {
while(!Serial) yield();// wait for the CAN2SER monitor to open
Serial.println("Welcome to: "+BOOTLOADER_SETTING.s_get_app_name()+
" (V" + BOOTLOADER_SETTING.u32_get_app_version()+")");
}
void loop() {
digitalWrite(LED_BUILTIN, HIGH);
delay(1000);
digitalWrite(LED_BUILTIN, LOW);
delay(1000);
}
- Select your device type (e.g. dice-CPU) in the
Tools -> Board
menu - Compile and upload the application onto your device
When the CAN2SER monitor opens, your application should welcome you with its name and the LED should blink.
3 – Include the SysSync library in your application
Now extend the application with the ability to be remotely updated. To use this tutorial on all dice devices, we will use the CANIP library as communication technology to connect to the internet. The CAN2SER monitor will act as the gateway to the internet. Of course any other dice-device that can connect the internet (e.g. dice-WiFi) could be used as CANIP- internet provider, instead.
- Include the CANIP and SysSync libraries.
- Create an instance of the class
CANIP_Client
. - Add the function call
i_doSysSync()
at the end of theloop()
. The example code below evaluates the return value ofi_doSysSync()
. It will stay in thewhile()
loop for as long as an update process is running. If you prefer to have a more detailed output of the update process while it runs, then use code fromExamples->SysSync->SysSyncCANIP
, instead.
// Application A
#include "CANIP.h"
#include "SysSync.h"
CANIP_Client t_postClient(&MCAN0, &BOOTLOADER_SETTING);
void setup() {
while(!Serial) yield();// wait for the CAN2SER monitor to open
Serial.println("Welcome to: "+BOOTLOADER_SETTING.s_get_app_name()+
" (V" + BOOTLOADER_SETTING.u32_get_app_version()+")");
}
void loop() {
// blink LED
digitalWrite(LED_BUILTIN, HIGH);
delay(1000);
digitalWrite(LED_BUILTIN, LOW);
delay(1000);
// check remote updates
while( i_doSysSync(&t_postClient) >= SYSSYNC_RET_UPDATE_WARN )
yield();
}
- Compile, upload and run your application again
4 – Export the application binary
In this tutorial we want to remotely update from application A to application B (and maybe back again).
This is why we need the application in form of a binary file (.bin) so that we can upload it (in a later step) to the SysSync server.
- Export the binary file of the app by clicking on
Sketch -> Export compiled binary
- Find the binary file in your sketch folder
Sketch -> Show sketch folder
.
In the sketch folder you will now find the file: Application_A.ino.V163xxxxxx.bin
. This is your compiled version of the application. As you can see, the toolchain added a version number into the file name. The version equals basically the epoche time of the compilation (see more details about the autom. versioning feature here)
- Copy the binary to the desktop so that we have it at hand later.
5 – Create another version of your application
Now that your device runs Application_A successfully, lets create a new version of the application. This ‘new’ version shall have the name ‘Application_B’ and blinks the LED double the speed. Note that the name of the application could be left unchanged since it could still be distinguished by its version number. For our example lets name it ‘Application_B’ so that we recognise it straight away when the CAN2SER monitor opens.
- Click on
File -> SaveAs
and save it under the name ‘Application_B‘ - Change the two code lines from
delay(1000);
todelay(500);
- Compile and export your new application
Sketch -> Export compiled binary
(don’t upload it to the device) - Open the sketch folder
Sketch -> Show sketch folder
and - Copy the binary
Application_B.ino.V1633xxxxxx.bin
to the desktop as well.
6 – Create an user account on the SysSync server
The device should still be running ‘Application_A’. Now let’s turn to the SysSync server, which should provide the updates for our device. For this we need the dice-Config tool. The tool is part of the dice-support package that is already installed on your computer, but for conveniences we will use the stand-alone version of the tool. You can download and install it here.
- Open the diceConfig tool
- Click on the picture (or click
Start -> (Re)connect
) to start your dice in bootloader mode an connect to it:

As you can see, the bootloader tells you that the current application is ‘Application_A’. We assume that you are a new user of the SysSync Cloud and therefore do not have an account yet. Lets create one:
- Click on the SysSync symbol
- Enter your email address and click on ‘Create new account’. This will trigger the server to send an email with a confirmation ‘token’.
- Use the token from the email and use it as password for the first login.
- After login in, the diceConfig tool will reload your devices bootloader settings and
the SysSync symbol looks like this:
Hint: Most elements in the tools have ‘tooltips’ for further explanations.
7 – Register the device at the server

This will automatically create device credentials that are secret shared by the server and your device only. The symbol should now look like this: . telling us that the device is now associated to your account only.
This can not be changed without your confirmation. Even if someone else gets physically hold of the device, he can not. Instead the following symbol would be shown: . So if a different syssync-account holder did the same procedure, he would rather trigger a ‘release request’ that will be send to you (via email). You can then decide to release the device from your account or not.
Alternatively, you can release the device by clicking on ‘Misc -> DeRegister the device
‘ in the menu of the diceConfig tool to release it from your account.
- Close the diceConfig tool.
8 – SysSync Cloud overview
Let have a look at the SysSync server. Either click on the button in the dicConfig tool, or click on
on our web page.
You can close the diceConfig tool now.
Clicking the link will open http://syssync.di-ce.de:

Logging in with your account email and password takes you here:

This is the main page of the SysSync server ‘Devices & Jobs’. As you can see, your device is already listed on this page. That’s because we registered it in your account in the previous step of this tutorial.
On the left side bar you will find the menu to the three pages of the server.
lists all your devices with further details like the health status, serial number, position, the current application and the status of a possible ‘Update Job’ etc.
‘File Storage’ lists your applications + files that you stored in your account
The ‘Groups’ button let you list, create and manage groups of several devices.
The top bar shows the statistics about devices, update jobs, files and groups depending on the active page. It also offers means of filtering and common command buttons.
Take some time and click through the three pages, test the filter settings and find the many ‘tooltip’ that most elements on the webpage have. Note: if you hold your mouse pointer over a ‘version number’ of an application it will show you the date/time that the version stands for (see epoch time)
9 – Create an update job
Ok. All the preparations are done. We created two application .bin files, an user account on the server and registered the device to the account. Now lets create our first update job. Say, we would like to remotely update our simple application ‘Application_A’ to the new (faster blinking) version: ‘Application_B’.
- Click on your device (e.g. dice-CPU) on the
page.

The device overview page shows (from top to down):
- Device type
- Article number
- Serial number
- Picture
- Name char-string as it is set in the bootloader settings
- Tag /notes – use this to define your own descriptive text for this device (e.g. ‘vehicle ABC of customer 123’)
- Table that describes the current system:
refresh the view
create a new update job
- Last activity – last time that this device connected to the server (heart beat)
- Name and version of the current application (hovering over the version number reveals the compilations time)
The easiest way to create an update job is drag-n-drop the new application binary: Application_B.ino.V1633xxxxxx.bin on the device picture:

This creates a new update job and adds the binary to it.

The table has changed. It did get the new column ‘System Update’ that lists the desired future system of our device. For now we only want to replace the application. But you could also add further (non .bin files) files to the update job. For example configuration files.
The table now has the row ‘Update status’. This says ‘INACTIVE’ which means that this update job would not be provisioned by the server yet. This is the status to create and modify update jobs. Note: the tooltips (eg. hover the mouse pointer over the little arrow symbol ) for most elements are very helpful to find your way around for the beginning.
On the right hands side, you see the ‘File Storage’. This table lists all files and applications of your account that are stored on the server. If there were any files stored yet, you could pick the files or the application that you want to have on your device / in this update job. The system would only offer application files here that match the specific device type (that were compiled for this ArtNo).
The button starts the update. Meaning, the server will provision the update job to our device when it polls it.
The button schedules the job provision at future date a/o time.
Finally the button deletes the job
At the end of the table you find two more checkbox selections:
Erase file system before update. This would trigger the complete deletion (formatting) of the SPI serial flash of the device before the update will start downloading any files or the new application.
Inform me about the progress. This selection will cause the server to send you emails at the start, completion or failure of the update job.
10 – Execute and monitor the update process
- Click on
to start the provisioning of the update job.
Now the update job table should look like this:

- Start the CAN2SER monitor
- Click on
Misc -> Provide internet access
in menu bar of the CAN2SER mon.

The CAN2SER monitor now serves as CANIP provider, giving our device the opportunity to use it as a gateway to reach the update server.
Now we could sit and wait until it is time for the SysSync function to poll the servers and to find our update job or
- Reset the device (e.g.
Misc -> Send reset cmd message
)
The device is restarted and the i_doSysSync() function queries the server for a new update.
- Click on
to refresh the page. The job status should eventually change from to:
ACTIVE –> PROCESSING… –> COMPLETED
Thats it. your first update job is finished!
You should notice the LED blinking faster and in the CAN2SER monitor, the new application should have welcomed you: Welcome to: Application_B (V1638xxxxxx)
The device details page shows

- As you can see, the current system has the right / same application as the update jobs.
- The file in the file systems
- Application_B.bin – is the download of the new app. during the update job
- recover.bin – is the image that was autom. created for a potential rollback
Suggestions
This tutorial explained how to do a simple update job. As discussed here, there are many more features build into the whole SysSync update system to be tested if you like:
- Rollback – try to cut the power supply or stop providing the internet connection during the update process and see how the system is handling it.
- Scheduled start – instead of starting the update straight away, try to schedule it at some time in future or within a time window.
- Inform me – Let the server send you emails when the device actually gets active (e.g. after the polling period)
- See what difference it makes to ‘Erase the filesystem before the update starts’ The files that are currently present on the device will be deleted / replaced.
- Attempt counter (see also while hovering over the System update activity time stamp) – make an update fail by e.g. providing an Application_B that doesn’t include the SysSync function.
- Discover the ‘File Storage’ page – See how the files are distinguished by its attributes (target type, version, type)
- Health status – see how the status tick symbol changes its color over the time when the target is switched off for longer.
- Filters – Jobs / Devices can be filtered by clicking on the little funnel symbols in the top bar
- Groups – once you more devices, group them and filter for groups
End of this tutorial