Skip to main content

mrg-iot

IoT testbed experiment automation for the Sphere / Merge Testbed platform.

PyPI version Python versions License: MIT Code style: black

mrg-iot exp deploy: the experiment, its hardware and an attached XDC in one command

mrg-iot is a command-line tool for running IoT experiments on the Merge Testbed without chaining mergetb and ssh calls together by hand. It creates the experiment and its device model, allocates the hardware, sets up and attaches an XDC, and tunnels to the experiment's camera streams, file server and control channel. From there you can send device commands, download what the devices produced, and release everything when you're done. If a deployment fails, it removes whatever it had already allocated.

Documentation

User documentation is on the SPHERE docs site. This README only covers installing the package.

Guide What's in it
IoT Devices Key concepts, how the pieces fit together, and the device catalog.
Installation Installing mrg-iot and the optional media tools.
Quickstart Install, then drive a real device in a few commands.
Using mrg-iot Account setup, experiments, device commands, camera streams, files and teardown.
Troubleshooting & FAQ Common errors, their causes and fixes.

The full device list is at devices.iot.sphere-testbed.net.

Run mrg-iot --help, or --help on any subcommand, for the full list of flags and their defaults.

Requirements

Requirement Notes
Python 3.9+ 3.9 through 3.12 are supported; CI tests on 3.12.
A Merge Testbed account With access to at least one IoT project (neuiot, iotbeta or iotdev). See Create a SPHERE account.
Network access To the gRPC portal (grpc.sphere-testbed.net:443) and the SSH jump host (jump.sphere-testbed.net:2022).
VLC / ffmpeg / Wireshark Optional. VLC is used by stream video open, ffmpeg by stream video push and Wireshark by stream traffic capture. None can be installed with pip; see Media tools.

Installation

We recommend pipx, which installs mrg-iot into its own environment and puts it on your PATH:

pipx install mrg-iot

You can also install it into a regular virtual environment:

python3 -m venv .venv && source .venv/bin/activate
pip install mrg-iot

Check that it worked:

mrg-iot --version
mrg-iot --help

If you get mrg-iot: command not found, pipx's install directory (~/.local/bin) probably isn't on your PATH. Run pipx ensurepath and open a new shell.

On macOS, portal calls can fail with certificate verify failed because the system Python often has no usable CA bundle. Set these to fix it:

export SSL_CERT_FILE="$(python -m certifi)"
export REQUESTS_CA_BUNDLE="$SSL_CERT_FILE"

Quick start

mrg-iot login                                        # cached in ~/.mrg-iot/session.json
mrg-iot devices list --available                     # devices free to reserve
mrg-iot exp deploy myexp --devices s-echodot-1       # create and deploy the experiment
mrg-iot cmd run "s-echodot-1 click_button" -e myexp  # send a device command
mrg-iot file download -e myexp                       # download captured files
mrg-iot exp undeploy myexp                           # release everything

Most names have defaults: the experiment is named after your username, the XDC is <experiment>xdc, the realization is realiot, and the project is neuiot (or your first project if you aren't in neuiot). So mrg-iot exp deploy --devices s-echodot-1 works by itself, and none of the commands above prompt for input.

For an interactive version, mrg-iot run deploys an experiment, opens the spiot_ctl > prompt, and asks whether to undeploy when you type exit.

The Quickstart goes through the same commands with example output, and Using mrg-iot covers everything else.

License

MIT © Sphere / NEU IoT Testbed contributors

Metadata

Release files for mrg-iot 1.5.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mrg-iot 1.5.8
File Size Uploaded Provenance Actions
mrg_iot-1.5.8.tar.gz 262.3 kB Without provenance Details for mrg_iot-1.5.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mrg-iot 1.5.8
File Interpreter ABI Platform Actions
mrg_iot-1.5.8-py3-none-any.whl Python 3 none any Details for mrg_iot-1.5.8-py3-none-any.whl

Total release size: 450.8 kB

Release files / mrg_iot-1.5.8.tar.gz

Download URL mrg_iot-1.5.8.tar.gz
Size 262.3 kB
Tags Source
SHA-256 checksum
How to use checksums
10ab0e8ea51784dcec3056b7c265e08e4d74595c3b18ff45bd10c47b4cbea1d9
BLAKE2b-256 checksum
How to use checksums
29bb466e36d4cb9581a8b769f4344a771b4cec65c629659bd950b87ccd460721
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / mrg_iot-1.5.8-py3-none-any.whl

Download URL mrg_iot-1.5.8-py3-none-any.whl
Size 188.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8a85da77c1e18472165ab557b63dc489009f0cd943db389c3fa1b8f4dadd6777
BLAKE2b-256 checksum
How to use checksums
fc35fb28c77094daf24616c09a460e3331ebee6f39f929f9fd0d38b8b53594a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.16

Security for mrg-iot 1.5.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page