From bb63f47944a0f71245f00013ec5cccc7072a8aaa Mon Sep 17 00:00:00 2001 From: mwojcik Date: Wed, 25 Sep 2024 12:29:21 +0800 Subject: [PATCH] stabilizer: connect MQTT --- src/hw/stabilizer.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/hw/stabilizer.md b/src/hw/stabilizer.md index d5c59b0..a896ee7 100644 --- a/src/hw/stabilizer.md +++ b/src/hw/stabilizer.md @@ -103,3 +103,24 @@ dfu-util -a 0 -s 0x08000000:mass-erase:force:leave 7. Ensure that there is the same wave on the second channel, with a small delay, as on the first channel 8. Repeat steps 4-7 for ADC/DAC1 (refer to the picture below for connection reference) ![](../img/stabilizer_ports_match.jpg) + +## Setting up MQTT + +For testing the Stabilizer, it's usually enough to do the settings above, as signal is filtered by the firmware. However, if you need to test the network connectivity or Pounder telemetry, MQTT may come useful. + +On PC side: + +1. Get IP address of your machine, e.g. with ``ip a``. Make note of it, that's the broker address. +2. Get mosquitto, e.g. with ``nix-shell -p mosquitto``. +3. Run mosquitto with the config from Stabilizer repository: ``mosquitto -c mosquitto.conf`` +4. In another shell, run [MQTT Explorer](https://github.com/thomasnordquist/MQTT-Explorer/releases) or other MQTT client you wish. Connect to your own PC IP address. + +Configure Stabilizer: + +1. Connect the Stabilizer to power. +2. Connect USB cable to the Stabilizer. +3. Run ``python -m serial /dev/ttyACM0`` to connect the serial port using ``pyserial``. +4. Change the broker setting with: ``set /net/broker ""``. +5. Reboot with ``platform reboot``. + +Now, disconnect the USB and connect the Ethernet cable to the Stabilizer, as both won't fit at the same time. Stabilizer should connect to moquitto automatically, and you should see the MQTT settings pop up in the MQTT Explorer. \ No newline at end of file