pounder_test/hitl/run.sh

43 lines
1.4 KiB
Bash
Raw Normal View History

2021-04-07 20:38:22 +08:00
#!/bin/bash
2021-04-06 19:28:07 +08:00
# Title:
# Stabilizer hardware-in-the-loop (HITL) test script.
#
# Description:
# This shell file is executed by the hardware runner in Quartiq's office to exercise the various
# hardware aspects of Stabilizer.
2021-04-07 20:31:49 +08:00
# Enable shell operating mode flags.
set -eux
2021-04-06 20:28:08 +08:00
# Set up python for testing
2021-08-09 22:23:18 +08:00
python3 -m venv --system-site-packages py-venv
. py-venv/bin/activate
2021-08-06 19:41:53 +08:00
# Install Miniconf utilities for configuring stabilizer.
2021-08-09 22:23:18 +08:00
python3 -m pip install -e py/
2021-08-09 18:50:58 +08:00
python3 -m pip install git+https://github.com/quartiq/miniconf#subdirectory=py/miniconf-mqtt
2021-08-06 19:41:53 +08:00
python3 -m pip install gmqtt
2021-04-06 20:28:08 +08:00
2021-06-22 15:52:56 +08:00
cargo flash --chip STM32H743ZITx --elf target/thumbv7em-none-eabihf/release/dual-iir
2021-04-09 19:35:23 +08:00
2021-05-13 17:21:41 +08:00
# Sleep to allow flashing, booting, DHCP, MQTT
2021-04-20 18:13:40 +08:00
sleep 30
2021-04-06 19:28:07 +08:00
# Test pinging Stabilizer. This exercises that:
# * DHCP is functional and an IP has been acquired
# * Stabilizer's network is functioning as intended
# * The stabilizer application is operational
2021-04-20 19:37:49 +08:00
ping -c 5 -w 20 stabilizer-hitl
2021-04-06 19:28:07 +08:00
# Test the MQTT interface.
2021-08-05 21:08:34 +08:00
python3 -m miniconf dt/sinara/dual-iir/04-91-62-d9-7e-5f afe/0='"G2"'
python3 -m miniconf dt/sinara/dual-iir/04-91-62-d9-7e-5f afe/0='"G1"' iir_ch/0/0=\
'{"y_min": -32767, "y_max": 32767, "y_offset": 0, "ba": [1.0, 0, 0, 0, 0]}'
2021-08-05 21:08:34 +08:00
# Test the ADC/DACs connected via loopback.
python3 hitl/loopback.py dt/sinara/dual-iir/04-91-62-d9-7e-5f
2021-08-05 22:21:55 +08:00
# Test the livestream capabilities
python3 hitl/streaming.py dt/sinara/dual-iir/04-91-62-d9-7e-5f