Skip to content

ekspla/tepra-lite-bleak

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tepra_bleak_cli

A stand alone CPython code to communicate with KING JIM TEPRA Lite LR30 over BLE

Preface

2026, modified by ekspla using CPython/Bleak, based on codes in tepra-lite-esp32.

Introduction

This is a stand alone CPython/Bleak version of code to communicate with KING JIM TEPRA Lite LR30 directly over BLE. No WiFi-BLE repeater (ESP32) is required.

This version of code does not work on Linux/BlueZ1 though Bleak, which is a cross-platform software, supports Android, MacOS, Windows and Linux. Confirmed to work on Windows 10 and 11.

Install

  • Copy tepra.py and tepra_bleak_cli.py to an appropriate directory.
  • Install dependencies using requirements.txt.
  • Edit the default font path (default_font) in tepra_bleak_cli.py.

Usage

  • Turn on your TEPRA Lite LR30.

Subcommands:

  • print: print strings, QR code and image

Print

Usage: tepra_bleak_cli.py print [OPTIONS]

Options:
  --preview                     Generate preview.png without printing.
  -f, --font PATH               Path to a font file.
  -S, --fontsize INTEGER RANGE  Font size. [px] (default = 30)  [x>=0]
  -d, --depth INTEGER RANGE     Depth of color. (default = 0)  [-3<=x<=3]
  -m, --message TEXT            Print a text.
  -s, --space TEXT              Leave space between parts. [px]
  -q, --qr TEXT                 Draw a QR code.
  -i, --image TEXT              Paste an image.
  --help                        Show this message and exit.

Print examples

Options Output
-m Hello
-S 15 -m Hello
-S 50 -m Hello
-m Hello -m World
-m Hello -s 10 -m World
-q "http://example.com" -s 20 -m "http://example.com"

Notes

  1. Because the descriptor of the specific characteristic (0xFFF1) is hidden by bluetoothd/BlueZ, there is no way to set notification=True from the higher level APIs (BlueZ/Bleak). There might be a way to work around from the lower level (e.g. hci, btmgmt, etc.) though.
  • Update 18 Mar. 2026
    With a bit of modifications, the codes successfully worked on Linux/Bleak with bumble backend / Google Bumble and TP-Link BT dongles (UB400, v4.0, CSR8510 chip and UB500, v5.3, RTL8761 chip) by using HCI over USB (HCI H2).
    The Bumble/Bleak combination also successfully worked with a home made HCI H4 USB-serial dongle on Linux.

About

A stand alone CPython code to communicate with KING JIM TEPRA Lite LR30 over BLE

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages