Skip to main content

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

Metadata

Release files for lego-console 0.1.1

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

Source distribution (sdist)

Source distribution for lego-console 0.1.1
File Size Uploaded
lego_console-0.1.1.tar.gz 21.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lego-console 0.1.1
File Interpreter ABI Platform
lego_console-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 42.0 kB

Release files / lego_console-0.1.1.tar.gz

Download URL lego_console-0.1.1.tar.gz
Size 21.1 kB
Tags Source
SHA-256 checksum
How to use checksums
31c7b3abbfa1333a070a667f4c870fe372391e50c3368d28ab477a698661ee1b
BLAKE2b-256 checksum
How to use checksums
b154ebd40e19b2681dda125a326b480139debefbc0972ef065ea3929f9a83b34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.4

Release files / lego_console-0.1.1-py3-none-any.whl

Download URL lego_console-0.1.1-py3-none-any.whl
Size 20.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
11dc8052619fdc409526bae97a3c126b0386fd2d98ec2046516e629932135ebd
BLAKE2b-256 checksum
How to use checksums
5a545a3979567db589e9c735da2b7dc0fbcaea1a88ab5f40dde9051662186650
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.4

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

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