Coder Social home page Coder Social logo

Serial latency? about arduino-robust-serial HOT 4 OPEN

araffin avatar araffin commented on July 17, 2024
Serial latency?

from arduino-robust-serial.

Comments (4)

araffin avatar araffin commented on July 17, 2024 1

Hello,
will try to answer a bit longer by this weekend.
In the past I used arduino mega mostly and I remember having ~1-10ms latency (but I'm not sure we checked it closely back then, that was more than 5 years ago ^^").

Using an arduino nano it takes me 15.5 ms to send and then receive 8 bytes from pyserial

so the problem is python?
if so, you might consider going to c++/rust or try to find faster implementation of Serial.read().
(the latency is from the python side, right?)

from arduino-robust-serial.

Armandpl avatar Armandpl commented on July 17, 2024

so the problem is python?

Looks like it's not as the latency varies depending on the arduino. e.g using the arduino nano every and the same code I get 1.5 ms instead of 15.5 ms.

try to find faster implementation of Serial.read()
On the arduino side? How would I go about finding this? any keyword I should search for?

from arduino-robust-serial.

araffin avatar araffin commented on July 17, 2024

You could also debug by mocking the arduino (maybe take a look at python serial tests: https://github.com/pyserial/pyserial/blob/master/test/handlers/protocol_test.py): https://github.com/balp/arduino-mock

Did you had a look at the low_latency_mode option?

See pyserial/pyserial#290

from arduino-robust-serial.

Armandpl avatar Armandpl commented on July 17, 2024

thanks very much I'm going to try that :)

from arduino-robust-serial.

Related Issues (6)

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.