Does any one have YMODEM package for Python.?

5.7k views Asked by At

I'm trying to find the package modem 1.0 listed in PyPi and hence want to use ymodem from it. The package description in this link http://pypi.python.org/pypi/modem only gives the description and not the download link unlike in this link http://pypi.python.org/pypi/xmodem/0.2.4 .

Does anyone know the location to download modem or ymodem package for Python?

Kindly help me.

Regards,

Manjunath Bhat

3

There are 3 answers

0
ReNa2019 On

If you want to use Ymodem with Python: do not waste your time with the 11 years old multi-protocol branch of https://github.com/tehmaze-labs/modem/tree/multi-protocol or the 5 years old ymodem branch of https://github.com/tesch1/xmodem/tree/ymodem because both do not work for me. Use https://github.com/alexwoo1900/ymodem

1
cmperezg On

This is very old but I thought I'd answer it, since I had this problem recently.

If you are using linux, you can do this, which I found in the following link: https://superuser.com/questions/604055/using-rz-and-sz-under-linux-shell

write a file called ysend with the following code:

#!/bin/sh

DEV=/dev/ttyUSB0

stty -F $DEV 115200
sb $1 > $DEV < $DEV

where DEV is your serial interface and the number is your baud rate. The sb command uses the YMODEM protocol.

you may then call this file from python with the following code:

import subprocess
subprocess.call(["sudo","bash","ysend",filename])

where filename is the file you want to send.

This solved all my problems after hours of searching for a ymodem implementation. Change sb to sz to use zmodem instead

1
Yu Peng On

It is not in the main branch of the repo and I had missed it at first glance.

https://github.com/tehmaze-labs/modem/tree/multi-protocol