Cruisers Forum
 


Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 06-04-2017, 11:12   #31
Registered User

Join Date: Aug 2009
Location: between the devil and the deep blue sea
Boat: a sailing boat
Posts: 20,231
Re: furuno FA-30 ais messages not being picked up by openCPN

Quote:
Originally Posted by bobbylockes View Post
what's Kplex exactly?
Kplex is a software multiplexer (a program) which runs on GNU/Linux, Mac OS X, FreeBSD, NetBSD and OpenWRT.

Kplex: An NMEA-0183 Multiplexer

So if you have anything that runs the above OS, you can use kplex to strip and reconstruct the nmea sentences using its filter function. You can also send the sentences over Ethernet / Wifi / Serial interfaces of your like.

I do this on small discarded wifi routers that I pick up in the streets and convert them into nmea/wifi routers. But I am almost sure one can simply run Linux inside a Virtualbox on Windows and do away with any extra hardware.

Short version : a software multiplexer that can trim / modify nmea sentences.

Cheers,
b.
barnakiel is offline   Reply With Quote
Old 06-04-2017, 11:26   #32
Registered User

Join Date: Apr 2017
Posts: 33
Re: furuno FA-30 ais messages not being picked up by openCPN

Quote:
Originally Posted by barnakiel View Post
Kplex is a software multiplexer (a program) which runs on GNU/Linux, Mac OS X, FreeBSD, NetBSD and OpenWRT.

Kplex: An NMEA-0183 Multiplexer

So if you have anything that runs the above OS, you can use kplex to strip and reconstruct the nmea sentences using its filter function. You can also send the sentences over Ethernet / Wifi / Serial interfaces of your like.

I do this on small discarded wifi routers that I pick up in the streets and convert them into nmea/wifi routers. But I am almost sure one can simply run Linux inside a Virtualbox on Windows and do away with any extra hardware.

Short version : a software multiplexer that can trim / modify nmea sentences.

Cheers,
b.
sounds like I've almost mashed that myself in a couple of java classes. If only the receiver.java class I posted previously would read the packets liek wireshark does. I'm thinking it must be bcause of the null bytes did-g refers to.
bobbylockes is offline   Reply With Quote
Old 06-04-2017, 11:31   #33
Registered User

Join Date: Apr 2017
Posts: 33
Re: furuno FA-30 ais messages not being picked up by openCPN

Quote:
Originally Posted by did-g View Post
Every 00 in your payload. look at the data in wireshark second pane or highlight it in the third one.
In most C like string functions 0 is end of string, here there's 0 before the AIS data and nothing is forwarded.

apparently null bytes terminate the udp messages

Python Sockets - Sending a packet to a server and waiting for a response - Stack Overflow

perhaps this is why the receiver code is not working.

time to try to fix it...
bobbylockes is offline   Reply With Quote
Old 06-04-2017, 11:45   #34
Registered User

Join Date: Apr 2017
Posts: 33
Re: furuno FA-30 ais messages not being picked up by openCPN

Quote:
Originally Posted by did-g View Post
Every 00 in your payload. look at the data in wireshark second pane or highlight it in the third one.
In most C like string functions 0 is end of string, here there's 0 before the AIS data and nothing is forwarded.

when you say nothing is forwarded, you mean thats why nothings is picked up by opencpn or my simple java udp receiver?

But why does wireshark pick up the whole packet ?

according to internet swhen udp servers generate a null byte it terminates the message but it seems furuno engineers got round that and are sending out null bytes and wireshark engineers are picking them up. Can't work out why my receiver code can't pick them up the packets that wireshark is picking up though. any ideas?

thanks!
bobbylockes is offline   Reply With Quote
Old 06-04-2017, 11:47   #35
Registered User

Join Date: Oct 2012
Location: Brighton, UK
Boat: Westerly Oceanlord
Posts: 438
Re: furuno FA-30 ais messages not being picked up by openCPN

Quote:
Originally Posted by bobbylockes View Post
apparently null bytes terminate the udp messages
[...]
perhaps this is why the receiver code is not working.
The length of a udp packet is specified in the udp packet header. It has nothing to do with the contents unless you decide to parse them that way.

https://www.ietf.org/rfc/rfc768.txt

Personally I'd believe Jon Postel over "The Internet" :-)

I don't do java but look at your code and ask yourself how much data you think your receive buffer can hold and what will be done with the rest of the packet
muttnik is offline   Reply With Quote
Old 06-04-2017, 16:15   #36
Registered User

Join Date: Aug 2009
Location: between the devil and the deep blue sea
Boat: a sailing boat
Posts: 20,231
Re: furuno FA-30 ais messages not being picked up by openCPN

Quote:
Originally Posted by did-g View Post
Every 00 in your payload. look at the data in wireshark second pane or highlight it in the third one.
In most C like string functions 0 is end of string, here there's 0 before the AIS data and nothing is forwarded.
Is the data rejected at the hex level or is it rejected at the ascii level?

Why I ask: If we feed this data thru an IP and Wireshark can read it, will possibly other software (not OpenCPN, for now) be able to read it?

Or else is the data discarded at a level before it becomes readable to software seeking serial ascii data from an IP source?

Yes, I know my question is not pro but I do hope you can see that I need.

THX in advance,
barnakiel
barnakiel is offline   Reply With Quote
Old 06-04-2017, 16:42   #37
Registered User

Join Date: Aug 2009
Location: between the devil and the deep blue sea
Boat: a sailing boat
Posts: 20,231
Re: furuno FA-30 ais messages not being picked up by openCPN

Quote:
Originally Posted by bobbylockes View Post
sounds like I've almost mashed that myself in a couple of java classes. If only the receiver.java class I posted previously would read the packets liek wireshark does. I'm thinking it must be bcause of the null bytes did-g refers to.
Keep on trying with java and I can try to bite it with kplex here (but do read on as I need some help from you up first)

If I can see the nulls in ascii file then I can run the file from one machine here (pretending it is a Furuno machine) to my kplex router and ask the router to clip the nulls or replace them or whatever is supposed to work.

Then I can ask my nmea router to forward the modified sentences to another machine (this one pretending to be OpenCPN or any other client).

If the above plan is viable with a router, we can try the same trick with a Virtualbox, without any routers or any other hardware.


To try this I need:

- a nmea sample file containing some Furuno ais sentence,
- info on how the nulls are represented in the ascii file (if they are),

Can you make such a file?

If you cannot, there is still hope: I can generate such a file here BUT I do need to know how to represent the (unwanted) nulls in the ais nmea ascii file. Because my machine(s) can generate ais nmea ascii files - ONLY CORRECT ONES though. I can then manipulate the correct file so that it looks like a Furuno (not surely but hopefully).

Do we know already how/if the dodgy nulls are represented in an ascii ais sentence? This is pretty essential for any progress, I think.

barnakiel
barnakiel is offline   Reply With Quote
Old 06-04-2017, 16:45   #38
Registered User

Join Date: Aug 2009
Location: between the devil and the deep blue sea
Boat: a sailing boat
Posts: 20,231
Re: furuno FA-30 ais messages not being picked up by openCPN

Me off to bed now, it is past midnight in this part of the globe. If you guys are far elsewhere and still typing, I may be lucky to be back on track in the morning.

barnakiel
from Las Palmas, Canary Islands
barnakiel is offline   Reply With Quote
Old 06-04-2017, 16:54   #39
Registered User

Join Date: Apr 2017
Posts: 33
Re: furuno FA-30 ais messages not being picked up by openCPN

Quote:
Originally Posted by barnakiel View Post
Keep on trying with java and I can try to bite it with kplex here (but do read on as I need some help from you up first)

If I can see the nulls in ascii file then I can run the file from one machine here (pretending it is a Furuno machine) to my kplex router and ask the router to clip the nulls or replace them or whatever is supposed to work.

Then I can ask my nmea router to forward the modified sentences to another machine (this one pretending to be OpenCPN or any other client).

If the above plan is viable with a router, we can try the same trick with a Virtualbox, without any routers or any other hardware.


To try this I need:

- a nmea sample file containing some Furuno ais sentence,
- info on how the nulls are represented in the ascii file (if they are),

Can you make such a file?

If you cannot, there is still hope: I can generate such a file here BUT I do need to know how to represent the (unwanted) nulls in the ais nmea ascii file. Because my machine(s) can generate ais nmea ascii files - ONLY CORRECT ONES though. I can then manipulate the correct file so that it looks like a Furuno (not surely but hopefully).

Do we know already how/if the dodgy nulls are represented in an ascii ais sentence? This is pretty essential for any progress, I think.

barnakiel

This is the furuno message picked up by wireshark in this example you could just cut and paste this several times to obtain a bigger list of nmea messages

