The Verizon USB720 Cellular modem is a quick and easy way to add wireless internet connectivity to your embedded system. Why might you want to add cellular connectivity to your embedded device? Remote access and diagnostics is a big reason. One customer I have is planning to supply all their distributors with a USB720 so they can easily upload log files from devices in the field. The alternative is copying the log files to a flash drive, finding a PC connected to the internet, and then uploading the files — too much hassle, therefore it does not get done. Also, think about the cost of sending a field support person on-site to troubleshoot problems versus shipping them a USB720 and accessing the device remotely.
The USB720 is a fairly small device that plugs into the ubiquitous USB port. This articles covers some of the details on how to configure an embedded Linux system to work with this device.
Why is the USB720 a good fit for wireless connectivity in Embedded Systems?
Some reasons the USB720 (or other USB based cellular modems) is an attractive option:
- fairly fast: provides typical download speeds of 600-1400kbps, and upload speeds of 500-800kbps
- convenience: it plugs into a USB port. No taking apart the box and installing an embedded module, etc.
- affordable: with plans around $60/mo, its a lot cheaper than sending field support people on-site to debug every problem.
- uses standard PPP protocols for connection. That means it works with Linux.
- supported by the mainstream Linux kernel
The USB720 looks like a USB-serial device to the host system. If you plug it into your Ubuntu desktop Linux system, all the needed kernel pieces are there and it will just work. With your embedded system, you need to make sure a number of kernel options are enabled including:
The CONFIG_USB_SERIAL_OPTION selection enables a driver that is specifically optimized to work with the USB chip found in many cellular modems. Once you enable the above modules, and if you are running udev, simply plugging in the device will cause the appropriate modules to load and a /dev/ttyUSB0 device will now appear.
The most difficult part of this exercise is figuring out how to configure the PPP scripts. Verizon of course does not tell you how to configure their device and only supplies software for Windows and MAC. There are a number of howtos available on the internet, but most of them are tailored to using kppp or wvdial. Neither are very practical for embedded systems. Fortunately, the standard pppd daemon is fairly easy to use, is easy to build for embedded systems (it is already included in OpenEmbedded), and seems to work very well. The following scripts are needed:
connect "/usr/sbin/chat -v -f /etc/ppp/peers/verizon_chat"
"<phone number>@vzw3g.com" * "vzw"
At this point, you can run pppd call verizon and you should see something like:
root@cm-x270:~$ pppd call verizon
Serial connection established.
using channel 9
Using interface ppp0
Connect: ppp0 <--> /dev/ttyUSB0
Warning - secret file /etc/ppp/pap-secrets has world and/or group access
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x539657b7> <pcomp> <accomp>]
rcvd [LCP ConfReq id=0x0 <mru 1500> <asyncmap 0x0> <magic 0xb9b652e5> <pcomp> <accomp>]
sent [LCP ConfAck id=0x0 <mru 1500> <asyncmap 0x0> <magic 0xb9b652e5> <pcomp> <accomp>]
rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0x539657b7> <pcomp> <accomp>]
sent [CCP ConfReq id=0x1 <deflate 15> <deflate(old#) 15>]
sent [IPCP ConfReq id=0x1 <compress VJ 0f 01> <addr 192.168.1.119> <ms-dns1 0.0.0.0> <ms-dns3 0.0.0.0>]
rcvd [LCP DiscReq id=0x1 magic=0xb9b652e5]
rcvd [LCP ProtRej id=0x2 80 fd 01 01 00 0c 1a 04 78 00 18 04 78 00]
rcvd [IPCP ConfReq id=0x0 <addr 188.8.131.52>]
sent [IPCP ConfAck id=0x0 <addr 184.108.40.206>]
rcvd [IPCP ConfRej id=0x1 <compress VJ 0f 01>]
sent [IPCP ConfReq id=0x2 <addr 192.168.1.119> <ms-dns1 0.0.0.0> <ms-dns3 0.0.0.0>]
rcvd [IPCP ConfNak id=0x2 <addr 220.127.116.11> <ms-dns1 18.104.22.168> <ms-dns3 22.214.171.124>]
sent [IPCP ConfReq id=0x3 <addr 126.96.36.199> <ms-dns1 188.8.131.52> <ms-dns3 184.108.40.206>]
rcvd [IPCP ConfAck id=0x3 <addr 220.127.116.11> <ms-dns1 18.104.22.168> <ms-dns3 22.214.171.124>]
not replacing default route to eth0 [192.168.1.1]
local IP address 126.96.36.199
remote IP address 188.8.131.52
primary DNS address 184.108.40.206
secondary DNS address 220.127.116.11
Script /etc/ppp/ip-up started (pid 2303)
Script /etc/ppp/ip-up finished (pid 2303), status = 0x0
ppp0 Link encap:Point-to-Point Protocol
inet addr:18.104.22.168 P-t-P:22.214.171.124 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
RX bytes:64 (64.0 B) TX bytes:94 (94.0 B)
You are connected 🙂
Using the OE ppp package
Add ppp support to your image using OE is fairly straightfoward:
- add the kernel modules to your image
- add ppp to your image
- add a custom package that includes the configuration scripts listed above
One thing that may trip you up is the ppp scripts are expecting resolv.conf to be in the following location: /var/run/resolv.conf. The reason for this is we want resolv.conf in a RAM file system to prevent unneeded flash wear. Therefore, /etc/resolv.conf should be configured in your rootfs as a soft link to /var/run/resolv.conf.
The Linux kernel support for USB720 and the pppd package offer a quick, robust way to add cellular network connectivity to about any embedded Linux system that has a USB host port. As systems become more complex, it will be increasingly important to be able to remotely access systems in the field to troubleshoot problems, help users with configuration, etc. The USB720 offers a quick way to provide this type of connection without going through the expense of designing cellular connectivity into your product. One thing I usually encourage all my customers to do when designing new products is expose a USB host port, even though they may not see any immediate use for it. This is one of those reasons.
Below is a picture of a USB720 connected to a Compulab cm-x270 development system.