Skip to main content
mono wireless logo

tweliter

A Python module for writing TWELITE series firmware. (beta)

MW-OSSLA

Overview

Write firmware over TWELITE R series via USB.

This module is executable in standalone and importable for your scripts.

Installation

The module is available in PyPI.

Use pip

pip install tweliter

or poetry

poetry add tweliter

Linux

Sometimes you need to set permission with udev.

  1. Create /etc/udev/rules.d/99-ftdi.rules
# TWELITE R / MONOSTICK (FT232R / 0403:6001)
SUBSYSTEM=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", MODE="0666"

# TWELITE R2 / R3 (FT230X / 0403:6015)
SUBSYSTEM=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6015", MODE="0666"
  1. Reload udev rules
sudo udevadm control --reload-rules
sudo udevadm trigger

Usage

Command line

Simply

$ tweliter dir/SomeApp_BLUE.bin

or use verification

$ tweliter --verify dir/SomeApp_BLUE.bin

FTDI chip can be filtered by URL

$ tweliter --url ftdi://:ft-x:/1 dir/SomeApp_BLUE.bin

or product type(s)

$ tweliter --type TWELITE_R2,TWELITE_R3 dir/SomeApp_BLUE.bin

In script

from pathlib import Path
from tweliter import Tweliter

file = Path("firmware/SomeApp_BLUE.bin")

try:
    with Tweliter(
        type_filter=Tweliter.Type.TWELITE_R2 | Tweliter.Type.TWELITE_R3
    ) as liter:
        # Get serial interface
        ser = liter.get_serial_instance()
        # Write firmware
        liter.write(ser, file, verify=True)
        # Show startup message
        print(liter.get_startup_message_after(ser, "!INF"))
except IOError as e:
    print(f"Couldn't connect {e}")
except RuntimeError as e:
    print(f"Failed to write {e}")

LICENSE

MW-OSSLA

Metadata

Release files for tweliter 0.5.4

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

Source distribution (sdist)

Source distribution for tweliter 0.5.4
File Size Uploaded Provenance Actions
tweliter-0.5.4.tar.gz 412.1 kB Without provenance Details for tweliter-0.5.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tweliter 0.5.4
File Interpreter ABI Platform Actions
tweliter-0.5.4-py3-none-any.whl Python 3 none any Details for tweliter-0.5.4-py3-none-any.whl

Total release size: 833.3 kB

Release files / tweliter-0.5.4.tar.gz

Download URL tweliter-0.5.4.tar.gz
Size 412.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0ea4b9e558bc95a22b5136e888f533fcd7ac8e6e8298da4eddf83323d8d01881
BLAKE2b-256 checksum
How to use checksums
4391c269319deb21343bf551391e79aaa6cfe085336a34df26a1a272b948bbc1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.1 CPython/3.12.9 Darwin/24.5.0

Release files / tweliter-0.5.4-py3-none-any.whl

Download URL tweliter-0.5.4-py3-none-any.whl
Size 421.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
149dd11d03e3b26c302fb5c0b068622efb67611e259342647801ec6753608f87
BLAKE2b-256 checksum
How to use checksums
b97157e60e9767064d62747ecaec3eee8c9ee31e60bf67c6f5fd4cea173e4f16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.1 CPython/3.12.9 Darwin/24.5.0

Security for tweliter 0.5.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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