No project description provided
Project description
MSF Cli
For use in creating and managing a project using the micropython-sniffs-framework: https://github.com/surdouski/micropython-sniffs-framework.
Installation
pipx install msf-cli
Usage
Note: docker must be installed and on path for broker commands.
new
msf new <path> # creates new msf project at <path>
Creates a new project at <path>. This is a convenience utility to set up your project so that it's easy to begin
development. However, it does also include some of the things you do require, such as the .config/mqtt_as.json
file with some defaults (although at minimum you need to update the "server" value). It also installs the framework and
it's required dependencies.
An example of what the directory looks like after being run:
After updating the json, you can uncomment
out the code in main.py related to the device and settings setup to test that everything is working. A simple way to
do this is to navigate to the project path, do mpbridge dev a0, wait for everything to load then press <Enter> once,
then press <ctrl+d> to do a soft restart on the device so that it runs main.py.
broker
msf broker up --port=1883 # starts a local MQTT broker for testing (--port is optional, default is 1883)
msf broker down # stops the local MQTT broker
up
msf broker up
# output: Local MQTT broker started at 192.168.x.x:1883.
This command is meant for testing on your local network. If you already have a broker set up elsewhere that you want to use, use that instead.
This command runs a eclipse-mosquitto:1.6 container with some defaults. Can optionally add --port to specify
a different port on your local machine you want to access it through.
This command also outputs your IP and port you can connect to it through on your local network.
down
msf broker down
Stops and removes the broker.
devices
All configuration/secrets for can be passed as env vars on the cmdline...
MQTT_DEVICES_TOPIC=test/devices msf devices <cmd>
... or in 2 configuration files, .config and .secrets.
.config
MQTT_DEVICES_TOPIC=topic/path/to/devices
.secrets
MQTT_SERVER_HOST=localhost
MQTT_SERVER_PORT=1883
MQTT_SERVER_USER=myuser # optional
MQTT_SERVER_PASS=mypass # optional, but required if user is specified
list
# list devices
msf devices
get device
# list settings for a device
msf devices <device_id>
get device setting
# show a specific setting
msf devices <device_id> <setting_id>
set device setting
# update the value of a setting
msf devices <device_id> <setting_id> [--set]/[-s] <value>
Tests (Development)
Will eventually put up a test harness for this and add it to workflows. Today, however, is not that day.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file msf_cli-0.2.2.tar.gz.
File metadata
- Download URL: msf_cli-0.2.2.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.10 Linux/5.4.0-193-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a96c5ab8a7825611fbb30d7122d8bbd0a16c77644bba556db4703bae27a84d68
|
|
| MD5 |
a8018dc4f9c4034e8f22ae4d46637ca7
|
|
| BLAKE2b-256 |
ba6d18afde223fa661d48f695163aa1ba5a8805d8552527aea7e8f58145ab40b
|
File details
Details for the file msf_cli-0.2.2-py3-none-any.whl.
File metadata
- Download URL: msf_cli-0.2.2-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.10 Linux/5.4.0-193-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b7e6aa1f1ca9aca8bb5d931c0ee191ae0f7accafc90dfeec5323408236ba7d50
|
|
| MD5 |
39ef078ea1a6af46a3f8b14736bf5078
|
|
| BLAKE2b-256 |
ce382f0d62dc0c715ce36398cb432b4818805db61a886c181ba3afb30bffc709
|