Skip to content

Small python script to send a command file to a serial console

License

Notifications You must be signed in to change notification settings

kgasso/pyserialcmd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

f769507 · Sep 1, 2024

History

4 Commits
Aug 31, 2024
Aug 31, 2024
Sep 1, 2024
Aug 31, 2024

Repository files navigation

pyserialcmd

Small python script to send a command file to a serial device. I originally wrote this to send scripted commands to a serial-controlled tower light (in my case an ANDONT Stack LED USB Tower Light).

STEP 1: Install required modules (pyserial)

pip install -r requirements.txt

STEP 2: Populate your commands file. This could contain code such as:

#red flash on

cmd = [0xA0, 0x01, 0x01, 0xB3]

cmd = bytearray(cmd)

STEP 3: Execute the command, passing in the serial port and path to the commands file:

pyserialcmd.py COM4 cmds\red-on-flash.py.part

or

pyserialcmd.py /dev/ttyUSB0 cmds/red-on-flash.py.part

You can also pass in other parameters for specific serial port settings, use pyserialcmd.py --help for a full list.

By no means am I a programmer and I'm brand new to Python... so beware - but hopefully this will help someone out with getting their own little project off the ground!

About

Small python script to send a command file to a serial console

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages