USB 3G dongle connection

I have a Vera controlling my house where I use a 3G usb dongle to connect to the internet. I would like to know if anyone has managed to get vera to access the internet and also share it wirelessly using a 3G dongle instead of a DSL line??
Regards
Fergal

If you’re going to do this, you should look to using a dedicated device to work with the USB-3G Modem, and then have Vera connect to that device, preferably using wired Ethernet (you could use Wifi if absolutely needed)

eg. MiFi, Cradlepoint (etc)

These devices will insulate you from the “how” part, since they work with a variety of 3G devices, in a supported manner, and turn it around to provide either Wifi, or Wired, ethernet service.

They’ll insulate you from the frustration of trying to get it working ‘directly’ with Vera, and keep it working over time.

I have all the bits to do this, but haven’t yet pulled the pin on the 3G provider to use. In my case, as a backup to DSL failure.

For reference, my [yet untested] setup involves:

DSL Modem
Cradlepoint MBR800 Wired Ethernet Gateway, with 3G Failover
Linksys Router/Firewall (DD-WRT)
Netgear 8x GB Switch
Audio Gear, TV, etc
Vera
Wifi Routers
Netgear 8x GB Switch
Wired Servers/File Servers

Obviously, there’s a bunch of kit here that’s not needed in smaller networks.

A lot of people could run just the DSL Modem and the Cradlepoint. In your case, there are simpler options, since you’re running only from the 3G modem, so you could get a Gateway with combined wired-and-wireless and reduce your box count down to 1 (plus Vera)

Once I make the call on the 3G/4G provider, I intend to configure the Cradlepoint to be the fallback to the DSL line. I could also use it to extend/augment capacity if needed.

[quote=“fear_gall, post:1, topic:167023”]I have a Vera controlling my house where I use a 3G usb dongle to connect to the internet. I would like to know if anyone has managed to get vera to access the internet and also share it wirelessly using a 3G dongle instead of a DSL line??
Regards
Fergal[/quote]

Sorry to revive an old topic, but I found this in the search engine and it fits my problem very well.

I can’t figure out how to get the Vera interface/UI4 to work over 3G USB. I have a working connection through the 3G interface:

root@vera:/etc/config# uname -a Linux vera 2.4.37.9 #143 Tue Jul 6 09:13:02 PDT 2010 mips GNU/Linux

root@vera:/etc/config# ifconfig |grep 3g
3g-ppp0 Link encap:Point-to-Point Protocol

root@vera:/etc/config# ping -I 3g-ppp0 google.dk
PING google.dk (74.125.79.99): 56 data bytes
64 bytes from 74.125.79.99: seq=0 ttl=51 time=599.568 ms

But as soon as I set up the 3G connection, the UI forward agent (cmh-ra-daemon? what is the proper name?) stops working and I can’t access UI4 from the internet. I get this when I search the logs:

root@vera:/etc/config# logread | grep cmh-ra

Mar 17 11:51:35 user.notice cmh-ra[31133]: === Starting MiOS Remote Control daemon … ===
Mar 17 11:51:35 user.notice cmh-ra[31133]: did kill on 31165
Mar 17 11:51:36 user.notice cmh-ra[31078]: Pipes Broken. Probably tunnels are down. Restart cmh-ra service
Mar 17 11:51:36 user.notice cmh-ra[31078]: Received EXIT Signal. Cleanup & restart
Mar 17 11:51:36 user.notice cmh-ra:31172: Stopping cmh-ra-daemon
Mar 17 11:51:39 user.notice cmh-ra[31198]: FAILSAFE OFF
Mar 17 11:51:39 user.notice cmh-ra[31198]: Reading MiOS RC Configuration file
Mar 17 11:51:39 user.notice cmh-ra[31198]: Returning working server for MAIN=fwd1.mios.com BCK=fwd2.mios.com LAST=fwd1.mios.com UseBCK=0 with do_report=1
Mar 17 11:51:39 user.notice cmh-ra[31198]: No default route. NO INTERNET. Quit test.
Mar 17 11:51:39 user.notice cmh-ra[31198]: No default route. NO INTERNET. Quit test.
Mar 17 11:51:39 user.notice cmh-ra[31198]: NONE Working

I took notice of this line: “Mar 17 11:51:39 user.notice cmh-ra[31198]: No default route. NO INTERNET. Quit test.”… No default route?

When I check my route table, I get this:

root@MiOS_15549:/etc/config# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.64.64.64     *               255.255.255.255 UH    0      0        0 3g-ppp0
192.168.81.0    *               255.255.255.0   U     0      0        0 br-lan
192.168.1.0     *               255.255.255.0   U     0      0        0 eth0.1
default         *               0.0.0.0         U     0      0        0 3g-ppp0

… and further digging through the logs yields this:

Mar 17 11:49:37 MiOS_15549 daemon.notice pppd[30670]: pppd 2.4.4 started by root, uid 0 Mar 17 11:49:40 MiOS_15549 daemon.info pppd[30670]: Serial connection established. Mar 17 11:49:40 MiOS_15549 daemon.info pppd[30670]: Renamed ppp0 to 3g-ppp0 Mar 17 11:49:40 MiOS_15549 daemon.info pppd[30670]: Using interface 3g-ppp0 Mar 17 11:49:40 MiOS_15549 daemon.notice pppd[30670]: Connect: 3g-ppp0 <--> /dev/usb/tts/0 Mar 17 11:49:42 MiOS_15549 daemon.warn pppd[30670]: Could not determine remote IP address: defaulting to 10.64.64.64 Mar 17 11:49:42 MiOS_15549 daemon.notice pppd[30670]: replacing old default route to eth0.1 [192.168.1.1]

As far as I can tell, the default route is set through the 3g-ppp0 interface automatically when I initialize the 3G modem, so what am I doing wrong here?

I don’t fully understand all the daemons and scripts that are running (cmh-xx), so I can’t really take a guess at what’s wrong. Can anyone please elaborate on this? The 3G connection is NAT’ed/proxied by the ISP - is this a problem?

If I get this up and running, I’d gladly revise the 3G Intro in the wiki and write a page on how to get UI4 connectivity through 3G.

What provider are you using. I’m a service manager for Sprint. You have a few options that you can do. Using a router that will allow your 3G modem to connect to it directly. I have seen D-Links & Linksys routers that will work. It all boils down that the needed software that the modem uses is on the router. Second option and it is quite easy to do. Connect your 3G modem to a computer (notebook for example) and use your computer as an internet gateway. Either via your Ethernet (CAT5) port or WiFi. This works very well!

VERY important though, all wireless providers have a bandwidth cap of some sort, unless using 4G (for example Sprint has no limit on bandwidth while on 4G) I can not speak for others, but then again only Verizon beside Sprint has true 4G. Sprint limits it’s 3G modem use to 5GB (unless of course you have a grandfathered plan that allows you unlimited use)

I have a Dell mini notebook that has a Sprint 3G/4G modem built into it. It already has software in it to use it as a hotspot, which I could connect Vera right to it.

[quote=“mikkelj, post:3, topic:167023”]I took notice of this line: “Mar 17 11:51:39 user.notice cmh-ra[31198]: No default route. NO INTERNET. Quit test.”… No default route?

When I check my route table, I get this:

root@MiOS_15549:/etc/config# route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 10.64.64.64 * 255.255.255.255 UH 0 0 0 3g-ppp0 192.168.81.0 * 255.255.255.0 U 0 0 0 br-lan 192.168.1.0 * 255.255.255.0 U 0 0 0 eth0.1 default * 0.0.0.0 U 0 0 0 3g-ppp0 [/quote]

Here’s a possibility:

# /usr/lib/cmh/functions.sh 
    local DEFAULT_ROUTE=$(route -n | awk '/UG/{print $2}')
    if [[ -z "$DEFAULT_ROUTE" ]]; then       
                log "No default route. NO INTERNET. Quit test."
                return 1                             
    fi

Your default route is missing the “gateway” flag, which seems to be what the MiOS script is looking for. I don’t know why you haven’t got the gateway flag in your routing table; possibly it’s because your 3G provider isn’t providing a remote IP address (“Could not determine remote IP address”).

Two things you could try.

One: You could hack your routing table with a route statement in an if-up script for the 3G modem, to convince the functions.sh script that you’ve got a gateway.

Two: You could alter the functions.sh script to check for ‘0.0.0.0’ rather than ‘UG’ to find the default route. That seems like the “right” way to me.

[quote=“futzle, post:5, topic:167023”]Your default route is missing the “gateway” flag, which seems to be what the MiOS script is looking for. I don’t know why you haven’t got the gateway flag in your routing table; possibly it’s because your 3G provider isn’t providing a remote IP address (“Could not determine remote IP address”).

Two things you could try.

One: You could hack your routing table with a route statement in an if-up script for the 3G modem, to convince the functions.sh script that you’ve got a gateway.

Two: You could alter the functions.sh script to check for ‘0.0.0.0’ rather than ‘UG’ to find the default route. That seems like the “right” way to me.[/quote]

Brilliant help! I’ll try that out and get back to you :slight_smile:

I live out in country with no access to DSL or Cable only dial-up, and out of necessity I use a AT&T 3G USB laptop connection device that is plugged into a Cradlepoint 1000. Works great as I have both wired and wireless devices that now have access to the Internet with reasonable access speeds). My Vera is currently connecting to my Cradlepoint via wireless with no problems. So I second @GUESSED recommendation. On problem that you might run in to is that some providers aka AT&T block ports disallowing you to use the portforwarding features (such as accessing IP camera’s from an external connection). Vera/MiOS uses tunneling access features that get pass the disabled port problem. Which is great, I now can access my house devices and view my IP and wired cameras via MiOS remote access. I have not tried to connect my USB device directly to Vera because, I like having a firewall between my internal LAN and the outside world… :wink:

