Txmodem
A Python class implementing the XMODEM and XMODEM-CRC send protocol
Install / Use
/learn @ArminTamzarian/TxmodemREADME
TXMODEM
A Python class implementing the XMODEM and XMODEM-CRC send protocol built on top of pySerial
Installation
Simply ensure the txmodem.py file is in your PATH or install the module by executing:
python setup.py install
Class Object Usage
Usage which automatically creates and closes the serial port with each call to TXMODEM.send():
from txmodem import *
try:
configuration = {
"port" : "/dev/tty.PL2303-000013FA",
"baudrate" : 115200,
"bytesize" : EIGHTBITS,
"parity" : PARITY_NONE,
"stopbits" : STOPBITS_ONE,
"timeout" : 10
}
TXMODEM.from_configuration(**configuration).send(filename)
except(ConfigurationException, CommunicationException) as ex:
print "[ERROR] %s" % (ex)
Usage which uses a preconfigured pySerial Serial object which defers management and further usage of said object:
from txmodem import *
from serial import *
try:
configuration = {
"port" : "/dev/tty.PL2303-000013FA",
"baudrate" : 115200,
"bytesize" : EIGHTBITS,
"parity" : PARITY_NONE,
"stopbits" : STOPBITS_ONE,
"timeout" : 10
}
serial_object = Serial(**configuration)
TXMODEM.from_serial(serial_object).send(filename)
serial_object.write("FOO")
serial_object.close()
except(ConfigurationException, CommunicationException) as ex:
print "[ERROR] %s" % (ex)
Command Line Usage
Ensure the txmodem.py file is executable and enter:
python txmodem.py [OPTION]...
Alternately if the module has been installed you can execute the main functionality by entering:
python -m txmodem.txmodem [OPTION]...
Command Line Options
Startup:
-?, --help print this help
-l, --list list the available serial port devices
Configuration:
-p, --port specify the serial port device to use
-b, --baud specify the baud rate for the serial port device
-t, --timeout specify the communication timeout in s
Transfer:
-f, --file specify the file that will be transfered
Related Skills
node-connect
349.9kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.9kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.9kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
