Note: novaGround must be installed and run on a raspberry pi 4 running the Raspberry Pi OS (Legacy, 64-bit) as the MCC DAQHat library does not work with Debian Trixie
sudo apt install build-essential clang
We use meson as our build tool in this project. It can be installed with pip:
sudo apt install meson
Meson does out of src builds therefore we will use novaGround/build directory as standard. I think we will likely add more build directories in the future for testing and release builds. But for development use build. To set up the build directory and use clang for compilation, run the following:
cd novaGround
CC=clang CXX=clang++ meson setup build
This will set up the build directory build. To compile, run the following:
meson compile -C build
The -C flag specifies which build directory to use.
Note that boost libraries will also need to be installed.
wget https://archives.boost.io/release/1.81.0/source/boost_1_81_0.tar.bz2
tar xf boost_1_81_0.tar.bz2
cd boost_1_81_0
./bootstrap.sh --prefix=/usr/local
./b2
sudo ./b2 install
echo 'export BOOST_ROOT=/usr/local' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH' >> ~/.bashrc
echo 'export CPLUS_INCLUDE_PATH=/usr/local/include:$CPLUS_INCLUDE_PATH' >> ~/.bashrc
also:
sudo apt-get install libpaho-mqtt-dev
sudo apt install libgpiod-dev
sudo apt-get install libcurl4-openssl-dev
Install the daqhats library
git clone https://github.com/mccdaq/daqhats.git
cd /daqhats
sudo ./install.sh
Install WiringPI for the servo drivers
# fetch the source
git clone https://github.com/WiringPi/WiringPi.git
cd WiringPi
# build the package
./build debian
mv debian-template/wiringpi_3.18_arm64.deb .
# install it
sudo apt install ./wiringpi-3.x.deb
This repository builds three executables, each with its own build ID and default sampling/publish rates:
novaGround(build IDnovaGround, sample1ms, publish50ms)novaThermo(build IDnovaThermo, sample100ms, publish250ms)novaMock(build IDnovaMock, sample100ms, publish250ms, hardware init disabled)
All targets are built by running:
meson compile -C build
In order to run the program, an MQTT broker should be available (defaults to localhost:1883).
Examples:
./build/novaGround
./build/novaThermo
./build/novaMock
You can override broker/backend endpoints and sampling/publish rates at runtime:
./build/novaGround --publish-ms 250 --verbosity 2
./build/novaGround --broker 192.168.137.1 --backend 192.168.137.1:8000 --fas-port /dev/ttyUSB0
./build/novaThermo --broker 192.168.0.1 --backend 192.168.0.1:8000Options:
--broker <host[:port]|mqtt://...>: MQTT broker address (defaultlocalhost:1883)--backend <host[:port]|http://...>: Backend base URL for data-file uploads (defaulthttp://localhost:8000)--verbosity <0|1|2>: 0=quiet, 1=info, 2=debug--sample-ms <ms>: DAQ sampling interval--publish-ms <ms>: Telemetry publish interval
Data files are automatically prefixed with the build ID. Example:
novaGround_someName_sensors.csv and novaGround_someName_actuators.csv.
When installing multiple hats, you must install the appropriate address jumpers onto address header locations A0-A2 of the new HAT board. The recommended addressing method is to have the addresses increment from 0 as the boards are installed, i.e. 0, 1, 2, and so forth. There must always be a board at address 0.
If you change the board stackup and have more than one HAT board attached, you must update the saved EEPROM images for the library to have the correct board information. You can use the DAQ HAT Manager or the command:
sudo daqhats_read_eeproms