Skip to main content

FlashTool library for BiSS C Firmware Update and Calibration by LENZ Encoders

Project description

lenz-flashtool

PyPI Version

FlashTool library for BiSS C Firmware Update and Calibration by LENZ Encoders.

This is the source repository for the lenz-flashtool Python package, designed to interface with LENZ BiSS C encoders for firmware updates, calibration, and data reading. It provides a FlashTool class and utility functions for working with encoder hardware, including hex file manipulation and color formatting utilities.

📚 Full Documentation: flashtool.lenzencoders.com

Features

  • Control LENZ BiSS C encoders via serial communication.
  • Upload firmware and calibration data.
  • Read encoder status, serial numbers, and error flags.
  • Utilities for CRC calculation, hex data generation, and colored logging output.

Installation

From PyPI (Recommended)

pip install lenz-flashtool

From local folder

pip install .

From GitHub

pip install git+https://github.com/lenzencoders/lenz-flashtool-lib.git

Requirements

  • Python 3.8 or higher
  • pyserial>=3.5 (for serial communication)
  • numpy>=1.21.0 (for data handling)
  • colorama>=0.4.6 (for cli colors)

Usage

Basic Example

from lenz_flashtool import FlashTool, init_logging

# Set up logging
#
# Level	            Integer Value
# logging.CRITICAL  50
# logging.ERROR     40
# logging.WARNING   30
# logging.INFO      20
# logging.DEBUG     10
# logging.NOTSET    0
init_logging(logfilename="flashtool.log", stdout_level=20, file_level=10)

# Initialize FlashTool
with FlashTool(port_description_prefixes=('XR21V')) as ft:
    # Power cycle the encoder
    ft.encoder_power_cycle()

    # Read serial number
    bootloader_ver, serial_num, mfg_date, program_ver = ft.biss_read_snum()
    print(f"Encoder Serial Number: {serial_num}")
# The connection is automatically closed when exiting the 'with' block

Note on Naming

The package is installed as lenz-flashtool (with a hyphen), but imported in Python as lenz_flashtool (with an underscore) due to Python’s naming conventions.

Documentation

For detailed API documentation, examples, and usage instructions, visit the LENZ FlashTool Documentation.

Development

Install Locally

git clone https://github.com/lenzencoders/lenz-flashtool-lib.git
cd lenz-flashtool-lib
pip install .

Run Tests

pip install pytest
pytest tests/

Contributing

Contributions are welcome! Please:

  1. Fork the repository.
  2. Create a feature branch (git checkout -b feature/my-feature).
  3. Commit your changes (git commit -m "Add my feature").
  4. Push to the branch (git push origin feature/my-feature).
  5. Open a pull request.

Report issues at github.com/lenzencoders/lenz-flashtool-lib/issues.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contact

For support or inquiries, contact LENZ ENCODERS at info@lenzencoders.com.

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

lenz_flashtool-0.1.8.tar.gz (73.4 kB view details)

Uploaded Source

Built Distribution

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

lenz_flashtool-0.1.8-py3-none-any.whl (86.2 kB view details)

Uploaded Python 3

File details

Details for the file lenz_flashtool-0.1.8.tar.gz.

File metadata

  • Download URL: lenz_flashtool-0.1.8.tar.gz
  • Upload date:
  • Size: 73.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for lenz_flashtool-0.1.8.tar.gz
Algorithm Hash digest
SHA256 b00b538b32c14fb4f5c5a78582e576c0382a6e99b411efe031617a52258d01d7
MD5 548c3aa5cdeb992a553122608f2167e8
BLAKE2b-256 521ea9cb0c1c01232f643585b46d2341fd0a1997a037e8e10e8df042ac59a6fb

See more details on using hashes here.

File details

Details for the file lenz_flashtool-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: lenz_flashtool-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 86.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for lenz_flashtool-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 ff9879e97e0c127fbe7fc0d69d173cd1cf674573ade2f19f4ab25f1726e0a253
MD5 bbbeb8f131d1a41db30254fa5b072b0c
BLAKE2b-256 76fb9f7b943458ed90ecfab7b28a8454195c207fa185be4c755f4c0d6cfad8b5

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