tehmaze-labs / modem Goto Github PK
View Code? Open in Web Editor NEWXMODEM, YMODEM and ZMODEM implementations in Python
XMODEM, YMODEM and ZMODEM implementations in Python
Issue in head of multi_protocol branch
Issue at head of multi_protocol branch
in https://github.com/tehmaze-labs/modem/blob/multi-protocol/setup.py
you have
long_description = file('doc/source/about.rst').read(),
should be
long_description = open('doc/source/about.rst').read(),
Total packet length should only be 128 or 1024 bytes. The payload (data) being passed to the _send_packet() is already 128 or 1024 byte, that coupled with the additional transmission of the start_char, the sequence (2 bytes) and the checksum (2 bytes) makes the packet too large by five bytes.
If I send a simple file called "hello.txt" using a program that I know has a working y-modem send protocol to another program that I know has a working y-modem receive program data transfer looks like (blue = sender, green = receiver, ymodem-ul is the command to start the receiver):
The initial packet payload consists of the filename + 0x00 + filesize + 0x00 padding.
The ymodem.py program is not adding the file size to the initial packet which is causing my receiver to reject the packet:
I'm not sure if either programs that I know work are compliant to the standard and the files size may be optional.
The checksum of the initial packet from ymodem.py does seem to be being calculated correctly.
It may be desirable that the local file path and the remote file path when transmitting a file over ymodem be different. Currently YMODEM.send uses the same file path for both the local and remote filenames. Adding a second parameter to the send function can remedy this issue. If the second parameter is None then the local file will be used for the remote file.
This issue, however, is complicated by the use of glob.glob to expand wild cards in the file name. The use of glob.glob further complicates issues in that it will put directories in to a list that are not expanded to specific files which will probably cause things to fall apart quick quickly.
Should I attempt to add this feature I will assume that only a single file is being transferred per call to send and that it will contain no shell expansion wild cards. Or I will a string that can be prepended to the file to put it in a specific directory on the receiving computer.
I finally gave up on Python 2 and moved to the Python 3 version. The multi-threading branch on my fork support threaded y-modem uploads. That's all we need so no plans to add threaded receives but it should be easy enough for anyone increased. Also, it would be nice to actually make YMODEM-THREADED class that inherits from YMODEM so that if you don't need threading you don't have to pull it in. I'm not a Python expert by any means so I don't know how big of a deal this is.
Probably should be error.ERROR_SEND_EOT which is defined.
The following exists and it may be trying to use this constant: error.DEBUG_START_FILENAME
Of course the issue is also in the multi_protocol branch.
Should probably be calc_crc16 which is defined in the base object.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.