Tiny mockup of a satellite OBDH system running on a Raspberry Pi. This system must be used in conjunction with a tiny ground station, preferrably running on a different computer (e.g. a laptop computer). Both computers communicate through sockets on an internet connection.
This repository contains Ada source code and project file for an example real-time system. The system is a very simplified version of a satellite OBDH (On Board Data Handling) system. The system uses a single temperature sensor as a representative of OBDH data. The sensor is read every 5 seconds, and temperature values are send to the ground station as telemetry (TM) messages. In addition to this, the OBDH system can receive telecommand (TC) messages from the ground station, requesting a log of the last values of houesekeeping variables.
To start using the TinyOBDH system, please go to the documentation directory where you will find detailed instructions about the hardware platform.
All files are provided under a 3-clause Berkeley Software Distribution (BSD) license. As such, and within the conditions required by the license, the files are available both for proprietary ("commercial") and non-proprietary use.
For details, see the LICENSE file in the root directory.
The software is written in Ada 2012 and uses several features of this version of the language.
The GNAT implementation pragma Debug and the GNAT library packages
System.IO and GNAT.Sockets are used in the program.
Building the program from with the sources requires a compiler supporting both Ada 2012 and the GNAT-defined features. The GNAT GPL cross-compiler for Raspberry Pi 2 Linux hosted on linux has been used to compile this example. Please note that you should set the following environment variable before invoking GPS or gprbuild:
export ENV_PREFIX=/usr/gnatpi/arm-linux-gnueabihf/sysroot
See the GNAT User's Guide Supllement for Cross Platforms for further details.
The executable file built with the cross-compiler on the host platform must be transferred to the Raspberry Pi target to be executed by any suitable means (e.g. scp)
The software has been tested on a Raspberry Pi 3B running Raspian Stretch. The platform must be configured to use whatever available internet connection, either ethernet or WIFI.
The software has been tested with a SunFounder DS18B20 temperature sensor, although it should not be too difficult to port it to other devices. The sensor is connected to the 3.3 V, ground, and GPIO4 pins of the board.
The following commands must be entered in order to install the kernel modules with the required drivers:
sudo modprobe w1-gpio
sudo modprobe w1-thermThe sensor code should appear as a directory under /sys/bus/w1/devices/. For example:
ls /sys/bus/w1/devices/
28-0516a0ef7bff w1_bus_master_1The code of the sensor in the example is "28-0516a0ef7bff". The temperature value is read by doing:
cat /sys/bus/w1/devices/28-0516a0ef7bff/w1_slavewhich should give an output similar to:
8c 01 4b 46 7f ff 0c 10 58 : crc=58 YES
8c 01 4b 46 7f ff 0c 10 58 t=24750The temperature value in this example is 24.750 ºC.
This setup is used by the software to read the temperature measured by the sensor
from the sensor file. The above sensor code should changed as needed to match
the actual one in your hardware, and the code in the package Sensor should
be edited accordingly.