stabilizer: connect MQTT #27

Merged
esavkin merged 1 commits from mwojcik/assembly:mqtt-stabilizer into master 2024-09-25 15:57:02 +08:00
1 changed files with 23 additions and 0 deletions
Showing only changes of commit 56207e5eba - Show all commits

View File

@ -103,3 +103,26 @@ 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. If you don't have it yet, download [MQTT Explorer](https://github.com/thomasnordquist/MQTT-Explorer/releases).

Needs nix-shell -p appimage-run and appimage-run /path/to/MQTT-Explorer-XXX.AppImage. On most sane distros it would work out of the box with double-click though

Needs `nix-shell -p appimage-run` and `appimage-run /path/to/MQTT-Explorer-XXX.AppImage`. On most sane distros it would work out of the box with double-click though
Outdated
Review

NixOS also has programs.appimage.binfmt.
And there is nothing sane about ld-linux.so which is causing the problem here, not on NixOS and not on any other glibc-based Linux distro.

NixOS also has ``programs.appimage.binfmt``. And there is nothing sane about ld-linux.so which is causing the problem here, not on NixOS and not on any other glibc-based Linux distro.
5. Call ``nix-shell -p appimage-run``, then ``appimage-run MQTT-Explorer-0.4.0-beta6.AppImage``.
6. Connect to the MQTT broker under your own IP address.
Configure Stabilizer:
1. Connect the Stabilizer to power.

It doesn't work out of the box, needs either venv or nix-shell manipulations

It doesn't work out of the box, needs either venv or nix-shell manipulations
Outdated
Review

Is the "manipulation" more than nix-shell -p python3Packages.pyserial?

Is the "manipulation" more than ``nix-shell -p python3Packages.pyserial``?

No, but not mentioning it will make those without much experience stuck

No, but not mentioning it will make those without much experience stuck
2. Connect USB cable to the Stabilizer.
3. Run ``cutecom`` or your favorite terminal emulator, connect to ``/dev/ttyACM0``.
4. Change the broker setting with: ``set /net/broker "<ip of your machine>"``.
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.