ff ff ff ff ff ff 00 d0 1d 04 e8 85 08 00 45 00 00 85 53 eb 00 00 20 11 d6 3c ac 1f 18 02 ac 1f ff ff 27 25 27 25 00 71 19 49 01 12 00 01 00 00 00 00 21 41 49 56 44 4d 2c 31 2c 31 2c 2c 42 2c 31 33 60 65 3f 35 50 50 31 3a 50 46 77 35 54 4d 73 3f 4b 57 30 67 77 32 52 36 49 38 2c 30 2a 33 39 0d 0a 21 41 49 56 44 4f 2c 31 2c 31 2c 2c 2c 31 3e 71 63 36 36 3f 50 3f 77 3c 74 53 46 30 6c 34 51 40 3e 34 3f 77 70 30 50 30 30 2c 30 2a 32 39 0d 0a


and this is it stripped of hexdecimal up to last 00 to leave the hex ais message


21 41 49 56 44 4d 2c 31 2c 31 2c 2c 42 2c 31 33 60 65 3f 35 50 50 31 3a 50 46 77 35 54 4d 73 3f 4b 57 30 67 77 32 52 36 49 38 2c 30 2a 33 39 0d 0a 21 41 49 56 44 4f 2c 31 2c 31 2c 2c 2c 31 3e 71 63 36 36 3f 50 3f 77 3c 74 53 46 30 6c 34 51 40 3e 34 3f 77 70 30 50 30 30 2c 30 2a 32 39 0d 0a

and i readable ascii
!AIVDM,1,1,,B,13`e?5PP1:PFw5TMs?KW0gw2R6I8,0*39
!AIVDO,1,1,,,1>qc66?P?w<tSF0l4Q@>4?wp0P00,0*29


to convert from hex to ascii i first converted hex to bytes then bytes to a string
bobbylockes is offline   Reply With Quote
Old 06-04-2017, 17:33   #40
Registered User

Join Date: Aug 2009
Location: between the devil and the deep blue sea
Boat: a sailing boat
Posts: 20,231
Re: furuno FA-30 ais messages not being picked up by openCPN

Quote:
Originally Posted by bobbylockes View Post

and i readable ascii
!AIVDM,1,1,,B,13`e?5PP1:PFw5TMs?KW0gw2R6I8,0*39
!AIVDO,1,1,,,1>qc66?P?w<tSF0l4Q@>4?wp0P00,0*29
Can Wireshark receive 'what it gets & how it gets' to a file? I can check this tomorrow on my other machine.

Wireshark screen may show hex data but the transfer is (I think) serial text ascii data, not hex.

I have two questions then:

1) where are the nulls? Are the nearly final zeroes '...0*...' the nulls?

2) why not rs422 btw? F30 does have rs422 output, no? Just asking.

b.
barnakiel is offline   Reply With Quote
Old 06-04-2017, 19:35   #41
Registered User

Join Date: Apr 2017
Posts: 33
Re: furuno FA-30 ais messages not being picked up by openCPN

Quote:
Originally Posted by barnakiel View Post
Can Wireshark receive 'what it gets & how it gets' to a file? I can check this tomorrow on my other machine.

Wireshark screen may show hex data but the transfer is (I think) serial text ascii data, not hex.

I have two questions then:

1) where are the nulls? Are the nearly final zeroes '...0*...' the nulls?

2) why not rs422 btw? F30 does have rs422 output, no? Just asking.

b.
1) 00 in hexidecimal is null byte
2) f-30 only has an ethernet port, at least mine does.

But in the meantime I've got my java program to work. It was a pure fluke though, as in order to get the message flowing into the UDPClient java program I first had to manually send a UDP packet using packetsender. Sending this one message to 172.31.24.6 port 10033 got picked up by my java program and that opened the flood gates for allthe packets coming from furuno fa-30 via ethernet network card. I have absolutely no idea why I have to send a message manually in order for furuno messages to be picked up.

So now the furuno messages enter my client I stripped the message down to just !AIVDM...... in ascii and sent it using my wireless network adapter address 192.168.178.15 to 192.168.178.7 on port 10034 (wireless adpater has submask 255.255.255.0). These !AIVDM messages that my program is forwarding as a UDP packet are indeed picked up by wireshark but despite configuring OpenCPN to 192.168.178.7 listening on port 10034 openCPN is STILL RECEVING NO MESSAGES!!!

So whether the nulls had anything to do with OpenCPN not working is now doubtful as I stripped them before forwarding them on further.

So I suspect OpenCPN needs additional coding to handle UDP messages coming through the network, unless someone can advise on the UDP format openCPN is expecting .. or something... I think I'll try to build a TCP connection to openCPN and see if the !AIVDM messages will be read by openCPN.

any advice welcome.
bobbylockes is offline   Reply With Quote
Old 06-04-2017, 19:56   #42
Registered User

Join Date: Apr 2017
Posts: 33
Re: furuno FA-30 ais messages not being picked up by openCPN

