[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1042
  • Last Modified:

nokia cs-10 on linux fedora

Hi!

I have a Nokia CS-10 broadband modem, but I want to configurate it in Fedora Linux. I make a few scripts of:

http://www.islascruz.org/html/index.php/blog/show/Nokia-Internet-Stick-CS-10-on-Linux.html

But I don't know shows me a error in the script on the line 10.

Or, exist other way to configure my modem?

Thnx a lot!
#!/bin/sh
# Don't eject if flag in place
if [ -f /etc/udev/nokia-zerocd-noeject ]; then
   exit 1
fi
# Extract USB serial into major and minor numbers
minor=`echo $2 | sed 's/.[0-9]*\.//'`
major=`echo $2 | sed 's/\.[0-9]*$//'`
# Compare with current software version
if [ "$major" -gt "0" ] ||  [ "$minor" -gt "10" ]; then
   exit 1
fi
# Clean exit on match
exit 0

Open in new window

0
javiermorquecho
Asked:
javiermorquecho
  • 15
  • 14
1 Solution
 
Duncan RoeSoftware DeveloperCommented:
Line 10 is fine if $major and $minor are both numeric. Other wise you get the error "integer expression expected" - is that what you see? Please post the error you do get otherwise.
The script expects to be able to extract the ttyUSB major and minor numbers from its 2nd argument - how are you calling it? If $2 is not in the required format, you will get an error.
Another approach is to add some diagnostics to the script, then you will soon see what's going on. Post if interested
0
 
javiermorquechoAuthor Commented:
Hi!

Yes, I see "integer expression expected". I'm calling the script from a /etc/udev/rules.d/90-nokia-zerocd.rules; like shows in http://www.islascruz.org/html/index.php/blog/show/Nokia-Internet-Stick-CS-10-on-Linux.html.

With the program and the rules, like said the post, I can make a wvdial connection.

By the way, when I've the modem connected I see the lsusb command results:

Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 005: ID 0421:060c Nokia Mobile Phones
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 003: ID 045e:0745 Microsoft Corp.
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

I've a microsoft mouse too.

I need to eject (or unmount) the device?

Thnx
0
 
Duncan RoeSoftware DeveloperCommented:
You can only umount a device that is mounted. I think you can also eject a device that is mounted (IIRC it does a umount for you) and also I think you can eject a device that is in /etc/fstab whether mounted or not. Eject will send more commands to a device than simple umount and may be necessary to get the changed behaviour mentioned in the link you posted.
The command "mount" will give you a list of all mounted devices, and you can see if Linux thinks it has mounted your phone.
You say you can get a connection with wvdial - do you still have a problem and if so, what?
0
Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

 
javiermorquechoAuthor Commented:
Hi!

When I try the mount command:

[javierMorquecho@localhost ~]$ mount
/dev/sda1 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
gvfs-fuse-daemon on /home/javierMorquecho/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=javierMorquecho)

I cannot see the Nokia phone. In theory (like say the POST), the wvdial command it's OK, but I cannot use that command becouse shows me:

[root@localhost javierMorquecho]# wvdial
--> WvDial: Internet dialer version 1.60
--> Warning: section [Dialer Defaults] does not exist in wvdial.conf.
--> Cannot open /dev/modem: No such file or directory
--> Cannot open /dev/modem: No such file or directory
--> Cannot open /dev/modem: No such file or directory

And I change the file /etc/wvdial.conf, creating a new connection.

Thnx a lot
0
 
Duncan RoeSoftware DeveloperCommented:
How do you change /etc/wvdial.conf? If you are changing references to /dev/modem to mention the actual device, you should instead make a udev rule to create the /dev/modem symbolic link when it sees the phone. /dev/modem is almost always a symbolic link. Even manually you could create that symlink, to test the procedure.
0
 
javiermorquechoAuthor Commented:
Hi!

Like the post ( http://www.islascruz.org/html/index.php/blog/show/Nokia-Internet-Stick-CS-10-on-Linux.html ) said, I create the /etc/udev/rules.d/90-nokia-zerocd.rules file with the rules. But I don't know if the symbolic link that do you say is created.

How I know that the symbolic link is correctly created?

I attach the /etc/udev/rules.d/90-nokia-zerocd.rules code.

Thnx
0
 
Duncan RoeSoftware DeveloperCommented:
I think something went wrong with your attachment - I can't see it anywhere. Udev rules to make symbolic links are separate from other rules, so you likely don't have such a rule right now. I don't have much time right now (morning here) but I can look into that more tonight - I've done it but a while ago.
In the meantime, here's something for you to try. Plug in your phone and identify its entry in /dev. I would expect it to show up as ttyUSBxx (xx some number, maybe 1 digit). Actually, please post what it shows up as. Next, as root:-

cd /dev
ln -sf ttyUSB0 modem

(Here I assume you found the phone as ttyUSB0).
Now, wvdial should "just work"
This test should determine whether it is appropriate to have udev create the symbolic link automatically
0
 
javiermorquechoAuthor Commented:
The code is:

SUBSYSTEMS=="usb", SYSFS{idVendor}=="0421", SYSFS{idProduct}=="060c", ACTION=="add", PROGRAM=="nokia-testcd %M %s{serial}", RUN+="/usr/bin/eject -s %k", OPTIONS+="last_rule"

Open in new window

0
 
Duncan RoeSoftware DeveloperCommented:
Yes you posted that before. Can you try doing what I suggested please. I am not even going to spend time looking for how to get udev to  make a symbolic link and (this takes longer) post my findings until you confirm that it will fix your problem. And if it doesn't fix your problem, I'll be happy to assist you to investigate why, and what to do instead. But first, you must actually try what I've asked for.
0
 
Duncan RoeSoftware DeveloperCommented:
My bad, you didn't post that before, as such. But it's an exact copy from the link you posted. My previous post still stands.
0
 
javiermorquechoAuthor Commented:
Hi!

Excuse me for waste time. In /dev I see only this usb: usbmon0, usbmon1, usbmon2, usbmon3, usbmon4, usbmon5. I don't know if this can to serve. I don't see files like ttyUSBxx.

When I use the command in /dev:

ln -sf ttyUSB0 modem
ln -sf ttyUSB1 modem
ln -sf ttyUSB2 modem
ln -sf ttyUSB3 modem
ln -sf ttyUSB4 modem
ln -sf ttyUSB5 modem

Don't shows me anything. I try with wvdial and shows me:

[root@localhost dev]# wvdial telcel
--> WvDial: Internet dialer version 1.60
--> Cannot open /dev/modem: No such file or directory
--> Cannot open /dev/modem: No such file or directory
--> Cannot open /dev/modem: No such file or directory

Thnx a lot
0
 
javiermorquechoAuthor Commented:
If is best to show:

[root@localhost dev]# ls
agpgart          loop4               ram2      tty0   tty37  tty8
block            loop5               ram3      tty1   tty38  tty9
bsg              loop6               ram4      tty10  tty39  ttyS0
bus              loop7               ram5      tty11  tty4   ttyS1
cdrom            lp0                 ram6      tty12  tty40  ttyS2
cdrom1           lp1                 ram7      tty13  tty41  ttyS3
cdrw             lp2                 ram8      tty14  tty42  urandom
char             lp3                 ram9      tty15  tty43  usbmon0
console          MAKEDEV             random    tty16  tty44  usbmon1
core             mapper              raw       tty17  tty45  usbmon2
cpu              mcelog              rfkill    tty18  tty46  usbmon3
cpu_dma_latency  mem                 root      tty19  tty47  usbmon4
disk             modem               rtc       tty2   tty48  usbmon5
dri              net                 rtc0      tty20  tty49  vcs
dvd              network_latency     scd0      tty21  tty5   vcs1
dvdrw            network_throughput  scd1      tty22  tty50  vcs2
fb               null                sda       tty23  tty51  vcs3
fb0              nvram               sda1      tty24  tty52  vcs4
fd               oldmem              sg0       tty25  tty53  vcs5
full             port                sg1       tty26  tty54  vcs6
fuse             ppp                 sg2       tty27  tty55  vcsa
fw0              ptmx                shm       tty28  tty56  vcsa1
hpet             pts                 snapshot  tty29  tty57  vcsa2
hvc0             ram0                snd       tty3   tty58  vcsa3
input            ram1                sr0       tty30  tty59  vcsa4
kmsg             ram10               sr1       tty31  tty6   vcsa5
log              ram11               stderr    tty32  tty60  vcsa6
loop0            ram12               stdin     tty33  tty61  vga_arbiter
loop1            ram13               stdout    tty34  tty62  watchdog
loop2            ram14               systty    tty35  tty63  zero
loop3            ram15               tty       tty36  tty7

I found the modem file:

[root@localhost dev]# file modem
modem: broken symbolic link to `ttyUSB5'

I cannot find something accord to the modem or USB

Thnx
0
 
Duncan RoeSoftware DeveloperCommented:
Yes, the is no ttyUSB there at all.
Let me get this right. Are you saying you somehow change /etc/wvdial.conf so you get a connection? If so, when you do get wvdial to work, what do you do exactly?
Have you ever got a connection via this modem? It starts to look to me like the failing udev rule results in no device being added to /dev. Again it's morning, I'll try to remember to investigate more tonight.
0
 
javiermorquechoAuthor Commented:
I config wvdial in the /etc/wvdial.conf:

[Dialer telcel]
Init1 = ATZ
Init2 = AT+CFUN=1
Init3 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init4 = AT+CGDCONT=1,"IP","internet.itelcel.com"
Password = webgprs2002
Phone = *99#
Modem Type = Analog Modem
Stupid mode = yes
Baud = 460800
New PPPD = yes
Modem = /dev/modem
ISDN = 0
Username = webgprs
Carrier Check = no
Auto Reconnect = yes

I call it: wvdial telcel

No, hasn't been connection with the modem.

thnx a lot
0
 
Duncan RoeSoftware DeveloperCommented:
Rats! I meant to borrow a USB serial adapter from work to experiment a bit but forgot. Really I'm a bit hazy on the internals of udev. From grepping in /lib/udev, it seems to me that the program most used for usb is usb_id.
Which reminds me ... we never pursued the idea of adding diagnostics to the nokia-testcd script. Want to try that?
0
 
javiermorquechoAuthor Commented:
Hi!

I try some "echo" instructions to test the nokia-testcd script. But the menor and major variables don't show something, are in blank.

I 've downloaded the Linux Debian and Ubunto installation packages:

http://europe.nokia.com/support/product-support/cs-10/software

But doesn't responds me

Thnx
0
 
Duncan RoeSoftware DeveloperCommented:
Remove your script. Get linux_2.10.zip from the above URL (that you just posted). unzip and try following instructions in the README
0
 
Duncan RoeSoftware DeveloperCommented:
Or did you already try that? I really think your script is causing a problem though.
0
 
javiermorquechoAuthor Commented:
Hi!

I follow the linux_2.10.zip instructions (README file) and doesn't responds me the modem.

Too, I removed the script and gives me similar results.

Thnx
0
 
javiermorquechoAuthor Commented:
I ask in the Nokia foroum and doesn't answer me

thnx
0
 
Duncan RoeSoftware DeveloperCommented:
Sorry about the delay in getting back to you - there's been a heatwave here (I think I've caught up on sleep now:)
Below are the diagnostics I'd like you to put at the head of the script, right after #!/bin/bash. You can put these lines at the head of any script, actually. Transcribe comments or not as you prefer.
Not suitable for leaving in scripts from which some output is expected (because all the output goes to the log file)
(I made a version where only standard error is logged - post if you'd like it)
# Substitute ">" for ">>" if you only want the file to show the last invocation.
# the log file grows with ">>" and shows all invocations

exec >> /tmp/$(basename $0).log 2>&1
echo "********************* $0 invoked on $(date) with args \"$@\""
set -x

Open in new window

0
 
javiermorquechoAuthor Commented:
Hi!

I added the script. The script writen a file in the /tmp/ directory with the scripts name, but the file is empty.

Thnx a lot
0
 
Duncan RoeSoftware DeveloperCommented:
Please post the script as amended
0
 
javiermorquechoAuthor Commented:
OK

thnx a lot

#!/bin/sh
# Don't eject if flag in place
exec >> /tmp/$(basename $0).log 2>&1
echo "********************* $0 invoked on $(date) with args \"$@\""
set -x
if [ -f /etc/udev/nokia-zerocd-noeject ]; then
   exit 1
fi
# Extract USB serial into major and minor numbers
minor=`echo $2 | sed 's/.[0-9]*\.//'`
major=`echo $2 | sed 's/\.[0-9]*$//'`
# Compare with current software version
if [ "$major" -gt "0" ] ||  [ "$minor" -gt "10" ]; then
   exit 1
fi
# Clean exit on match
exit 0

Open in new window

0
 
Duncan RoeSoftware DeveloperCommented:
This is absolutely bizarre. There is nothing wrong with your script, it works fine for me (with some made-up arguments).
I think we need to concentrate on getting the script diagnostics to work, then we can see a bit more of what is going on. Verify for yourself that when you run the script by hand as I did, then you get output. Use "ls -l" to check which user is the owner of the log file - you may need to rm it first if you run as a different user. Be sure to rm it again afterwards if that is the case
09:41:08$ ~/tests/ee54.sh xxx 02.99
09:41:18$ cat /tmp/ee54.sh.log
********************* /home/dunc/tests/ee54.sh invoked on Sat Jan 16 09:41:18 EST 2010 with args "xxx 02.99"
+ '[' -f /etc/udev/nokia-zerocd-noeject ']'
++ echo 02.99
++ sed 's/.[0-9]*\.//'
+ minor=99
++ echo 02.99
++ sed 's/\.[0-9]*$//'
+ major=02
+ '[' 02 -gt 0 ']'
+ exit 1
09:41:20$ cat /home/dunc/tests/ee54.sh
#!/bin/sh
# Don't eject if flag in place
exec >> /tmp/$(basename $0).log 2>&1
echo "********************* $0 invoked on $(date) with args \"$@\""
set -x
if [ -f /etc/udev/nokia-zerocd-noeject ]; then
   exit 1
fi
# Extract USB serial into major and minor numbers
minor=`echo $2 | sed 's/.[0-9]*\.//'`
major=`echo $2 | sed 's/\.[0-9]*$//'`
# Compare with current software version
if [ "$major" -gt "0" ] ||  [ "$minor" -gt "10" ]; then
   exit 1
fi
# Clean exit on match
exit 0

Open in new window

0
 
javiermorquechoAuthor Commented:
Excuse me for the time!

I consulted the nokia support and they haven´t a solution for fedora 12.

So, I will try to change the device with my cell phone company.

Do you have other solution?

thnx
0
 
Duncan RoeSoftware DeveloperCommented:
Sounds like a good idea
0
 
javiermorquechoAuthor Commented:

I answer to me
Firstly, I have the USB modem without a  CDROM behavior ( Like is saw in Ubuntu and Debian ). But my Fedora 12  doesn´t.

I used the advice:
http://www.islascruz.org/html/index.php/blog/show/Nokia-Internet-Stick-CS-10-on-Linux.html
But  weren't give me a result.

Before I saw the device with  the command "lsusb" like:Bus 001 Device 005: ID 0421:060c Nokia Mobile Phones
Like  the reference (in the end of this comment), I write the next code in  the /etc/udev/rules.d/SUBSYSTEMS=="usb", SYSFS{idVendor}=="0421", SYSFS{idProduct}=="060c", ACTION=="add", RUN+="/usr/bin/eject -s %k", OPTIONS+="last_rule"
Next  I was reboot the machine. Then, I see the device shining the red light,  and next the green ( brefore I was config a 3G Telcel connection).

Reference:
http://blog.nielshorn.net/2010/02/using-a-nokia-cs-10-gsm-modem-on-slackware/ 

Points to me! hahaha

Anyway thnx
 
0
 
Duncan RoeSoftware DeveloperCommented:
Well done! I did hear others complaining about that modem - great for Windows but screws everybody else. Award yourself the points by all means - but don't delete this Q!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 15
  • 14
Tackle projects and never again get stuck behind a technical roadblock.
Join Now