Skip to content

Repository files navigation

Nova Ground

Build and Formatting tools

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

Installing and using meson

    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.

Dependencies

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

documentation

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

Build Targets

This repository builds three executables, each with its own build ID and default sampling/publish rates:

  1. novaGround (build ID novaGround, sample 1ms, publish 50ms)
  2. novaThermo (build ID novaThermo, sample 100ms, publish 250ms)
  3. novaMock (build ID novaMock, sample 100ms, publish 250ms, hardware init disabled)

All targets are built by running:

    meson compile -C build

Running

In order to run the program, an MQTT broker should be available (defaults to localhost:1883).

Examples:

    ./build/novaGround
    ./build/novaThermo
    ./build/novaMock

Runtime Options

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:8000

Options:

  1. --broker <host[:port]|mqtt://...>: MQTT broker address (default localhost:1883)
  2. --backend <host[:port]|http://...>: Backend base URL for data-file uploads (default http://localhost:8000)
  3. --verbosity <0|1|2>: 0=quiet, 1=info, 2=debug
  4. --sample-ms <ms>: DAQ sampling interval
  5. --publish-ms <ms>: Telemetry publish interval

Data Logging

Data files are automatically prefixed with the build ID. Example: novaGround_someName_sensors.csv and novaGround_someName_actuators.csv.

Hardware Setup

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

About

[Software] Hardware interfacing program for Nova

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages