Page 2 of 3
Re: Mobile Broadband
Posted: Wed Jun 13, 2012 10:42 am
by AndrewS
pygmy_giant wrote:sleep: invalid time interval `1\r'
That indicates the file has been saved with DOS line-endings, rather than UNIX line-endings.
Try using something like Notepad++ and check the script is saved in the correct format

Re: Mobile Broadband
Posted: Wed Jun 13, 2012 10:49 am
by pygmy_giant
possible as I'm shuttling between windows pc and pi via pen drive but have just tried that and get the same error?
Regardless of that, I still can't compile the c file despite re-installing all the recommended wvdial substitute packages without problem.
life shouldn't be this complicated should it?
I'm loosing interest...might just go without mobile broadband on my pi for the moment. If I feel differently I'll come back, but I'm sure more able people than I will be getting Pis in the post soon. Happy to be a follower.
pfft, as the French say.
Re: Mobile Broadband
Posted: Wed Jun 13, 2012 11:34 am
by bredman
How did you edit this script? The \r at the end of the line means that the formatting of the script is corrupted
sleep: invalid time interval `1\r'
The script should be in a plain text file.
It looks like the device /dev/ttyUSB0 does not exist yet. Have you run the C activation program and do you have a flashing light on the modem?
Re: Mobile Broadband
Posted: Wed Jun 13, 2012 11:50 am
by AndrewS
pygmy_giant wrote:life shouldn't be this complicated should it?
It's
much easier when you can just connect your Rpi to the internet via ethernet, and then install packages using apt-get (which I realise you've already said you can't do).
Maybe a future version of the Raspi OS download will come with Mobile Broadband support built in

Re: Mobile Broadband
Posted: Wed Jun 13, 2012 11:53 am
by bredman
I agree that this would be just a couple of minutes work if you had an internet connection available.
Re: Mobile Broadband
Posted: Wed Jun 13, 2012 11:56 am
by pygmy_giant
As previously stated, attempting to compile the c code without wvdial or kernel object unavailable for ARM architecture generates:
/tmp/ccxxyy8W.o: In function `release_usb_device':
huaweiAktBbo.c:(.text+0x20): undefined reference to `usb_release_interface'
huaweiAktBbo.c:(.text+0x54): undefined reference to `usb_close'
/tmp/ccxxyy8W.o: In function `list_devices':
huaweiAktBbo.c:(.text+0x94): undefined reference to `usb_get_busses'
/tmp/ccxxyy8W.o: In function `find_device':
huaweiAktBbo.c:(.text+0x148): undefined reference to `usb_get_busses'
/tmp/ccxxyy8W.o: In function `main':
huaweiAktBbo.c:(.text+0x328): undefined reference to `usb_init'
huaweiAktBbo.c:(.text+0x32c): undefined reference to `usb_find_busses'
huaweiAktBbo.c:(.text+0x330): undefined reference to `usb_find_devices'
huaweiAktBbo.c:(.text+0x384): undefined reference to `usb_open'
huaweiAktBbo.c:(.text+0x3ec): undefined reference to `usb_get_descriptor'
huaweiAktBbo.c:(.text+0x428): undefined reference to `usb_get_descriptor'
huaweiAktBbo.c:(.text+0x464): undefined reference to `usb_get_descriptor'
huaweiAktBbo.c:(.text+0x4b8): undefined reference to `usb_control_msg'
huaweiAktBbo.c:(.text+0x4e0): undefined reference to `usb_close'
collect2: ld returned 1 exit status
despite my installing and re-installing the packages suggested to me.
as for the bash script, I have edited it and saved it with notepad++ and saved it in the unix bash format but I still get that \r error ?!
I question whether this approach is possible without wvdial
Has anyone else got mobile broadband working?
If so, how?
Re: Mobile Broadband
Posted: Wed Jun 13, 2012 12:08 pm
by bredman
Your problems with the C program have NOTHING to do with wvdial or anything similar.
It is complaining that it cannot find the USB library libusb-dev. That is your only problem.
Re: Mobile Broadband
Posted: Wed Jun 13, 2012 12:11 pm
by pygmy_giant
thanks, but I have re-installed that package with the correct dependancies without any error messages so I can't understand why it won't find what its looking for - do I have to re-boot or sync or something?
I'll try compiling it from the boot directory in case its a file path problem
Re: Mobile Broadband
Posted: Wed Jun 13, 2012 12:20 pm
by bredman
Try this command to see if you have libusb-dev installed correctly...
find /usr/lib -name "*usblib*"
I assume that you are trying to do the compilation in your home directory or similar. Do not try to compile within the /boot directory.
Re: Mobile Broadband
Posted: Wed Jun 13, 2012 12:36 pm
by pygmy_giant
root@raspberrypi:~# dpkg -i /root/Desktop/3g/libusb-dev_0.1.12-16_armel.deb
(Reading database ... 46708 files and directories currently installed.)
Preparing to replace libusb-dev 2:0.1.12-16 (using .../libusb-dev_0.1.12-16_armel.deb) ...
Unpacking replacement libusb-dev ...
Setting up libusb-dev (2:0.1.12-16) ...
Processing triggers for man-db ...
root@raspberrypi:~# gcc /root/Desktop/3g/huaweiAktBbo.c -o huaweiAktBbo.out
/tmp/cccP6aKE.o: In function `release_usb_device':
huaweiAktBbo.c:(.text+0x20): undefined reference to `usb_release_interface'
huaweiAktBbo.c:(.text+0x54): undefined reference to `usb_close'
/tmp/cccP6aKE.o: In function `list_devices':
huaweiAktBbo.c:(.text+0x94): undefined reference to `usb_get_busses'
/tmp/cccP6aKE.o: In function `find_device':
huaweiAktBbo.c:(.text+0x148): undefined reference to `usb_get_busses'
/tmp/cccP6aKE.o: In function `main':
huaweiAktBbo.c:(.text+0x328): undefined reference to `usb_init'
huaweiAktBbo.c:(.text+0x32c): undefined reference to `usb_find_busses'
huaweiAktBbo.c:(.text+0x330): undefined reference to `usb_find_devices'
huaweiAktBbo.c:(.text+0x384): undefined reference to `usb_open'
huaweiAktBbo.c:(.text+0x3ec): undefined reference to `usb_get_descriptor'
huaweiAktBbo.c:(.text+0x428): undefined reference to `usb_get_descriptor'
huaweiAktBbo.c:(.text+0x464): undefined reference to `usb_get_descriptor'
huaweiAktBbo.c:(.text+0x4b8): undefined reference to `usb_control_msg'
huaweiAktBbo.c:(.text+0x4e0): undefined reference to `usb_close'
collect2: ld returned 1 exit status
root@raspberrypi:~# find /usr/lib -name "*usblib"
root@raspberrypi:~#
Re: Mobile Broadband
Posted: Wed Jun 13, 2012 12:40 pm
by bredman
Found your problem...
The gcc command needs the -lusb option to tell it to read the USB library.
Please read the original instructions.
Re: Mobile Broadband
Posted: Wed Jun 13, 2012 12:42 pm
by pygmy_giant
thanks for your patience

Re: Mobile Broadband
Posted: Wed Jun 13, 2012 12:43 pm
by bredman
Also, did you realise that you are running as root? This will cause major problems. For the gcc command, your are creating an executable that is owned by root and cannot be executed by a normal user.
Exit root and use sudo if you NEED extra permissions for any particular command.
Re: Mobile Broadband
Posted: Wed Jun 13, 2012 1:08 pm
by pygmy_giant
all done - thanks all - just need to sort out that /r problem - have to go out now, will attempt this evening...
Re: Mobile Broadband
Posted: Wed Jun 13, 2012 10:34 pm
by pygmy_giant
Typed the script out in leafpad to remove mystery carriage returns....
....now I get:
/usr/sbin/pppd: The remote system is required to authenticate itself
/usr/sbin/pppd: but I couldn't find any suitable secret (password) for it to use to do so.
so I guess that's progress....(!)
Re: Mobile Broadband
Posted: Wed Jun 13, 2012 10:56 pm
by pygmy_giant
How I got here with my Huawei E220:
packages used:
http://packages.debian.org/squeeze/armel/ppp/download
http://packages.debian.org/squeeze/libpcap0.8
http://packages.debian.org/squeeze/arme ... v/download
code run:
www.kanoistika.sk/bobovsky/archiv/umts/huaweiAktBbo.c
(compile with gcc -lusb huaweiAktBbo.c -o huaweiAktBbo.out)
commandline typed:
rmmod usb-storage
mknod /dev/ttyUSB1 c 188 1
mknod /dev/ttyUSB2 c 188 2
modprobe usbserial vendor=0x12d1 product=0x1003
./huaweiAktBbo.out
BASH Script run:
#!/bin/sh
DEV=/dev/ttyUSB0
echo "ATZ" >$DEV
head -n 2 $DEV
echo 'AT+CGDCONT=1,"IP","???????"' >$DEV
head -n 2 $DEV
echo 'ATD*99***1#' >$DEV
head -n 2 $DEV
sleep 1
/usr/sbin/pppd debug nodetach 460800 $DEV
changing the "???????" to APN
Re: Mobile Broadband
Posted: Thu Jun 14, 2012 8:19 am
by bredman
pygmy_giant wrote:/usr/sbin/pppd: The remote system is required to authenticate itself
/usr/sbin/pppd: but I couldn't find any suitable secret (password) for it to use to do so.
Did you remember to turn off the PIN on the SIM card?
Also, google for wvdial and the APN of your provider just in case your provider needs a username and password.
Re: Mobile Broadband
Posted: Thu Jun 14, 2012 11:49 am
by pygmy_giant
Thanks again bredman
Don't think my SIM PIN is active - will check
I'm with 3
APN= three.co.uk
Username = three
Password = three
(
http://polishlinux.org/linux/ubuntu/thr ... ntu-linux/)
not sure how to pass this info to linux - do I insert
Username = three
Password = three
it in the bash script?
Re: Mobile Broadband
Posted: Thu Jun 14, 2012 12:07 pm
by bredman
pygmy_giant wrote:do I insert
Username = three
Password = three
it in the bash script?
This is not something I ever had to do, but it does not belong in this bash script.
Check if the following files exists
/etc/ppp/peers/mobile-auth
If it does, you should add these lines to the file.
user "your_usr"
password "your_pass"
Note that I have never tried this myself, I just found it by googling your problem.
Re: Mobile Broadband
Posted: Thu Jun 14, 2012 12:19 pm
by pygmy_giant
Thanks Bredman, will try this evening....
Re: Mobile Broadband
Posted: Thu Jun 14, 2012 8:23 pm
by pauly24
I've installed the packages as pygmy_giant mentioned. (ppp, libpcap and libusb-dev)
I download the and compile the huaweiAktBbo code, then when I run the code with "./huaweiAktBbo.out" it says:
Hladem HUAWEI E220 a prepnem na modem - bbo 06
huaweiAktBbo.out: huaweiAktBbo.c:113: main: Assertion `dev' failed.
Aborted
Any clues?
Re: Mobile Broadband
Posted: Thu Jun 14, 2012 8:54 pm
by bredman
You would have to look at line 113 of the program, but I would guess that it is trying to open a device such as /dev/ttyUSB0 and cannot find it.
Try the command
ls /dev/ttyUSB*
and you should see 3 devices (0 to 2).
If not, unplug the modem and try again.
Re: Mobile Broadband
Posted: Thu Jun 14, 2012 8:57 pm
by pauly24
My modem wasn't plugged in when trying to run the huaweiAktBbo.c code... so the code works fine now.
Anyways so now I've made the connection script and tried to run it, but its giving me permission denied,
Did some searching, used chmod 755. Ran the script and it just hangs.
Re: Mobile Broadband
Posted: Thu Jun 14, 2012 9:11 pm
by bredman
It is a very bad idea to login as root unless you really really really understand the consequences. You will just cause yourself more trouble in the long run. Every command you enter now will risk setting something else in the system with the wrong ownership, and make it harder to fix afterwards.
Please use sudo if you need permission for something.
Edit: This is in response to text that has just been deleted, but is still good advice.
Re: Mobile Broadband
Posted: Thu Jun 14, 2012 9:13 pm
by pauly24
I'm reformatting the memory card every couple of days, next reformat Ill try and stay in as a user and not root. Just newbie moves... anyways back to the problem, the script just hangs
