Mar 27, 2020 XMODEM protocol implementation. The following are 20 code examples for showing how to use serial.SerialTimeoutException.These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example.
Latest version Released:
XMODEM protocol implementation.
Project description
XMODEM protocol implementation
Documentation available at http://packages.python.org/xmodem/
Python Package Index (PyPI) page is available at https://pypi.python.org/pypi/xmodem
Usage
Create a function to get and put character data (to a serial line forexample):
Now, to upload a file, use the send method:
To download a file, use the recv method:
For more information, take a look at the documentation.
Changes
- bugfix: Abort send on EOT in startup-sequence Issue #34.
- enhancement: Include LICENSE file in the source distribution.
- bugfix: Remove bogus assert False code in recv() that resulted inAssertionError introduced in version 0.4.0 commit-id 9b03fc20, PR #29.
- bugfix: Large file transfers in send() were more likely to fail forsmall values of retry: This value should be the maximum failures perblock transfer as documented, but was improperly implemented as the numberof failures allowed for the total duration of the transfer, PR #21.
- bugfix: send(retry=n) and recv(retry=n) should retry n timesas documented, was retrying n - 1.
- bugfix: putc() callback was called in series, 3 times for each part ofxmodem block header, data, and checksum during block transfer. Now allthree data blocks are sent by single putc() call. This resolves issueswhen integrating with microcontrollers or equipment sensitive to timingissues at stream boundaries, PR #19.
- bugfix: documentation files missing from the release tarballIssue #16.
![Pyserial readline timeout Pyserial readline timeout](/uploads/1/2/4/6/124634370/190804424.jpg)
- bugfix: re-transmit in send() on NAK or timeout, previouslyre-transmissions (wrongly) occurred only on garbage bytes.PR #12.
- enhancement: support for python 3PR #8.
- bugfix: CRC failures in XMODEM.recv() were not renegotiated correctlyPR #11.
Release historyRelease notifications | RSS feed
0.4.6
0.4.5
0.4.4
0.4.3
0.4.2
0.4.1
0.3.2
0.2.4
0.2.3
0.2.2
0.2.1
0.2
0.1
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size xmodem-0.4.6-py2-none-any.whl (36.6 kB) | File type Wheel | Python version 2.7 | Upload date | Hashes |
Filename, size xmodem-0.4.6.tar.gz (32.2 kB) | File type Source | Python version None | Upload date | Hashes |
Hashes for xmodem-0.4.6-py2-none-any.whl
Algorithm | Hash digest |
---|---|
SHA256 | 48ba47b68f86419399b8ddf9cdcf7ce27e594a881c287ad5c24ec71c11a79791 |
MD5 | d30a594df6a0bd1d56da184894405813 |
BLAKE2-256 | 645d9ed983ed3d533b79cb81f1749b59bb2981c2f557f040b5319f188fb90cdf |
Hashes for xmodem-0.4.6.tar.gz
Algorithm | Hash digest |
---|---|
SHA256 | 089737298f5738eabc43f2519efdc80b402693768f16383f7013b9e6f8f279d7 |
MD5 | f876cb35caf276b61990377710a3b4c4 |
BLAKE2-256 | 295da20d7957f207fc4c4c143881ca7b9617ab7700c153012372ef0a934c7710 |
Pyserial Readline Timeout
Using PySerial is it possble to wait for data? (2)
I've got a python program which is reading data from a serial port via the
PySerial
module. The two conditions I need to keep in mind are: I don't know how much data will arive, and I don't know when to expect data.Python Serial Write
Based on this I have came up with the follow code snipets:
So this code will loop forever getting data off the serial port. We'll get up to 500 characters store the data, then alert the main loop by setting a flag. If no data is present we'll just go back to sleep and wait.
Cbdesigner for macbook air. The code is working, but I don't like the 5s timeout. I need it because I don't know how much data to expect, but I don't like that it's waking up every 5 seconds even when no data is present.
Is there any way to check when data becomes available before doing the
read
? I'm thinking something like the select
command in Linux.Python Serial Timeout
EDIT:
Just thought I'd note that I found the
Just thought I'd note that I found the
inWaiting()
method, but really that seems it just change my 'sleep' to a poll, so that's not what I want here. I just want to sleep until data comes in, then go get it.Pyserial Read Timeout
Ok, I actually got something together that I like for this. Using a combination of
read()
with no timeout and the inWaiting()
method:Python Serial Readline Timeout
This seems to give the results I wanted, I guess this type of functionality doesn't exist as a single method in Python