SDKs

We have Device SDKs available for the following languages currently:

We’re adding SDKs more languages soon. If you want us to prioritize a particular language, please let us know.

Device SDKs are built for devices running operating systems such as Linux and macOS.

We’re going to make a set of Microcontroller SDKs soon to support microcontrollers such as the Raspberry Pi Pico, Arduinos, and others, enabling you to write code in MicroPython, C++, and other languages to integrate with Fostrom.

Device SDK Architecture

All of our Device SDKs are powered by the Fostrom Device Agent. The Device Agent is a lightweight binary, written in Rust, and compiled for various architectures and operating systems. The Device SDKs download the Device Agent either on package install or first run, depending on the language, and start it when your program executes.

Once the Agent starts, it connects to Fostrom over a light-weight TCP+TLS based protocol we’ve developed (codenamed Moonlight). The Device SDKs communicate with the agent over HTTP through a UNIX socket located at /tmp/fostrom/agent.sock or over localhost:8585. The Agent keeps a connection open to Fostrom, and sends heartbeats, regardless of whether your program continues to run or not.

The Fostrom Device Agent is available for the following Operating Systems and Architectures:

Linux
  ARM64         # For Raspberry Pi, etc.
  AMD64         # For Intel and AMD chipsets like servers
  ARMv6         # For the Raspberry Pi Zero
  RISCV64       # For RISC-V chipsets like the MilkV Duo

macOS           # Delivered as a Universal Binary for
  ARM64         #   Apple Silicon based Macs
  AMD64         #   Intel based Macs

The Linux builds are compiled with statically linked musl instead of glibc, so they should work on pretty much any Linux-based OS. If you need support for an architecture or operating system we don’t support yet, let us know.

You don’t need to manually download the Device Agent for your operating system or architecture. The SDKs are bundled with a shell script which automatically downloads the Device Agent. You need to have one of wget or curl installed on your system though.

The Device Agent only creates files in /tmp/fostrom and cleans them up on exit. Since the files are placed in /tmp, they would anyway be cleared by the operating system on reboot.

Note that only one instance of the Device Agent can be alive on a device, and the Device Agent only supports connecting with one device’s credentials as shown in the Fostrom Console. That means, you can only start one program which connects to Fostrom on the operating system.