Building simple application for Raspberry Pi Zero
TL;DR
In the last blog post about Getting Started with Scurid digital identity for Raspberry Pi Zero, we saw how to install Scurid Edge Agent on Raspberry Pi Zero 2. This post builds on top of that to help show how to build a simple IoT Edge application using Scurid Edge Agent on Raspberry Pi Zero 2.
Github Repo for Scurid Sample Apps
To help you get started quickly access our sample apps repository, available here. The codebase for this particular use case for Raspberry Pi Zero is available under the path go/pi-zero.
Scenario
IoT Edge App does the following:
- Makes call to ISS (International Space Station) Open API to collect current ISS telemetry data.
- Processes the data in desired format.
- Configure the Scurid Server to accept data from the device in your desired format.
- Uses Scurid Edge Agent to securely and verifiably send the data to the Scurid server for storage.
Through this scenario you get to experience calling Scurid Edge Agent's APIs on the device and see how it works and performs.
What is Scurid Edge Agent doing under the hood for you?
- Managing the device identity, so it can be globally identified and authenticated among the fleet of devices.
- Managing the secure connection to the Scurid server, so you don't have to worry about it.
- Setting up and managing the data stream for pushing values to the Server.
- Managing the data signing before sending it to the Scurid server, so you can verify the data integrity and authenticity.
Connect to the device
- You can connect to the device using SSH and view some basic information about the device. e.g. ssh @
- A simple pinout command can be used to view the pin and other information about the device
Configure device identity on Scurid Server
- We want Server to process the data in our desired format, so we need to configure the device identity on the server which represents the actual device.
- To do this simply create a new data structure definition in the Scurid App which accurately represents the data format you want to send to the server.
- Let's assing this to the identity of the device and also give a unique table name to store the data in the database. Navigate to the Agent > click on the Agent name > Click on General Info and add required information.
Build the app
Sample apps readme contains the steps to build and transfer the app on the device. See the required steps here: PiZero-README.md
Run the app
Start the Scurid Edge Agent and the app on the device. Following screenshot shows the running agent on the left and the app running on the right terminal.
We can see in the Scurid Edge agent terminal logs on the left, that it is unpacking and signing the data before sending it to the server and the time it takes to do so.
We can also check out the htop command to see the CPU and memory usage of the device while the app is running.
Finally, accessing data
We can now view the data in the database configured for the Scurid Server. A simple select statement to
Mentioned in this article
Edge Agent
Empower your devices with the Scurid Edge Agent a fusion of robust digital identity, trusted data exchange, and sleek efficiency. Crafted for the discerning IoT architect, it is the future of device autonomy and security.
Server
A server application designed to be deployed on-premise, private cloud or managed as a service by Scurid.
App
A unified cross platform desktop native app to manage fleets of devices in your IIoT ecosystem. Minimizing programming effort to help bring easier access to data verification and trust.
An established platform for your IoT devices and data. Ready for production.
With Scurid’s easy-to-use API-based platform for hardware, sensors, and applications we want to enable the adoption of secure autonomous systems. Scurid is already trusted in production, helping our users achieve a faster and safer go-to-market.