I work for a small company that uses the Vera box in their product-line. There is a demand for deployment in places without traditional connectivity, so I’ve been looking into 3G connectivity. Another box for connectivity (cradlepoint etc) is the last resort, as it screws up the clean all-in-one-solution with everything running on the Vera box. It would also increase costs, so I would really love to get this up and running on the Vera box :slight_smile:

The 3G connection doesn’t have a public IP - with the IPv4 pool spent and all - so the ISP basically acts as a “passive firewall”.

In /usr/lib/cmh/functions.sh

# /usr/lib/cmh/functions.sh 
    local DEFAULT_ROUTE=$(route -n | awk '/UG/{print $2}')
    if [[ -z "$DEFAULT_ROUTE" ]]; then       
                log "No default route. NO INTERNET. Quit test."
                return 1                             
    fi

… I ended up replacing

$(route -n | awk '/UG/{print $2}')

with

$(route | awk '/default/{print $2}')

I guess that does the same. My only problem now, is that the file is read-only…

File resides in /usr/lib/cmh:

root@MiOS_15549:/usr/lib/cmh# ls -l lrwxrwxrwx 1 root root 30 Jan 1 2000 functions.sh -> /mios/usr/lib/cmh/functions.sh

and it’s mounted on a read-only partition:

root@MiOS_15549:/usr/lib/cmh# mount |grep /mios /dev/loop/0 on /mios type squashfs (ro)

From what I can see in the wikipedia article, I can’t easily modify this file, since squashfs is read-only. I’ve renamed the functions.sh-symlink and made a local copy, is there a more clean way to do this?

Yep, the file is read-only, but the symlink in /usr/lib/cmh is not, so you can make it point somewhere else, or you can replace the file with an actual file instead of a symlink. Copy the whole of functions.sh from /mios/usr/lib/cmh to /overlay/usr/lib/cmh (you may have to rm the symlink first).

Cradlepoint is interesting device, but looking at Cradlepoint 1000 or 1200 price point I think I’d rather go with Mikrotik RB493G as “all in one and 3G” router.

It’s a little monster machine, both hardware and software wise - some WISP use these as their backbone or even core routers. No battery, but it can talk to APC’s UPS, and boy, it’s configurable!

I got my Cradlepoint MBR800 (4x Wired + 3G via USB Dongle or Card) for $120 shipped from NewEgg, via a deal they run every ~2mo. It comes “enclosed” with a Power supply, and ready to insert a 3G modem running either Active-Active with the 3G or Active-Passive.

The MBR800 is the “no built in Wifi” model in their lineup (compared to the 1000, and 1200 models), so it makes for a great “Closet-mounted” option, a cheaper version of the above for those that don’t need additional Wifi, or have it elsewhere in the house (why pay for something you already have)

Given these various hardware options are cheap, it’s a good option for anyone wanting support for their Vera. The above changes will invalidate any support, and will likely break on Firmware upgrades… definitely not something the Sellers should be doing, unless they want a lot of long term support heartache. 8)

They don’t sell MBR800 here in Canada anyways :slight_smile:
I’m just curious how does it work - you pay monthly fee for extra 3G data plan?

[quote=“325xi, post:13, topic:167023”]They don’t sell MBR800 here in Canada anyways :slight_smile:
I’m just curious how does it work - you pay monthly fee for extra 3G data plan?[/quote]
Yup. You buy either a 3G or 4G USB Dongle, or an ExpressCard one, from a Vendor of your choice and connect it. I believe you can technically have 2x of these in a system - both an ExpressCard and a USB Dongle. In the US, there are a bunch of vendors supported for that mode.

You then pay the monthly usage fee for that service, in addition to whatever you’re generally paying for the Primary Broadband service (although technically you can run solely off 3G if you’re in the wild somewhere and can get 3G/4G Services, but no BBand)

Like anything, resilience/redundancy isn’t cheap…

I chose it for the USB Connectivity, since it can be attached on a long USB-cable to get the Radio “outside” of the Structured Wiring Closet (similar to how I used to do Vera1’s Z-Wave dongle)… It also runs on 12V, which is another “quirky” requirement I have for all my gear as I have a 12v in-closet UPS.

I still haven’t found any viable solutions to my problem with connectivity through a 3G dongle.

If I plug the 3G dongle in a router and connects the Vera box to the router, I have access through http://cp.mios.com

However, if I plug the 3G dongle directly in the Vera box, the remote agent daemon fails. I have a working internet connection through the dongle, but it still fails. Can someone please help me towards a solution on this?