2

(lsusb details at the bottom of the post)


I've been trying to get my Raspberry Pi (running Raspbian) online, and I've been following a guide, which suggests Sakis3g.

I've installed ppp, a few different versions of lib-usb and (perhaps mistakenly) usb-modeswitch.

I can run the Sakis script (currently trying to use the binary-free version), but it says "Illegal instruction" and returns me to the menu. I have tried running it in debug mode to see what's going wrong, but I can't really make head nor tail of it:

Illegal instruction
------------------------
Sakis3G 0.2.0e running on DEBUG mode.
-------------------------------------------
Tue Jan 15 02:31:42 UTC 2013
-------------------------------------------
Command line was: /tmp/sakis3gz.8395.sakis3g "--interactive" "--console" "--debug"
Running with PID: 8425
-------------------------------------------
Environment is:
DEBUG='on'
DESKTOP=''
DISPLAY=':0'
EXTRACTED='/tmp/sakis3gz.8395.sakis3g'
HOME='/root'
IFS='   
'
LANG='en_GB.UTF-8'
LOGNAME='root'
LS_COLORS='rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:'
MAIL='/var/mail/root'
MEGZ='./sakis3g'
MYVERSION='0.2.0e'
NOFUNCNAME='1'
OLDPWD='/home/pi'
OPTIND='1'
PATH='/bin:/sbin:/usr/bin:/usr/sbin'
PPID='8395'
PROVIDER='./sakis3g'
PS1='# '
PS2='> '
PS4='+ '
PWD='/home/pi/Documents/Philip/Raspberry Pi'
SHELL='/bin/bash'
SHLVL='1'
SUDO_COMMAND='/usr/bin/x-terminal-emulator'
SUDO_GID='1000'
SUDO_UID='1000'
SUDO_USER='pi'
TERM='xterm'
TRAPS='cleanscreen '
USER='root'
USERNAME='root'
XAUTHORITY='/tmp/libgksu-gzo1Q5/.Xauthority'
_='./sakis3g'
allargs='"--interactive" "--console" "--debug"'
binaryfree='yes'
binaryvariable='grep'
cutbin='/usr/bin/cut'
grepbin='/bin/grep'
interactive='yes'
lastverbosetext='Starting up'
me='/tmp/sakis3gz.8395.sakis3g'
printfbin='/usr/bin/printf'
sedbin='/bin/sed'
stick_to_console='yes'
trbin='/usr/bin/tr'
verbosecurrentcount='7'
whichbin='/bin/which'
-------------------------------------------
Will now proceed with Sakis3G execution.
-------------------------------------------
[08425] [02:31:42] Located "echo" within PATH (/bin/echo).
[08425] [02:31:42] Level 1 dependencies met.
[08425] [02:31:42] Dir "/bin" exists in PATH.
[08425] [02:31:42] Dir "/usr/bin" exists in PATH.
[08425] [02:31:42] Dir "/sbin" exists in PATH.
[08425] [02:31:42] Dir "/usr/sbin" exists in PATH.
[08425] [02:31:42] Done setting up PATH.
[08425] [02:31:43] Located "readlink" within PATH (/bin/readlink).
[08425] [02:31:43] My location is "/home/pi/Documents/Philip/Raspberry Pi/sakis3g".
[08425] [02:31:43] Located "wc" within PATH (/usr/bin/wc).
[08425] [02:31:43] Located "cat" within PATH (/bin/cat).
[08425] [02:31:43] Located "tail" within PATH (/usr/bin/tail).
[08425] [02:31:43] Located "head" within PATH (/usr/bin/head).
[08425] [02:31:43] Located "sort" within PATH (/usr/bin/sort).
[08425] [02:31:43] Located "uniq" within PATH (/usr/bin/uniq).
[08425] [02:31:43] Located "ls" within PATH (/bin/ls).
[08425] [02:31:43] Located "setsid" within PATH (/usr/bin/setsid).
[08425] [02:31:43] Located "getent" within PATH (/usr/bin/getent).
[08425] [02:31:43] Located "ps" within PATH (/bin/ps).
[08425] [02:31:43] Located "chmod" within PATH (/bin/chmod).
[08425] [02:31:44] Located "chown" within PATH (/bin/chown).
[08425] [02:31:44] Located "touch" within PATH (/bin/touch).
[08425] [02:31:44] Located "expr" within PATH (/usr/bin/expr).
[08425] [02:31:44] Located "seq" within PATH (/usr/bin/seq).
[08425] [02:31:44] Located "cp" within PATH (/bin/cp).
[08425] [02:31:44] Located "rm" within PATH (/bin/rm).
[08425] [02:31:44] Located "who" within PATH (/usr/bin/who).
[08425] [02:31:44] Located "mv" within PATH (/bin/mv).
[08425] [02:31:44] Located "basename" within PATH (/usr/bin/basename).
[08425] [02:31:44] Located "dirname" within PATH (/usr/bin/dirname).
[08425] [02:31:44] Level 2 dependencies met.
[08425] [02:31:44] Basic binaries are resolved.
[08425] [02:31:45] Parent process is: bash
[08425] [02:31:45] Running by user request.
[08425] [02:31:45] Person behind screen is pi.
[08425] [02:31:45] Configuration file /etc/default/sakis3g does not exist or is not readable.
[08425] [02:31:45] Configuration file /etc/sysconfig/sakis3g does not exist or is not readable.
[08425] [02:31:45] Configuration file /etc/sakis3g.conf does not exist or is not readable.
[08425] [02:31:45] Configuration file(s) loaded.
[08425] [02:31:46] Not using an X display due to stick-to-console variable.
[08425] [02:31:46] Selecting GUI.
[08425] [02:31:46] Unable to locate "dialog" within PATH.
[08425] [02:31:46] Located "whiptail" within PATH (/usr/bin/whiptail).
[08425] [02:31:46] whiptail selected as GUI.
[08425] [02:31:46] Locale en_GB.UTF-8 found in environment.
[08425] [02:31:46] Will attempt to get translation file from package: messages/en_GB.UTF-8.
[08425] [02:31:46] Loaded default value for foldwrapping: 60
[08425] [02:31:46] No translations retrieved from file. Will not be using translations.
[08425] [02:31:46] Loaded default value for foldwrapping: 60
[08425] [02:31:46] Located "ifconfig" within PATH (/sbin/ifconfig).
[08425] [02:31:46] Root level dependencies met.
[08425] [02:31:47] Loading Usb-ModeSwitch device database.
[08425] [02:31:47] Embedded device database contains 0 entries.
[08425] [02:31:47] Folder "/etc/usb_modeswitch.d" exists. Will check if it contains configuration files.
[08425] [02:31:47] Loading system supplied device database.
[08425] [02:31:47] Switchable devices within system device database:

[08425] [02:31:47] Switched devices within system device database:

[08425] [02:31:47] Finished starting up.
[08425] [02:31:47] No actors defined.
[08425] [02:31:47] Executing default actor for "whiptail".
[08425] [02:31:47] Loaded default value for pppint: ppp0
[08425] [02:31:48] Asking user to select: MENU Please select an action Choose action for Sakis3G script to follow. OK Cancel CONNECT Connect with 3G MOREMENU More options... ABOUT About Sakis3G EXIT Exit
[08425] [02:31:48] Asking user to select: MENU Please select an action Choose action for Sakis3G script to follow. OK Cancel CONNECT Connect with 3G MOREMENU More options... ABOUT About Sakis3G EXIT Exit
[08425] [02:31:48] Variable MENU is not set already.
[08425] [02:31:48] Prompting user to select variable MENU.
[08425] [02:31:52] User selected: "1. Connect with 3G"
[08425] [02:31:52] Considering selection: 1
[08425] [02:31:52] User selection was 1.
[08425] [02:31:53] Verbosing: 7% Locating device
[08425] [02:31:53] Loading Usb-ModeSwitch device database.
[08425] [02:31:53] Embedded device database contains 0 entries.
[08425] [02:31:53] Folder "/etc/usb_modeswitch.d" exists. Will check if it contains configuration files.
[08425] [02:31:53] Loading system supplied device database.
[08425] [02:31:54] Switchable devices within system device database:

[08425] [02:31:54] Switched devices within system device database:

[08425] [02:31:54] Fetching connected USB devices by using "/sys/bus/usb/devices".
[08425] [02:31:54] Connected USB devices are:
0424:9512:BUSNUM=001
0424:ec00:BUSNUM=001
046d:c517:USB Receiver
12d1:1446:HUAWEI Mobile
1d6b:0002:DWC OTG Controller
[08425] [02:31:54] No plugged modems found.
[08425] [02:31:54] Asking user to select: OTHER Please select modem type Select modem category that best fits your 3G modem. Select Cancel USBMODEM USB device BLUETOOTH Bluetooth modem CUSTOM_TTY Custom tty...
[08425] [02:31:54] Asking user to select: OTHER Please select modem type Select modem category that best fits your 3G modem. Select Cancel USBMODEM USB device BLUETOOTH Bluetooth modem CUSTOM_TTY Custom tty...
[08425] [02:31:55] Variable OTHER is not set already.
[08425] [02:31:55] Prompting user to select variable OTHER.
[08425] [02:31:56] User selected: "1. USB device"
[08425] [02:31:57] Considering selection: 1
[08425] [02:31:57] User selection was 1.
[08425] [02:31:57] Fetching connected USB devices by using "/sys/bus/usb/devices".
[08425] [02:31:57] Connected USB devices are:
0424:9512:BUSNUM=001
0424:ec00:BUSNUM=001
046d:c517:USB Receiver
12d1:1446:HUAWEI Mobile
1d6b:0002:DWC OTG Controller
[08425] [02:31:57] Asking user to select: USBMODEM Please select USB modem Select USB device that provides modem capabilities. Select Cancel 0424:9512 BUSNUM=001 0424:ec00 BUSNUM=001 046d:c517 USB Receiver 12d1:1446 HUAWEI Mobile 1d6b:0002 DWC OTG Controller
[08425] [02:31:58] Asking user to select: USBMODEM Please select USB modem Select USB device that provides modem capabilities. Select Cancel 0424:9512 BUSNUM=001 0424:ec00 BUSNUM=001 046d:c517 USB Receiver 12d1:1446 HUAWEI Mobile 1d6b:0002 DWC OTG Controller
[08425] [02:31:58] Variable USBMODEM is not set already.
[08425] [02:31:58] Prompting user to select variable USBMODEM.
[08425] [02:32:00] User selected: "4. HUAWEI Mobile"
[08425] [02:32:00] Considering selection: 4
[08425] [02:32:00] User selection was 4.
[08425] [02:32:00] Fetching connected USB devices by using "/sys/bus/usb/devices".
[08425] [02:32:00] Connected USB devices are:
0424:9512:BUSNUM=001
0424:ec00:BUSNUM=001
046d:c517:USB Receiver
12d1:1446:HUAWEI Mobile
1d6b:0002:DWC OTG Controller
[08425] [02:32:00] User selected USB modem "12d1:1446".
[08425] [02:32:00] Setting up modem.
[08425] [02:32:01] We are root already. Proceeding.
[08425] [02:32:01] Setting up USB modem 12d1:1446.
[08425] [02:32:01] Fetching connected USB devices by using "/sys/bus/usb/devices".
[08425] [02:32:01] Connected USB devices are:
0424:9512:BUSNUM=001
0424:ec00:BUSNUM=001
046d:c517:USB Receiver
12d1:1446:HUAWEI Mobile
1d6b:0002:DWC OTG Controller
[08425] [02:32:01] Located "lsusb" within PATH (/usr/bin/lsusb).
[08425] [02:32:01] Using information of lsusb to determine usable interfaces.
[08425] [02:32:01] USB Device 12d1:1446 provides 0 interruptable endpoint(s).
[08425] [02:32:01] lsusb output was:

[08425] [02:32:01] No modem lines on USB device "12d1:1446". Device may need switching.
[08425] [02:32:01] Interfaces collected from lsusb are: 
[08425] [02:32:01] Failed to locate any usable interface for device 12d1:1446.
[08425] [02:32:01] Failed to get an interface for device.
[08425] [02:32:01] Loading Usb-ModeSwitch device database.
[08425] [02:32:02] Embedded device database contains 0 entries.
[08425] [02:32:02] Folder "/etc/usb_modeswitch.d" exists. Will check if it contains configuration files.
[08425] [02:32:02] Loading system supplied device database.
[08425] [02:32:02] Switchable devices within system device database:

