Skip to main content

Write TWELITE BLUE/RED firmware (beta)

Project description

mono wireless logo

tweliter

A Python module for writing TWELITE BLUE/RED 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

$ tweliter dir/SomeApp_BLUE.bin

In script

from pathlib import Path
from tweliter import Tweliter

file = Path('dir/SomeApp_BLUE.bin')

try:
    with Tweliter(url="ftdi://:ft-x:/1") as liter:
        # Get serial interface for communication
        ser = liter.get_serial_instance()

        # Reset and enter program mode
        liter.enter_program_mode()

        # Write firmware
        liter.write_firmware(ser, file)

        # Reset device to check startup message
        liter.reset_device()

        # Show startup message
        ser.read_until(b"!INF MONO WIRELESS") # wait for prefix
        line = ser.readline()
        print(line.decode("utf-8").strip())
except IOError as e:
    print(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.3.1.tar.gz (406.2 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.3.1-py3-none-any.whl (414.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tweliter-0.3.1.tar.gz
  • Upload date:
  • Size: 406.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.12.3 Linux/6.8.0-51-generic

File hashes

Hashes for tweliter-0.3.1.tar.gz
Algorithm Hash digest
SHA256 6fb78bf96d3108a5c829ade6a7c58fc07978e93515e4056a28b1abfa081b543a
MD5 d9da1ce4be9dda6e2cb7c3104b647ecb
BLAKE2b-256 a1d2cf598cd29a8003a9278fb784ef8ae44f0f744b79e8832edb1c942f6e8a35

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tweliter-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 414.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.12.3 Linux/6.8.0-51-generic

File hashes

Hashes for tweliter-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 79e38c4cc5d7b0ee5c75ec2a8737d389e528757864b4265ecc5a9c567b033193
MD5 5e5b6e8ecbd77116a0467bce6d1b2c20
BLAKE2b-256 20829a02b76b56669d0835793aa2c2eb93908ee7f8c166e3969b6495fa9e5e92

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