Skip to main content

Write TWELITE series firmware (beta)

Project description

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

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

tweliter-0.5.2.tar.gz (412.1 kB view details)

Uploaded Source

Built Distribution

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

tweliter-0.5.2-py3-none-any.whl (421.3 kB view details)

Uploaded Python 3

File details

Details for the file tweliter-0.5.2.tar.gz.

File metadata

  • Download URL: tweliter-0.5.2.tar.gz
  • Upload date:
  • Size: 412.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.12.9 Darwin/24.5.0

File hashes

Hashes for tweliter-0.5.2.tar.gz
Algorithm Hash digest
SHA256 09e77bd883e3a66b72437bf43b1c359dfa65699bb2a7f397917e83f8ca2f1637
MD5 6b6866af695ad6492c0a3e31316b7950
BLAKE2b-256 cfd1a698f605a54d227bf3e3bac5789e0340e783e7961879f7758ff008bf8211

See more details on using hashes here.

File details

Details for the file tweliter-0.5.2-py3-none-any.whl.

File metadata

  • Download URL: tweliter-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 421.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.12.9 Darwin/24.5.0

File hashes

Hashes for tweliter-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0cece95cdb4f34903d79d5dc2cc16311dbea07750fca78330b53be3e482669f2
MD5 ebd1002c3e2f728583607cd6c0ab35eb
BLAKE2b-256 4d8cd52398beee6bbd4a3ce96f1aacc2f21df4896a33f368fde608e75ae97529

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