Giter VIP home page Giter VIP logo

Comments (3)

AndersBNielsen avatar AndersBNielsen commented on June 25, 2024 1

Mmmkaay. It doesn't seem to be limited to FT232 chips or Sonoma.

I tried the script above with a Raspberry Pi and the same FT232 - worked flawlessly.
Then I downgraded a Mac to Ventura - same issue.
Then I tried an Arduino Pro Micro with USB passthrough firmware - it got more bytes through (like 60 instead of 10) but transfer was still cut short(at seemingly random lenghts) unless I had a cat -v < $serialport running in another window.

... and then I figured it out.

The connection is closed before the last bytes are actually sent - if they're in the buffer when closing I assume they're flushed and that's what's going on here.
At higher speeds I guess it's not a problem but running at 9600 baud like I do here it seems to be.

Considering this is also a problem upstream - even running echo $longstring > /dev/cu.usbserialx has this problem - I'm not sure this is a pyserial bug...

But inserting a 100ms delay before closing seems to be enough of a workaround in my case - dunno if there's a good way to make sure TX buffer is empty before closing on macOS that can or should be implemented.

from pyserial.

Nielotz avatar Nielotz commented on June 25, 2024

Check whether OS autosuspends USB.

from pyserial.

AndersBNielsen avatar AndersBNielsen commented on June 25, 2024

Check whether OS autosuspends USB.

Does not.
The thought did make me consider if the macOS console spits out anything useful, but doesn't seem to be the case.
I might try to downgrade a Mac to see if something went sideways with Sonoma. Already tried FTDI VCP drivers to no avail.
Validating script and dongle on a linux box tomorrow.

from pyserial.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.