Skip to main content

A python wrapper for tycmd

Project description

tycmd-wrapper

A Python wrapper for tycmd by Niels Martignène - a tool for managing Teensy USB Development Boards by PJRC.

Examples

Identifying a firmware file

To identify which models are compatible with a specific firmware file, use the identify() method.

import tycmd
compatible_models = tycmd.identify('blink.hex')

Models compatible with the firmware file will be returned as a list of strings:

['Teensy 4.0', 'Teensy 4.0 (beta 1)']

List Available Boards

To list all available boards, use the list_boards() method.

import tycmd
boards = list_boards()

Details for the available boards will be returned as a list of python dictionaries.

[
    {
        'action': 'add',
        'tag': '3576040-Teensy',
        'serial': '3576040',
        'description': 'USB Serial',
        'model': 'Teensy 3.1',
        'location': 'usb-1-4',
        'capabilities': ['unique', 'run', 'reboot', 'serial'],
        'interfaces': [['Serial', '/dev/ttyACM1']],
    },
    {
        'action': 'add',
        'tag': '14014980-Teensy',
        'serial': '14014980',
        'description': 'USB Serial',
        'model': 'Teensy 4.0',
        'location': 'usb-1-3',
        'capabilities': ['unique', 'run', 'rtc', 'reboot', 'serial'],
        'interfaces': [['Serial', '/dev/ttyACM0']],
    },
]

Uploading a firmware file

To upload a firmware file to a board, use the upload() method. You can specify a board by its port or by its serial number.

import tycmd
import logging

logging.basicConfig(level=logging.INFO)
tycmd.upload('blink.hex', port='/dev/ttyACM0')

The upload progress will be logged:

INFO:tycmd:Uploading to board '14014980-Teensy' (Teensy 4.0)
INFO:tycmd:Triggering board reboot
INFO:tycmd:Firmware: blink40.hex
INFO:tycmd:Flash usage: 19 kiB (1.0%)
INFO:tycmd:Uploading...
INFO:tycmd:Sending reset command (with RTC)

Full Documentation

The full API documentation is available here.

License Coverage CI PyPI

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

tycmd_wrapper-0.2.1-py3-none-win_amd64.whl (321.7 kB view details)

Uploaded Python 3 Windows x86-64

tycmd_wrapper-0.2.1-py3-none-manylinux_2_35_x86_64.whl (63.0 kB view details)

Uploaded Python 3 manylinux: glibc 2.35+ x86-64

tycmd_wrapper-0.2.1-py3-none-macosx_10_9_x86_64.whl (65.8 kB view details)

Uploaded Python 3 macOS 10.9+ x86-64

File details

Details for the file tycmd_wrapper-0.2.1-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for tycmd_wrapper-0.2.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 73c17d7c6d073d7dd2b050731988a5fabb3be69ec339c3ef5fcfaae42eefe090
MD5 ee25fca937cbd9a92fadab645d45c9d1
BLAKE2b-256 ceb5b0a185ba79417bbf1e4d81349f9486b47b7e5148eb6a7ed8217febf0a50d

See more details on using hashes here.

File details

Details for the file tycmd_wrapper-0.2.1-py3-none-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for tycmd_wrapper-0.2.1-py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 3730db1e9f066afbecc494eca6bb0bc98e318f9dab0d528a82636eeb2b825818
MD5 eaee5ef8d17cfdc7a4f3f835744b2177
BLAKE2b-256 075b8cb3caaa401539bd83562d42f345d77c4afba6c862a9776137eb0fad83f7

See more details on using hashes here.

File details

Details for the file tycmd_wrapper-0.2.1-py3-none-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for tycmd_wrapper-0.2.1-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b0db3787a9c85a2f79b7b9b867d5cec8c64bde54de3fdc13cb54243ff5aeaf2e
MD5 faee48647204a92597e2ce5ee7c158b9
BLAKE2b-256 07ace5af5ef1d88c0290bde40776e1217189a0269ee16041a281e949cc286e58

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page