[08425] [02:32:02] Switched devices within system device database:

[08425] [02:32:02] Device "12d1:1446" is not switchable.
[08425] [02:32:02] Failed setting up USB modem "12d1:1446".
[08425] [02:32:02] Error: Failed to connect.
[08425] [02:32:04] Asking user to select: MENU Please select an action Choose action for Sakis3G script to follow. OK Cancel CONNECT Connect with 3G MOREMENU More options... ABOUT About Sakis3G EXIT Exit
[08425] [02:32:04] Asking user to select: MENU Please select an action Choose action for Sakis3G script to follow. OK Cancel CONNECT Connect with 3G MOREMENU More options... ABOUT About Sakis3G EXIT Exit
[08425] [02:32:04] Variable MENU is not set already.
[08425] [02:32:04] Prompting user to select variable MENU.
[08425] [02:32:07] User selected: "4. Exit"
[08425] [02:32:07] Considering selection: 4
[08425] [02:32:07] User selection was 4.
[08425] [02:32:07] Breaking chain.
[08425] [02:32:07] Verbosing: 7% Cleaning
[08425] [02:32:07] Stopping operation with return status: 98
[08425] [02:32:07] Now executing traps.
[08425] [02:32:07] Executing trap "cleanscreen".

If anyone has any suggestions on what's going wrong and/or what I can try differently, I'd appreciate it.


Update

I've checked my version of Linux, and although I can't remember exactly what it said, I know it contained the words "Raspbian", "Wheezy" and "sid".

I've been trying to follow BigCowPi's guide, which begins by checking that the USB device is connected with lsusb.

However, running that just prints a message saying Illegal Instruction (the same as sakis3g). I've tried reinstalling usbutils and its dependency libusb-1.0-0 (both the armhf versions), but that doesn't change the situation.

I'm getting decidedly stuck at this point - I don't know why these things keep saying Illegal Instruction, and I'd really appreciate further advice or ideas if anyone has some.

Second Update (file & ldd)

As per gurcanozturk's request, here's the output from file /usr/bin/lsusb:

/usr/bin/lsusb: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.26, BuildID[sha1]=0xebd0351741a93fbee0e66b4835b4770ca8de0e14, stripped

and here's ldd /usr/bin/lsusb:

/usr/lib/arm-linux-gnueabihf/libcofi_rpi.so (0x40281000)
libusb-1.0.so.0 => /lib/arm-linux-gnueabihf/libusb-1.0.so.0 (0x400de000)
libz.so.1 => /lib/arm-linux-gnueabihf/libz.so.1 (0x40085000)
libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0x40110000)
librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0x400a3000)
libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0x4023d000)
/lib/ld-linux-armhf.so.3 (0x400b7000)
libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0x4000f000)

Update 3

/etc/apt/sources.list:

deb http://mirrordirector.raspbian.org/raspbian/ wheezy main contrib non-free rpi

/etc/apt/sources.list.d contains one file, raspi.list:

deb http://archive.raspberrypi.org/debian/ wheezy main

/etc/apt/preferences.d is an empty directory.

I've tried to install a version of libusb-0.1-4_0.1.12-23.2_armhf.deb from the address given in sources.list, which now says it needs a newer version of libc6. I have 2.13 and it needs >=2.15.

