Guide: Mobile Broadband Usb Stick Usage


How can i eject the stick?
Code:
sudo eject <?>

Where can i see the correct mountpoint?

greetings

Edit:
Code:
sudo eject /dev/ttyUSB0 -v
doesn't work:
Code:
[...]
/dev/ttyUSB0 is not mounted
/dev/ttyUSB0 is not a mount point
/dev/ttyUSB0 is not a multipartition device
[...]
 
^ Why do you want to eject something that is essentially a serial device :blink: ? Just make sure you're not using it and pull it out... (which is essentially what you would do with an usb stick too, just unmount it so that you're not using it and pull it out...)

EDIT: Also to note, eject is usually used only for removable media devices (like optical media, cd/dvd drives, etc)...
Note2: "mountpoint" :D ? It is a freaking serial port, not a block device...
 
Oh, I only knew of a "read-only" (contents can be changed with a firmware update AFAIK) "cd-rom drive" they feature for driver installation, AFAIK useless in linux. Since that is read-only I think it should be safe to pull the stick out at any time (regarding that), though it is proper conduct to atleast check that you're not reading from it at the moment. "mount" would list it as /dev/sr0 (again AFAIK) or so, see this example "[61123.907135] sr 3:0:0:0: Attached scsi CD-ROM sr0" The microsd port seems to be "[61128.344451] sd 4:0:0:0: [sda] Attached SCSI removable disk" <- this i think. Would show up as /dev/sda (or /dev/sda1 or so) in mount listing.

EDIT:
@Capitano:
In short: "mount" to list mounted stuff. "sudo umount /dev/sr0" to unmount the virtual cd-rom drive if it was sr0. "sudo umount /dev/sda" (or /dev/sda1, whatever mount lists) for unmounting the microSD slot (sd-something). The serial device needs no "ejecting"/unmounting. Just close the connection before pulling the device out, or so...
 
Alerino said:
urjaman said:
Oh, I only knew of a "read-only" (contents can be changed with a firmware update AFAIK) "cd-rom drive" they feature for driver installation, AFAIK useless in linux.

that "sr0" thing is, in fact, the 3G company built-in dialer, which works similarly to the cdrom autorun.inf file when you stick it
Since it's a Windows application, it will be useless, unless WINE can open it (never tried that in my Ubuntu Box though, never needed anyways)
Yeah I know. I used to install E220s for use with windows laptops for work. :/
I know the "cd-rom" has a bit more than the bare driver, but I still call the collection of stuff in there "drivers".
 
Last edited by a moderator:
urjaman said:
@Capitano:
In short: "mount" to list mounted stuff. "sudo umount /dev/sr0" to unmount the virtual cd-rom drive if it was sr0. "sudo umount /dev/sda" (or /dev/sda1, whatever mount lists) for unmounting the microSD slot (sd-something). The serial device needs no "ejecting"/unmounting. Just close the connection before pulling the device out, or so...

Ok, i think i missunderstood something. I thought the eject-thing was a tip for me to get my stick to work;)


greetings
 
Last edited by a moderator:
It was a suggestion to get the stick working but I think perhaps I didn't explain enough.

Some sticks which have a CDrom emulation and all you need to do to "mode switch" them is to eject that CD-ROM device that gets installed. You can even wait for it to appear on the desktop and right click and eject it there.

It may work, it may not either way it's worth a try. Also ensure you don't have a microSD card in the stick to begin with because sometimes that can fire up another driver to confuse things.
 
illusionx said:
Some sticks which have a CDrom emulation and all you need to do to "mode switch" them is to eject that CD-ROM device that gets installed. You can even wait for it to appear on the desktop and right click and eject it there.

It may work, it may not either way it's worth a try. Also ensure you don't have a microSD card in the stick to begin with because sometimes that can fire up another driver to confuse things.
Ah okay.
unfortunately, there is no cdrom device on the desktop and a sudo eject cannot find a cdrom device either. And the micrSD-Slot is empty.

greetings
 
Last edited by a moderator:
After I have installed modemmanager, plugged my Huawei E160E and tried all sorts of things this is what I get:

