Getting Started with Devices
Pictorus currently supports code deployment to Linux single-board computers and a selection of embedded STM32 boards. We can directly deploy software to a single board computer, and manage software deployments to embedded boards connected to your laptop/desktop or a single board computer. In this section we'll go through the setup for these two use cases.
Overview
There are 4 basic steps that must be completed to deploy software to a connected device from Pictorus:
- Connect a device (laptop, desktop, single-board computer) to the internet
- Install the Pictorus manager on your device
- Register your device with Pictorus
- Configure your device to deploy software to an appropriate target (either Linux process or embedded board)
Connecting Your Device to Wifi
In order to interact with your device in the Pictorus UI, you'll need to ensure it's connected to the internet. These instructions vary from device to device, so you should follow the setup instructions associated with your hardware. Here are some links to network setup instructions for some common single-board computers.
- Raspberry Pi: https://www.raspberrypi.com/documentation/computers/configuration.html#configuring-networking
- Beaglebone: https://www.fis.gatech.edu/how-to-configure-bbw-wifi/
- Jetson Nano: https://learn.sparkfun.com/tutorials/adding-wifi-to-the-nvidia-jetson/all
Registering your device with Pictorus
(You can also read our Blog post on setting up devices for more details.)
In order to deploy software to your device, we need to install our device manager, and register the device with Pictorus cloud.
Install Pictorus on device
macOS
pipx install pictorus
pipx ensurepath
- Register the device using
pictorus-cli
This will create a us.pictor.dm.plist
file in ~/Library/LaunchAgents
and register the service to start at boot as a user level service.
Linux
Option 1
This option is recommended if you are using a Single Board Computer (SBC) like a Raspberry Pi and want to get up and running quickly:
sudo pip install pictorus --break-system-packages
- The--break-system-packages
flag let Pictorus Python dependencies be installed alongside or on top of existing Python dependencies, which may cause issues for other packages and programs.- Register the device using
pictorus-cli
withsudo
access.
This option will create a sudo
level pictorus.service
in /etc/systemd/system
that starts the pictorus-device-manager
at boot with sudo
access to embedded USB peripherals. The service can be managed using systemctl
if needed.
Option 2
This option is recommended for systems with restricted or controlled access using pipx
to manage Python dependencies and avoid possible problems with other Python dependencies as well as to
respect Linux account permissions:
pipx install pictorus
pipx ensurepath
- Register the device using
pictorus-cli
This creates a user level pictorus.service
in ~/.config/systemd/user
and manages the service using systemctl --user
.
Additional Configuration steps for Option 2 (requires sudo
access)
Running on Embedded Targets
Linux requires modified permissions for non-sudo
users to access certain hardware resources. The recommended way to do this is to modify the udev
rules to allow users to access certain peripherals, for example the STLink:
Running Device Manager at boot
The pictorus.service
that is installed using Option 2 is only activated when a user logs in, i.e. via a terminal session or the desktop. This service can be configured to launch at boot using:
sudo loginctl enable-linger $USER
Register device with Pictorus
Next, run the CLI to register the device.
Once this is done, you should be able to select your device from the deployment drop down menu in the upper-right hand corner of the app builder.
For single board computers, you can deploy software immediately after following the above steps, using Pictorus's default configuration settings. You have the ability to push software to your device as long as it remained online, using the Deploy
button just to the right of the device selection drop-down. Apps deployed to devices do not automatically start running (for safety), so you must hit the Play
button to the right to start the app. At any time, you can hit Stop
to stop the app. A note of caution: Your device must retain a stable internet connection to Start/Stop reliably!
For embedded boards or to manage multiple apps on one device, see the below section.
Embedded Boards
Currently, Pictorus can deploy software to an embedded board connected to a laptop, desktop or single board computer with an installed device manager. An additional configuration step is necessary to deploy software to an embedded target. After completing the above steps for registering a device, click on the three dots to the right of the device name in the deployment drop down menu. This will take you to the device configuration menu, where you can manage device deployment targets.
You will see a process target titled 'Main', which is the default configuration for single board, Linux-based computers. Click on the 'Add Embedded Target' button to create a new embedded target, add a name, and select the appropriate platform and target type. The newly created target will now appear in the deployment dropdown, nested under a device name. Select the target to deploy your app to it. Multiple embedded boards can be added to a single device, and will appear as a list in this section. A green circle will appear next to connected hardware.
Note: You may also need to make sure you select the correct platform and target type in the app settings menu.
This can also be setup on app creation in the 'Advanced' settings dropdown menu.
Running Multiple Process Targets
In the device configuration menu, you can also add multiple process targets. This allows you to run multiple Pictorus apps on a single-board computer. Simply choose 'Add Process Target' and name the target as you wish. Remember to select the correct target name when deploying.