9
  • I followed the same guide, and got it to work nicely. I installed usb-modeswitch from raspbian's repositories. "Illegal instruction" sounds as if you have some binary file compiled for a different architecture. The sakis script I use is here if you want to try it (since the official sakis site is gone, sadly). There is a description of what I did as well. I don't know what is wrong with your way.
    – Frepa
    Mar 31, 2013 at 12:47
  • can you paste the outputs of 'file /usr/bin/lsusb' and 'ldd /usr/bin/lsusb' commands? Aug 29, 2013 at 15:41
  • @gurcanozturk Ok, I've added that information - anything useful in there?
    – Philip C
    Sep 11, 2013 at 9:58
  • Please post /etc/apt/source.list and /etc/apt/source.list.d/*. In short: it seems you are using a vanilla debian sid repository, which is built for armv7, while raspbian wheezy is a armv6 + hard float build. Checking /etc/apt/preferences might be a good idea too.
    – M Noit
    Sep 11, 2013 at 10:46
  • @PhilipC @M Noit is right, it looks like youre using wrong version of Sakis. It should build for armv6-hf. By the way why youre using Sakis ? Wvdial is very simple for pppd. Sep 11, 2013 at 13:31

3 Answers 3

1
+50

I wrote a guide to using Sakis3g and a Huawei E303 dongle to provide internet on the Pi. It takes you through how to get usb_modeswitch running too - I had to do some research to get the correct information for usb_modeswitch.conf :)

3
  • I've started going through your guide, and it seems I've fallen at the first step. I tell it "lsusb", it tells me "Illegal Instruction". In my bid to try all sorts of combinations of libraries that sakis3g uses, I've probably installed something that I shouldn't have, but I don't know what that would be, or what needs to be reinstalled to fix it.
    – Philip C
    Mar 31, 2013 at 15:27
  • Are you using Raspbian?
    – BigCowPi
    Mar 31, 2013 at 15:47
  • Yes, I am using Rasbian.
    – Philip C
    Apr 8, 2013 at 7:49
0

Some 3g modems present themselves as usb optical drives at first (check if your modem creates /dev/sr0).

You need to switch it to modem mode. This can be done with sg_raw from sg3-utils package:

sg_raw /dev/sr0 11 06 20 00 00 00 00 00 01 00
3
  • The switching can also be done with usb-modeswitch, which is what the sakis script uses and what the OP says. Some versions of the script even bundles a copy of usb-modeswitch.
    – Frepa
    Mar 31, 2013 at 12:51
  • 2
    However, the debug output he posted shows:[08425] [02:32:02] Device "12d1:1446" is not switchable. Which probably means that the specific modem is not in sakis3g's database.
    – n00
    Mar 31, 2013 at 12:59
  • Good point! Is the modem a Huawei E1692? I found these instructions on how to add it to the usb-modeswitch database. Btw, does one know those magic-looking numbers to give sg_raw?
    – Frepa
    Mar 31, 2013 at 21:03
0

I was using Huawei E176 3G modem (w/ USB storage) with RPi. I didn't like Sakis3G so i tried Wvdial. wvdial has a simple config file /etc/wvdial.conf

If you need switch to modem mode instead usb storage, you can use usb_modeswitch. You can find more information and documentation at http://www.draisberghof.de/usb_modeswitch

Then install wvdial,

apt-get install wvdial

To use wvdial you have to create /etc/wvdial.conf manually. Run command below to create new one.

echo "[Dialer defaults]
        Init1 = ATZ
        Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
        Init3 = AT+CGDCONT=1, "IP", "APN_NAME"
        Modem = /dev/ttyUSB2
        Baud = 460800
        ISDN = 0
        New PPPD = yes
        Modem Type = Analog Modem
        Phone = *99#
        Username = userid
        Password = pass
        Stupid Mode = 1
        Dial Command = ATDT
" > /etc/wvdial.conf

In this config, APN_NAME your APN name (if you have), userid and pass your username and password for 3G access.

After creating config file just run wvdial.

If you get error such as 'Modem not responding' change the Modem line with appropriate device name. (ttyUSB0, ttyUSB1, etc.)

You also need to set the default gateway via 3g so vi /etc/ppp/peers/wvdial and add the two following lines at the end: defaultroute replacedefaultroute

2
  • Thanks for your help. I'm having a little difficulty at present. Because I haven't got the Pi online yet, apt-get won't be able to download anything. I'm not entirely sure which version of wvdial to download manually. This is probably the source of my "Illegal instruction" problems in the first place...
    – Philip C
    Nov 16, 2013 at 15:01
  • Also, having tried wvdial, it gives an "Illegal Instruction" error, too. I think I've messed up my libusb installation, but I don't know how to get it right again.
    – Philip C
    Nov 16, 2013 at 16:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.