Skip to content

TinyProtocolStream - encapsulate tinyproto into Arduino Stream for ease of use #24

Description

@embedded-creations

I need a reliable Serial connection between two Arduinos, and found your project. I created an Arduino Stream class that inherits from IFd and it's getting close to reliable at high throughput as tested through a loopback test running between two Teensy 4.1s.

https://github.com/embedded-creations/tinyproto/tree/stream

Take a look at this example to see how simple it is to use (just a few lines reference tinyproto in the sketch, and the API is nearly identical to a Stream object like Serial which makes it easy for a new user):

https://github.com/embedded-creations/tinyproto/blob/stream/examples/arduino_generic/TinyProtocolStreamTest/TinyProtocolStreamTest.ino

Some questions:

  • Would you like to include FdStream in the library once it's finished?
  • It's difficult to see the status of the library, have you thought about how to improve the API in this regard? I added a getStatus() method to access tiny_fd_get_status(), but beyond that I'd like to know if I lost any data so I can reset the protocol running on top of tinyproto.
  • Have you run any loopback tests that validate data? I didn't see any in the repo and found packets were getting dropped unless I left a couple of I slots free when running at high throughput. This may go overlooked if you're just counting packets received and not validating.
  • Do you have any Teensy devices? I'm using the Teensy 4 as it has multiple hardware serial ports, and I can enable multiple USB serial ports so I can get the tinyproto debug output on one, and sketch data on another. I had to make some HAL tweaks to get this to work, which I can contribute if it helps you.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions