dgiardini / rtl-ais

A simple AIS tuner and generic dual-frequency FM demodulator
Other
267 stars 89 forks source link

No output when checking with 'telnet' #50

Open haraldhh opened 3 months ago

haraldhh commented 3 months ago

Hi, if I understood the help-section correctly running 'rtl_ais -nT' should produce a TCP-server that's listening on port 10110 and it should print out NMEA-sentences on both STDERR and the TCP-port.

However, if I telnet the port I get no output? Is this correct, I was expecting the exact same AIVDM line on the console and over the TCP-connection?

$ ./rtl_ais -nT 
Edge tuning disabled.
DC filter enabled.
RTL AGC disabled.
Internal AIS decoder enabled.
Buffer size: 163.84 mS
Downsample factor: 64
Low pass: 25000 Hz
Output: 48000 Hz
Found 1 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Generic RTL2832U OEM
Detached kernel driver
Found Rafael Micro R820T tuner
Log NMEA sentences to console ON
Tcp listen port 10110
Ais message timeout with 15
Tuner gain set to automatic.
Tuned to 162000000 Hz.
Sampling at 1600000 S/s.
Allocating 12 zero-copy buffers
!AIVDM,1,1,,B,33KtVF5wh0QkGO4RM5OUM4Gb0Dbb,0*0E

$ telnet localhost 10110
Trying ::1...
Connection failed: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
^CConnection closed by foreign host
```.
dgiardini commented 3 months ago

HI Harald

The server will show you received sentences briefly so you can get them

and then the socket closes. That´s because it was coded to be compatible with OpenCPN that works that way.

Some time (years now) ago, there was a request similar to yours, and Mik3y added that functionality. You can look at their repository here; that should fulfill your needs: https://github.com/mik3y/rtl-ais. Look for the -k option.

I didn't merge that code with the main branch, because the code is incompatible with Windows. If at some point I found time to port the changes or make conditional compiling, I'll be glad to merge the code, maybe some other programmer could do it too.

Regards, David

On Fri, Aug 30, 2024 at 6:27 AM Harald Hannelius @.***> wrote:

Hi, if I understood the help-section correctly running 'rtl_ais -nT' should produce a TCP-server that's listening on port 10110 and it should print out NMEA-sentences on both STDERR and the TCP-port.

However, if I telnet the port I get no output? Is this correct, I was expecting the exact same AIVDM line on the console and over the TCP-connection?

$ ./rtl_ais -nT Edge tuning disabled. DC filter enabled. RTL AGC disabled. Internal AIS decoder enabled. Buffer size: 163.84 mS Downsample factor: 64 Low pass: 25000 Hz Output: 48000 Hz Found 1 device(s): 0: Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Generic RTL2832U OEM Detached kernel driver Found Rafael Micro R820T tuner Log NMEA sentences to console ON Tcp listen port 10110 Ais message timeout with 15 Tuner gain set to automatic. Tuned to 162000000 Hz. Sampling at 1600000 S/s. Allocating 12 zero-copy buffers !AIVDM,1,1,,B,33KtVF5wh0QkGO4RM5OUM4Gb0Dbb,0*0E

$ telnet localhost 10110 Trying ::1... Connection failed: Connection refused Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. ^CConnection closed by foreign host



—
Reply to this email directly, view it on GitHub
<https://github.com/dgiardini/rtl-ais/issues/50>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADBJPT43NWNPJB3OVXOJYGDZUA3I5AVCNFSM6AAAAABNMDGQ22VHI2DSMVQWIX3LMV43ASLTON2WKOZSGQ4TMNZQHAYDGMI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
haraldhh commented 2 months ago

Thank You! I will look into that. I think Navionics keep the connection open, so will have to try that with Navionics and see how that behaves.