0

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

manz
  • 95
  • 3
  • 8
  • As far as I can tell modem never existed, the repos here has only the same xmodem code. https://github.com/tehmaze?tab=repositories – Jay M Mar 26 '13 at 14:07
  • Although it looks like the author planned y and z modem it was never released. – Jay M Mar 26 '13 at 14:08
  • Here's a ymodem implementation - it's just a branch on the xmodem code, and doesnt have full test coverage; BUT it works for me: https://github.com/tesch1/xmodem/tree/ymodem – tesch1 Aug 16 '16 at 04:21
  • Why though? Ymodem was practically never used in practice; Zmodem completely dominated and if that didn't work or wasn't available you usually fell back to plain Xmodem. – tripleee Jan 20 '23 at 11:38

3 Answers3

3

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

cmperezg
  • 145
  • 11
  • Why the `sudo`? You should probably drop that, and grant permissions to use the port to the regular user. – tripleee Jan 20 '23 at 11:40
1

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

ReNa2019
  • 51
  • 2
0

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

  • If I install that with python setup.py install, when I import modem, it gives an error: ImportError: No module named protocol.xmodem – takluiper Jun 15 '20 at 10:37