Skip to main content

Package to easily control your DotBots and SailBots.

Project description

CI PyPI version Documentation Coverage License

PyDotBot

This package contains a complete environment for controlling and visualizing DotBots.

The DotBots hardware design can be found here (PCB). The firmware running on the DotBots can be found here.

This package can also be used to control devices running the SailBot firmware application.

DotBots controller overview

Installation

Run pip install pydotbot

Setup

Flash the required firmwares on the DotBots and gateway board (use an nRF52833DK/nRF52840DK/nrf5340DK board as gateway), as explained in the DotBots firmware repository.

Usage

dotbot-controller --help
Usage: dotbot-controller [OPTIONS]

  DotBotController, universal SailBot and DotBot controller.

Options:
  -a, --adapter [serial|edge|cloud]
                                  Controller interface adapter. Defaults to
                                  serial
  -p, --port TEXT                 Serial port used by 'serial' and 'edge'
                                  adapters. Defaults to '/dev/ttyACM0'
  -b, --baudrate INTEGER          Serial baudrate used by 'serial' and 'edge'
                                  adapters. Defaults to 1000000
  -H, --mqtt-host TEXT            MQTT host used by cloud adapter. Default:
                                  localhost.
  -P, --mqtt-port INTEGER         MQTT port used by cloud adapter. Default:
                                  1883.
  -T, --mqtt-use_tls              Use TLS with MQTT (for cloud adapter).
  -d, --dotbot-address TEXT       Address in hex of the DotBot to control.
                                  Defaults to FFFFFFFFFFFFFFFF
  -g, --gw-address TEXT           Gateway address in hex. Defaults to
                                  0000000000000000
  -s, --network-id TEXT           Network ID in hex. Defaults to 0000
  -c, --controller-http-port INTEGER
                                  Controller HTTP port of the REST API.
                                  Defaults to '8000'
  -w, --webbrowser                Open a web browser automatically
  -v, --verbose                   Run in verbose mode (all payloads received
                                  are printed in terminal)
  --log-level [debug|info|warning|error]
                                  Logging level. Defaults to info
  --log-output PATH               Filename where logs are redirected
  --config-path FILE              Path to a .toml configuration file.
  --help                          Show this message and exit.

By default, the controller expects the serial port to be /dev/ttyACM0, as on Linux, use the --port option to specify another one if it's different. For example, on Windows, you'll need to check which COM port is connected to the gateway and add --port COM3 if it's COM3.

Using the --webbrowser option, a tab will automatically open at http://localhost:8000/PyDotBot. The page maintains a list of available DotBots, allows to set which one is selected and controllable and provide a virtual joystick to control it or change the color of the on-board RGB LED.

Use --config-path to specify the file:

# Use settings from the config file
dotbot-controller --config-path config_sample.toml
# Use config file but override port and adapter (simulator example)
dotbot-controller --config-path config_sample.toml -a dotbot-simulator

Values defined in the config file behave exactly like CLI options. If both are provided, CLI flags override config values.

Firefox users: If the webapp is not working, press Ctrl + L, type about:config, and set network.http.http2.websockets to false.

Tests

To run the tests, install tox and use it:

tox

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

pydotbot-0.28.0.tar.gz (2.9 MB view details)

Uploaded Source

File details

Details for the file pydotbot-0.28.0.tar.gz.

File metadata

  • Download URL: pydotbot-0.28.0.tar.gz
  • Upload date:
  • Size: 2.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pydotbot-0.28.0.tar.gz
Algorithm Hash digest
SHA256 42061f3b277f6f522fc22931867a89410a4a7fcb4c385213b14ac8dc84cdfa63
MD5 0dcef598128c47ccca96aba931ed1efb
BLAKE2b-256 14bc1b9ebc427a0980cfe886c5cf0f1a522de9f6e823cb0dd6f759d061d137cd

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