Manual network selection



Hi,

Firstly, my environment:

Location: Australia
Modem: ZTE 636
Distribution: Fedora
NM packages: NetworkManager-0.7.2-2.git20091223.fc11.i586.rpm, NetworkManager-
glib-0.7.2-2.git20091223.fc11.i586.rpm, NetworkManager-
gnome-0.7.2-2.git20091223.fc11.i586.rpm

The problem here is that the manual network selection doesn't work at it does 
under Windows. The basic problem is that there appears to be a "sub-network 
id". For example, when the modem is sent the command:

AT+COPS=?

the following response is received (reformatted for readability):

+COPS: (2,"Telstra Mobile","Telstra","50501",2),
       (1,"Telstra Mobile","Telstra","50501",0),
       (1,"3Telstra","3Telstra","50506",2),
       (3,"YES OPTUS","Optus","50502",0),
       (3,"YES OPTUS","Optus","50502",2),
       (3,"vodafone AU","voda AU","50503",2),

Under Windows, to select the first of these networks, it sends the following 
command to the modem:

AT+COPS=1,2,"50501",2

and to select the second:

AT+COPS=1,2,"50501",0

If the device is left to select a default Telstra network, or an unqualified 
"50501" network, it seems to select the "50501,0" network – which is a 2G 
network that is basically unusable. There are 30+ second delays in getting 
responses to DNS name resolutions with "traceroute" showing that the problem 
is in the first hop. To get anything usable, the "50501,2" network is 
required. This functionality is not present in NetworkManager.

In the function "manual_registration" in the file "nm-gsm-device.c" there is 
the code:

command = g_strdup_printf ("AT+COPS=1,2,\"%s\"", nm_setting_gsm_get_network_id 
(setting));

What I have done, and I agree it's an absolutely ugly hack, is to enter, in 
the "Network" field in the network connection editor dialog, the six-digit 
entry "505012" and use a modified version of "nm-gsm-device.c" with the 
following code:

===== start of code snippet =====
static void
manual_registration (NMGsmDevice *device)
{
	NMSettingGsm *setting;
	char *command;
	const char *responses[] = { "OK", "ERROR", "ERR", NULL };
	char *network_id;
	char network_subid;

	setting = NM_SETTING_GSM (gsm_device_get_setting (device, 
NM_TYPE_SETTING_GSM));
	network_id = g_strdup( nm_setting_gsm_get_network_id (setting));

	if( strlen( network_id ) != 6 )
		command = g_strdup_printf ("AT+COPS=1,2,\"%s\"", network_id );
	else
	{	network_subid = network_id[ 5 ];
		network_id[ 5 ] = '\0';
		command = g_strdup_printf ("AT+COPS=1,2,\"%s\",%c", network_id, 
network_subid );
	}

	g_free( network_id );
	modem_wait_for_reply (device, command, 15, responses, responses, 
manual_registration_response, NULL);
	g_free (command);
}
===== end of code snippet =====

What I think is required is:
1) in the network connection editor for GSM devices, have a button which does 
the COPS=? command and present that list to the user;
2) the user can then select which network they want to connect to, with the 
"sub-id" being recorded in the configuration file; and
3) the "manual_registration" function be modified accordingly.

I've tried to do this myself but my knowledge of the Gnome API and environment 
is sadly lacking.

So, is there anyone out there willing to have a go at this. Of course, I'm 
willing to test any modifications.

Cheers,
Kevin


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]