There are multiple ways to prepare OS image and install an edge device. Synpse does not care which Operating system it is running on as long as few requirements are met:
- An operating system(OS) is Linux based
- SystemD support
- Docker support
But if you are starting from scratch, we will cover a few ways to do so. Feel free to choose your preference. And as always, if you struggle with any of the steps, please drop us a line on Discord and we will help you out!
###Method 1: Build from scratch
Download [rpi-imager](https://www.raspberrypi.org/software/ and install to your workstation. It’s a small application that will help you prepare SD card for your device.
Chose OS of your preference and SD card to write to:
Insert an SD card to device and connect it to the screen and keyboard. You will have to run several commands on your device.
Synpse relies on Docker to be preset. Once OS boots up, you will need to install it on your device.
Open a terminal and run the following commands:
|
|
Open the page https://cloud.synpse.net in your browser, login to it and navigate to Device section so you can copy and paste the Synpse installation command:
Important: If installing Synpse step is not clear, please read this blog post.
Paste the command into device CLI window:
Assuming device is connected to the internet - you should be done!
Method 2: Synpse image builder (Preview feature)
We are working on a new way to build Synpse enabled images. Currently we have WIP conceptual builder ready in synpse CLI based on Cloud-init method 3 bellow. You can either try CLI version of it, or use an advanced cloud-init method itself.
Anyway feedback on this topic is very welcome as we are still in the early stage of this feature.
CLI builder currently works on Linux only (Ubuntu subsystem for Windows is not supported)
In the long run, this should become cloud based service available in Synpse Cloud!
Prerequisites
- Linux based machine (Ubuntu subsystem for Windows is not supported)
- Synpse CLI installed and logged into Synpse Cloud
- CLI must be ran as privileged user, because an image builds are using
mount
to build the image
After build, an image startup might take 10-15 minutes for updates and install process to complete. Time might wary based on your internet and device speed.
List available images
Chose base image you want to use for your build. If you don’t find base images you would like, let us know in Discord to see how we can help!
|
|
Output example:
|
|
Run build command with build parameters (parameters can be found by executing synpse build -h
)
|
|
If
--project-id
or--registration-token
is not provided CLI attempt to get the default provisioning token for the project configured in CLI. User must have access to read Device Provisioning Tokens in RBAC.
If
--unixUser
is not provided synpse user will be created.
Build using config file
For more re-usable build you can use config file build:
|
|
Where config file example is:
|
|
When build finishes successfully, you will find your image in --image-output
directory.
Once this image boots up, it should automatically connect to your wifi network and register
to Synpse Cloud.
###Method 3: Cloud-init (advanced)
Here we will explain how to build an image in the advanced mode using cloud-init as the bootstrap method. It allows to produce re-usable images for mass usage or configure your device without access to them. This is an advanced method and requires some knowledge of cloud-init. You can use this way to construct your own CI/CD pipelines or flows to create re-usable images.
We will walk you through the whole process. These scripts will work with any image, which supports cloud-init. But we recommend using Ubuntu 20.04.2 LTS image.
- Clone helper scripts repository:
|
|
- Download image into
assets/images
directory. This can be done manually or withmake download-base
:
|
|
- Decompress Image. Extract image so we could use it:
|
|
- Add your Synpse project details and wi-fi credentials. Create a configuration for your local home setup:
|
|
- Generate image
Generate cloud-init
configuration and create a pre-configured image for RPI:
|
|
- Write the image to an SD card
Once this is done, you can use any existing image “burning” tools to write this image into SD card. We recommend using one of these:
###./wrap_up
We understand that all this can be a bit overwhelming. We are working to make this easier for you to use and if you have any suggestions, ideas, or feedback, please let us know in our forum.