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

ttybus losing some bytes #17

Open
leoheck opened this issue Nov 12, 2023 · 3 comments
Open

ttybus losing some bytes #17

leoheck opened this issue Nov 12, 2023 · 3 comments

Comments

@leoheck
Copy link

leoheck commented Nov 12, 2023

I think I understood what was going on with my application.
The tty_mux socket might be filling its buffer after some time, and then things do not work well anymore.

Found out that the BUFFER_SIZE is 4096.
image

ttybus currently doesn't have a way to change this value from the command line, but I am not sure yet if increasing it will make any difference since my app will be running for a long time and the issue will eventually happen again

Do you have a suggestion for what I could do in this case?

I started my issue here, #14 (comment). Well, I am opening a new issue instead of hijacking the other one.

@leoheck
Copy link
Author

leoheck commented Nov 13, 2023

Found this:

➜ ls -ltr /dev/ttyGNSS*    
srwxrwxrwx 1 root root  0 Nov 12 11:17 /dev/ttyGNSS_mux
lrwxrwxrwx 1 root root 10 Nov 12 11:17 /dev/ttyGNSS_fake_a.bak -> /dev/pts/0
lrwxrwxrwx 1 root root 10 Nov 12 11:17 /dev/ttyGNSS_fake_b -> /dev/pts/1
lrwxrwxrwx 1 root root 10 Nov 12 19:15 /dev/ttyGNSS_fake_a -> /dev/pts/1 <== this should not be /1

As I could understand, my main service that creates the /dev/ttyGNSS_mux and also the ones that create /dev/ttyGNSS_fake_a and /dev/ttyGNSS_fake_b started fine at 11h17.

For some reason, the service that creates /dev/ttyGNSS_fake_a had to restart and then ended up using the same device (/dev/pts/1) that /dev/ttyGNSS_fake_a was already using.

I am not sure if this is caused by the way I use ttybus, but I am sharing this here to follow the discussions.

I am using it this way:

# Service 1
tty_bus -d -s /dev/ttyGNSS_mux
tty_attach -s /dev/ttyGNSS_mux /dev/ttyUSB0

# Sevice 2
tty_fake -o -s /dev/ttyGNSS_mux /dev/ttyGNSS_fake_a &

# Sevice 3
tty_fake -o -s /dev/ttyGNSS_mux /dev/ttyGNSS_fake_b &

@leoheck
Copy link
Author

leoheck commented Nov 13, 2023

I was using the flag -o on tty_fake is it possible that this flag is causing this issue?

@leoheck
Copy link
Author

leoheck commented Nov 14, 2023

Removing this -o definitely improved.y system since there is no duplicated devices being created. But I still have issues after a couple of ours with the bytes being lose.

Is there any way to monitor the created socket? I could not find any tool for that, just the ss but os doesn't show anything that helps me here.

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

No branches or pull requests

1 participant