An MQTT-based terminal for remote management of micropython devices.
Inspired by mqboard.
On a micropython device, install with mip from the REPL:
>>> import mip
>>> mip.install("github:solanus-systems/mqterm")Or on a unix build of micropython via the CLI:
micropython -m mip install github:solanus-systems/mqtermTODO
You need python and a build of micropython with asyncio support. Follow the steps in the CI workflow to get a micropython binary and add it to your PATH.
Before making changes, install the development (CPython) dependencies:
pip install -r dev-requirements.txtThis project uses ruff for linting. After making changes, you can run the linter:
ruff checkBefore running tests, install the test (micropython) dependencies:
./bin/setupNote that you need to set up your MICROPYPATH environment variable so that the local copy of the package is loaded before any installed packages.
export MICROPYPATH="$(pwd)/tests/mocks:$(pwd):.frozen:~/.micropython/lib:/usr/lib/micropython"You can run the unit tests using the micropython version of unittest:
micropython -m unittestIntegration tests use a running MQTT broker (mosquitto), which you need to have installed (e.g. with brew).
There is a script that will set up the test environment, run the tests, and tear down the broker afterward:
./bin/test_e2eSometimes it's useful to debug an individual integration test. To do this, you need to run the broker yourself, then set up the environment and invoke the test directly:
mosquitto -v # keep open to check the broker logsThen in another terminal:
LOG_LEVEL=DEBUG MICROPYPATH="$(pwd)/tests/mocks:$(pwd):.frozen:~/.micropython/lib:/usr/lib/micropython" micropython ./tests/e2e/e2e_file_ops.pyTo release a new version, update the version in package.json. Commit your changes and make a pull request. After merging, create a new tag and push to GitHub:
git tag vX.Y.Z
git push --tags