umtskeeper and sierra wireless 307


8 posts
by p4trykx » Mon Nov 05, 2012 8:31 pm
Hello
I have a very strange problem. I use a 3G modem to connect my Raspi to the internet. I have a modem Sierra Wireless 307 and use sakis3g script. I also use another script umtskeeper which monitors the connection and when it's down reconnects using sakis3g.
The problem is when I use umtskeeper with exact same command as directly form console I get errors. This runs fine.
Code: Select all
sudo ./sakis3g  connect --console APN='CUSTOM_APN' USBINTERFACE='3' USBDRIVER='sierra' USBMODEM='1199:68a3' OTHER='USBMODEM' MODEM='OTHER' CUSTOM_APN='darmowy' APN_USER='user' APN_PASS='pass'"


I pass the exact same parameters to umtskeeper. When I echo the command used to run sakis3g in umtskeeper script before it is invoked I get the same.
Code: Select all
echo "$sakisProg $sakisActors $sakisSwitches $sakisOperators"

this outputs
Code: Select all
sudo ./sakis3g connect --console  APN='CUSTOM_APN' USBINTERFACE='3' USBDRIVER='sierra' USBMODEM='1199:68a3' OTHER='USBMODEM' MODEM='OTHER' CUSTOM_APN='darmowy' APN_USER='user' APN_PASS='pass'


When I hardcoded the above it in the umtskeeper script it all goes well. How is it possible? Maybe it's some kind of a bug? It seems that when run from variables there is some error with loading unloading sierra module.
Posts: 120
Joined: Wed Jan 11, 2012 2:55 pm
by hunternet93 » Tue Nov 06, 2012 3:33 am
Could you post the exact errors you're getting?
Posts: 325
Joined: Mon Dec 12, 2011 4:34 pm
by p4trykx » Tue Nov 06, 2012 10:24 am
I made some more test to rule out other things
Code: Select all
#!/bin/bash

progDir=`dirname $0`
progName=`basename $0`
sakisProg="sudo ${progDir}/sakis3g"

sakisActors="connect"
sakisSwitches="--console"
sakisOperators="APN='CUSTOM_APN' USBINTERFACE='3' USBDRIVER='sierra' USBMODEM='1199:68a3' OTHER='USBMODEM' MODEM='OTHER' CUSTOM_APN='darmowy' APN_USER='user' APN_PASS='pass'"

echo "$sakisProg $sakisActors $sakisSwitches $sakisOperators"

$sakisProg $sakisActors $sakisSwitches $sakisOperators

output is
Code: Select all
./test
sudo ./sakis3g connect --console APN='CUSTOM_APN' USBINTERFACE='3' USBDRIVER='sierra' USBMODEM='1199:68a3' OTHER='USBMODEM' MODEM='OTHER' CUSTOM_APN='darmowy' APN_USER='user' APN_PASS='pass'
Failed to load module " sierra ".
Unable to load driver " sierra " for device "1199:68a3"
Failed to connect.

In this case Sakis3G tries to load and unload(or just load again) the kernel module for sierra wireless module. When I run in debug mode parameters seems to be pass fine.
I looked at the debug and noticed that "sierra" becomes " sierra " (with spaces) and maybe that's why
Code: Select all
pi@raspberrypi ~/3g $ ./test
sudo ./sakis3g connect --console --debug APN='CUSTOM_APN' USBINTERFACE='3' USBDRIVER='sierra' USBMODEM='1199:68a3' OTHER='USBMODEM' MODEM='OTHER' CUSTOM_APN='darmowy' APN_USER='user' APN_PASS='pass'
[07156] [10:47:06] Command line set variable APN to "CUSTOM_APN".
[07156] [10:47:06] Command line set variable USBINTERFACE to "3".
[07156] [10:47:07] Command line set variable USBDRIVER to "sierra".
[07156] [10:47:07] Command line set variable USBMODEM to "1199:68a3".
[07156] [10:47:07] Command line set variable OTHER to "USBMODEM".
[07156] [10:47:07] Command line set variable MODEM to "OTHER".
[07156] [10:47:07] Command line set variable CUSTOM_APN to "darmowy".
[07156] [10:47:08] Command line set variable APN_USER to "user".
[07156] [10:47:08] Command line set variable APN_PASS to "pass".

-------------------------------------------
Sakis3G 0.2.0e running on DEBUG mode.
-------------------------------------------
Tue Nov  6 10:47:08 CET 2012
-------------------------------------------
Command line was: /tmp/sakis3gz.7126.sakis3g "connect" "--console" "--debug" "APN= CUSTOM_APN " "USBINTERFACE= 3 " "USBDRIVER= sierra " "USBMODEM= 1199:68a3 " "OTHER= USBMODEM " "MODEM= OTHER " "CUSTOM_APN= darmowy " "APN_USER= user " "APN_PASS= pass "
Running with PID: 7156


[07156] [10:47:23] Device "1199:68a3" has no storage part.
[07156] [10:47:23] Device 1199:68a3 sysfs dir found: /sys/bus/usb/devices/1-1.3.1/1-1.3.1.2
[07156] [10:47:24] Found already loaded driver "sierra".
[07156] [10:47:24] USBDRIVER variable instructs to use " sierra " instead.




This one works
Code: Select all
#!/bin/bash

sudo ./sakis3g  connect --console APN='CUSTOM_APN' USBINTERFACE='3' USBDRIVER='sierra' USBMODEM='1199:68a3' OTHER='USBMODEM' MODEM='OTHER' CUSTOM_APN='darmowy' APN_USER='user' APN_PASS='pass'


output
Code: Select all
pi@raspberrypi ~/3g $ ./test2
USB 307 connected to Aero2 (26001).


and in the debug there are no additional spaces
Code: Select all
-------------------------------------------
Command line was: /tmp/sakis3gz.12016.sakis3g "connect" "--console" "--debug" "APN=CUSTOM_APN" "USBINTERFACE=3" "USBDRIVER=sierra" "USBMODEM=1199:68a3" "OTHER=USBMODEM" "MODEM=OTHER" "CUSTOM_APN=darmowy" "APN_USER=user" "APN_PASS=pass"
Running with PID: 12046
-------------------------------------------
Environment is:
APN='CUSTOM_APN'
APN_PASS='pass'
APN_USER='user'
CUSTOM_APN='darmowy'
DEBUG='on'
DESKTOP=''
DISPLAY=''
EXTRACTED='/tmp/sakis3gz.12016.sakis3g'
HOME='/root'
Attachments
ok.log.zip
debug from successful start
(6.95 KiB) Downloaded 31 times
debug.log.zip
fail to run
(4.66 KiB) Downloaded 29 times
Posts: 120
Joined: Wed Jan 11, 2012 2:55 pm
by hunternet93 » Tue Nov 06, 2012 2:03 pm
Maybe it's a bug with sakis3g? I'd try filing a bug with them. The sakis3g script should remove the extra spaces etc. automatically, they may need to make a few changes.
Posts: 325
Joined: Mon Dec 12, 2011 4:34 pm
by p4trykx » Tue Nov 06, 2012 5:05 pm
Maybe, but it's a strange behavior. On my laptop it works both ways. I also remember it was working before some update on raspi. I will have to try older releases.

As for reporting to Sakis3g it seems a little abandoned the forum is not working for a long time and there is no response from developer.

For now I just replaced all calls of sakis3g in umtskeepr with hardcoded strings.
Posts: 120
Joined: Wed Jan 11, 2012 2:55 pm
by hunternet93 » Tue Nov 06, 2012 5:12 pm
Ok. I'm guessing there's a bug in one of the scripts that's adding in the extra spaces, causing the modprobe command to not find the module.
Posts: 325
Joined: Mon Dec 12, 2011 4:34 pm
by p4trykx » Wed Nov 07, 2012 8:14 pm
Thanks to Umtskeeper creator I tried to run it without USBDRIVER="sirerra" and this solved the problem.
Posts: 120
Joined: Wed Jan 11, 2012 2:55 pm
by hunternet93 » Wed Nov 07, 2012 8:48 pm
Glad you found a solution!
Posts: 325
Joined: Mon Dec 12, 2011 4:34 pm