mobilebroadband/gsm_connection test needs Access Point Name (APN)

Bug #1207179 reported by Po-Hsu Lin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Checkbox Provider - Base
Won't Fix
Medium
Unassigned

Bug Description

We have to set the Access Point Name to "internet" for the
service provider Chunghwa Telecom that we used here in Taipei.
Otherwise, the connection cannot be established at all.

This could be done by modify the variable gsm_apn in plugins/environment_info.py,
but it varies depends on different providers.

I think we could make use of the database in nm-connection-editor
which is: /usr/share/mobile-broadband-provider-info/serviceproviders.xml

Tags: scripts
Revision history for this message
Daniel Manrique (roadmr) wrote :

For certification use, we can define per-satellite values for the gsm_apn, in checkbox-message/examples/yantok we could add:

--config=checkbox-satellite/plugins/preseed_info/gsm_apn=internet

add this to the end of CHECKBOX_OPTIONS.

Note that a few more changes would be needed for this to work, if you want to do this we can certainly work on it.

I also looked at the serviceproviders.xml file and the information is a bit strange, for instance for Chunghwa it has this:

<apn value="emome">
                                <plan type="postpaid"/>
                                <usage type="internet"/>
                                <username>web</username>
                                <password>web</password>
                        </apn>

From this I infer the gsm_apn would be "emome". For example, for Bell (which is what I use in Canada), it has three different APNs (I need to use inet.bell.ca):

<apn value="inet.bell.ca">
                                <plan type="postpaid"/>
                                <usage type="internet"/>
                                <name>Internet</name>
                        </apn>
                        <apn value="pda.bell.ca">
                                <plan type="postpaid"/>
                                <usage type="internet"/>
                                <name>Mobile Web</name>
                        </apn>
                        <apn value="pda2.bell.ca">
                                <plan type="postpaid"/>
                                <usage type="internet"/>
                                <name>Mobile Fast Web</name>
                        </apn>

If we can think of a way to extract this from the gsmproviders data, it would be cool; if not, we can preconfigure this per-satellite as mentioned.

Let me know which way you prefer.

Cheers!

Changed in checkbox:
status: New → Incomplete
importance: Undecided → Medium
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

Hello Daniel,
Thanks for your advice, the CHECKBOX_OPTIONS method will be a good one for Lab testers.
But as you mentioned, it will be great to let all tester benefit from the serviceproviders.xml file.

I think if a cell phone could obtain informations like providers from a SIM card, there must be a way to extract these data from it.
So I'll look around to see if there is such a way to achieve this.

And as far as I know, the "emome" APN for Chunghwa Telecom is used for providing extra services form them , not for 3G network. (The 3G network connection cannot be established here with "emome", but it works with "internet")
In serviceproviders.xml, it's the second APN under the Chunghwa Telecom category.

Changed in checkbox:
status: Incomplete → Confirmed
assignee: nobody → Po-Hsu Lin (cypressyew)
Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

I initially thought about this, but the fact is that you would still need to configure the environment, just with different information - the country/network - rather than the APN name for example. So I think the scope of this bug should be to find if we can configure the test automatically using the data on the SIM (a question would be why doesn't Ubuntu itself do that then?).

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

Yeah... it would be easier (and cool) if Ubuntu could do this in advance.

After playing around with it, I figured out that we can extract information from the SIM card by the following steps (Performed on 201202-10527 with SIM card unlocked):

1. Locate your 3G Modem:
The "usb-devices" command told me that my modem is Dell DW5560.
$ find /dev/ -name "*DW5560*"
/dev/serial/by-id/usb-Dell_DW5560_00E4CD51F65F91F0-if09
/dev/serial/by-id/usb-Dell_DW5560_00E4CD51F65F91F0-if03
/dev/serial/by-id/usb-Dell_DW5560_00E4CD51F65F91F0-if01
$ ls -l /dev/serial/by-id/usb-Dell_DW5560_00E4CD51F65F91F0-if01
This one was pointed to /dev/ttyACM0

2. Listening outputs on it
$ sudo cat /dev/ttyACM0

3. Send AT commands[1]
Open a new terminal, set output format to string, and print it out:
$ echo -e "AT+COPS=3,0;+COPS?\r" > /dev/ttyACM0
Set output format to numeric, and print it out:
$ echo -e "AT+COPS="3,2;+COPS?\r" > /dev/ttyACM0

Then we will get the operator name:
+COPS: 0,0,"Chunghwa Telecom",2

And the Mobile Country Code + Mobile Network Code[2]:
+COPS: 0,2,"46692",2

Voilà!!
Now I think it's possible to use the data on the card.
(I'm curious about if the MCC would be different while using this card in other country, which might be an alternative approach to locate the system.)

But it comes with another problem: How to determine which APN should be used?
I have no idea.

[1] http://www.shapeshifter.se/2008/04/30/list-of-at-commands/
[2] http://en.wikipedia.org/wiki/Mobile_country_code

Changed in checkbox:
assignee: Po-Hsu Lin (cypressyew) → nobody
Revision history for this message
Daniel Manrique (roadmr) wrote :

Checkbox already includes the mm-test script, could we check if it extracts the needed information? it already knows how to send AT commands to the modem, so it may be a good start, rather than coding our own it may be easier to extend this.

Revision history for this message
Daniel Manrique (roadmr) wrote :

I'll set this to triaged.
Work to do:

- See if we can modify the mm-test script we include to obtain the provider name.
- Parse the xml file to extract the provider data, including possible APN names (maybe use lxml).
- Think of a way to choose the correct APN. This is a bit of a chicken-and-egg problem. We could just try all available APNs and see if one of them enables pinging an external IP address. But it none of them work, it may be because the modem doesn't work? This needs some thinking.
- If all this works, maybe we can upstream it asking cyphermox for help.

tags: added: scripts
Changed in checkbox:
status: Confirmed → Triaged
Zygmunt Krynicki (zyga)
affects: checkbox → plainbox-provider-checkbox
Changed in plainbox-provider-checkbox:
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.