Martin Hecht said: In Germany I have received an "O2 LTE 4G Surf stick" whih is recognized as "ZTE WCDMA Technologies MSM" and carries the labelling "Model: MF821D". I'm using it with Ubuntu 12.04 LTS. Normally I have configured my ethernet and wlan devices manually, i.e. directly in /etc/network/interfaces and I manage them with ifup/ifdown ifconfig. I'm posting my steps to get the stick working here assuming it could be useful for anybody else.
To get the stick working I basically followed the instructions above. I did
# apt-get install usb-modeswitch usb-modeswitch-data modemmanager
plugged in the stick and found it:
# lsusb
...
Bus 001 Device 004: ID 19d2:0326 ZTE WCDMA Technologies MSM
...
That's odd. The 19d2:0326 ID is supposed to be the switched (modem) ID, which would indicate that usb-modeswitch had already done it's job. The unswitched ID of this device should be 19d2:0325. Maybe you could confirm that by looking in e.g. the dmesg output?
What does "lsusb -vd 19d2:0326" look like before and after you do "eject /dev/sr0"?
However, neither editing a file in /lib/udev/rules.d/, nor putting an appropriate file in /etc/usb_modeswitch.d/ did make the stick working. Here http://www.linuxforums.org/forum/wireless-internet/193096-zte-ac682-modem-not-working-ubuntu-12-04-a.html I have found the required hint:
# eject /dev/sr0
caused the stick to switch from the stroage mode to the modem mode. (maybe someone can provide a better way using udev, but at least it is working now). About 60 seconds after ejecting it is ready to be used as a modem.
"eject" is the common command used to switch ZTE devices, so that sounds reasonable. The usb-modeswitch equivalent of eject is "5553424312345678000000000000061b000000020000000000000000000000" if you just want to add a usb-modeswitch configuration for your device.
But it is already there AFAICS. The only issue is that there is a likely typo in the 19d2:0325 entry: The TargetVendor should probably be 0x19d2 instead of 0x12d1
Furthermore, I needed:
# apt-get install wvdial minicom
for my O2 Go Surf & Flat M contract the following parameters (see http://hilfe.o2online.de/t5/Funktionen-Einstellungen/Einstellungen-Mobiltelefon-manuell-einrichten/ta-p/143574) in /etc/wvdial.conf
[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = Analog Modem
New PPPD = yes
Modem = /dev/ttyUSB2
ISDN = 0
Baud = 57600
Ask Password = 0
Dial Command = ATDT
Stupid Mode = 1
Compuserve = 0
Idle Seconds = 0
Init3 = AT+CGDCONT=1,"IP","internet"
Phone = *99#
Password = internet
Username = o2
Auto DNS = 0
actually username is not required by the provider, but wvdial would not accept the config file if username is not in there. To open a connection I use the following script:
#!/bin/bash
# close other connections to avoid routing trouble
ifconfig wlan0 down
ifconfig eth0 down
# start services if not running yet
service modemmanager restart
service network-manager restart
# remind me to plug in the surf stick ;-)
echo insert stick
# wait until it is there and switch to modem mode
while [ ! -e /dev/sr0 ] ; do sleep 1 ; done
echo Stick found
sleep 3
echo ejecting sr0
eject sr0
# be verbose to make the 60 seconds more comfortable...
# we watch syslog to see what's happening
echo "waiting 60s for unlocking of stick (when it's green you can ctrl-c and call wvdial)"
tail -f /var/log/syslog &
for s in $(seq 60) ; do
echo ; echo -n "${s}s: "
sleep 1
done
# hoping that we were waiting long enough (modem-manager asks us to enter the PIN in the meantime) - we stop watching syslog
kill %1
echo
echo to disconnect press ctrl-c
# dial in
wvdial
# after user hits ctrl-c we stop the managers again so that we can manually start other network connections again
service modemmanager stop
service network-manager stop
finally, I had to adapt my firewall settings to allow traffic over the ppp0 interface
I'm still trying to get rid of the network-manager and the modem manager. One step towards this would be to enter the PIN of the SIM card with minicom, but I did not yet manage to do so (and I'm afraid locking down my card completely). Useful links to this topic: http://3g-modem.wikifoundry.com/page/ZTE+AT-commands and here an example for the use of the At commands to force the stick to 4G mode: http://www.eigenmagic.com/2012/03/14/how-to-get-telstra-4g-mobile-broadband-working-with-linux/ Manual for the LTE 4G stick: http://zte.com.au/downloads/manuals/MF821_Manual.pdf (I have found this on google, but I can not access th file from outside Australia, maybe someone can post the AT commands for this model here?)
I can understand your problems with network-manager, but I will recommend that you look closer at recent ModemManager development before giving it up completely. Maybe contributing to make it do what you want is a better option?
Modern LTE/UMTS/CDMA modem management is much more than just connect/disconnect, and traditional static network confgurations will severely limit the usability of these devices. It might be OK for you, but I would not recommend it for the common user. Most people will want some control wrt roaming, LTE/3G/2G network selection/priority, SMS, positioning etc. And they will also want to use the ethernet-like interface instead of PPP to achieve the full LTE speed in both directions. You can of course script all these things yourself (I know - I have done it :-), but using ModemManager does it so much better.
Not that it can't still be improved. But I beleive that it is better to work in that direction than trying to work around it.