[Solved] Huawei 3G Modem

Questions about WIFI networks and devices
Forum rules
Before you post please read this

[Solved] Huawei 3G Modem

Postby vayth on Wed Dec 04, 2013 8:40 pm

Hi,
I have a problem with my Huawei Modem, E1550 to be exact. It almost always get detect as storage mode, and some"rare"times, as modem. Unfortunately, I'm unable to switch at my will. I've tried many article about usb_modeswitch, but it always said no driver or can't switch. installing Mobile Partner used to work and fix the problem in Mint 15, but for some reason, I can't get it installed in Mint 16...

Any solution?
Last edited by vayth on Tue Dec 24, 2013 2:35 am, edited 1 time in total.
vayth
Level 1
Level 1
 
Posts: 32
Joined: Tue Feb 14, 2012 7:09 am

Linux Mint is funded by ads and donations.
 

Re: Huawei 3G Modem

Postby Zorba on Wed Dec 04, 2013 9:34 pm

1- If your 3g dongle is not dtected at all, that's because it's mouted as USB SCSI CDROM. The easiest way to switch to modem mode is by ejecting the CDROM :


Code: Select all
eject /dev/sr1


now add that command line to startup applications

2- to establish a 3g mobile broadband autoconnection/ reconnection on Linux Mint :

b- Solution 1:

a- find the name of you If you have already set up a 3g connection by runnig this command in terminal:


Code: Select all
nmcli con list


this will list the configured connections in your Network Manager. It would show the following example output:

Code: Select all
Tunisie Télécom / TUNTEL WEB DATA 1 96e3f81e-6a1c-4ca4-bbf3-3b6056839b69 gsm Wed 13 Nov 2013 11:28:32 AM CET


In the example look for the name of your mobile broadband connection (it will have "gsm" at the end of first line). In the example above it is "Tunisie Télécom / TUNTEL WEB DATA"


b- create a shell script as follows (Replace "Tunisie Télécom / TUNTEL WEB DATA" with the name of your Mobile Broadband connection name):

Code: Select all
#!/bin/bash

while true; do
    LC_ALL=C nmcli -t -f TYPE,STATE dev | grep -q "^gsm:disconnected$"
    if [ $? -eq 0 ]; then
        #jdownloader is still in the download status so stop it because
        #internet is disconnected and jdownloader won't resume download
        #when connected again
        #jdownloader --stop-download
        #sometimes I can not get connected after disconnection when
        #I click on <name of the network connection>. I have to disable
        #and enable Mobile Broadband
        nmcli -t nm wwan off
        sleep 1
        nmcli -t nm wwan on
        sleep 1
        nmcli -t con up id "Tunisie Télécom / TUNTEL WEB DATA"
        #wait approximately 15 sec to get connected
        #if anyone can add better command to check for it just comment it :-p
        sleep 15
        #now connected to internet so start download
        #jdownloader --start-download
    fi
    #it does not worth keep it checking every millisecond.
    #my connection will be reestablished within 5-15 seconds
    sleep 2
    #if anyone can code it better please feel free to comment
    #TO-DO:: check for data received. if data < 15 KB after 20 seconds of connection
    #reconnect mobile broadband connection 
done



2- Save it and give it execution permission then add it to Startup Applications.

Image


Now it will connect automatically at startup and if connection is dropped.


Solution 2 :

1- get the attached script below

