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.1.tar.gz (21.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.1-py3-none-any.whl (20.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lego_console-0.1.1.tar.gz
  • Upload date:
  • Size: 21.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.1.tar.gz
Algorithm Hash digest
SHA256 31c7b3abbfa1333a070a667f4c870fe372391e50c3368d28ab477a698661ee1b
MD5 687ec45f1f4ab9e60280a781a057136c
BLAKE2b-256 b154ebd40e19b2681dda125a326b480139debefbc0972ef065ea3929f9a83b34

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lego_console-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 20.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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 11dc8052619fdc409526bae97a3c126b0386fd2d98ec2046516e629932135ebd
MD5 4c959c1fc985c0befc053723a503e2eb
BLAKE2b-256 5a545a3979567db589e9c735da2b7dc0fbcaea1a88ab5f40dde9051662186650

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