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
|
|
|
|
python3 -m venv --system-site-packages py
|
2021-04-07 21:09:34 +08:00
|
|
|
. py/bin/activate
|
|
|
|
python3 -m pip install -r requirements.txt
|
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
|
2021-04-07 20:30:39 +08:00
|
|
|
# * 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-04-20 19:37:49 +08:00
|
|
|
python3 miniconf.py dt/sinara/dual-iir/04-91-62-d9-7e-5f afe/0='"G2"'
|
|
|
|
python3 miniconf.py dt/sinara/dual-iir/04-91-62-d9-7e-5f afe/0='"G1"' iir_ch/0/0=\
|
2021-04-08 23:11:44 +08:00
|
|
|
'{"y_min": -32767, "y_max": 32767, "y_offset": 0, "ba": [1.0, 0, 0, 0, 0]}'
|