Finally, I’ve had some success in making UMTS on Archos G9 in Plasma Active work. In this post I describe the steps I did for, at first manually, enabling UMTS, how to automate this, and some useful techniques for debugging WWAN.
The hardware I use is a Archos G9 tablet and the Archos 3G UMTS stick. This stick plugs into a standard USB port of the tablet and integrates seamlessly with the case of the Archos G9 series.
At first it has to be noted that the Archos 3G UMTS stick has two operating modes: a storage and a 3G mode. In the storage mode the stick is detected as a usual USB mass storage device. The storage mode is the default mode. In order to operate it as a WWAN adapter the mode has to be switched to 3G first.
This mode switching can be done with a tool like usb_modeswitch. You can grab a compiled version from one of my repositories. To install it on your device the easiest way is to add that repository and then install usb-modeswitch via zypper as follows:
zypper ar http://repo.pub.meego.com/home:/wonko:/CE:/MW:/Shared/Mer_Core_armv7l/home:wonko:CE:MW:Shared.repo zypper in usb-modeswitch
Then, after installing usb-modeswitch the mode of the stick can be switched. First of all, check which mode it is in using lsusb:
[root@localhost ~]# lsusb Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 009: ID 1bbb:f000 T & A Mobile Phones
Here you can see the Archos 3G stick with vendor id “1bbb” and product id “1fff”. For switching to 3G mode the following command can be used:
usb_modeswitch -s 3 -v 0x1bbb -p 0xf000 -V 0x1bbb -P 0x00b7 -M 5553424308a05984c000000080000606f50402527000000000000000000000
After this the product id should have changed to “00b7″. You can verify this with the following command:
[root@localhost ~]# lsusb Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 009: ID 1bbb:00b7 T & A Mobile Phones
Please note that after waking your tablet from suspend the UMTS stick will be reset to storage mode. So, after resuming it you need to switch the mode again.
Kernel and Modules
At this stage it might happen that the hso kernel module gets automatically loaded. You can check this with lsmod. If the hso module got loaded you should see some new devices in /dev: /dev/ttyHSx, with x being 0-3 or 4.
Even though, the hso module is for operating WWAN USB sticks like the Archos 3G stick I couldn’t get 3G working here using this module. I might give it another try later as I got some indication that it should work via this module as well, but so far I used a different approach.
I used the generic usbserial module. This, however, required to build a custom kernel as the stock Plasma Active kernel does not come with the required settings. You can get this kernel from one of my repositories. For the sake of brevity, I will not cover the custom kernel installation procedure here. Feel free to send me a note if you still like hands-on instructions on that one, I will then post more detailed instructions in another post.
The usbserial kernel module has to be loaded as follows. Note that you have to do this before you switch the stick to 3G mode as described above as this could yield the hso module to be automatically loaded:
modprobe usbserial vendor=0x1bbb product=0x00b7
After the module had been loaded the stick can be switched to 3G mode. Now there should be new devices in /dev that are named ttyUSBx.
Once the /dev/ttyUSBx devices had been set up, first, basic tests can be made. It is possible to directly read from these devices, e.g., with cat. Writing to these devices can be done, e.g., with echo. I found this information on this web page. Via this you can use AT commands to control the UMTS stick.
So, to do the first tests you can just open one shell (I suggest using SSH) and issue cat on one of these devices (either /dev/ttyUSB3 or /dev/ttyUSB4 will do) and use another shell to echo AT commands into the device. You will also notice that /dev/ttyUSB3 outputs some information in regular intervals.
Useful commands are, e.g.:
echo "AT+^M" > /dev/ttyUSB4 # As a very simple test. echo "AT+CPIN=?^M" > /dev/ttyUSB4 # To check if a pin needs to be entered. echo "AT+CPIN=XXXX^M" > /dev/ttyUSB4 # To unlock a device using pin XXXX. echo "AT+CLCK=\"SC\",0,\"XXXX\"^M" > /dev/ttyUSB4 # To disable the pin (pin being XXXX). echo "AT+CLCK=\"SC\",2^M" > /dev/ttyUSB4 # To check the pin enabled state.
I got the information on disabling the pin from this web site.
Note that I disabled the pin. I don’t know if this is required but I found that it works better this way.
Until now, what we did is to just prepare the system so that we can actually use the hardware. But you still need to configure your provider specific settings. The easiest way to get a basic configuration is to use the network manager applet. There you enter the settings and simply add a new broadband connection.
Even though, I could get a configuration this way, I noticed that I still needed to some manual changes. The following listing shows my configuration file which is located beneath /etc/NetworkManager/system-connections:
[root@localhost ~]# cat /etc/NetworkManager/system-connections/simyo\ Internet [connection] id=simyo Internet uuid=e0dca2bc-bb07-49b2-a4d4-4b47deefd479 type=gsm autoconnect=false [ppp] lcp-echo-failure=5 lcp-echo-interval=30 [ipv6] method=ignore [ipv4] method=auto [gsm] number=*99# username=simyo password=simyo apn=internet.eplus.de
Note that I removed the pin entry. As I decided to deactivate the pin in the SIM card as described above the pin is not necessary anyhow. Please also note that it can take up to something like 20 seconds or so until the 3G stick appears in the network management applet after the UMTS stick mode had been switched to 3G.
Also note that I had to update ModemManager to a more recent version in order to get everything to work. You can get this version (0.5.4) from yet another one of my repositories.
Debug Network Manager etc.
I encountered quite a number of different errors while messing with this. I found that the NetworkManager web site has pretty good hints for debugging.
Two deamons are primarily involved here: NetworkManager and modem-manager. These do the major parts for setting up and controlling 3G connections.
In the following I just summarize the steps I found most helpful. I suggest that you use at least three shells: one for debugging NetworkManager, one for debugging modem-manager, and one for issuing commands.
The commands I used for debugging NetworkManager and modem-manager respectively were as follows:
killall -9 NetworkManager && NM_PPP_DEBUG=1 /usr/sbin/NetworkManager --no-daemon killall -9 modem-manager && modem-manager --debug
These commands do the following: kill the existing deamon instance and restart a new instance with debugging output turned on.
I suggest to start with NetworkManager. Please note that killing NetworkManager results in the loss of all network connections. However, as you instantly re-start it, you just need to wait a few seconds for the connection to come up again (So, don’t close a SSH shell but wait a little bit until the connection recovers.). This way you can then interactively see what it happening.
Last but not least, we want a little bit more comfort than messing with cryptic and long shell commands all the time. Automating this is actually very simple and just requires to add some simple files.
First of all we need to load the usbserial module and also set its parameters. The following listing shows the two files that are required for achieving this:
[root@localhost ~]# cat /etc/modules-load.d/usbserial.conf usbserial [root@localhost ~]# cat /etc/modprobe.d/archos-3g-stick.conf options usbserial vendor=0x1bbb product=0x00b7
Finally, we need to switch the UMTS stick to 3G mode. In order to automate this we use a simple udev rule:
[root@localhost ~]# cat /lib/udev/rules.d/95-archos-3g-stick.rules # The Archos 3G UMTS stick operates in two different modes: storage and 3G. # After plugging the stick in it is in storage mode. # In order to use the 3G functionality the 3G mode has to be enabled. # This rule tries to do this automatically. KERNEL=="sg0", RUN+="/usr/sbin/usb_modeswitch -s 3 -v 0x1bbb -p 0xf000 -V 0x1bbb -P 0x00b7 -M 5553424308a05984c000000080000606f50402527000000000000000000000"
Note that after suspend the stick is again in storage mode and needs to be switched to WWAN mode again. This rule handles this situation automatically.