Skip to main content

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:

new-cmd.png

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
dops devices

devices-list.png

get device

# list settings for a device
dops devices <device_id>

get-device_id.png

get device setting

# show a specific setting
dops devices <device_id> <setting_id>

get-device-setting.png

set device setting

# update the value of a setting (both --set and --type are required)
# valid options for [--type] : --type=float,str,bytes,bytearray
dops devices <device_id> <setting_id> [--set]/[-s] <value>

set-device-setting.png

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

msf_cli-0.2.1.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

msf_cli-0.2.1-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file msf_cli-0.2.1.tar.gz.

File metadata

  • Download URL: msf_cli-0.2.1.tar.gz
  • Upload date:
  • Size: 7.4 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

Hashes for msf_cli-0.2.1.tar.gz
Algorithm Hash digest
SHA256 3284a39952d2ed7dc39d8b272135586b1f536a10dc041298e117b2bbcdba9cc7
MD5 36fe0b9a978bff6286e1223207ba158e
BLAKE2b-256 d764c1c5d0b36bdcbf410885be9ed997a2ef110edb0c599d6e3a5d6cc314f8a8

See more details on using hashes here.

File details

Details for the file msf_cli-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: msf_cli-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 8.3 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

Hashes for msf_cli-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 81c0a05c59f3cec916ad1152568789b29084232d3d0d18c906fbf31867208c60
MD5 bd779bf83127b60747ae2fcb1a44d80e
BLAKE2b-256 0ea80b8cb20ce104ddda97aa6d44321328c25c33f26410edfe428462da5eddba

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page