Monday, December 01, 2008

Howto: Ubuntu 8.10, Dell 5530, 3G/WWan and GPS

There is an updated howto on the Dell 5530 using my own python based monitoring tool at http://blog.bjw.me.uk/2009/03/dell-5530ericsson-f3507g-on-linux.html

Introduction

Here is a Howto document for getting the Dell 5530 wwan card working along with the onboard GPS under Ubuntu 8.10. This card does not work conveniently with the bundled Network Manager software, but replacing NetworkManager with other utilities will give the ability to get online using a pretty GUI and not have to resort to using wvdial and the command line...

It should also work with the Ericsson f3507g as I believe the Dell 5530 is a rebadged version of this module.

Check Hardware

First you need to check the modem is detected correctly. On my computer, the modem is detected out of the box by the cdc_acm module and exposes three serial ports (/dev/ttyACM[0,1,2]) for communication. Check by running:

dmesg | grep ACM

Mine shows the following:


[ 34.385302] cdc_acm 1-6:1.1: ttyACM0: USB ACM device
[ 34.390039] cdc_acm 1-6:1.3: ttyACM1: USB ACM device
[ 34.401983] cdc_acm 1-6:1.9: ttyACM2: USB ACM device


Install and Configure wvdial

Next, you need to ensure you can get online using the terminal and wvdial - you will only need to use wvdial to switch the radio on and off - something that can easily be added to Ubuntu's Gnome menu.

Using apt, install wvdial:

sudo apt-get install wvdial

I have written a wvdial script which uses /dev/ttyACM0 for reading the signal quality and switching the device on and off. /dev/ttyACM1 is used exclusively for ppp and /dev/ttyACM2 is used exclusively for the GPS.


[Dialer Defaults]
New PPPD = yes
Stupid Mode = 1
Modem Type = USB Modem

#[Dialer PIN]
#Init1 = AT+CPIN=

[Dialer signal]
Modem = /dev/ttyACM0
Init1 = AT+CSQ
Init2 = AT+COPS?

[Dialer gps]
Modem = /dev/ttyACM2
Init1 = AT*E2GPSCTL=1,2,1
Init2 = AT*E2GPSNPD

[Dialer on]
Modem = /dev/ttyACM0
Init1 = AT+CFUN=1

[Dialer off]
Modem = /dev/ttyACM0
Init1 = AT+CFUN=4

[Dialer connect]
Modem = /dev/ttyACM1
Init1 = AT
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Baud = 460800
ISDN = 0
Phone = *99***1#
Password = web
Username = web


This script allows the following commands to be run:






wvdial onSwitch Radio On
wvdial offSwitch Radio Off
wvdial signalShow signal quality, network provider and signal connection (HSPA/3g/GPRS)
wvdial connectConnects to the mobile network
wvdial gpsEnables GPS NMEA message output on /dev/ttyACM2 outputting a new message every 2 seconds


Make sure you can switch your radio on and connect to the internet. If so, you should also be able to switch the GPS on without effecting your network connection. As a final check, run wvdial signal and you should get information about the signal strength - this is crucial that you can get this information whilst the connection is open as it will help later with UMTSMon.

If you find you cannot connect to the network with wvdial connect without being root or using sudo. Ensure you are in the 'dip' group. You can do this through the "Users and Groups" application in the the Adminstration menu, make sure you unlock to get superuser privileges, highlight your login and press the "Properties" button. In the "User Privileges" tab you can tick the box next to "Use Modems", I also clicked a few more like "Dial out using a modem" which I think adds you to the 'dialout' group which appears to be completely irrelevant to pppd and I presume NetworkManager since it's unchecked by default - WTF?

You might need to logout and back in again or re-source your shell. Check you can dial out using wvdial. This is important so you don't need to run UMTSMon as sudo.

Install UMTSMon

Download a pre-built binary of UMTSMon for Debian from the following page:
http://people.debian.org/~winnie/umtsmon/. Note I had to use dpkg to install this file, the graphical gdebi failed for some reason.

sudo dpkg -i umtsmon_0.9-1_i386.deb

Once it is installed it should appear in your "Internet" Gnome application sub-menu.

Before you run umtsmon, switch your radio on using wvdial on.

I initially ran umtsmon from the command line so run it using umtsmon. During first run it will setup an rc file in your home directory at ~/.umtsmon/umtsmonrc. You may have to add a profile for your network provider - I use Vodafone and found the information I needed online. Once you have the information you need, add it using the Connection>Manage Profiles... menu item. Add a new profile and fill in the information you need. Additionally you can set usage limits for this profile on this page.

Hopefully you will see signal strength in the umtsmon window, but don't click connect just yet as you want to ensure wvdial and umtsmon are compatible. This is so you can switch the radio off, use GPS and view signal strength whilst connected. The first time I used UMTSMon, it used the same serial port for everything and I couldn't see signal strength or switch the card off once online. Close UMTSMon and in the command line edit the following file ~/.umtsmon/umtsmonrc using your favourite editor! Ensure the device section entries for ATPortName and PPPPortName looks like this:


ATPortName=/dev/ttyACM0
PPPPortName=/dev/ttyACM1


This ensures the UMTSMon config is compatible with wvdial.

Add the following entries to your Gnome menu:


wvdial on
wvdial off
wvdial gps


All with options to run in the terminal. The last GPS option will hold onto the terminal for the moment, but once you kill it, the GPS will continue to write NMEA statements for read on /dev/ttyACM2.

GPS

You will need to install gpsd using apt, then run using gpsd /dev/ttyACM2.

I used tangoGPS which I installed from their website at http://www.tangogps.org. Tango can also be configured to use Google Maps data in addition to OpenStreetMap.

NetworkManager alternative

To stop the NetworkManager applet nagging you about the new card it can't use, get rid of it and try Wicd - a much cleaner and faster utility for accessing WiFi networks.
http://wicd.sourceforge.net/

Credits

http://ubuntu-virginia.ubuntuforums.org/showthread.php?t=941079
http://ubuntuforums.org/showthread.php?t=979587
http://www.nabble.com/X301-Ericsson-Modul-f3507g-AT-Command-reference-td20152955.html
http://www.pharscape.org/vodafone-3g-umts-how-to.html#_Toc83808170

29 comments:

Anonymous said...

Thanks for the tutorial: I ended with about the same wvdial conf file. However I cannot manage to have AT+CSEQ and AT+COPS? woking correctly at the same time. Sometimes AT+COPS? gives a correct answer, but then the signal is always 99,99 (however I can connect with Wvdial connect). From time to time I have the right signal strength, but then AT+COPS? yields ERROR?????
This mess causes all the time umtsmon to fail (either no signal strength, or no network: in all cases I cannot connect).
JY

Barry said...

Hi JY,

I think I was having a similar problem yesterday with the AT+CSQ command. UMTSMon wouldn't connect as AT+CSQ was reporting 99,99. However I could connect using wvdial. During the time AT+CSQ was returning 99,99, I was in a 3G area. When I moved into a GPRS area (AT+COPS? has a zero at the end rather than a 2), the AT+CSQ was correctly displaying the signal quality. In this instance, I was able to connect to the internet using UMTSMon.

It seems AT+CSQ doesn't work when the card is in a 3G area, thus failing UMTSMon as it regards AT+CSQ response 99,99 as no signal.

Thanks for the feedback - definitely some issues still! Not quite a finished howto...

Anonymous said...

Thanks for putting this guide together. Is a PIN required for the [Dialer PIN] section of wvdial.conf? I have UMTSMon picking up the signal but it only displays "Searching..."

Barry said...

My SIM didn't need a PIN so I commented out that section of the wvdial.conf.

Sorry, but I'm not sure what happens with a PIN protected SIM and wouldn't want to speculate. If you do need a PIN and have tried it - could you post the results here and I'll update the howto.

Thanks!

Dan said...

I'm not sure I need a PIN, was just wondering if it might have been causing any problems. A bit more digging reveals a few errors when doing a 'wvdial signal' - is this a similar issue to what JY reported above?

d@d-netbook:~$ wvdial signal
--> WvDial: Internet dialer version 1.60
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: AT+CSQ
AT+CSQ
+CSQ: 204,195
OK
--> Sending: AT+COPS?
AT+COPS?
ERROR
--> Bad init string.
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: AT+CSQ
AT+CSQ
+CSQ: 204,195
OK
--> Sending: AT+COPS?
AT+COPS?
ERROR
--> Bad init string.
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: AT+CSQ
AT+CSQ
+CSQ: 204,195
OK
--> Sending: AT+COPS?
AT+COPS?
ERROR
--> Bad init string.

Barry said...

Hi Dan,

I can recreate the problem you have - but only if the radio is off first. I found on my machine every time I suspend the computer and resume, the radio switches itself back off.

Double check with wvdial on before testing the signal again. I found the value displayed in the signal command is sometimes a residual value. Either by entering a 3G area or by switching the radio off manually.


Barry

Dan said...

Thanks Barry, yes you were correct the radio was not on.

After turning it on I can now successfully get a signal back:

--> WvDial: Internet dialer version 1.60
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: AT+CSQ
AT+CSQ
+CSQ: 99,99
OK
--> Sending: AT+COPS?
AT+COPS?
+COPS: 0,0,"vodafone UK",2
OK
--> Modem initialized.
--> Configuration does not specify a valid phone number.
--> Configuration does not specify a valid login name.
--> Configuration does not specify a valid password.

But then although a 'wvdial connect' seems to make a connection there is an error regarding pppd - have you seen this one before?

d@d-netbook:~$ wvdial connect
--> WvDial: Internet dialer version 1.60
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: AT
AT
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
--> Modem initialized.
--> Sending: ATDT*99***1#
--> Waiting for carrier.
ATDT*99***1#
~[7f]}#@!}!}!} }9}#}%B#}%}(}"}'}"}"}&} } } } }%}&}01H,< a~
CONNECT
--> Carrier detected. Starting PPP immediately.
--> Unable to run /usr/sbin/pppd.
--> Check permissions, or specify a "PPPD Path" option in wvdial.conf.
~[7f]}#@!}!}"} }9}#}%B#}%}(}"}'}"}"}&} } } } }%}&}01H,p[0c]~~[7f]}#@

Barry said...

I think you have a permissions problem with pppd. The ppp daemon needs to run with superuser privileges.

You need to check you are in the 'dip' group. You can do this through the "Users and Groups" application in the the Adminstration menu in Ubuntu. Make sure you unlock to get superuser privileges, highlight your login and press the "Properties" button. In the "User Privileges" tab you can tick the box next to "Use Modems", I also clicked a few more like "Dial out using a modem" which I think adds you to the 'dialout' group.

BTW - You have the same problem I'm running into - as soon as the card registers with Vodafone's 3G network, the signal strength goes to 99,99. UMTSMon reads this 99,99 as a failure to connect and doesn't allow you to dial up. However, wvdial connect works perfectly!

I'm working on this last problem...

Dan said...

Cheers Barry, that solved that problem! I have one more permissions problem however.. A 'wvdial connect' now gives:

dan@dan-netbook:~$ wvdial connect
--> WvDial: Internet dialer version 1.60
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: AT
AT
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
--> Modem initialized.
--> Sending: ATDT*99***1#
--> Waiting for carrier.
ATDT*99***1#
~[7f]}#@!}!}!} }9}#}%B#}%}(}"}'}"}"}&} } } } }%}&!&7b}3`~
CONNECT
--> Carrier detected. Starting PPP immediately.
--> Starting pppd at Tue Dec 9 12:49:41 2008
--> Warning: Could not modify /etc/ppp/pap-secrets: Permission denied
--> --> PAP (Password Authentication Protocol) may be flaky.
--> Warning: Could not modify /etc/ppp/chap-secrets: Permission denied
--> --> CHAP (Challenge Handshake) may be flaky.
--> Pid of pppd: 8957
--> Using interface ppp0
--> pppd: X^G �eG
--> pppd: X^G �eG
--> pppd: X^G �eG
--> pppd: X^G �eG
--> pppd: X^G �eG
--> pppd: X^G �eG
--> pppd: X^G �eG
--> Disconnecting at Tue Dec 9 12:49:46 2008
--> The PPP daemon has died: A modem hung up the phone (exit code = 16)
--> man pppd explains pppd error codes in more detail.
--> Try again and look into /var/log/messages and the wvdial and pppd man pages for more information.
--> Auto Reconnect will be attempted in 5 seconds

Any idea how I should set PAP and CHAP permissions?

Barry said...

Both of those files are owned by the group 'dialout'. So you will need to be a member of the 'dialout' group so pppd be able to read or write to these files using your account.

Dan said...

Do I have to create a dialout group Barry? Because when I do:

dan@dan-netbook:~$ sudo adduser dan dialout
adduser: The group `dialout' does not exist.

Barry said...

It depends on the permissions of the files with ls -al in /etc/ppp. On my system I get:

-rw-rw---- 1 root dialout 90 2008-12-08 15:43 chap-secrets
-rw-rw---- 1 root dialout 90 2008-12-08 15:43 chap-secrets

Dan said...

Thanks again, got that going now but does anyone else have an issue with the modem hanging up?

dan@dan-netbook:/etc/ppp$ wvdial connect
--> WvDial: Internet dialer version 1.60
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: AT
AT
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
--> Modem initialized.
--> Sending: ATDT*99***1#
--> Waiting for carrier.
ATDT*99***1#
~[7f]}#@!}!}!} }9}#}%B#}%}(}"}'}"}"}&} } } } }%}&[18]^r}8]^~
CONNECT
--> Carrier detected. Starting PPP immediately.
--> Starting pppd at Tue Dec 9 13:38:49 2008
--> Pid of pppd: 12643
--> Using interface ppp0
--> pppd: X>� �E�
--> pppd: X>� �E�
--> pppd: X>� �E�
--> pppd: X>� �E�
--> pppd: X>� �E�
--> pppd: X>� �E�
--> pppd: X>� �E�
--> Disconnecting at Tue Dec 9 13:38:51 2008
--> The PPP daemon has died: A modem hung up the phone (exit code = 16)
--> man pppd explains pppd error codes in more detail.
--> Try again and look into /var/log/messages and the wvdial and pppd man pages for more information.
--> Auto Reconnect will be attempted in 5 seconds
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: AT

Dan said...

Finally got my internet working via vodafone, thanks for all the help Barry,

One thing that still confuses me is the gps.. if I run:

[code]
dan@dan-netbook:~$ gpsd /dev/ttyACM2
dan@dan-netbook:~$ wvdial gps
--> WvDial: Internet dialer version 1.60
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: AT*E2GPSCTL=1,2,1
--> Sending: ATQ0
ATQ0
--> Re-Sending: AT*E2GPSCTL=1,2,1
[02][19]f[1c][08] [04][02] [12][03]o[02]8[0b]q [03]
--> Modem not responding.
[/code]

I can see data coming back but then it stops. How do I get this GPS data to be consantly written out so tangogps can use it?

Patrick said...

I dont understand why gps isnt working for me.

I did what was said above and get the light on when i do wvdial on.
But wvdial gps gives:

--> WvDial: Internet dialer version 1.60
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: AT*E2GPSCTL=1,1,1
--> Sending: ATQ0
--> Re-Sending: AT*E2GPSCTL=1,1,1
--> Modem not responding.

Any ideas? I remember i had output last week, but i dont know how i did that. :D

Barry said...

Hi Patrick,

I had a similar problem a few weeks back. I resolved it by reinserting the SIM after a quick clean. The GPS won't work without a SIM inserted. Does your card dial up to the net?

mgmechanics said...

Thanks for the tutorial!
(1) I had a SIM-Card with PIN. Your wvdial.conf was working for a short time. From one boot to another it stop working - suddenly. I got the the message
"The PPP daemon has died: A modem hung up the phone (exit code = 16)".
tail -f /var/log/messages shows:
Dec 23 08:29:03 michael-pc pppd[6262]: pppd 2.4.4 started by michael, uid 1000
Dec 23 08:29:03 michael-pc pppd[6262]: Using interface ppp0
Dec 23 08:29:03 michael-pc pppd[6262]: Connect: ppp0 <--> /dev/ttyACM1
Dec 23 08:29:03 michael-pc pppd[6262]: Warning - secret file /etc/ppp/pap-secrets has world and/or group access
Dec 23 08:29:03 michael-pc pppd[6262]: Warning - secret file /etc/ppp/chap-secrets has world and/or group access
Dec 23 08:29:03 michael-pc pppd[6262]: CHAP authentication succeeded: Congratulations!
Dec 23 08:29:03 michael-pc pppd[6262]: CHAP authentication succeeded
Dec 23 08:29:03 michael-pc pppd[6262]: LCP terminated by peer
Dec 23 08:29:03 michael-pc pppd[6262]: Modem hangup
Dec 23 08:29:03 michael-pc pppd[6262]: Connection terminated.
Dec 23 08:29:03 michael-pc pppd[6262]: Exit.
"LCP terminated by peer" means that the system on the other end of the line did hang up. But why? - Because the PIN is missing! But how to get rid of the PIN?
- "AT+CPIN=number" returns an error "Bad init string" -> don't work
- the Windows-Software "Vodafone Mobil Connect" don't have the option "don't ask for a PIN" -> don't work
- so i put the SIM-card into my Nokia i1110 cellphone and switch Settings -> Security -> "ask for PIN" -> "off" (german: "Einstellungen" -> "Sicherheitseinstellungen" -> "PIN-Code-Abfrage" -> "Aus") -> that works!
(2) my Ubuntu 8.10 has
ls -al /etc/ppp
-rw------- 1 root root 90 2008-12-08 15:43 chap-secrets
-rw------- 1 root root 90 2008-12-08 15:43 chap-secrets
- i changed it alike your system:
-rw-rw---- 1 root dialout 90 2008-12-08 15:43 chap-secrets
-rw-rw---- 1 root dialout 90 2008-12-08 15:43 chap-secrets
A look into both files reveals no secrets ;-)
(3) after installing umtsmon apt is missing packages - just update your Ubuntu, the it will install the missing packages

Anonymous said...

Hey, me again.

No it doesnt connect. Do i have to active the modul or something? like this? All i did was buying this book and put my SIM of my phone into the slot...
Yesterday it worked for some reason. Today (reboot) it does not. I dont understand why :(

George said...

PIN entry is a bit weird. According to the UMTS docs, AT+CPIN expects a string.
This means you need to use AT+CPIN="xxxx". Yes, those are double quotes around the PIN.

It should work then.

Patrick said...

Hey!

Here my results with Ubuntu 8.10 and the configuration in this thread:

"dmesg | grep ACM"

[ 11.256094] cdc_acm 8-6:1.1: ttyACM0: USB ACM device
[ 11.256894] cdc_acm 8-6:1.3: ttyACM1: USB ACM device
[ 11.257373] cdc_acm 8-6:1.9: ttyACM2: USB ACM device


"wvdial on"

--> WvDial: Internet dialer version 1.60
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: AT+CFUN=1
AT+CFUN=1
OK
--> Modem initialized.
--> Configuration does not specify a valid phone number.
--> Configuration does not specify a valid login name.
--> Configuration does not specify a valid password.

"wvdial gps"--> WvDial: Internet dialer version 1.60
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: AT*E2GPSCTL=1,10,1
AT*E2GPSCTL=1,10,1
--> Sending: ATQ0
--> Re-Sending: AT*E2GPSCTL=1,10,1
--> Modem not responding.

"wvdial signal"

--> WvDial: Internet dialer version 1.60
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: AT+CSQ
AT+CSQ
ERROR
--> Bad init string.

"wvdial connect"



Any idea? I tried to use another SIM card (the actual was delivered my Dell (a vodafine one)) but no change.
I remember like the guy above me, that it worked for the first time i tried it. (I got gps signals) But now it doesnt. I am only interested in getting the gps stuff to work. Any idea what else i can try? I already tried to reinsert the SIM etc. :(

craptree said...

Originally this guide didn't work for me, but after a few small changes, works fine. Here they are...they may be of help to someone.

First I updated to the newest kernel (Update to kernel 2.6.27-11). Now the dell 5530 is detected by the usbserial module (not cdc_acm).

This kernel gives you 10 ttyUSB's in /dev. Most of which don't work, but the following worked for me.

/dev/ttyUSB10 for AT/signal commands
/dev/ttyUSB4 for PPP/connect data
/dev/ttyUSB2 for GPS data

I also changed the dialing phone number to
*99#
and added the following init line
Init3 = AT +CGDCONT=1, "IP", "APN"

Where APN is your networks APN address. In the UK i have found all networks need this string. A good site to find your APN and username/pass data for your network is from http://www.taniwha.org.uk/gprs.html

Good luck! Any questions, mail me at craptee+wwan at gmail dot com

riz

Etienne said...

Good to know.

it works with networkmanager in jaunty now()

Radu - Eosif Mihailescu said...

Thank you for a great and concise tutorial :-) My Dell 5530 in my Latitude E6400 works like a charm now (I'm writing this via that connection).

Keep up the good work,
@Dexter

Anonymous said...

Really a superb guide , my compliments !
With Ubuntu 9.04 the 5530 broadband worked out of the box, it was detected by Ubuntu broadband utility and I just had to write what was my provider in the pop up box.
For Gps once installed gpsd I follow your suggestions and modify wwdial.conf successfully then simply launch in terminal :wvdial gps
Really great !
Thanks again !
Lucamax from Milan - Italy

Anonymous said...

Really a superb guide , my compliments !
With Ubuntu 9.04 the 5530 broadband worked out of the box, it was detected by Ubuntu broadband utility and I just had to write what was my provider in the pop up box.
For Gps once installed gpsd I follow your suggestions and modify wwdial.conf successfully then simply launch in terminal :wvdial gps
Really great !
Thanks again !
Lucamax from Milan - Italy

Anonymous said...

also read this page for gps use

great job barry


Javier Delgado
Lima - Peru

Daddy Steve said...

Thank you Barry.

Running Karmic Kubuntu Netbook on Dell Mini 9 with the 5530.

To get gpsd working I had to load the garmin_gps module.

> modprobe garmin_gps

After that everything worked perfectly. I hope this is useful to the next person who reads this post. If your having trouble with gpsd run

> gpsd -N -D 5 /dev/ttyACM2

and check the output. That's how I found out about the missing module.

Steve.

totalizator said...

Thanks for the config script! Finally I've been able to run Sony Ericsson GC75e PCMCIA card on my vintage Vaio laptop (Arch Linux i586) with it.

The only thing missing was:

lcp-echo-interval=30
lcp-echo-failure=4

Without it I've been disconnected every time, after few minutes and pppd complained about "Lack of LCP echo responses". It works flawlessly now - yay!

PaweĊ‚ said...

i got:

--> Sending: ATQ0
--> Re-Sending: AT*E2GPSCTL=1,2,1
--> Modem not responding.

but after changing in wvdial.conf

[Dialer gps]
Modem = /dev/ttyACM2

to

[Dialer gps]
Modem = /dev/ttyACM0

i started getting responses