Skip to main content

Console for Lego Mindstorms Inventor / Spike Prime.

Project description

lego-console

pypi version build status coverage status python versions linting code style license

Overview

Console for Lego Mindstorm Inventor / Spike Prime.

Refactored from recursivetree/spiketools.

Installation

From pypi.org

$ pip install lego-console

From source code

$ git clone https://github.com/crashvb/lego-console
$ cd lego-console
$ virtualenv env
$ source env/bin/activate
$ python -m pip install --editable .[dev]

Usage

Copying a python script to slot #3

10:57:08 user@local-computer [~/lego-console]
$ lego-console start
Device connected.
10:57:14 MyLegoHub [/]
🤖: install -s 3 -t python my_project.py
Installed '/home/user/lego-console/my_project.py' to slot #3.
10:59:19 MyLegoHub [/]
🤖: slots
Status      : Connected
Device      : /dev/ttyACM0
Device Name : MyLegoHub
Slots       :
  0: <empty>
  1: <empty>
  2: <empty>
  3: my_project.py
    id       : 10003
    type     : python
    modified : 2025-03-01 10:58:24
  4: <empty>
  5: <empty>
  6: <empty>
  7: <empty>
  8: <empty>
  9: <empty>
10:59:22 MyLegoHub [/]
🤖: help

Documented commands (type help <topic>):
========================================
EOF  clear    disconnect  history  ls    slots      upload
cat  connect  download    install  quit  status     vi
cd   cp       exit        ll       rm    uninstall  vim

Undocumented commands:
======================
help

10:59:53 MyLegoHub [/]
🤖: exit
Device disconnected.
10:57:08 user@local-computer [~/lego-console]
$

Environment Variables

Variable Default Value Description
EDITOR vim The default system editor.
LC_HISTFILE ~/.lc_history The name of the file in which command history is saved.
LC_HISTSIZE 500 The number of commands to remember in the command history.

Troubleshooting

Unable to connect; no device provided!

Make sure the hub is powered on and connected via USB or bluetooth.

Message: 'Unable to connect to device: /dev/...'

Make sure the user has permissions to the device.

  • /dev/ttyACM0 for USB connections.
  • /dev/rfcomm0 for bluetooth connections.

Development

Source Control

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

lego_console-0.1.0.tar.gz (20.1 kB view details)

Uploaded Source

Built Distribution

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

lego_console-0.1.0-py3-none-any.whl (19.9 kB view details)

Uploaded Python 3

File details

Details for the file lego_console-0.1.0.tar.gz.

File metadata

  • Download URL: lego_console-0.1.0.tar.gz
  • Upload date:
  • Size: 20.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.4

File hashes

Hashes for lego_console-0.1.0.tar.gz
Algorithm Hash digest
SHA256 054db27f7836ef7ce22750c3a07aa80794ca0a1f2851a001b4668eab4408d7f5
MD5 47b0d1fdb89ecef41189986109d84bab
BLAKE2b-256 291995639820269d4a03a83b6218310f6767872c70c474d1fc91db170a2d1644

See more details on using hashes here.

File details

Details for the file lego_console-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: lego_console-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.4

File hashes

Hashes for lego_console-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6799c7fffa70d7fc184a4d2adefcdc962dd183083b6bfdef7a2e18e5709c1024
MD5 3a94109f7f50740e0712f6da2b5ca852
BLAKE2b-256 342ba8e43622feb6c58e70809edee3e89e45ee8dfbcea870edb2717285f71ff7

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