User avatar
AndrewS
Posts: 3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
Contact: Website

Re: Mobile Broadband

Wed Jun 13, 2012 10:42 am

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 :)

pygmy_giant
Posts: 1562
Joined: Sun Mar 04, 2012 12:49 am

Re: Mobile Broadband

Wed Jun 13, 2012 10:49 am

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.
Ostendo ignarus addo scientia.

bredman
Posts: 1415
Joined: Tue Jan 17, 2012 2:38 pm

Re: Mobile Broadband

Wed Jun 13, 2012 11:34 am

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?

User avatar
AndrewS
Posts: 3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
Contact: Website

Re: Mobile Broadband

Wed Jun 13, 2012 11:50 am

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 :?

bredman
Posts: 1415
Joined: Tue Jan 17, 2012 2:38 pm

Re: Mobile Broadband

Wed Jun 13, 2012 11:53 am

I agree that this would be just a couple of minutes work if you had an internet connection available.

pygmy_giant
Posts: 1562
Joined: Sun Mar 04, 2012 12:49 am

Re: Mobile Broadband

Wed Jun 13, 2012 11:56 am

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?
Last edited by pygmy_giant on Wed Jun 13, 2012 12:08 pm, edited 1 time in total.
Ostendo ignarus addo scientia.

bredman
Posts: 1415
Joined: Tue Jan 17, 2012 2:38 pm

Re: Mobile Broadband

Wed Jun 13, 2012 12:08 pm

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.

pygmy_giant
Posts: 1562
Joined: Sun Mar 04, 2012 12:49 am

Re: Mobile Broadband

Wed Jun 13, 2012 12:11 pm

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
Ostendo ignarus addo scientia.

bredman
Posts: 1415
Joined: Tue Jan 17, 2012 2:38 pm

Re: Mobile Broadband

Wed Jun 13, 2012 12:20 pm

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.

pygmy_giant
Posts: 1562
Joined: Sun Mar 04, 2012 12:49 am

Re: Mobile Broadband

Wed Jun 13, 2012 12:36 pm

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:~#
Ostendo ignarus addo scientia.

bredman
Posts: 1415
Joined: Tue Jan 17, 2012 2:38 pm

Re: Mobile Broadband

Wed Jun 13, 2012 12:40 pm

Found your problem...

The gcc command needs the -lusb option to tell it to read the USB library.

Please read the original instructions.

pygmy_giant
Posts: 1562
Joined: Sun Mar 04, 2012 12:49 am

Re: Mobile Broadband

Wed Jun 13, 2012 12:42 pm

thanks for your patience :oops:
Ostendo ignarus addo scientia.

bredman
Posts: 1415
Joined: Tue Jan 17, 2012 2:38 pm

Re: Mobile Broadband

Wed Jun 13, 2012 12:43 pm

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.

pygmy_giant
Posts: 1562
Joined: Sun Mar 04, 2012 12:49 am

Re: Mobile Broadband

Wed Jun 13, 2012 1:08 pm

all done - thanks all - just need to sort out that /r problem - have to go out now, will attempt this evening...
Ostendo ignarus addo scientia.

pygmy_giant
Posts: 1562
Joined: Sun Mar 04, 2012 12:49 am

Re: Mobile Broadband

Wed Jun 13, 2012 10:34 pm

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....(!)
Ostendo ignarus addo scientia.

pygmy_giant
Posts: 1562
Joined: Sun Mar 04, 2012 12:49 am

Re: Mobile Broadband

Wed Jun 13, 2012 10:56 pm

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
Ostendo ignarus addo scientia.

bredman
Posts: 1415
Joined: Tue Jan 17, 2012 2:38 pm

Re: Mobile Broadband

Thu Jun 14, 2012 8:19 am

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.

pygmy_giant
Posts: 1562
Joined: Sun Mar 04, 2012 12:49 am

Re: Mobile Broadband

Thu Jun 14, 2012 11:49 am

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?
Ostendo ignarus addo scientia.

bredman
Posts: 1415
Joined: Tue Jan 17, 2012 2:38 pm

Re: Mobile Broadband

Thu Jun 14, 2012 12:07 pm

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.

pygmy_giant
Posts: 1562
Joined: Sun Mar 04, 2012 12:49 am

Re: Mobile Broadband

Thu Jun 14, 2012 12:19 pm

Thanks Bredman, will try this evening....
Ostendo ignarus addo scientia.

pauly24
Posts: 59
Joined: Fri May 18, 2012 2:42 pm

Re: Mobile Broadband

Thu Jun 14, 2012 8:23 pm

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?

bredman
Posts: 1415
Joined: Tue Jan 17, 2012 2:38 pm

Re: Mobile Broadband

Thu Jun 14, 2012 8:54 pm

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.

pauly24
Posts: 59
Joined: Fri May 18, 2012 2:42 pm

Re: Mobile Broadband

Thu Jun 14, 2012 8:57 pm

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.

bredman
Posts: 1415
Joined: Tue Jan 17, 2012 2:38 pm

Re: Mobile Broadband

Thu Jun 14, 2012 9:11 pm

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.

pauly24
Posts: 59
Joined: Fri May 18, 2012 2:42 pm

Re: Mobile Broadband

Thu Jun 14, 2012 9:13 pm

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 :(

Return to “General discussion”