Cruisers Forum
 

Go Back   Cruisers & Sailing Forums > Engineering & Systems > Marine Electronics
Cruiser Wiki Click Here to Login
Register Vendors FAQ Community Calendar Today's Posts Log in

Reply
  This discussion is proudly sponsored by:
Please support our sponsors and let them know you heard about their products on Cruisers Forums. Advertise Here
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 07-10-2014, 05:05   #1
Registered User
 
Mollymawk's Avatar

Join Date: Nov 2009
Location: on the high seas
Boat: "Mollymawk" 50ft Steel Ketch
Posts: 149
Multiplexing NMEA on a router (NMEA over WiFi redux)

Some time ago - over two years, it seems; time flies! - I asked some questions on the forum about broadcasting NMEA data over WiFi for the use of devices such as Android tablets, as well as computers which needn't be at the chart table.
After a very interesting discussion with lots of helpful ideas from forum members I decided I would build my own NMEA multiplexer with an Ethernet interface to my router, using an Arduino or perhaps a Raspberry Pi - but two years later it still hasn't happened. Too many more important but less interesting jobs competing for my time, plus it's hard to get things like Arduinos and RPis in South America.

Anyway, some time back I came across RobbieW's account of getting kplex working on a router, and I realised that of course this is a simpler way to achieve my goal - or at least, it's a way that only uses equipment I already have, since I have a router with a USB port.

I've installed OpenWRT on my router (TP-Link TL-MR3240), but not got as far as cross-compiling kplex yet.
I know RobbieW was planning to switch to OpenWRT from Tomato, so I'm hoping he might have some tips for me - but I thought I'd post here rather than emailing him, so that others can benefit from the discussion.
And maybe others will have useful input, too!
__________________
www.yachtmollymawk.com
Mollymawk is offline   Reply With Quote
Old 07-10-2014, 23:52   #2
Registered User

Join Date: Aug 2011
Location: On board
Boat: Rival 41C
Posts: 74
Send a message via Skype™ to RobbieW
Re: Multiplexing NMEA on a router (NMEA over WiFi redux)

I havent (yet) migrated my router to OpenWRT. Mostly because the imperative to do so is no longer so urgent, the conflicting serial device problem I've worked around simply by not plugging the mobile dongle direct into the hub router. There is also the concern that devices with the Broadcom wireless chipset that mine has are not really on the main development branch of OpenWRT and are not supported by older, stable versions.

I used 'tomatoware', a compile environment for Tomato, to build kPlex direcitly on the router having failed to create a cross compile environment that would work. 'tomatoware' was installed on a mountable USB stick on the router and utilised from there.

I found, with the help of tomatoware's creator, that I needed a couple of compile options to get a clean build of kPlex that would run when the compile environment was unmounted. Those options are -zmuldefs and -static; the first seems to deal with multiple definitions of the same variable in the source, the second builds all externally called functions into the kPlex module making it independent. A side effect of using -static was to create a much larger module, c. 600k against about 70 iirc. I used another utility 'upx' to compress the compiled module, which got it down to a more reasonable 200k.

One of the things that made this route feasible is that Tomato has drivers for the FTDI Serial-USB converter built in, you do have to load them with each reboot however as they are not part of the core function. I havent looked at OpenWRT for a while now so cant remember if the same drivers are present. I also found it was possible to use a USB hub to enable multiple USB inputs to a router with limited USB ports, kPlex didnt seem to mind so long as you address each one correctly.
RobbieW is offline   Reply With Quote
Old 08-10-2014, 00:50   #3
Registered User

Join Date: Jun 2013
Location: canada
Posts: 4,662
Re: Multiplexing NMEA on a router (NMEA over WiFi redux)

look at moxa stuff. they probably make this stuff already. I have defiantly seen nmea put into Ethernet before.

maybe like this

Moxa Wireless Device Servers NPort W2150A/2250A - 1 and 2-port RS-232/422/485 Wireless Device Servers


once it's in the network you'd need some way to decode it back down though?...
smac999 is offline   Reply With Quote
Old 08-10-2014, 01:05   #4
Registered User

Join Date: Oct 2012
Location: Brighton, UK
Boat: Westerly Oceanlord
Posts: 513
Re: Multiplexing NMEA on a router (NMEA over WiFi redux)

There's a recently started google group for kplex which might be worth posting to. There's definitely people who've got it running on OpenWRT (on mips) who both Robbie and I have been in contact with. I'll try and dig out some mails and ping them.
muttnik is offline   Reply With Quote
Old 08-10-2014, 05:59   #5
Registered User
 
Mollymawk's Avatar

Join Date: Nov 2009
Location: on the high seas
Boat: "Mollymawk" 50ft Steel Ketch
Posts: 149
Re: Multiplexing NMEA on a router (NMEA over WiFi redux)

Robbie, Keith, thanks for the replies.

I would be inclined to go for the 'easy' route of installing Tomato and following where you have gone before, but I have the opposite problem you have: Tomato is not available for my Atheros-based router. Anyway, I enjoy the challenge and hopefully if I get it going and write about it here it will help others in the future.

Compiling directly on the router certainly seems logical. I haven't found anything useful about compiling on an OpenWrt router, but perhaps I should ask on the OpenWrt forum. What are the build requirements? If I could get GCC installed on the router would that be enough?
On the other hand, I suppose I should at least try cross-compiling first, since that's the standard way to port software to OpenWrt.

Of course, I could use DebWrt, then I wouldn't have to do any of this, but I'd have to build it myself for my router and I'd have to set up the routing aspect of it myself too.

Keith, thanks for pointing me to the kplex Google Group, I will post there later. If you were able to point people who have got this going in the direction of this thread that would be great.

I thought of another little question last night. My Garmin GPS has a USB port as well as an NMEA connection. But on the USB port it will only talk Garmin's proprietary language. Is there a way to translate that data into NMEA format and get it into kplex? Maybe gpsd can do it?

Cheers, Caesar
__________________
www.yachtmollymawk.com
Mollymawk is offline   Reply With Quote
Old 08-10-2014, 06:02   #6
Registered User
 
Mollymawk's Avatar

Join Date: Nov 2009
Location: on the high seas
Boat: "Mollymawk" 50ft Steel Ketch
Posts: 149
Re: Multiplexing NMEA on a router (NMEA over WiFi redux)

smac999, I know about those Moxa devices, but can't afford them! I was planning to build one myself - one day - but here I'm talking about actually installing software directly in the router to handle the NMEA broadcasting over ethernet.
__________________
www.yachtmollymawk.com
Mollymawk is offline   Reply With Quote
Old 08-10-2014, 20:41   #7
Registered User
 
Mollymawk's Avatar

Join Date: Nov 2009
Location: on the high seas
Boat: "Mollymawk" 50ft Steel Ketch
Posts: 149
Re: Multiplexing NMEA on a router (NMEA over WiFi redux)

Well, I've got kplex running on OpenWrt, no problem. It took a bit of research, since nothing is documented properly, but was really quite trivial. It installs and runs fine (as a service or normally).
I haven't been able to actually test it yet as I don't have a source of NMEA data handy...

I'm going to be offline for the next few days (or more), but when I get back online I'll document this and maybe upload my code to github.

Keith, have you thought of putting your code online under version control, eg on github?
Then I could just create a repo for the openwrt package and include kplex master as an external...
__________________
www.yachtmollymawk.com
Mollymawk is offline   Reply With Quote
Old 08-10-2014, 20:43   #8
Registered User
 
Mollymawk's Avatar

Join Date: Nov 2009
Location: on the high seas
Boat: "Mollymawk" 50ft Steel Ketch
Posts: 149
Re: Multiplexing NMEA on a router (NMEA over WiFi redux)

Oh, and it's only 21kB... :-)

It does depend on an external module; libpthreads. I thought I ought to be able to roll that into the same package but didn't have any luck. But it's available from the standard OpenWrt sources so not a big problem I guess.
__________________
www.yachtmollymawk.com
Mollymawk is offline   Reply With Quote
Old 09-10-2014, 00:10   #9
Registered User

Join Date: Aug 2011
Location: On board
Boat: Rival 41C
Posts: 74
Send a message via Skype™ to RobbieW
Re: Multiplexing NMEA on a router (NMEA over WiFi redux)

Excellent, well done. I might tap into your experience sometime in the future!
RobbieW is offline   Reply With Quote
Old 10-10-2014, 13:58   #10
Registered User

Join Date: Oct 2012
Location: Brighton, UK
Boat: Westerly Oceanlord
Posts: 513
Re: Multiplexing NMEA on a router (NMEA over WiFi redux)

Quote:
Originally Posted by Mollymawk View Post
Keith, have you thought of putting your code online under version control, eg on github?
It is under git version control (I resisted the temptation to use sccs from the outset :-) but not on github. There's a very old version that someone else posted there but last I looked it wasn't maintained. The source is obviously always downloadable but this week when I've got a bunch of fixes but no time to make and test a release has convinced me that I should open up the repository

github doesn't appear to be ipv6 accessible: what's the point of that? :-)
muttnik is offline   Reply With Quote
Old 13-10-2014, 17:57   #11
Registered User
 
Mollymawk's Avatar

Join Date: Nov 2009
Location: on the high seas
Boat: "Mollymawk" 50ft Steel Ketch
Posts: 149
Re: Multiplexing NMEA on a router (NMEA over WiFi redux)

Quote:
Originally Posted by muttnik View Post
It is under git version control (I resisted the temptation to use sccs from the outset :-) but not on github. There's a very old version that someone else posted there but last I looked it wasn't maintained. The source is obviously always downloadable but this week when I've got a bunch of fixes but no time to make and test a release has convinced me that I should open up the repository
That would be great – the bazaar is better than the cathedral!
Gives everyone the chance to test fixes in trunk before you make a stable release, and everyone can contribute fixes too.

Quote:
Originally Posted by muttnik View Post
github doesn't appear to be ipv6 accessible: what's the point of that? :-)
Seems like a major oversight on their part, but I don't know much about it as I never have an IPv6-enabled connection. I feel it's probably not a sufficient reason to avoid them... :-)
__________________
www.yachtmollymawk.com
Mollymawk is offline   Reply With Quote
Old 14-10-2014, 08:19   #12
Registered User

Join Date: Aug 2011
Location: On board
Boat: Rival 41C
Posts: 74
Send a message via Skype™ to RobbieW
Re: Multiplexing NMEA on a router (NMEA over WiFi redux)

This discussion prompted me to go and look at the status of the currrent, Barrier Breaker, releases of OpenWRT. Seems its now released with formal support for the RT-N16, so I've downloaded 14.07. Whether I install that before leaving the boat or next spring depends on how I get on with putting the boat to bed
RobbieW is offline   Reply With Quote
Old 17-10-2014, 06:35   #13
Registered User
 
Mollymawk's Avatar

Join Date: Nov 2009
Location: on the high seas
Boat: "Mollymawk" 50ft Steel Ketch
Posts: 149
Re: Multiplexing NMEA on a router (NMEA over WiFi redux)

Ok, while I've been offline I put together a quick howto and I've now uploaded the OpenWrt Makefile, the OpenWrt-specific init file, and instructions on how to use them to https://github.com/CaesarSchinas/kplex-openwrt.

If anyone has any questions or suggestions let me know.
__________________
www.yachtmollymawk.com
Mollymawk is offline   Reply With Quote
Old 17-10-2014, 06:53   #14
Registered User

Join Date: Aug 2011
Location: On board
Boat: Rival 41C
Posts: 74
Send a message via Skype™ to RobbieW
Re: Multiplexing NMEA on a router (NMEA over WiFi redux)

Have you found that you need to run 'modprobe' or something similar to load drivers for whatever Serial/USB device you have ?

For example, I have to include in the startup scripts for Tomato something like 'modprobe -a ftdi_sio pl2303' to load drivers for FTDI & Prolific devices.
RobbieW is offline   Reply With Quote
Old 17-10-2014, 07:14   #15
Registered User
 
Mollymawk's Avatar

Join Date: Nov 2009
Location: on the high seas
Boat: "Mollymawk" 50ft Steel Ketch
Posts: 149
Re: Multiplexing NMEA on a router (NMEA over WiFi redux)

No I don't have to do anything special, just have the drivers installed. You'll need the packages kmod-usb-core, kmod-usb-serial, and kmod-usb-serial-pl2303 (for Prolific devices - I don't recall the name for FTDI but it is the same story).

With those installed my USB serial adaptors just automatically show up at /dev/ttyUSB0 etc when I plug them in.

One scenario I haven't tackled yet is connecting the USB serial adaptors after startup. By declaring the serial interfaces as optional in the kplex config file, kplex will load even if the adaptors are not plugged in, but I don't think it will start reading data from them when they are connected. The simple workaround is to reboot the router after connecting the adaptors, if they weren't connected at startup, but ideally I'd like to be able to (re)start kplex when a USB serial adaptor is plugged in.
__________________
www.yachtmollymawk.com
Mollymawk is offline   Reply With Quote
Reply

Tags
nmea, route


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
Wifi Router Configuration Question Dockhead Marine Electronics 5 01-04-2014 02:59
3G/Wifi: Locomarine Yacht Router Micro Reviews? Emerald Sea Product or Service Reviews & Evaluations 16 12-02-2014 10:07
Need WiFi Router, Coax and Antenna David M Marine Electronics 16 31-01-2012 16:52
Does a Wireless 3G AND Wifi Input Router Exist ? Fuss Marine Electronics 12 21-02-2011 19:37
WiFi Bullet and Linksys Router Config Meck Marine Electronics 1 17-10-2009 08:03

Advertise Here


All times are GMT -7. The time now is 15:54.


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

ShowCase vBulletin Plugins by Drive Thru Online, Inc.