Mobile Broadband


57 posts   Page 1 of 3   1, 2, 3
by Hammond7372 » Tue Dec 27, 2011 5:36 pm
What would be the best way to add mobile broadband to the Rpi..

This http://tinyurl.com/6o2ca7b looks good just wondered what would be an appropriate modem for Rpi Unix ?

Thanks
Posts: 26
Joined: Mon Nov 14, 2011 10:07 pm
by pygmy_giant » Sun Jun 03, 2012 2:11 am
Just got my pi and need internet access and have only Huawei 220 - am looking into this also.

http://www.sakis3g.org/

?
Ostendo ignarus addo scientia.
Posts: 1566
Joined: Sun Mar 04, 2012 12:49 am
by bredman » Sun Jun 03, 2012 10:24 am
Here are instructions to add a Huawei E220 to a Debian ARM machine which is much older/smaller than a Raspberry Pi. They should work perfectly on a Raspberry Pi.
http://www.nslu2-linux.org/wiki/HowTo/AddUsb3gModem

Somebody listed the E220 as working in the wiki list of periperals confirmed working, http://elinux.org/RPi_VerifiedPeripherals but there are no details of how it was done. So it is definitely possible.
Posts: 1413
Joined: Tue Jan 17, 2012 2:38 pm
by pygmy_giant » Sat Jun 09, 2012 12:59 am
Hmm - catch 22 - I need an internet connection to do that?!
Ostendo ignarus addo scientia.
Posts: 1566
Joined: Sun Mar 04, 2012 12:49 am
by adlambert » Sat Jun 09, 2012 7:23 am
You need an Internet connection to use this forum?!
Posts: 291
Joined: Tue Jan 03, 2012 3:18 pm
by pygmy_giant » Sat Jun 09, 2012 11:21 pm
Thanks bredman - I am accessing this forum via my Windows PC - I believe I need to access the internet on my Pi to:

apt-get install build-essential
apt-get install libusb-dev
apt-get install wvdial

hence the 'catch 22' e.g. 'sudo gcc the huaweiAktBb.c' file gives these errors:

huaweiAktBbo.c:15:17: error: usb.h: No such file or directory
huaweiAktBbo.c: In function ‘list_devices’:
huaweiAktBbo.c:37: warning: assignment makes pointer from integer without a cast
huaweiAktBbo.c:37: error: dereferencing pointer to incomplete type
huaweiAktBbo.c:40: error: dereferencing pointer to incomplete type
huaweiAktBbo.c:40: error: dereferencing pointer to incomplete type
huaweiAktBbo.c:42: error: dereferencing pointer to incomplete type
huaweiAktBbo.c:43: error: dereferencing pointer to incomplete type
huaweiAktBbo.c: In function ‘find_device’:
huaweiAktBbo.c:50: warning: assignment makes pointer from integer without a cast
huaweiAktBbo.c:50: error: dereferencing pointer to incomplete type
huaweiAktBbo.c:53: error: dereferencing pointer to incomplete type
huaweiAktBbo.c:53: error: dereferencing pointer to incomplete type
huaweiAktBbo.c:54: error: dereferencing pointer to incomplete type
huaweiAktBbo.c:55: error: dereferencing pointer to incomplete type
huaweiAktBbo.c: In function ‘main’:
huaweiAktBbo.c:115: warning: assignment makes pointer from integer without a cast
huaweiAktBbo.c:169: error: ‘USB_TYPE_STANDARD’ undeclared (first use in this function)
huaweiAktBbo.c:169: error: (Each undeclared identifier is reported only once
huaweiAktBbo.c:169: error: for each function it appears in.)
huaweiAktBbo.c:169: error: ‘USB_RECIP_DEVICE’ undeclared (first use in this function)
huaweiAktBbo.c:169: error: ‘USB_REQ_SET_FEATURE’ undeclared (first use in this function)

Which I'm guessing is to do with missing include files... I'm a linux noob and would be grateful for any suggestions as to a work-around to 'apt-get install' via a Windows PC which will enable me to get these required header files so that I can then get my Huawei E220 up and running and so then 'apt-get install' conventially.
Ostendo ignarus addo scientia.
Posts: 1566
Joined: Sun Mar 04, 2012 12:49 am
by bredman » Sun Jun 10, 2012 8:00 am
Did you install the package libusb-dev?

This is what is causing the problem with a missing usb.h file.
Posts: 1413
Joined: Tue Jan 17, 2012 2:38 pm
by bredman » Sun Jun 10, 2012 8:09 am
I just re-read your last post and realised that you have not installed any software yet.

To install software without an internet connection...
1. Use a PC to download the package from the correct repository
2. Transfer the package to the RPi
3. Install the package

To elaborate...
1. Download from (libusb-dev as example) http://packages.debian.org/squeeze/arme ... v/download
2. You can copy files from a Windows PC to the 70MB partition on the RPi SD card, this is shown as the directory /boot on the RPi.
3. Use the command (libusb-dev as example) dpkg -i /boot/libusb-dev.deb
Posts: 1413
Joined: Tue Jan 17, 2012 2:38 pm
by pygmy_giant » Sun Jun 10, 2012 8:03 pm
Many thanks bredman - I will give that a go and report back...
Ostendo ignarus addo scientia.
Posts: 1566
Joined: Sun Mar 04, 2012 12:49 am
by pygmy_giant » Sun Jun 10, 2012 8:14 pm
pants - there does not seem to be a version of wvdial for arm architecture: http://packages.debian.org/squeeze/wvdial :¬/

Thanks for the hints anyway - can use that technique to get packages without being online, so maybe no need to have my pi hooked up to the web via mobile broadband anyway :¬)
Ostendo ignarus addo scientia.
Posts: 1566
Joined: Sun Mar 04, 2012 12:49 am
by bredman » Sun Jun 10, 2012 8:34 pm
You don't really need wvdial. Loot at the very end of the page that I recommended.
Posts: 1413
Joined: Tue Jan 17, 2012 2:38 pm
by ledow » Mon Jun 11, 2012 12:59 pm
I have a Huawei E160 3G modem but there seems to be a problem with USB that makes it just drop any 3G connection when you try to actually download something (while GPRS / AT commands for SMS, etc. work fine, and it works fine if you do nothing but ping but as soon as you, say, try to download a HTML page, PPPd complains the modem hung up). I'm pretty sure it's a USB issue but the only debugging on the USB "packet acknowledged but not passed on to software" issue is being done by a small handful of forum users and getting no interest from the RPi team at the moment (not even assigned to anyone on Github, nobody "official" has replied to the debugging thread, etc.).

That said, there's no reason it *couldn't* work. If the RPi wasn't dropping my USB packets, it would work just fine (I know, because I ported an in-car linux PC that I made on a x86 Mini-ITX machine that used a 3G stick for lots of things - there's no reason that a RPi can't just run the same scripts / software that I used). And I didn't have to compile any modules or use wvdial for it to work (as others point out, wvdial isn't available for ARM and it's NOT just an easy fix to make it work, and you can dial AT commands with an old-fashioned send-expect dial script quite easily).

But it works, and if I leave it on GPRS mode it works fine. It's only the USB issue that affects it and that affects several other devices / people as well on completely unrelated things.
User avatar
Posts: 36
Joined: Thu Feb 02, 2012 12:55 pm
by bredman » Mon Jun 11, 2012 2:14 pm
How are you providing power to the E160? 3G needs a lot more power than GPRS.
Posts: 1413
Joined: Tue Jan 17, 2012 2:38 pm
by pygmy_giant » Mon Jun 11, 2012 10:30 pm
Bredman said
You don't really need wvdial. Loot at the very end of the page that I recommended.


not sure which page you are talking about....?

