\n\n\n lsusb<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n\n\n\nThis will churn out something like this:<\/p>\n\n\n\n \n \n \n \n \n\n\n\n\n Bus 001 Device 004: ID 050d:2103 Belkin Components F7D2102 802.11n N300 Micro Wireless Adapter v3000 [Realtek RTL8192CU]<\/code><\/div>\nBus 001 Device 006: ID 19d2:0031 ZTE WCDMA Technologies MSM MF110<\/code>\/MF627\/MF636<\/code><\/div>\nBus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512<\/code>\/9514<\/code> Fast Ethernet Adapter<\/code><\/div>\nBus 001 Device 002: ID 0424:9512 Standard Microsystems Corp. SMC9512<\/code>\/9514<\/code> USB Hub<\/code><\/div>\nBus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n\n\n\nMy device (ZTE WCDMA Technologies…) is showing up here. To confirm that your device is acting as a modem as not as removable storage, you need to edit the modeswitch config file. For this, you need the DefaultVendor and DefaultProduct parameters, which usually can be found by going a quick Google search for ‘<<Dongle Model Number>> usb_modeswitch’.<\/p>\n\n\n\n \n \n \n \n \n\n\n\n\n sudo<\/code> nano <\/code>\/etc\/usb_modeswitch<\/code>.conf<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n\n\n\nAt the bottom of this file, add the following lines:<\/p>\n\n\n\n \n \n \n \n \n\n\n\n\n DefaultVendor = 0x<<VendorID>><\/code><\/div>\nDefaultProduct = 0x<<ProductID>><\/code><\/div>\nMessageEndPoint = <\/code>\"0x01\"<\/code><\/div>\nMessageContent = <\/code>\"55534243000000000000000000000011060000000000000000 000000000000\"<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n\n\n\nWhere <<VendorID>> and <<ProductID>> are the information you found online. Sometimes, they are revelaed in the lsusb command, but you must ensure that they are correct (i.e. actually a modem). In my lsusb, the VendorID is 19d2 and the ProductID is 0031 but in my modeswitch config file, I enter 0103 for my ProductID.<\/p>\n\n\n\n Connecting to the cellular network:<\/h3>\n\n\n\nWe installed UMTSkeeper earlier, who’s job it is to automatically connect (and re-connect should the connection drop out) the 3G connection. This uses sakis3g to do that. It’s prudent to check the 3G connection before we script the connection automatically with UMTSkeeper .<\/p>\n\n\n\n Firstly, we need to sakis3g and utmskeeper executable.<\/p>\n\n\n\n \n \n \n \n \n\n\n\n\n sudo<\/code> chmod<\/code> +x <\/code>\/opt\/umtskeeper\/sakis3g<\/code><\/div>\nsudo<\/code> chmod<\/code> +x <\/code>\/opt\/umtskeeper\/umtskeeper<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n\n\n\nThen, we can run sakis3g with the interactive <\/em>flag to test our 3G connection:<\/p>\n\n\n\n\n \n \n \n \n\n\n\n\n sudo<\/code> .<\/code>\/sakis3g<\/code> --interactive<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n\n\n\nThis will guide you through the process of connecting to the internet using your 3G Modem.<\/p>\n\n\n\n - Choose ‘Connect with 3G’<\/li>
- In the ‘Select Modem Type’, choose ‘1. USB device’<\/li>
- Under ‘Please select USB modem’, select your USB Modem (in my case, it’s ZTE WCDMA Technologies MSM).<\/li>
- Under ‘Please select an APN’, either choose your carrier’s APN or select ‘Custom APN’ (in my case, it’s offered ‘Mobile Device (three.co.uk)’ which I know is the correct APN’<\/li>
- You should receive a notification confirming the device is connected. In my case, it says ‘MF112 connected to 3’.<\/li>
- Under ‘Please select an action’, click ‘Exit’ and you will return to the command line.<\/li><\/ol>\n\n\n\n
To make sure the device is actually connected:<\/p>\n\n\n\n \n \n \n \n \n\n\n\n\n pi@raspberrypi:<\/code>\/opt\/umtskeeper<\/code> $ <\/code>ifconfig<\/code><\/div>\nppp0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500<\/code><\/div>\n <\/code>inet 10.120.8.29 netmask 255.255.255.255 destination 10.64.64.64<\/code><\/div>\n <\/code>ppp txqueuelen 3 (Point-to-Point Protocol)<\/code><\/div>\n <\/code>RX packets 6 bytes 102 (102.0 B)<\/code><\/div>\n <\/code>RX errors 0 dropped 0 overruns 0 frame 0<\/code><\/div>\n <\/code>TX packets 7 bytes 141 (141.0 B)<\/code><\/div>\n <\/code>TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n\n\n\nNow we’ve proven the connection, we need to automate it. Let’s disconnect from 3G to not waste that data! Hop back in to the sakis3g interactive session and select ‘Disconnect’.<\/p>\n\n\n\n In doing this, we’ve established some settings we’ll need to use with UTMSkeeper. We’ve established that:<\/p>\n\n\n\n - The APN is three.co.uk<\/em><\/li>
- The APN does not require a username or password
<\/em><\/li>- The USB Modem is running correctly<\/li><\/ul>\n\n\n\n
We can run that connection in one command:<\/p>\n\n\n\n \n \n \n \n \n\n\n\n\n sudo<\/code> \/opt\/umtskeeper\/sakis3g<\/code> connect --nostorage --pppd APN=<\/code>\"three.co.uk\"<\/code> APN_USER=<\/code>\"0\"<\/code> APN_PASS=<\/code>\"0\"<\/code> USBINTERFACE=<\/code>\"19d2:0031\"<\/code> USBDRIVER=<\/code>\"option\"<\/code> OTHER=<\/code>\"USBMODEM\"<\/code> USBMODEM=<\/code>\"19d2:0031\"<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n\n\n\nHere are the components of that command:<\/p>\n\n\n\n - APN – the APNof your carrier<\/li>
- APN_USER – the APN user of your carrier. If you didn’t need one, enter 0<\/li>
- APN_PASS – the APN password of your carrier. If you didn’t need one, enter 0<\/li>
- USBINTERFACE – the ID of your USB Modem, found above when we did lsusb<\/em>.<\/li>
- USBMODEM – also the ID of your USB Modem<\/li><\/ul>\n\n\n\n
So running that command connects the device up to the internet again. We can confirm this by performing ifconfig<\/em> again. Now we’ve confirmed the parameters we need for UMTSkeeper. To disconnect, just run sakis3g with disconnect.<\/p>\n\n\n\n
|
|
| | | | | |