Page 3 of 3

Re: Huawei E3231 - new model

Posted: 27 Feb 2013, 16:30
by bmork
chrisberesford wrote:I read here: http://blog.phoenixhaven.net/2012/09/11 ... alup-modem
about the lack of serial ports, and tried to add using the suggested command, but I can't find any reference to the usb-serial module on my system. Is it possible to install as a driver or something?
You'll need the option module and any dependencies Try

Code: Select all

modprobe option
echo 12d1 1c05  >/sys/bus/usb-serial/drivers/option1/new_id

Re: Huawei E3231 - new model

Posted: 02 Mar 2013, 00:08
by chrisberesford
modprobe option appears to load OK, and appears to recognise the dongle briefly, but I think it then gets put into another mode. There's no ttyUSB or ttyA* ports listed when I look in /dev.

Code: Select all

[ 1013.652103] usb 2-4: new high-speed USB device number 4 using ehci_hcd
[ 1013.892201] usbcore: registered new interface driver cdc_ether
[ 1013.895622] usb 2-4: bad CDC descriptors
[ 1013.895674] usb 2-4: bad CDC descriptors
[ 1013.896730] usb 2-4: bad CDC descriptors
[ 1013.896836] usbcore: registered new interface driver rndis_host
[ 1013.939796] cfg80211: Calling CRDA to update world regulatory domain
[ 1014.009638] cfg80211: World regulatory domain updated:
[ 1014.009650] cfg80211:     (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[ 1014.009657] cfg80211:     (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[ 1014.009664] cfg80211:     (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[ 1014.009670] cfg80211:     (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[ 1014.009676] cfg80211:     (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[ 1014.009682] cfg80211:     (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[ 1014.031077] usb 2-4: bad CDC descriptors
[ 1014.031345] usb 2-4: bad CDC descriptors
[ 1014.031490] usb 2-4: bad CDC descriptors
[ 1014.031602] usbcore: registered new interface driver rndis_wlan
[ 1129.737259] usbcore: registered new interface driver usbserial
[ 1129.737301] USB Serial support registered for generic
[ 1129.737414] usbcore: registered new interface driver usbserial_generic
[ 1129.737420] usbserial: USB Serial Driver core
[ 1129.757657] USB Serial support registered for GSM modem (1-port)
[ 1129.757983] usbcore: registered new interface driver option
[ 1129.757988] option: v0.7.2:USB Driver for GSM modems

Re: Huawei E3231 - new model

Posted: 02 Mar 2013, 03:58
by LOM
chrisberesford wrote:modprobe option appears to load OK, and appears to recognise the dongle briefly, but I think it then gets put into another mode. There's no ttyUSB or ttyA* ports listed when I look in /dev.
Remove the rndis_host driver, it claims those interfaces which you want the option driver to handle.

Re: Huawei E3231 - new model

Posted: 02 Mar 2013, 11:10
by bmork
LOM wrote:
chrisberesford wrote:modprobe option appears to load OK, and appears to recognise the dongle briefly, but I think it then gets put into another mode. There's no ttyUSB or ttyA* ports listed when I look in /dev.
Remove the rndis_host driver, it claims those interfaces which you want the option driver to handle.
I don't think it does that. It will load and attempt to probe the interfaces because the class codes match, but the probe is designed to fail so it will not claim them. The "bad CDC descriptors" warning is actually a good sign. It means that the rndis_host probe failed.

It would be useful to see which drivers, if any, were bound to which interfaces. Something like this would do (provided the device still is connected to port 2-4 - adjust if necessary):

Code: Select all

ls -l /sys/bus/usb/devices/2-4:*/driver

Re: Huawei E3231 - new model

Posted: 02 Mar 2013, 16:01
by chrisberesford
No results for that query. I also checked each of the three directories for 2-4:1-3 and there is no /driver directory for any of them.

Any more ideas please?

Thanks
Chris

Re: Huawei E3231 - new model

Posted: 02 Mar 2013, 16:14
by bmork
chrisberesford wrote:No results for that query. I also checked each of the three directories for 2-4:1-3 and there is no /driver directory for any of them.
which is good in the sense that it confirms that no driver has captured any of the interfaces. If the modem really has vid:pid = 12d1:1c05, then something *should* happen when you type:

Code: Select all

echo 12d1 1c05  >/sys/bus/usb-serial/drivers/option1/new_id
If you have Linux v3.5 or later, then you can verify the list of dynamically added IDs by doing

Code: Select all

cat /sys/bus/usb-serial/drivers/option1/new_id

Re: Huawei E3231 - new model

Posted: 04 Mar 2013, 22:14
by chrisberesford
Yippee!

Code: Select all

[ 4029.552484] option 2-4:1.0: GSM modem (1-port) converter detected
[ 4029.553620] usb 2-4: GSM modem (1-port) converter now attached to ttyUSB0
[ 4029.553748] option 2-4:1.1: GSM modem (1-port) converter detected
[ 4029.553958] usb 2-4: GSM modem (1-port) converter now attached to ttyUSB1
[ 4029.554060] option 2-4:1.2: GSM modem (1-port) converter detected
[ 4029.554938] usb 2-4: GSM modem (1-port) converter now attached to ttyUSB2
then using the command

Code: Select all

AT^U2DIAG=119 to return to HiLink mode


gives the following (after unplugging & replugging the dongle)

Code: Select all

[ 5478.288089] usb 2-4: new high-speed USB device number 5 using ehci_hcd
[ 5478.462502] Initializing USB Mass Storage driver...
[ 5478.465916] scsi6 : usb-storage 2-4:1.0
[ 5478.466181] usbcore: registered new interface driver usb-storage
[ 5478.466187] USB Mass Storage support registered.
[ 5478.601988] usb 2-4: USB disconnect, device number 5
[ 5480.384098] usb 2-4: new high-speed USB device number 6 using ehci_hcd
[ 5480.520627] cdc_ether 2-4:1.0: eth0: register 'cdc_ether' at usb-0000:00:04.1-4, CDC Ethernet Device, 58:2c:80:13:92:63
[ 5480.608841] udevd[14307]: renamed network interface eth0 to eth2
It actually appears in network manager and everything! Not tested for data access yet though, but at least it appears to be revived!

Thanks for your help again, and I hope this is useful to others too.
Chris

Re: Huawei E3231 - new model

Posted: 13 May 2013, 00:25
by tartamas
bmork wrote:
OK, that does not look good at all. Only two interfaces and both look like possible RNDIS interfaces, but without any interrupt endpoint. I have no idea how to use that. AFAIK it is required for RNDIS. We certainly require it in Linux at least.


Bjørn
Hi,

Here is the driver for the e3231 dongle.
Includes the linux driver as well.
Hope you can find out something.

http://href.hu/x/kh6j

Re: Huawei E3231 - new model

Posted: 13 May 2013, 09:51
by bmork
tartamas wrote:Here is the driver for the e3231 dongle.
Includes the linux driver as well.
Hope you can find out something.

http://href.hu/x/kh6j
Looks like that just set a static "hwcdrom" name for the embedded CD and end up running a "mbbservice" binary. Without source we cannot know exactly what it does, but based on the string content I see, I assume it just switches the device and starts a browser pointing to http://192.168.1.1

Which will work if the device is switched to a mode like this:
http://www.draisberghof.de/usb_modeswit ... 8037#p8037

But you are much better off leaving the switching to usb_modeswitch and just firing up a browser yourself, IMHO.

Looking at the contained Windows driver doesn't help much either. The only usable reference I find there is

Code: Select all

USB\Class_E0&SubClass_01&Prot_03
and I don't think we've seen the device announce any e0/01/03 interface? I assume this is just some random part from generic Windows driver fixes/updates included on the CD. The whole point of the "HiLink" devices is being "driverless"

Re: Huawei E3231 - new model

Posted: 26 May 2013, 00:07
by dibbo_yorks
I am running a dell xps 13 developer edition with basically the stock dell/ubuntu 12.04 install.
I have found that the e3231 will reliably correctly switch and be detected by the OS as a network interface if the dongle is sitting on a usb 2.0 hub plugged into the computer, but it does not reliably work if plugged directly into the usb 3.0 ports of the computer.

Here is the log from usb_modeswitch for anyone interested (this is with it actually working when plugged into a usb 3.0 port):

Code: Select all

USB_ModeSwitch log from Sat May 25 22:52:12 2013

Using global config file: /etc/usb_modeswitch.conf

Raw args from udev: /3-2:1.0

Bus ID for device not given by udev.
 Trying to determine it from kernel name (3-2:1.0) ...
Using top device dir /sys/bus/usb/devices/3-2

USB dir exists: /sys/bus/usb/devices/3-2
Warning: USB attribute "serial" not readable.

SCSI dir exists: /sys/bus/usb/devices/3-2
Warning: SCSI attribute "vendor" not readable.
Warning: SCSI attribute "model" not readable.
Warning: SCSI attribute "rev" not readable.
----------------
USB values from sysfs:
  idVendor	12d1
  idProduct	1f01
  manufacturer	HUAWEI Technology
  product	HUAWEI Mobile
  serial	(null)
  bNumConfigurations	1
----------------
bNumConfigurations is 1 - don't check for active configuration
Found packed config collection /usr/share/usb_modeswitch/configPack.tar.gz
Searching entries named: /usr/share/usb_modeswitch/12d1:1f01*
Searching overriding entries named: /etc/usb_modeswitch.d/12d1:1f01*
SCSI attributes not needed, moving on.

Extracting config 12d1:1f01 from collection /usr/share/usb_modeswitch/configPack.tar.gz
config: TargetVendor set to 12d1
config: TargetProduct set to 14db
config: NoDriverLoading is set to active
Driver will not be handled by usb_modeswitch
! matched, now switching
Command to be run:
/usr/sbin/usb_modeswitch -I -W -D -s 20 -c /run/usb_modeswitch/current_cfg -u -1   -v 12d1 -p 1f01 2>&1

Verbose debug output of usb_modeswitch and libusb follows
(Note that some USB errors are expected in the process)
--------------------------------

Reading config file: /run/usb_modeswitch/current_cfg

 * usb_modeswitch: handle USB devices with multiple modes
 * Version 1.2.3 (C) Josua Dietze 2012
 * Based on libusb0 (0.1.12 and above)

 ! PLEASE REPORT NEW CONFIGURATIONS !

DefaultVendor=  0x12d1
DefaultProduct= 0x1f01
TargetVendor=   0x12d1
TargetProduct=  0x14db
TargetClass=    not set
TargetProductList=""

DetachStorageOnly=0
HuaweiMode=0
SierraMode=0
SonyMode=0
QisdaMode=0
GCTMode=0
KobilMode=0
SequansMode=0
MobileActionMode=0
CiscoMode=0
MessageEndpoint=  not set
MessageContent="55534243123456780000000000000a11062000000000000100000000000000"
NeedResponse=0
ResponseEndpoint= not set

InquireDevice disabled
Success check enabled, max. wait time 20 seconds
System integration mode enabled


Looking for target devices ...
  searching devices, found USB ID 1d6b:0003
  searching devices, found USB ID 12d1:1f01
   found matching vendor ID
  searching devices, found USB ID 1d6b:0002
  searching devices, found USB ID 8087:07da
  searching devices, found USB ID 8087:0024
  searching devices, found USB ID 1d6b:0002
  searching devices, found USB ID 0c45:644d
  searching devices, found USB ID 8087:0024
  searching devices, found USB ID 1d6b:0002
 No devices in target mode or class found
Looking for default devices ...
  searching devices, found USB ID 1d6b:0003
  searching devices, found USB ID 12d1:1f01
   found matching vendor ID
   found matching product ID
   adding device
  searching devices, found USB ID 1d6b:0002
  searching devices, found USB ID 8087:07da
  searching devices, found USB ID 8087:0024
  searching devices, found USB ID 1d6b:0002
  searching devices, found USB ID 0c45:644d
  searching devices, found USB ID 8087:0024
  searching devices, found USB ID 1d6b:0002
 Found device in default mode, class or configuration (1)
Accessing device 007 on bus 003 ...
Skipping the check for the current configuration
Using first interface: 0x00
Using endpoints 0x01 (out) and 0x81 (in)

USB description data (for identification)
-------------------------
Manufacturer: HUAWEI Technology
     Product: HUAWEI Mobile
  Serial No.: not provided
-------------------------
Looking for active driver ...
 OK, driver found ("usb-storage")
 OK, driver "usb-storage" detached
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
 Could not reset endpoint (probably harmless): -71
 Device is gone, skipping any further commands

Checking for mode switch (max. 20 times, once per second) ...
 Searching for target devices ...
  searching devices, found USB ID 1d6b:0003
  searching devices, found USB ID 12d1:14db
   found matching vendor ID
   found matching product ID
   adding device
  searching devices, found USB ID 1d6b:0002
  searching devices, found USB ID 8087:07da
  searching devices, found USB ID 8087:0024
  searching devices, found USB ID 1d6b:0002
  searching devices, found USB ID 0c45:644d
  searching devices, found USB ID 8087:0024
  searching devices, found USB ID 1d6b:0002

Found target device, now opening

Found target device 008 on bus 003

Target device description data
-------------------------
Manufacturer: HUAWEI Technology
     Product: HUAWEI Mobile
  Serial No.: not provided
-------------------------
 Found correct target device

Mode switch succeeded. Bye.

ok:
--------------------------------
(end of usb_modeswitch output)

USB dir exists: /sys/bus/usb/devices/3-2
Warning: USB attribute "serial" not readable.
Doing no driver checking or binding for this device

All done, exiting

So based on this all I can say is that the default settings for usb_modeswitch do work some of the time, maybe some of the other people seeing problems are using usb 3.0 ports?

Regards

Dave