RecentChanges TextFormattingRules AllWikiTopics OrphanedWikiTopics ToDoWikiTopics WikiLockList RSS Export2HTML WikiSearch SetUsername StartingPoints Home |
MF627 @May 16, 2013 10:05:32 PM
3G USB donglePackages we will require:
sudo apt-get update Configure postfix as an Internet mail server. Convert from CD-ROM to modemThe '3' 3G USB dongle I'm connecting to my Raspberry Pi is a ZTE MF627. It has two modes, when it's originally plugged in it appears as a USB CD-ROM, for automatically installing software drivers, and has to be ejected before it turns into a network device. When the device is a CD-ROM it's ID is 19d2:2000, when it's a network device the ID is 19d2:0031. Run from udevHere's an easy way to eject the CD-ROM device to turn the dongle into a network device:Create: /etc/udev/rules.d/ZTE_MF627.rules with this contents: SYSFS{idVendor}=="19d2", SYSFS{idProduct}=="2000", RUN+="/usr/bin/eject %k", OPTIONS+="last_rule" Now when the dongle is inserted the udev daemon spots the device and sends the eject command. You can check the device ID with lsusb. We can test the device now with chat: chat -s -v ATZ OK AT+CSQ OK >/dev/ttyUSB2 </dev/ttyUSB2 in the output you'll see the current signal strength. Run pppdFirst we'll create a pppd config file and it's associated modem chat file. Create: /etc/ppp/peers/giffgaff with this contents: /dev/ttyUSB2 Create: /etc/ppp/peers/giffgaff.chat with this contents: ABORT BUSY ABORT 'NO CARRIER' Create: /etc/ppp/ip-up.d/default_route with this contents: #!/bin/sh -e Make it runnable chmod a+x /etc/ppp/ip-up.d/default_route and test with pon giffgaff Run from udevCreate: /usr/local/bin/ZTE_MF627 with this contents: #!/bin/sh -e KERNEL=="ttyUSB0", SUBSYSTEM=="tty", ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="0031", RUN+="/usr/local/bin/ZTE_MF627", OPTIONS+="last_rule"
|