danielinux / ttybus

A simple TTY multiplexer.
GNU General Public License v2.0
114 stars 41 forks source link

Documentation: Explain "non-reliable" in README.md #14

Open Gdsimms opened 1 year ago

Gdsimms commented 1 year ago

The README.md file currently states "a shared, non-reliable bus" and this is scaring off some of my coworkers from adopting this as a solution to a current problem we have. Could you explain somewhere in the documentation what the meaning of "non-reliable" is in this context? Is it just that it can't prevent corruption when multiple devices send simultaneously? If that's all it is, then my other current issue #13 would make the bus reliable by locking out writing on all but one fake_tty.

leoheck commented 12 months ago

I was reading the README yesterday and this word also made me uncomfortable. What is the meaning of non-reliable here @Gdsimms ? Can you give us a hint on what you thought?

Gdsimms commented 12 months ago

I have no answer. I have switched to using a few 'socat' commands to perform the serial sharing in my application.

leoheck commented 12 months ago

Ah, sorry I wanted to ask @danielinux , this MS GitHub is getting annoying.

@Gdsimms this is interesting, I was using socat since it is more spread. But a coworker asked me to change to use this instead. I will give a socat another try to compare it with ttybus

danielinux commented 11 months ago

non-reliable simply means that there is no guarantee that all the bytes are transferred to the destination, because the output is non-blocking.

Imagine a tty transmitting to two devices attached. If one of the two is not 'ready to receive' (i.e. poll with POLLWR returns 0) only the other one will receive the payload.

Perhaps instead of 'non-reliable' it would have been more correct to use 'best-effort'.

leoheck commented 11 months ago

I see, thanks for your feedback @danielinux

What about the data being transferred while both clients are connected and working. Can we say that both clients will always receive the same amount of data without losing any bytes?

I am splitting data from a gnss board connected to the USB into 2 instances of a server. It looks it works fine, but after a couple of hours or after a day something changes on one of the servers. I am not saying if ttybus is the issue, I just don't know where to look to find or debug this specific issue.

OevreFlataeker commented 1 month ago

I have no answer. I have switched to using a few 'socat' commands to perform the serial sharing in my application.

Could you please describe how you used socat to multiplex the access to the ttyUSBx device?