2- extract it to your home folder (or somewhere safe) and make it hidden by placing a dot before it like this .network-autoconnection.sh (so that you won't accidently delete it)

3- Give it execution permission like this: rightclick on it, go to "properties", then navigate to "permissions" then tick "Allow executing file as program"


Image


Image



4- go to the Mint menu and type "startup applications"


5- click on "add" then "browse" opposite to "command" field to give the directory of the script (your home folder or wherever you've placed it) then give it a name in the "name" field, for example mine is "Tunisie Télécom / TUNTEL WEB DATA".

Image



Appendix: The following commands are useful if you want to start your connection from terminal/create a launcher and you can use them in a script as well:

Code: Select all
#! /bin/sh -e
nmcli nm wwan on
nmcli con up id "Tunisie Télécom / TUNTEL WEB DATA"


and don't forget to replace "Tunisie Télécom / TUNTEL WEB DATA" with the name of your Mobile Broadband connection name

To retart your network manager use this command in terminal:

Code: Select all
sudo service network-manager restart
or this with alt+f2
Code: Select all
gksu service network-manager restart




Now you can run Linux Mint 16 Petra! enjoy :D
Attachments
network-autoconnection.sh.tar.gz
(741 Bytes) Downloaded 30 times
Last edited by Zorba on Wed Dec 04, 2013 9:42 pm, edited 1 time in total.
Image Image
User avatar
Zorba
Level 8
Level 8
 
Posts: 2012
Joined: Tue May 29, 2012 10:12 pm
Location: Tunisia

Re: Huawei 3G Modem

Postby vayth on Thu Dec 05, 2013 7:33 pm

unfortunately, it didn't work..

I have no device for sr1, and sr0 pointing to my actual cd-rom.
It's actually listed as storage device usb/memory card; I read some modem with memory card are confused by Linux whether it's a modem or a storage device.

I tried to detach it with
Code: Select all
sudo usb_modeswitch -v 12d1 -p 1446 -d 1

and results in...
Code: Select all
Looking for default devices ...
   found matching product ID
   adding device
 Found device in default mode, class or configuration (1)
Accessing device 002 on bus 003 ...
Getting the current device configuration ...
 OK, got current device configuration (1)
Using first interface: 0x00
Using endpoints 0x01 (out) and 0x81 (in)
Inquiring device details; driver will be detached ...
Looking for active driver ...
 No driver found. Either detached before or never attached

SCSI inquiry data (for identification)
-------------------------
  Vendor String: HUAWEI 
   Model String: Mass Storage   
Revision String: 2.31
-------------------------

USB description data (for identification)
-------------------------
Manufacturer: HUAWEI Technology
     Product: HUAWEI Mobile
  Serial No.: not provided
-------------------------
Only detaching storage driver for switching ...
 Any driver was already detached for inquiry
-> Run lsusb to note any changes. Bye.


Still, my lsusb didn't change
Code: Select all
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 093a:2510 Pixart Imaging, Inc. Optical Mouse
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 003: ID 064e:d251 Suyin Corp.
Bus 003 Device 002: ID 12d1:1446 Huawei Technologies Co., Ltd. E1552/E1800/E173 (HSPA modem)
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub


if I tried to detach it again, or trying to switch with
Code: Select all
sudo usb_modeswitch -v 12d1 -p 1446 -V 12d1 -P 1001


I got
Code: Select all
Looking for target devices ...
 No devices in target mode or class found
Looking for default devices ...
   found matching product ID
   adding device
 Found device in default mode, class or configuration (1)
Accessing device 002 on bus 003 ...
Getting the current device configuration ...
 OK, got current device configuration (1)
Using first interface: 0x00
Using endpoints 0x01 (out) and 0x81 (in)
Inquiring device details; driver will be detached ...
Looking for active driver ...
 No driver found. Either detached before or never attached

SCSI inquiry data (for identification)
-------------------------
  Vendor String: HUAWEI 
   Model String: Mass Storage   
Revision String: 2.31
-------------------------

USB description data (for identification)
-------------------------
Manufacturer: HUAWEI Technology
     Product: HUAWEI Mobile
  Serial No.: not provided
-------------------------
Warning: no switching method given.
-> Run lsusb to note any changes. Bye.


I don't understand... :(

P.S: Your script actually working if it gets detected as a modem first (like the method I usually do: login to Windows, connect the modem, then restart to Linux, and it will get detected as modem. Not working if I have shutdown between Windows and Linux. Not really efficient way, right? :lol: )
vayth
Level 1
Level 1
 
Posts: 32
Joined: Tue Feb 14, 2012 7:09 am

Re: Huawei 3G Modem

Postby Zorba on Fri Dec 06, 2013 9:14 am

go to disk-utility and check how it is listed. It would be something like dev/sr0 :D than replace " /dev/sr1" in the command line I gave you with it so it would look like

Code: Select all
eject /dev/sr0
or whatever itis listed :D

I had that issue before with ZTE dongles!
Image Image
User avatar
Zorba
Level 8
Level 8
 
Posts: 2012
Joined: Tue May 29, 2012 10:12 pm
Location: Tunisia

Re: Huawei 3G Modem

Postby vayth on Sun Dec 15, 2013 8:44 pm

Okay, so it's listed as /dev/sdb
But when I ejected it
Code: Select all
sudo eject /dev/sdb

It says:
Code: Select all
eject: unable to eject, last error: Invalid argument


The same is displayed when I tried to eject it from disk-utility GUI:
Code: Select all
Error ejecting /dev/sdb: Command-line 'eject "/dev/sdb"' exited with non-zero exit status 1:
eject: unable to eject, last error: Invalid argument
(udisks-error-quark, 0)
vayth
Level 1
Level 1
 
Posts: 32
Joined: Tue Feb 14, 2012 7:09 am

Re: Huawei 3G Modem

Postby vayth on Mon Dec 23, 2013 11:12 pm

sorry for giving this another bump, since it's been almost 3 weeks since last post.
still the same problem, and this is a show-stopper for me.. :(
vayth
Level 1
Level 1
 
Posts: 32
Joined: Tue Feb 14, 2012 7:09 am

Re: Huawei 3G Modem

Postby Pierre on Tue Dec 24, 2013 1:05 am

this has been addressed before, but the Forum's search function, doesn't always give those thread(s).

"Also, for most of the times you don't need to use sakis3g. You just need to update the modeswitch program and lists"
http://www.sakis3g.org

even this guide, is a little dated, now.
http://www.draisberghof.de/usb_modeswitch/
Last edited by Pierre on Tue Dec 24, 2013 1:38 am, edited 1 time in total.
Image
User avatar
Pierre
Level 6
Level 6
 
Posts: 1036
Joined: Fri Sep 05, 2008 5:33 am
Location: Perth, AU.

Re: Huawei 3G Modem

Postby vayth on Tue Dec 24, 2013 2:35 am

Pierre wrote:this has been addressed before, but the Forum's search function, doesn't always give those thread(s).

"Also, for most of the times you don't need to use sakis3g. You just need to update the modeswitch program and lists"
http://www.sakis3g.org

even this guide, is a little dated, now.
http://www.draisberghof.de/usb_modeswitch/

I've tried usb_modeswitch with no avail before.

ah, sakis3g, I've seen that before, but for reason it escape my mind since I was trying to use any dedfault tools and not trying to install anything.
but that solves the problem. Thanks a lot...
it's really that easy... at least one of my problem goes away. thanks again :D
vayth
Level 1
Level 1
 
Posts: 32
Joined: Tue Feb 14, 2012 7:09 am

Re: [Solved] Huawei 3G Modem

Postby Pierre on Tue Dec 24, 2013 3:58 am

Sakis3g simply bangs the switch.

so, if that works, then so should a mode_switch update.

Code: Select all
usb_modeswitch --version


it should be above v1.2.6 - the latest is above v2

note:- 4g modems aren't always supported, give that some more time .. ..

http://www.zoringroup.com/forum/viewtop ... f=6&t=4077
for a better guide.
Image
User avatar
Pierre
Level 6
Level 6
 
Posts: 1036
Joined: Fri Sep 05, 2008 5:33 am
Location: Perth, AU.

Re: [Solved] Huawei 3G Modem

Postby vayth on Thu Dec 26, 2013 7:53 am

I see.. I have version 1.2.3, but it said that I have the latest version already. Maybe that's outdated and I need to update it manually.
I've tried it before (like on my posts above), but maybe I used it wrong...
vayth
Level 1
Level 1
 
Posts: 32
Joined: Tue Feb 14, 2012 7:09 am

Linux Mint is funded by ads and donations.
 

Return to Wireless

Who is online

Users browsing this forum: No registered users and 7 guests