Back to all posts

Building simple application for Raspberry Pi Zero

Posted on Dec 31, 2023 in Engineering
Sushant Pandey
Sushant Pandey
Founder and CEO, Scurid
Raspberry Pi Zero
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:

  1. Makes call to ISS (International Space Station) Open API to collect current ISS telemetry data.
  2. Processes the data in desired format.
  3. Configure the Scurid Server to accept data from the device in your desired format.
  4. 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?

  1. Managing the device identity, so it can be globally identified and authenticated among the fleet of devices.
  2. Managing the secure connection to the Scurid server, so you don't have to worry about it.
  3. Setting up and managing the data stream for pushing values to the Server.
  4. Managing the data signing before sending it to the Scurid server, so you can verify the data integrity and authenticity.

Connect to the device

  1. You can connect to the device using SSH and view some basic information about the device. e.g. ssh @
  2. A simple pinout command can be used to view the pin and other information about the device
    Pinout command output
    Pinout command output

Configure device identity on Scurid Server

  1. 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.
  2. 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.
    Data structure definition
    Data structure definition
  3. 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.
    Device identity
    Device identity

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.

Running agent and app
Running agent and app

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.

See this screenshot
See this screenshot

Finally, accessing data

We can now view the data in the database configured for the Scurid Server. A simple select statement to

checkout the data
checkout the data

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.

Get started