Update on Huawei-E172 card and NetworkManager
Minor changes are required in NetworkManager on Fedora-8 to make it work fine with the Huawei-E172 card and the french mobile broadband network provider SFR.
install the latest version of hal-info from updates-testing repository.
if you don't want the usb storage stuff of the card to show up each time you plug it in, add an entry in hal, named /usr/share/hal/fdi/preprobe/20thirdparty/20-huawei.fdi and containing :
<?xml version="1.0" encoding="UTF-8"?>
<deviceinfo version="0.2">
<device>
<match key="storage.bus" string="usb">
<match key="@storage.originating_device:usb.vendor_id" int="0x12d1">
<match key="@storage.originating_device:usb.product_id" int="0x1003">
<merge key="info.ignore" type="bool">true</merge>
</match>
</match>
</match>
</device>
</deviceinfo>
add an udev rule, that will send the PIN code the the card control device upon card insertion, in a file named /etc/udev/rules.d/99-huawei.rules
ACTION=="add", KERNEL=="ttyUSB1", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1003", RUN+="/usr/local/bin/huawei-e172-send-pin $env{DEVNAME}"
create the script file that will send the PIN code to the card, /usr/local/bin/huawei-e172-send-pin
#!/bin/bash if [ -n "$1" -a -c "$1" -a -w "$1" ]; then echo 'at+cpin="1234"' >gt; "$1" fi exit 0
the two previous steps can be replaced by creating a gconf key containing the pin value, system/networking/connections/*/gsm/pin, of type String. But this won't work on the first connection, because NM currently doesn't wait after setting the pin and before the card becomes available for dialing.
--- NetworkManager-0.7.0/src/nm-gsm-device.c.orig 2008-01-09 19:10:50.000000000 +0100
+++ NetworkManager-0.7.0/src/nm-gsm-device.c 2008-04-11 15:02:32.000000000 +0200
@@ -169,7 +169,7 @@
setting = NM_SETTING_GSM (gsm_device_get_setting (NM_GSM_DEVICE (device), NM_TYPE_SETTING_GSM));
- command = g_strdup_printf ("AT+COPS=1,2,\"%s\"", setting->network_id);
+ command = g_strdup ("AT+CGDCONT=1,\"IP\",\"slsfr\"");
nm_serial_device_send_command_string (device, command);
g_free (command);
@@ -268,10 +268,7 @@
setting = NM_SETTING_GSM (gsm_device_get_setting (NM_GSM_DEVICE (device), NM_TYPE_SETTING_GSM));
- if (setting->network_id)
- manual_registration (device);
- else
- automatic_registration (device);
+ manual_registration (device);
}
static void
@@ -440,7 +437,7 @@
guint id;
char *responses[] = { "OK", "ERR", NULL };
- nm_serial_device_send_command_string (device, "ATZ E0");
+ nm_serial_device_send_command_string (device, "ATZ Q0V1E0S0=0&C1&D2");
id = nm_serial_device_wait_for_reply (device, 10, responses, init_done, NULL);
if (id)
with gconf-editor, go to the system/networking/connections/*/ppp entries related to your gsm connection, and toggle the noauth key to true.
restart haldaemon, NetworkManager and the nm-applet, and you should be able to connect to your broadband provider, using NetworkManager.
Update:
It appears that the patch to nm-gsm-device.c above, that modifies the ATZ init string and fixes the SFR APN with AT+CGDCONT is not needed. Defaults values should work just fine.