Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ensure crlf line endings to prevent upload crashes #48

Merged
merged 1 commit into from
Oct 20, 2019

Conversation

csboling
Copy link
Contributor

@csboling csboling commented Oct 20, 2019

Since crow expects CRLF line endings (I am not exactly sure what it is causes problems with LF-only line endings), line endings need to be adjusted when uploading file contents. Sending line endings as-is on Linux and Mac would typically only send \n, causing upload failures / hangs / other odd states. This patch corrects line endings by using rstrip to remove trailing whitespace and then adding \r\n to each line sent during upload.

This explains why the patch monome/crow#232 improves upload stability a lot on Windows, but uploads were still failing for me on Mac - on Windows the line endings are already CRLF. In combination with monome/crow#232 I believe this patch resolves a lot of upload issues, possibly including #44 and #47.

@csboling csboling changed the title ensure crlf line endings when uploading ensure crlf line endings to prevent upload crashes Oct 20, 2019
@simonvanderveldt
Copy link
Member

Nice find!
Shouldn't we fix crow though to either not care about this or just work when there's only a \n?

@trentgill do you know why crow expects a \r\n?

@tehn
Copy link
Member

tehn commented Oct 20, 2019

expert find.

this is huge, thank you!

@tehn tehn merged commit 821f38c into monome:master Oct 20, 2019
@tehn
Copy link
Member

tehn commented Oct 20, 2019

i merged this as a short-term fix ahead of any firmware updates.

@csboling
Copy link
Contributor Author

It also seems possible that this is getting buffered on the PC side, in pyserial or elsewhere, not sending until it decides it has a "whole line" rather than this being an issue on the crow side.

@csboling csboling deleted the upload-line-endings branch October 20, 2019 21:57
@simonvanderveldt simonvanderveldt added this to the 0.2.0 milestone Oct 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants