Using a wifi AND 3G connection from a router on a boat.

fergycool

Well-Known Member
Joined
2 Nov 2013
Messages
144
Location
Cambridge
Visit site
I’ve a little bit of a complicated routing (for me) issue for my “boat’s LAN" (LAN is currently a bit disingenuous as there's only the router which is just used for internet access!).

I have a 3G router on my boat which is currently used for iPads, iPhones, laptops and general internet stuff!

However, I now want to add a RPI to monitor various “things” around the boat.

The boat is normally moored within wifi range of my house, and so I’d like to use that connection, and fall back to the 3G router only when the boat is out of range of the house wifi.

I’m using a RUT500 router with an external aerial. You can use 3G, Ethernet or wifi as the external WAN, with a fallback to a second if the first fails. Initially I assume that the RUT500 had two wifi chips/aerials and so could route/extend between an external wifi connection and the internal one. However, it does not. If you use WIFI as a WAN connection, you cannot have an LAN WIFI active.

So I have two options I think:

(1) Use a cheap wifi extender that I can connect to the house WIFI and then, via ethernet, to the RUT500 router. Any suggestions on one that runs on 12/14v? I have visual sight of the boat so it does not have to be some directional super aerial!

OR

(2) do some complicated routing (which is currently beyond my networking skills) to make the RPI connect to the house WIFI and fallback to the 3G router. That’s slightly less complicated in that the RPI would not need a Gateway for external internet traffic when not connected to the house. Just LAN (I’ll be on the boat then!).

- When wifi is available, then the RPI will connect to it and use that as the gateway, except it will still connect to traffic via Ethernet on the LAN. It will use the DHCP/DNS server of the “house” LAN, although I guess it could easily be static.

- However when there is no wifi available it will fallback to the Ethernet link to the router and therefore use the 3G connection of that. The gateway will now be the 3G router. It will use the DHCP/DNS server of the 3G router except there will be minimal (if any) internet traffic.

- All local traffic i.e. Cameras, will always use the Ethernet, I.e. Stuff that's connected to the router's wifi lan
 
I connect via 4G or Wi-Fi, I find the best solution is to switch off the one I'm not using.

Whereas that would be easier, I'd like to monitor the boat externally, and sods law says that when I need to, I'll have forgotten to switch it over.

Funnily enough (from your boat's location) this has all been prompted during a (non boating) holiday in Lanzarote a week ago. A neighbour rang me to say that the boat's bilge alarm was going off. It was not (it was a lorry reversing at midnight!), but it made me worry all night long and gave me indigestion from my paella!
 
I think - but I am not sure - that if I do USB tethering to my Android phone I can then use whatever data connection it is using, whether that's wifi or mobile.
 
If you get a pi3 with built in wifi and add another decent wifi usb adaptor then the Pi can be your router, add a cheap smartphone to be a 3g hotspot and off you go. Just turn in the phone when your away from your home network. Not tried it but the Pi should connect automatically the whatever wifi network is available, though dunno what would happen if both are there. Openplotter makes it simple to set all this up, can be headless if you don't want a monitor, just use a tablet or whatever to set it up. Openplotter is very powerful for monitoring as well, can send a tweet / email if a nmea or switch condition is met.
 
If you get a pi3 with built in wifi and add another decent wifi usb adaptor then the Pi can be your router, add a cheap smartphone to be a 3g hotspot and off you go. Just turn in the phone when your away from your home network. Not tried it but the Pi should connect automatically the whatever wifi network is available, though dunno what would happen if both are there. Openplotter makes it simple to set all this up, can be headless if you don't want a monitor, just use a tablet or whatever to set it up. Openplotter is very powerful for monitoring as well, can send a tweet / email if a nmea or switch condition is met.

Just what I was wanting to hear. A much simpler solution to what I was trying to do! Thanks!

I already have the 3G router (and aerial) installed. So I'll add that as a fallback Ethernet route if wifi fails.

Thanks!
 
Brief example of what you can do..



gtsNenh.jpg


Check pretty much anything for being bigger or smaller or not present, or a switch...


Then do something, like send a tweet or email

SpiT87K.jpg
 
In the BOOT device on the card you need to uncomment the lines below in config.txt then you can log onto "openplotter" access point and vnc using 10.10.10.1 , log in is pi and password raspberry. Then if you have another wifi dongle in the Pi you can connect that to your home network for updates etc , or ethernet i suppose, never tried it.
Often I'll just use vnc rather than sit at the cart table.
Then if you're nifty with python or bash or whatever you could get it to do all sorts of funky stuff and call the scripts from openplotter :)

or Pi3 internal wifi:

#uncomment to set WiFi access point when monitor is not present (headless)
device=wlan0
ssid=OpenPlotter
pass=12345678
 
Whereas that would be easier, I'd like to monitor the boat externally, and sods law says that when I need to, I'll have forgotten to switch it over.

Funnily enough (from your boat's location) this has all been prompted during a (non boating) holiday in Lanzarote a week ago. A neighbour rang me to say that the boat's bilge alarm was going off. It was not (it was a lorry reversing at midnight!), but it made me worry all night long and gave me indigestion from my paella!

Are you expecting to be able to make an incoming connection over 3G? That is, at best, problematic and, at worst, impossible.
 
Would you need to?

The OP says that he wants to monitor the boat externally - I have seen solutions where the electronics on the boat is pro-active and pushes out periodic status messages, but I've also seen systems that allow the owner to interrogate the boat. Most 3G SIMS don't allow that because they sit behind NAT servers and the boat has no public IP address. I was offered a SIM a few months ago that did provide a public IP address and would have allowed me to run an externally accessible web server on the boat. I came close to taking it till I read the small print and thought more carefully about it - it had the potential to bankrupt me!
 
... Not tried it but the Pi should connect automatically the whatever wifi network is available, though dunno what would happen if both are there..

You can prioritise them, the Pi will connect to the highest priority SSID that's available, and repeat if a connection is dropped.
 
Last edited:
The OP says that he wants to monitor the boat externally - I have seen solutions where the electronics on the boat is pro-active and pushes out periodic status messages, but I've also seen systems that allow the owner to interrogate the boat. Most 3G SIMS don't allow that because they sit behind NAT servers and the boat has no public IP address. I was offered a SIM a few months ago that did provide a public IP address and would have allowed me to run an externally accessible web server on the boat. I came close to taking it till I read the small print and thought more carefully about it - it had the potential to bankrupt me!
I am using a M2M 3G router but with a bog standard data sim. When the boat is unoccupied it's within wifi range of my home. When it's out of range I'm on the boat and do not need external monitoring (external to the 'boatLAN' that is.

Cheers
Fergycool
 
The OP says that he wants to monitor the boat externally - I have seen solutions where the electronics on the boat is pro-active and pushes out periodic status messages, but I've also seen systems that allow the owner to interrogate the boat.
Interrogation is not really that difficult over the web - have the boat device parse MQTT channels or tweets for keywords. Node-red is built into raspbian now and looks like it could do that without too much in depth knowledge of programming. (ain't tried that yet :) )
 
The OP says that he wants to monitor the boat externally - I have seen solutions where the electronics on the boat is pro-active and pushes out periodic status messages, but I've also seen systems that allow the owner to interrogate the boat. Most 3G SIMS don't allow that because they sit behind NAT servers and the boat has no public IP address.

Any possibilities in getting the boat to set up a ssh tunnel to home? VPN?
 
Top