Automatic Activation, Hotplug and UDEV, Configuration
Post Reply
onlineuser
Posts: 6
Joined: 18 Jun 2015, 11:04

Huawei 3531...

Post by onlineuser » 18 Jun 2015, 11:10

Hello,

I have a Huawei 3531 UMTS stick and I do not get it in modem mode.

Code: Select all

lsusb
Bus 001 Device 006: ID 12d1:15ca Huawei Technologies Co., Ltd.
The modem mode should be 12d1:1506.

When I try sudo usb_modeswitch -v 12d1 -p 15ca -M '55534243123456780000000000000011062000000100000000000000000000' it also not switches to modem mode.

Code: Select all

 sudo usb_modeswitch -v 12d1 -p 15ca -M '55534243123456780000000000000011062000000100000000000000000000'

Looking for default devices ...
   found matching product ID
   adding device
 Found device in default mode, class or configuration (1)
Accessing device 006 on bus 001 ...
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
     Product: HUAWEI Mobile
  Serial No.: FFFFFFFFFFFFFFFF
-------------------------
Setting up communication with interface 0
Using endpoint 0x01 for message sending ...
Trying to send message 1 to endpoint 0x01 ...
 OK, message successfully sent
Resetting response endpoint 0x81
Resetting message endpoint 0x01
-> Run lsusb to note any changes. Bye.
I also tried this:

Code: Select all

sudo usb_modeswitch -v 12d1 -p 15ca -M '55534243123456780000000000000011062000000100000000000000000000' 
sudo modprobe option
echo "12d1 1506" | sudo tee /sys/bus/usb-serial/drivers/option1/new_id 
Do anyone have any tip for me?

Best Regards

LOM
Posts: 1404
Joined: 11 Jul 2012, 15:14
Location: Koh Samui, TH

Re: Huawei 3531...

Post by LOM » 18 Jun 2015, 11:42

onlineuser wrote:Hello,

I have a Huawei 3531 UMTS stick and I do not get it in modem mode.
What kind of hardware do you use the dongle on?
usb_modeswitch version? linux distro and kernel version?
onlineuser wrote: I also tried this:

Code: Select all

sudo usb_modeswitch -v 12d1 -p 15ca -M '55534243123456780000000000000011062000000100000000000000000000' 
sudo modprobe option
echo "12d1 1506" | sudo tee /sys/bus/usb-serial/drivers/option1/new_id 
Do anyone have any tip for me?
Not much use in forcing the option driver to bind to the switched id if the dongle never switches..
12d1:15ca should work out of the box, the id was added to usb_modeswitch in May last year so
you should not need any manual cmds if your usb_modeswitch software is up-to-date.
The same goes for the option driver, it should bind to the dongles interfaces without need for
using the new_id function.

onlineuser
Posts: 6
Joined: 18 Jun 2015, 11:04

Re: Huawei 3531...

Post by onlineuser » 18 Jun 2015, 11:46

What kind of hardware do you use the dongle on?
usb_modeswitch version? linux distro and kernel version?
I use it on my Raspberry.

On an other Raspberry I also used a E176 and then I changed to E3531 and it worked.

But on this Raspberry I do not get the stick in the modem mode.
Under Windows it runs without problems.

LOM
Posts: 1404
Joined: 11 Jul 2012, 15:14
Location: Koh Samui, TH

Re: Huawei 3531...

Post by LOM » 18 Jun 2015, 16:45

onlineuser wrote:
What kind of hardware do you use the dongle on?
I use it on my Raspberry.
That is what I guessed.
There are lots of different 3G dongle problems on Raspberry Pi caused by the usb root hub driver (dwc_otg).
These problems can only be solved by the maintainers of the Raspbian distro.

onlineuser
Posts: 6
Joined: 18 Jun 2015, 11:04

Re: Huawei 3531...

Post by onlineuser » 18 Jun 2015, 17:40

Thx.

But it's strange that the changing to the 3531 was no problem but now the 3531 does not run on a fresh installation.

Today I will try the usbreset script for Raspberry - maybe this helps.

Is there any other way to force the stick to the modem mode?

modamn
Posts: 4
Joined: 20 Jun 2015, 15:31

Re: Huawei 3531...

Post by modamn » 20 Jun 2015, 15:40

But it's strange that the changing to the 3531 was no problem but now the 3531 does not run on a fresh installation.
When you have multiple Installations ( Dual/Multi-Boot) and have switched the mode from usb storage to the modem mode
and reboot into another partition , without powering off the PC or unplugging the modem ,
then the switched mode should persist .
No modeswitch needed in such case .
This may lead to thinking , that it once worked , but at another day not any more .

modamn
Posts: 4
Joined: 20 Jun 2015, 15:31

Re: Huawei 3531...

Post by modamn » 20 Jun 2015, 16:25

I have several USB Modems from Provider O2/Telefonica for Germany .

It is sold in a package where it is printed HUAWEI E3531 .
O2 Prepaid Surfstick ( Huawei E3531 )
GSM/GPRS/EDGE/ 850/900/1800/1900MHz / HSPA+/UMTS 900/2100MHz
Inside the stick after removing the lid to access the SIM-card and µSD-card slots ,
the sticker says :
HUAWEI Mobile Broadband
O2 Prepaid-Surfstick
HUAWEI E3531
Model: E3531s - 2
IMEI: SOMENUMBER
S/N: SOMECHARSANDNUMBERS
The srX drive contains a 32-bit linux modeswitching daemon with an /etc/init.d/runmbbservice shell script .
The script is mainly made for SuSE since it contains code using sysvinit patched with a few binaries ,
only available in SuSE repositories ( found source and compiled around SuSE 10.3 ) .

The Huawei provided and installed modeswitching works for me on 32-bit

Code: Select all

/etc/init.d/script start ; ifconfig eth1 up; dhcpcd eth1 ;
I am not using udevd .
I am using a busybox ash script to handle add and firmware events ( echo /path/to/handler.sh >/proc/sys/kernel/hotplug ) ,
which works for me in a satisfying manner .

The Linux I am using is "Puppy Linux" older version 4.3.x ( 2.6.30.5 ) with newer self-compiled kernels ( 2.6.34 ,2.6.37, 3.5.0, 3.9.9 , 3.13.x ) .

By default Puppy Linux uses udevd , which I made a fall-back if my handler is not executable .

Now I have installed a 64-bit version of Puppy-Linux .
Though I recompiled the kernel to support IA32 , the Huawei modeswitch daemon still segfaults , even with added 32-bit libs and re-set LD_LIBRARY_PATH .

The Vendor-ID is < 121d > as usual for Huawei .
The Product-ID is < 157c > for the unswitched mode .
The Product-ID is < 14dc > for the modem mode .
But until now was not able to use usb_modeswitch -p 121d -v 157c -P 121d -V 14dc - it gives me error , that device wasn't found .

Current cat /sys/kernel/debug/usb/devices output on 32-bit :

Code: Select all

T:  Bus=01 Lev=02 Prnt=02 Port=01 Cnt=02 Dev#=  6 Spd=480  MxCh= 0
D:  Ver= 2.00 Cls=02(comm.) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=12d1 ProdID=14dc Rev= 1.02
S:  Manufacturer=HUAWEI
S:  Product=HUAWEI Mobile
C:* #Ifs= 3 Cfg#= 1 Atr=80 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=06 Prot=00 Driver=cdc_ether
E:  Ad=83(I) Atr=03(Int.) MxPS=  16 Ivl=32ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether
E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 2 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=125us
Note : Puppy Linux by default is not configured to support debugfs !

Kernel 3.4 was last kernel to be able to configure usbfs to mount /proc/bus/usb .
Note : Puppy Linux by default should support and mount usbfs if available .

usb-modeswitch-data has apparently several 121d:157c configuration files ,
as

Code: Select all

# Huawei E3276-s150
TargetVendor=0x12d1
TargetProduct=0x1506
MessageContent="55534243123456780000000000000011062000000101000100000000000000"
or

Code: Select all

# Huawei E3276-s150
TargetVendor=0x12d1
TargetProduct=0x1506
HuaweiNewMode=1
So both usb_modeswitch and the pre-compiled and shipped mbbservice daemon do not work for me to switch the mode on 64-bit .
usb_modeswitch has changed .
I cannot find an older versions archive , need to browse other distribution's repositories to get me older versions of usb_modeswitch and -data .

LOM
Posts: 1404
Joined: 11 Jul 2012, 15:14
Location: Koh Samui, TH

Re: Huawei 3531...

Post by LOM » 20 Jun 2015, 17:52

modamn wrote: The Vendor-ID is < 121d > as usual for Huawei .
No, the Huawei vendor id is 12d1
modamn wrote: The Product-ID is < 157c > for the unswitched mode .
The Product-ID is < 14dc > for the modem mode .

But until now was not able to use usb_modeswitch -p 121d -v 157c -P 121d -V 14dc - it gives me error , that device wasn't found .
Of course not found when you use the vendor id with the product switch and the product id with the vendor switch and furthermore use a wrong vendor id.
Nothing is correct in your cmd line..

-v and -V 12d1, -p 157c, -P 14dc and not the other way around.

That will still not switch the device, you do also need a switch method/switch message on the cmd line:

-M 55534243123456780000000000000011062000000101000100000000000000

modamn
Posts: 4
Joined: 20 Jun 2015, 15:31

Re: Huawei 3531...

Post by modamn » 20 Jun 2015, 19:00

Thank you very much LOM !

Oops - you are right , I posted from another partition , and now checking the .history file , every line had 121d - not 12d1 .
That is why I got the device not found message .. :oops:

Works now with

Code: Select all

usb_modeswitch -W -v 12d1 -p 157d -V 12d1 -P 14dc -M "55534243123456780000000000000011062000000101000100000000000000"
Before I used another MessageContent line from a config file in /etc/modeswitch.d , that switched to 1001 .
Did not work .

The correct MessageContent line I found in
usb-modeswitch-data-20140327
which I either found in some slackware or ubuntu repository I think . debian should be newer or older .


The MessageContent strings appear many times same or only slightly different for Huawei .

Posting from it now .

Terminal Log :

Code: Select all

# lsusb                                               
Bus 001 Device 002: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 005 Device 002: ID 04d9:1503 Holtek Semiconductor, Inc. Shortboard Lefty
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 004: ID 045e:07b2 Microsoft Corp. 
Bus 001 Device 007: ID 12d1:157d Huawei Technologies Co., Ltd. 

<-M "55534243123456780000000000000011062000000101000100000000000000"         

Take all parameters from the command line


 * usb_modeswitch: handle USB devices with multiple modes
 * Version 2.0.1 (C) Josua Dietze 2013
 * Based on libusb1/libusbx

 ! PLEASE REPORT NEW CONFIGURATIONS !

DefaultVendor=  0x12d1
DefaultProduct= 0x157d
TargetVendor=   0x12d1
TargetProduct=  0x14dc
MessageContent="55534243123456780000000000000011062000000101000100000000000000"
NeedResponse=0

InquireDevice enabled (default)

Look for target devices ...
  found USB ID 05e3:0608
  found USB ID 04d9:1503
  found USB ID 1d6b:0002
  found USB ID 1d6b:0001
  found USB ID 1d6b:0001
  found USB ID 1d6b:0001
  found USB ID 1d6b:0001
  found USB ID 045e:07b2
  found USB ID 12d1:157d
   vendor ID matched
 No devices in target mode or class found
Look for default devices ...
  found USB ID 05e3:0608
  found USB ID 04d9:1503
  found USB ID 1d6b:0002
  found USB ID 1d6b:0001
  found USB ID 1d6b:0001
  found USB ID 1d6b:0001
  found USB ID 1d6b:0001
  found USB ID 045e:07b2
  found USB ID 12d1:157d
   vendor ID matched
   product ID matched
 Found devices in default mode (1)
Access device 007 on bus 001
Get the current device configuration ...
 OK, got current device configuration (1)
Use interface number 0
Use endpoints 0x01 (out) and 0x81 (in)
Inquire device details; driver will be detached ...
Looking for active driver ...
 OK, driver detached

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

USB description data (for identification)
-------------------------
Manufacturer: HUAWEI
     Product: HUAWEI Mobile
  Serial No.: FFFFFFFFFFFFFFFF
-------------------------
Set up interface 0
Use endpoint 0x01 for message sending ...
Trying to send message 1 to endpoint 0x01 ...
 OK, message successfully sent
Reset response endpoint 0x81
Reset message endpoint 0x01
 Device is gone, skip any further commands
-> Run lsusb to note any changes. Bye!

# lsusb                                             
Bus 001 Device 002: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 005 Device 002: ID 04d9:1503 Holtek Semiconductor, Inc. Shortboard Lefty
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 004: ID 045e:07b2 Microsoft Corp. 
Bus 001 Device 008: ID 12d1:14dc Huawei Technologies Co., Ltd. 


Question : Is it possible to switch back to the storage or default mode from the modem mode ?
When I used the wrong MessageContent string , it was not possible to switch from product ID 1001 to 157d .
Replugging helped .

LOM
Posts: 1404
Joined: 11 Jul 2012, 15:14
Location: Koh Samui, TH

Re: Huawei 3531...

Post by LOM » 21 Jun 2015, 05:14

modamn wrote:
Question : Is it possible to switch back to the storage or default mode from the modem mode ?
When I used the wrong MessageContent string , it was not possible to switch from product ID 1001 to 157d .
Replugging helped .
There is no provision for switching back, that can only be achieved by removing power from the dongle.

Josh
Site Admin
Posts: 6593
Joined: 03 Nov 2007, 00:30

Re: Huawei 3531...

Post by Josh » 21 Jun 2015, 10:11

modamn wrote:The correct MessageContent line I found in
usb-modeswitch-data-20140327 which I either found in some slackware or ubuntu repository I think.
Are you aware that the latest usb-modeswitch-data is available right here on this site?

modamn
Posts: 4
Joined: 20 Jun 2015, 15:31

Re: Huawei 3531...

Post by modamn » 22 Jun 2015, 16:30

Josh wrote:
modamn wrote:The correct MessageContent line I found in
usb-modeswitch-data-20140327 which I either found in some slackware or ubuntu repository I think.
Are you aware that the latest usb-modeswitch-data is available right here on this site?
Of course I am .

Sadly , I wrote :
usb_modeswitch has changed .
I cannot find an older versions archive , need to browse other distribution's repositories to get me older versions of usb_modeswitch and -data .
Usually there are archives .
usb_modeswitch has no own archive apparently on draisenberghof.de .
Archives act as proof , how stupid the programmers were or still are .. :oops:

Josh ! Keep up the good work !

Josh , the modem bundle for the E3531s - 2 was sold at Saturn Electronic-Market once for 15 €uro instead the usual 24-40 €uro .
Weeks later that special offer was abandoned , but the O2-girl at Saturn gave me 4 more for 15 €uro .

If you are interested , I can send you one for free . It is pre-paid with one week free testing full-speed 3G up to 1GB traffic .
Since you seem located at the countryside , am really astonished , that you do this mobile modem thing , since antennas likely are fewer than in urban areas .

onlineuser
Posts: 6
Joined: 18 Jun 2015, 11:04

Re: Huawei 3531...

Post by onlineuser » 22 Jun 2015, 17:20

I found this tool "autoconnect" - http://flyingcarsandstuff.com/2014/11/r ... pberry-pi/

This tool was able to switch my Huawei E 3531 to the modem mode. :-)

With usb_modeswitch it only worked for my Huawei E 182 but not for the Huawei E 3531.

Josh
Site Admin
Posts: 6593
Joined: 03 Nov 2007, 00:30

Re: Huawei 3531...

Post by Josh » 23 Jun 2015, 21:05

I've looked into the tool, and it does basically the same thing as usb_modeswitch, just going through the SCSI subsystem. The command arriving at the device is identical.

Maybe I'll look around if I can buy one of those modems, and get a first-hand look.

Post Reply