I followed all the instructions except those relating to wvdial (steps 3 and 9+ at http://www.nslu2-linux.org/wiki/HowTo/AddUsb3gModem )

Is that the page you are refering to?

I cant find:

kernel-module-usbserial
kernel-module-ppp-generic
kernel-module-ppp-async
libusb-0.1-dev
ppp

as a substitute as suggested at the bottom of that page and I am guessing the kernel modules referred to there would also be architecture specific to the NSLU2.

Needless to say - still no connection - any help appreciated - what does ledow mean when he says
dial AT commands with an old-fashioned send-expect dial script quite easily
?
Ostendo ignarus addo scientia.
Posts: 1566
Joined: Sun Mar 04, 2012 12:49 am
by SN » Mon Jun 11, 2012 11:23 pm
When you crack it I'd be interested to know if this will work for a Huawei E272 (the little vodafone bar of white soap)
Steve N – binatone mk4->intellivision->zx81->spectrum->cbm64->cpc6128->520stfm->pc->raspi ?
User avatar
Posts: 1008
Joined: Mon Feb 13, 2012 8:06 pm
Location: Romiley, UK
by bredman » Tue Jun 12, 2012 9:09 am
To answer several questions at once...

You should not need to load the kernel modules, all you need is ppp
http://packages.debian.org/squeeze/armel/ppp/download

You should not use the "0.1" version of libusb-dev, the full version should be used.
http://packages.debian.org/squeeze/arme ... v/download

To drive the modem using "AT-commands" you use a script like this...

#!/bin/sh
DEV=/dev/ttyUSB0
echo "ATZ" >$DEV
head -n 2 $DEV
echo 'AT+CGDCONT=1,"IP","web.yesss.at"' >$DEV
head -n 2 $DEV
echo 'ATD*99***1#' >$DEV
head -n 2 $DEV
sleep 1
/usr/sbin/pppd debug nodetach 460800 $DEV

Remember to change the "web.yesss.at" to the Access Point Name (APN) for your provider. Search the internet to find it if you don't know.
Posts: 1413
Joined: Tue Jan 17, 2012 2:38 pm
by pygmy_giant » Tue Jun 12, 2012 9:14 pm
.... thanks but now have a new dependency problem - libusb-dev_0.1.12-16_armel.deb needs libpcap0.8 but can only find libpcap-dev_1.1.1-2+squeeze1_all.deb which also requires libpcap0.8 so not possible?!

double pants :¬/
Ostendo ignarus addo scientia.
Posts: 1566
Joined: Sun Mar 04, 2012 12:49 am
by AndrewS » Wed Jun 13, 2012 12:49 am
User avatar
Posts: 2193
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
by pygmy_giant » Wed Jun 13, 2012 9:47 am
thanks :oops: ... watch this space...
Last edited by pygmy_giant on Wed Jun 13, 2012 10:09 am, edited 1 time in total.
Ostendo ignarus addo scientia.
Posts: 1566
Joined: Sun Mar 04, 2012 12:49 am
by pygmy_giant » Wed Jun 13, 2012 10:01 am
Hi - I now get 'Permission denied' when I run bredman's AT commands bash script:

#!/bin/sh
DEV=/dev/ttyUSB0
echo "ATZ" >$DEV
head -n 2 $DEV
echo 'AT+CGDCONT=1,"IP","three.co.uk"' >$DEV
head -n 2 $DEV
echo 'ATD*99***1#' >$DEV
head -n 2 $DEV
sleep 1
/usr/sbin/pppd debug nodetach 460800 $DEV

Now that I have all the suggested packages installed, I tried re-compiling huaweiAktBbo.c but get these errors:

/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

I'm still of the opinion that wvdial is necessary
Last edited by pygmy_giant on Wed Jun 13, 2012 10:24 am, edited 1 time in total.
Ostendo ignarus addo scientia.
Posts: 1566
Joined: Sun Mar 04, 2012 12:49 am
by AndrewS » Wed Jun 13, 2012 10:18 am
Try running the script using sudo?
User avatar
Posts: 2193
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
by bredman » Wed Jun 13, 2012 10:20 am
Did you make the script executable?
Are you using sudo before the script name?
Posts: 1413
Joined: Tue Jan 17, 2012 2:38 pm
by pygmy_giant » Wed Jun 13, 2012 10:26 am
err....

.... problems with compiling the c script and the bash script - will try sudoing but dont think that will help as I cant compile the c script...
Ostendo ignarus addo scientia.
Posts: 1566
Joined: Sun Mar 04, 2012 12:49 am
by AndrewS » Wed Jun 13, 2012 10:28 am
Looks like you haven't installed the libusb-dev package properly.
User avatar
Posts: 2193
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
by pygmy_giant » Wed Jun 13, 2012 10:39 am
perhaps

sudo bashing the at script generates:

ATZ
AT+CGDCONT=1,"IP","three.co.uk"
ATD*99***1#
sleep: invalid time interval `1\r'
Try `sleep --help' for more information.
'usr/sbin/pppd: unrecognized option '/dev/ttyUSB0
pppd version 2.4.5
Usage: /usr/sbin/pppd [ options ], where options are:
<device> Communicate over the named device
<speed> Set the baud rate to <speed>
<loc>:<rem> Set the local and/or remote interface IP
addresses. Either one may be omitted.
asyncmap <n> Set the desired async map to hex <n>
auth Require authentication from peer
connect <p> Invoke shell command <p> to set up the serial line
crtscts Use hardware RTS/CTS flow control
defaultroute Add default route through interface
file <f> Take options from file <f>
modem Use modem control lines
mru <n> Set MRU value to <n> for negotiation
Ostendo ignarus addo scientia.
Posts: 1566
Joined: Sun Mar 04, 2012 12:49 am