Add Upswift to Yocto image
These guidelines explain how to insert Upswift agent into a Yocto image build, in order to deploy Upswift on a big scale of devices at once.
- 1.Systemd or init.d + Cron. *It is recommended to use Systemd
DISTRO_FEATURES_append = " systemd"
VIRTUAL-RUNTIME_init_manager = "systemd"
DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
VIRTUAL-RUNTIME_initscripts = ""
CORE_IMAGE_EXTRA_INSTALL_append = " openssh"
Upswift agent automatically recognizes new devices based on the "device_token" (generated by the Upswift ser) of the device. The next method can help you install Upswift on a fleet of devices easily without the need to register each device separately.
This guide is specifically for building Yocto image with Upswift agent inside:
- 1.Download Upswift software zip file:
2. Extract the zip file.
3. Open the file upswift -> service -> settings.json
4. Fill the values of "user_token" and "project_name" (can be found by clicking on 'Register Device' inside Upswift platform). Colors: user_token - orange, project_name - green.
5. Save the file. Here is an example of a ready settings.json file:
*By default devices will register with automatic name - "New Device" to group - "Production".
6. Copy the next files and directories to your Yocto file system:
- 1.upswift directory to
- 2.upswift.service to
- 3.upswift.service to
After copying the files, the next paths need to exist: directory ->
As noted above, new devices will automatically be registered with "New Device" as the device name and into the "Production" group. After adding the Upswift agent to the file-system image, you might want to add a unique 'Device name' and 'Group' to each of the devices that register themselves. You can choose any of these 2 options to do so.
By using the Upswift REST API, the device can run a script to change the name and group after device registration.
In order to set a custom name and group for each deployed device you will need to add a script which will run on the device boot. The script should pull a unique identifier for this device (For example - mac address or serial number). To insert the value as the device name and update the Upswift agent settings JSON file, found at
/etc/upswift/service/settings.jsonand insert the value under "device_name" key. You can also edit the "group" key to match the group you want the device to move into.