I GOT IT TO WORK!!!!!

What a battle that was!

IT was a case of
1. initializing my network card (or something) by sending a packet manually to 172.31.255.255 port 10033 submask 255.255.0.0 using packetsender (packetsender.com), this opened the floodgates and allowed the unfiltered furuno messages to enter my java UDP program for filtering.
2. writing a program to strip the packet from furno to just !AIVDM message
3. resending the stripped packet through UDP from 192.168.178.15 to 192.168.178.255 port 10034
4. configuring openCPN on my wireless network card 192.168.178.255 (I have submask 255.255.255.0)
6. and initializing opencpn to receive messages by sending a message via UDP manually from packetsender to 192.168.178.255 on port 10034 (which I'd configured openCPN to receive on). This in turnh opened the floodgates on the openCPN side to receive ascii messages being forward from my java prgram. All of a sudden targets appeared and the !AIVDM messages could be seen in the nmea debug window.

Packetsender did not open the floodgates when trying to initilize messages from furuno to opencpn so it appears null bytes need to be removed and the ais message to be clean. But what is packetsender doing when it manual sends a message. very wierd.

So many unanswered questions despite getting it to work. I do not feel I'm any wiser. what is packetsender doing that allows the java and opencpn to suddenly start receiving messages?!?!!? mmmmmm

seriously no idea why this s**t is working and why this process so opaque in the first place.
bobbylockes is offline   Reply With Quote
Old 07-04-2017, 01:32   #43
Registered User

Join Date: Jun 2015
Posts: 372
Re: furuno FA-30 ais messages not being picked up by openCPN

Congratulation

Maybe it's some kind of firewall or NAT? It looks like one.

Wireshark is capturing data very early in the network stack and is not affected.

Couple of things:

- On the same machine you can try to forward on 127.0.0.1 (or 127.1 if they understand shorthand notation) rather than 192.168.178.255.

- 192.168.178.255 is the broadcast address for a /24, it could confuse naive softwares, better use a different IP if 127.0.0.1 doesn't work.
did-g is offline   Reply With Quote
Old 07-04-2017, 03:06   #44
Registered User

Join Date: Apr 2017
Posts: 33
Re: furuno FA-30 ais messages not being picked up by openCPN

Quote:
Originally Posted by did-g View Post
Congratulation

Maybe it's some kind of firewall or NAT? It looks like one.

Wireshark is capturing data very early in the network stack and is not affected.

Couple of things:

- On the same machine you can try to forward on 127.0.0.1 (or 127.1 if they understand shorthand notation) rather than 192.168.178.255.

- 192.168.178.255 is the broadcast address for a /24, it could confuse naive softwares, better use a different IP if 127.0.0.1 doesn't work.
any idea why this only worked when I chose x.x.255.255 and x.x.x.255. this whole process doesnt't work if id dont use 255 in the ipaddress AND manuallyfire off a pcket with pacjet sender to said ip address?

windows firewalk as opened for 10033.

sounds something like this... Can't receive udp packets
bobbylockes is offline   Reply With Quote
Old 07-04-2017, 07:58   #45
Registered User

Join Date: Aug 2009
Location: between the devil and the deep blue sea
Boat: a sailing boat
Posts: 20,231
Re: furuno FA-30 ais messages not being picked up by openCPN

Quote:
Originally Posted by bobbylockes View Post


2) f-30 only has an ethernet port, at least mine does.

How come?

The manual says FA-30 has a regular rs com port (422) and the image of the backdoor plate shows a COM/POWER cable!

Vide instruction manual dumps:

barnakiel
Attached Thumbnails
Click image for larger version

Name:	FA30_rs.jpg
Views:	85
Size:	58.4 KB
ID:	144870   Click image for larger version

Name:	FA30_rs_COM.jpg
Views:	74
Size:	109.2 KB
ID:	144871  

barnakiel is offline   Reply With Quote
Reply

Tags
ais, enc, furuno, opencpn

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
AIS NMEA messages not acquired. usodimare OpenCPN 8 16-04-2017 19:16
OpenCPN do not read TTM messages pudozh OpenCPN 1 03-09-2016 09:42
Just Picked Up a Yamaha 6hp 2 Stroke 2 Cyl - Anything To Watch For? MarkSF Engines and Propulsion Systems 1 29-08-2012 22:41
AIS Transponders and AIVDO Messages bdbcat OpenCPN 5 06-09-2010 20:16
Finally Picked our Boat Insurance Kasidah Dollars & Cents 3 17-03-2007 12:50

Advertise Here


All times are GMT -7. The time now is 05:06.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2020, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.