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 setup: create, realize, materialize, XDC and attach 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 provisioning fails partway, it cleans up whatever it had already allocated.

Documentation

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

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, 3.10, 3.11 and 3.12 are tested in CI.
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 open, ffmpeg by stream push and Wireshark by stream 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 setup 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 teardown 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 used automatically if you only have one. So mrg-iot exp setup --devices s-echodot-1 works by itself, and none of the commands above prompt for input.

For an interactive version, mrg-iot run provisions an experiment, opens the spiot_ctl > prompt, and cleans up 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.5

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.5
File Size Uploaded
mrg_iot-1.5.5.tar.gz 268.8 kB Details

Built distribution (wheel)

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

Total release size: 465.9 kB

Release files / mrg_iot-1.5.5.tar.gz

Download URL mrg_iot-1.5.5.tar.gz
Size 268.8 kB
Tags Source
SHA-256 checksum
How to use checksums
ab9b675188357a7ba429b8099620605bc3fcd68d539b13d5f51445835daba439
BLAKE2b-256 checksum
How to use checksums
73486707ecc419e018478bbdc4e0ea0c45af94b0e6a30b801196e8080d0bca31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.15

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

Download URL mrg_iot-1.5.5-py3-none-any.whl
Size 197.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d90004eea4f5cf77fe8750d3af29ebbf36ee9005186873e5bab857732ccb826f
BLAKE2b-256 checksum
How to use checksums
66394ee663108172a1cee412ef811e2c2a733c75892223a90425f6aeb5b58474
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.15

Release history Release notifications | RSS feed

This release

1.5.5 This release

2 release files

1.5.4

2 release files

1.5.3

2 release files

1.5.2

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.7

2 release files

1.3.6

2 release files

1.3.5

2 release files

1.3.4

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.1

2 release files

1.1.11

2 release files

1.1.10

2 release files

1.1.9

2 release files

1.1.8

2 release files

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