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

Feature request: support for --net-heartbeat <secs> #19

Open
kx1t opened this issue Mar 7, 2023 · 11 comments
Open

Feature request: support for --net-heartbeat <secs> #19

kx1t opened this issue Mar 7, 2023 · 11 comments

Comments

@kx1t
Copy link

kx1t commented Mar 7, 2023

In areas with low UAT traffic, the data stream dump978 (raw) -> uat2esnt -> readsb will disconnect when there's no traffic after a while. This is causing a lot of connects / disconnects that are visible in the logs.

Would it be possible to add a heartbeat option that keeps the data connection open? Ideally, this would be exposed through a command line option like --net-heartbeat <secs>, where the heartbeat is off if this is not included on the command line.

Tnx!

@mutability
Copy link
Collaborator

Which connection is disconnecting?

@YipYup
Copy link

YipYup commented Mar 7, 2023

I'm not any expert by any means, and perhaps kx1t can help clarify, but here's the issue I logged on the downstream project.

sdr-enthusiasts/docker-dump978#65

@mutability
Copy link
Collaborator

The reason that I ask is that

a) I'm not clear how exactly your pipeline is working (legacy uat2esnt operates as a pipe, how are you turning that into network connections);
b) if it's the uat2esnt -> readsb connection that is reconnecting, then that's where the heartbeat needs to be, i.e. dump978 changes wouldn't do anything

@kx1t
Copy link
Author

kx1t commented May 7, 2023

Sorry for the delay… the reason is that we upgraded our pipeline (took bit of time) and that we are now connecting straight from dump978 using that program’s raw output to Wiedehopf’s branch of readsb using the (new) uat_in net-connector option of that branch of readsb. No more uat2esnt. Works great, except for the connection time-outs in no-traffic hours :)

So the heartbeat should be implemented in dump978.

@mutability
Copy link
Collaborator

Okay. What's your proposed message format for a heartbeat (readsb will obviously need to handle this too)

@kx1t
Copy link
Author

kx1t commented May 8, 2023

the same message format that is used in W's readsb fork -- see https://github.com/search?q=repo%3Awiedehopf%2Freadsb%20heartbeat&type=code

(I think the message format is here: https://github.com/wiedehopf/readsb/blob/c4a0e401d12b7e0c545eee20794abf940b5893bd/net_io.c#L105-L107 but the rest of the search shows you how it's implemented in readsb)

Thanks :)

@mutability
Copy link
Collaborator

Those heartbeats are for other protocols - AVR, Beast, SBS. They won't directly work with the dump978 raw-UAT format.

I could just pick something, but then readsb would likely break when it hears it. This needs coordination between the two ends to agree on what the heartbeat should look like.

@kx1t
Copy link
Author

kx1t commented May 8, 2023

eh... line 106...

static const char raw_heartbeat_msg[] = "*0000;\n";

Isn't that for raw?

@mutability
Copy link
Collaborator

mutability commented May 8, 2023

That is the AVR-style "raw" connection for 1090MHz data: https://github.com/wiedehopf/readsb/blob/c4a0e401d12b7e0c545eee20794abf940b5893bd/net_io.c#L947

UAT is here (note "no_heartbeat" currently, but that's actually a red herring anyway since IIRC it is output-side-only):
https://github.com/wiedehopf/readsb/blob/c4a0e401d12b7e0c545eee20794abf940b5893bd/net_io.c#L964

@wiedehopf
Copy link

readsb has the same code as uat2esnt ;)

Pretty sure nothing will break readsb and i can implement whatever you think is best.

@wiedehopf
Copy link

In doubt just propose something here and i'll look at the readsb code ... or maybe upload a sample output from the network and i can feed it in with socat and test.

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

4 participants