Raspberry Pi OS (32-bit) with desktop and dAISy setup

37 views
Skip to first unread message

Newcastle Lifeboat

unread,
Sep 30, 2020, 1:36:05 PM9/30/20
to kplex
Hmm..

Had a little fiddle about with the raspberry pi as I'm waiting for a new pole to extend the aerial

Rebuild the Pi with the Raspberry Pi OS (32-bit) with desktop and set up the kplex system with the following:

# Home AIS via dAISy setup on Raspberry Pi
[serial]
filename=/dev/serial0
direction=both
baud=38400

[tcp]
mode=server
port=10110
direction=out

[udp]
address=5.9.207.224
port=******
coalesce=yes
direction=out

I can connect to the system with Shipplotter and see vessels around my area. So far so good.

Off to bed I go then at 23:39, I don't notice I see an email from Marinetraffic to say I am offline (I only see it when I get it the next day when in work. Must check later tonight as I've just reset it)

Came home this evening to check if shipplotter is connecting to it. No. So, restart Raspberry Pi and all starts working again on shipplotter.

Just waiting to see if Marinetraffic starts to see me online.

Anyone know what to check to see what is going on?

Regards

Declan


Jim Starkey

unread,
Sep 30, 2020, 2:26:52 PM9/30/20
to kp...@googlegroups.com

If you go to your station's page on marinetraffic.com, there is a realtime plot of 24 hour's worth of messages per minute.  That will tell you immediately whether Marine Traffic is receiving data from your Raspberry Pi.

--
You received this message because you are subscribed to the Google Groups "kplex" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kplex+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kplex/77c6f408-1cfb-493e-8cc1-a2994d281156n%40googlegroups.com.
-- 
Jim Starkey

Newcastle Lifeboat

unread,
Sep 30, 2020, 4:20:46 PM9/30/20
to kplex
Yes James.

Somethings not right. Vessels are popping up at 21Nm away on shipplotter here yet Marinetraffic now has me as Offline. Earlier on it was showing me as online but No Data.

Weird

Keith Young

unread,
Oct 2, 2020, 9:14:23 AM10/2/20
to kplex
Right after I get through fighting with with my VAT submission software I'm going to write a kplex/marinetraffic FAQ...I learned a lot playing with this myself.

Here's my guess as to what's happening.  You dropped a connection to your router  / were issued with a new dhcp address.  Check your messages file an hour before the offline mail and my guess is you'll see something about the network interface going down then up.  kplex tried to write a udp packet, got an error and the marinetraffic interface shut down.  There is no "persist" option for udp interfaces because hey, it's connectionless.  But I forgot about interfaces up-downing and that pesky dhcp.  I have it on the "to do" list but it's non-trivial and I have a lot on at the moment.

Options to stop it happening again?
1. Try using a fixed IP address on your outgoing network interface
2. use a dhcpcd hook to restart kplex when dhcpcd gets a new address (I will hopefully document how to do that sometime in the coming week)
3. use tcp with "persist=fromstart"

As discussed in another recent thread, if you have particularly low volumes of data and want to stay "online", be aware that:
- marinetraffic regularly (every hour in my experimentation but I understand they vary this) restart their servers which will disconnect a tcp connection
- kplex will only notice an outbound-only connection has been dropped when it tries to write data and fails
...so your choices are:
1. Remain offline until there's something else to send
2. Make the connection to marinetraffic bi-directional.  kplex notices the connection closing immediately for read interfaces.  You might want to add "ifilter=-all" to that interface, although marinetraffic won't send you anything
3. Use the heartbeat option implemented in the develop branch to send a valid-but-meaningless nmea sentence to marinetraffic once every so often (e.g. 10 mins) which will make kplex discover a dropped connection


Reply all
Reply to author
Forward
0 new messages