panda:~$ sudo /lib/udev/modem-modeswitch -v 0x12d1 -p 0x1003 -t option-zerocd -d
D: Found mass storage device:
D: Endpoints: 3
D: Class: 0xFF
D: SubClass: 0xFF
D: Protocol: 0xFF
E: No device found

It is certain, that lsusb knows it is there. But modprobe command doesn't seem to do anything for me. I can't switch it to modem mode. And Network Manager doesn't have the magical "Enable Mobile Broadband" option. Dang it. Any suggestions?
 
The following is more of a documentation of my struggle with getting this to work than a how-to, so please read this thread first and use google and your brain a lot. I'm not liable for any damage done by following this post.

A lot of the things mentioned in this thread somehow didn't work for me. I have a 4G Systems XS Stick P14 (1c9e:f000 in CD mode, 1c9e:9605 in modem mode) with an O2 germany data plan.

Things that didn't work:
Modeswitching with udev and modem-modeswitch
automatic driver loading
automatic connection setup with NetworkManager (I installed modem manager, but it didn't work)

So I used usbmodeswitch and pppd.

First, I installed usbmodeswitch (NOT usb-modeswitch) and usb-modeswitch-data via opkg (I don't know whether you need to install pppd or whether it comes pre-installed with the Pandora. You might need to install it, too.).
(WARNING, WRITES ON NAND)
Code:
sudo opkg update
sudo opkg install usb-modeswitch-data
sudo opkg install usbmodeswitch

I plug in the stick and looked up its vendor-id and product-id:
sudo lsusb
> Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
> Bus 001 Device 007: ID 1c9e:f000


Then modeswitch with:
sudo usb_modeswitch -c /etc/usb_modeswitch.d/1c9e:f000

Check lsusb output again:
sudo lsusb
> Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
> Bus 001 Device 007: ID 1c9e:9605

Load the driver:
sudo modprobe usbserial vendor=0x1c9e product=0x9605

Check if everything worked:
ls /dev/ttyUSB*
> /dev/ttyUSB0 /dev/ttyUSB1 /dev/ttyUSB2 /dev/ttyUSB3

Setup /etc/ppp/peers/umts:
Code:
# File /etc/ppp/peers/umts
noauth
connect "/usr/sbin/chat -v -f /etc/chatscripts/umts"
defaultroute
/dev/ttyUSB3
115200
persist
debug
passive
noipdefault
usepeerdns
# Varies between carriers, some don't even need these.
user "o2"
password "o2"

Setup /etc/chatscripts/umts (Be sure to replace surfo2 according to your carrier. Google "<yourcarrier> APN"):
Code:
TIMEOUT         120
ABORT           'BUSY'
ABORT           'ERROR'
ABORT           'NO CARRIER'
'              'ATE1'
# Change according to your carrier
OK              AT+CGDCONT=1,"IP","surfo2"
OK              ATD*99***1#
# or OK         ATD*99#
CONNECT         \d\c
Also, if you use O2 germany, stay clear of using the internet APN and use surfo2.

Connect with:
sudo pon umts

Ping something to test the connection (Sometimes I need to run this a few times before it actually reaches something.):
ping -c3 openpandora.org
> 64 bytes from pithos.open-pandora.org (178.63.21.4): icmp_req=1 ttl=56 time=51.3 ms
> 64 bytes from pithos.open-pandora.org (178.63.21.4): icmp_req=2 ttl=56 time=49.7 ms
> 64 bytes from pithos.open-pandora.org (178.63.21.4): icmp_req=3 ttl=56 time=49.1 ms
>
> --- openpandora.org ping statistics ---
> 3 packets transmitted, 3 received, 0% packet loss, time 2002ms
> rtt min/avg/max/mdev = 49.112/50.069/51.312/0.938 ms

After I got this far I wrote a small bash-script I run manually everytime I want to go online with my surfstick:

Code:
#!/bin/bash
sudo killall pppd
sleep 1
sudo modprobe -r usbserial
sudo mknod /dev/ppp c 108 0
sudo usb_modeswitch -c /etc/usb_modeswitch.d/1c9e:f000
sleep 2
sudo modprobe usbserial vendor=0x1c9e product=0x9605
sleep 2
sudo pon umts
 
Last edited by a moderator:
ok i got it to work with some help from here and this topic.

better still it makes "enable mobile broadband" appear in connection manager

this is for a huawei e1750 dongle but may work with others with slight alteration

step 1

Code:
sudo opkg update
sudo opkg install usb-modeswitch-data
sudo opkg install usbmodeswitch

if you get any errors with usbmodeswitch run this command.

Code:
sudo rm /etc/usb_modeswitch.conf
sudo rm /lib/udev/usb_modeswitch

then run

Code:
sudo opkg install usbmodeswitch

again it should install no problem

next

Code:
sudo mousepad /etc/udev/rules.d/usb_modeswitch.rules

enter

Code:
SUBSYSTEM=="usb", SYSFS{idProduct}=="1446", SYSFS{idVendor}=="12d1", RUN+="/usr/sbin/usb_modeswitch -c /etc/usb_modeswitch.d/12d1:1446"

and click file and save

next

Code:
sudo mousepad /etc/usb_modeswitch.conf

add to the bottom

Code:
DefaultVendor=0x12d1
DefaultProduct=0x1446

TargetVendor=0x12d1
TargetProduct=0x1001

MessageContent="55534243000000000000000000000011060000000000000000000000000000"
MessageEndpoint=0x01
CheckSuccess=5

and click file and save and then

Code:
sudo udevadm control --reload-rules
sudo update-modules

after u done all that it when u enter ur huawei e1750 dongle it will auto detect it and will show "enable mobile broadband" tick it then u just need to enter ur network settings :)

this should work for other dongles but the product and vendor id's will be different
 
milkshake said:
ok i got it to work with some help from here and this topic.

better still it makes "enable mobile broadband" appear in connection manager

this is for a huawei e1750 dongle but may work with others with slight alteration
Think this is the dongle I have,, will be checking this later,, thanks alot
 
Last edited by a moderator:
I have a ZTE usb modem provided by '3 Internet' (a UK mobile ISP). Using modem-modeswitch didn't work - the product ID remained the same, I didn't get more than 1 ttyUSB, 'enable mobile internet' didn't show. Googling about revealed that modem-modeswitch is not being maintained and has been depreciated by the udev team in favour of usb-modeswitch, so maybe it doesn't work with newer devices.

However, as Illusionx pointed out, the solution was much easier than using either modem-modeswitch or usb-modeswitch - the problem was that the usb stick provides an emulated cd drive for Windows drivers, so all I had to do was right-click on the drive in Thunar to eject it, and the stick reverts to being a modem! The product id changes, 'enable mobile internet' pops up, and I just had to put '3internet' as the APN in network manager and I was online.
 
The current version of modemmanager in the Angstrom repository seems to conflict with an old package on the Pandora (udev), but installing with "opkg --nodeps modemmanager" still works.

After that, using usb_modeswitch to change the USB id from 12d1:1446 to 12d1:140c makes my Huawei E1750 detectable by Network manager.
 
The current version of modemmanager in the Angstrom repository seems to conflict with an old package on the Pandora (udev), but installing with "opkg --nodeps modemmanager" still works.

Oh thanks you very much I was stuck with this problem :D
 
I DID IT I DID IT !!!!

Sorry for the double post, but from my previous message yesterday I just worked during about 15 hours from 11.am to 1.pm during two entire days on this big issue :D :D

I'm so exhausted, I tested so many things... so switch didn't want to work !!!!! I tried every combinaison as possible, I didn't want to buy a new stick (I could find a new one for about 20 euros, but I can't afford it xd ( xDD ) ). Each time I failed to turn the switch.

So, I was thinking, if I can't turn it off, I HAVE TO REMOVE THE CD ROM by reflashing my stick !! It was 5 hours ago.
My 3g stick is a ZTE K3565-z. I will do an entire how to as soon as I have the time to do it.

Thanks everyone =)
 
Back
Top