I have a working connection with my serial device via PySerial, but I also want to transfer files via the xmodem protocol as part of my program.
Which would be the most platform-neutral way to do this? Worst case, I could close()
my serial.Serial
object in Python and use subprocess
to call upon /usr/bin/sb
, but that seems inelegant.
I'm currently on Ubuntu 9.10 and am using a USB-TTY adapter.
Any ideas?
There is xmodem module on PyPi. It takes two functions in constructor for reading and writing data, implement them to work with your opened serial port. Below is simple sample of its usage: