Author Message

<  Device Information  ~  Disable HiLink of E3256

PostPosted: Wed Mar 15, 2017 2:35 pm Reply with quote
Posts: 9 Joined: Wed Mar 15, 2017 2:19 pm
Hi
I have tried to override the normal usb-modeswitch behavour for a Huawei E3256 device, but without luck.

No matter what i seems to do, the device is present in HiLink mode (12d1:14db) but I would like it to be in serial mode (12d1:1001) so that I can use it with gammu.

I can see in the syslog that modeswitch change the dongle from cdrom mode (12d1:1f01) and into HiLink Mode.

Here is the content of the /etc/usb_modeswitch.d/12d1:1f01


Code:
# Huawei E3531s-2 - switch to modem mode instead of HiLink CDC-Ether mode
TargetVendor=0x12d1
TargetProduct=0x1f01
DefaultVendor=0x12d1
DefaultTarget=0x14db


# switch to 12d1:1001 (modem mode, 3 virtual serial ports)
MessageContent="55534243123456780000000000000011063000000100010000000000000000"



And here are the content of /etc/usb_modeswitch.conf

Code:
# Configuration for the usb_modeswitch package, a mode switching tool for
# USB devices providing multiple states or modes
#
# Evaluated by the wrapper script /usr/sbin/usb_modeswitch_dispatcher
#
# To enable an option, set it to "1", "yes" or "true" (case doesn't matter)
# Everything else counts as "disable"


# Disable automatic mode switching globally (e.g. to access the original
# install storage)

DisableSwitching=0


# Enable logging (results in a extensive report file in /var/log, named
# "usb_modeswitch_<interface-name>" and probably others

EnableLogging=1


# Optional increase of "delay_use" for the usb-storage driver; there are hints
# that a recent kernel default change to 1 sec. may lead to problems, particu-
# larly with USB 3.0 ports. Set this to at least 3 (seconds) in that case.
# Does nothing if the current system value is same or higher

#SetStorageDelay=4


What am I doing wrong? How do I get 12d1:1f01 into 12d1:1001? I really hope somebody can help, as i've spend a lot of time on this.


Offline
PostPosted: Wed Mar 15, 2017 8:16 pm Reply with quote
Site Admin Posts: 6423 Joined: Sat Nov 03, 2007 12:30 am
Have you had a look at the log?

# Enable logging (results in a extensive report file in /var/log, named
# "usb_modeswitch_<interface-name>" and probably others

EnableLogging=1


Offline
PostPosted: Wed Mar 15, 2017 11:26 pm Reply with quote
Posts: 9 Joined: Wed Mar 15, 2017 2:19 pm
I dont have any specific files in /var/log/

Code:
alternatives.log  daemon.log    fontconfig.log  messages.1  wtmp
apt               daemon.log.1  fsck            ntpstats    Xorg.0.log
auth.log          debug         kern.log        samba       Xorg.0.log.old
auth.log.1        debug.1       kern.log.1      syslog
boot.log          dmesg         lastlog         syslog.1
bootstrap.log     dpkg.log      lightdm         user.log
btmp              faillog       messages        user.log.1


If i take a look in syslog then i have the
Code:
Mar 13 10:17:06 MirrorPi kernel: [    9.024128] scsi 0:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2
Mar 13 10:17:06 MirrorPi usb_modeswitch: switch device 12d1:1f01 on 001/004
Mar 13 10:17:06 MirrorPi avahi-daemon[446]: Server startup complete. Host name is MirrorPi.local. Local service cookie is 3293869510.
Mar 13 10:17:06 MirrorPi kernel: [    9.231007] usb 1-1.3: USB disconnect, device number 4

Mar 13 10:17:08 MirrorPi logger: usb_modeswitch: switched to 12d1:14db on 001/005
Mar 13 10:17:08 MirrorPi systemd[1]: Started USB_ModeSwitch.



Offline
PostPosted: Tue Mar 21, 2017 11:28 am Reply with quote
Posts: 9 Joined: Wed Mar 15, 2017 2:19 pm
Does this gives any clue to what could be wrong?


Offline
PostPosted: Tue Mar 21, 2017 9:50 pm Reply with quote
Site Admin Posts: 6423 Joined: Sat Nov 03, 2007 12:30 am
usb_modeswitch is obviously starting automatically and switching the modem, but not creating a log. Do you have any information which version of usb_modeswitch is installed?

Run "usb_modeswitch -h" if you can't find anything.


Offline
PostPosted: Tue Mar 21, 2017 10:25 pm Reply with quote
Posts: 9 Joined: Wed Mar 15, 2017 2:19 pm
Yes, i run 2.2.0


Code:
pi@MirrorPi:~ $ usb_modeswitch -e

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

 ! PLEASE REPORT NEW CONFIGURATIONS !


Offline
PostPosted: Tue Mar 21, 2017 11:07 pm Reply with quote
Site Admin Posts: 6423 Joined: Sat Nov 03, 2007 12:30 am
Can you try to install the current version?

Your's is a bit dated and will likely include bugs that have been fixed since.


Offline
PostPosted: Tue Mar 21, 2017 11:25 pm Reply with quote
Posts: 9 Joined: Wed Mar 15, 2017 2:19 pm
Thats weird. Even after uninstalling usb-modeswitch and rebooting, the usb dongle is still in HiLink mode?


Offline
PostPosted: Tue Mar 21, 2017 11:50 pm Reply with quote
Posts: 9 Joined: Wed Mar 15, 2017 2:19 pm
Updating usb-modeswitch seemed to do the trick. I had to get it from jessie backports source but it seems to be working.

Thank you very much for spending the time on helping me.


Offline
PostPosted: Tue Mar 21, 2017 11:55 pm Reply with quote
Posts: 9 Joined: Wed Mar 15, 2017 2:19 pm
I was to fast..

It worked perfectly, then i rebooted and now the usb dongle is back in HiLink mode..

But the log file is finally present.

Code:
USB_ModeSwitch log from Tue Mar 21 22:50:43 CET 2017

Use global config file: /etc/usb_modeswitch.conf
Raw parameters: {--switch-mode} {1-1.4.1:1.0}
Top device directory not found (/sys/bus/usb/devices/1-1.4.1)! Exit


Offline
PostPosted: Wed Mar 22, 2017 9:04 am Reply with quote
Site Admin Posts: 6423 Joined: Sat Nov 03, 2007 12:30 am
It is pretty obvious that there are two 'authorities' fighting to mode-switch the modem.

Either there is annother tool similar to usb_modeswitch installed or there are two instances of usb_modeswitch present. Did you install any Huawei software perhaps?

Let's focus on the trigger for USB plug-in actions. Go to "/lib/udev/rules.d" and run "grep -i 12d1 *". This should reveal all files in which the Huawei vendor ID is used. Ideally, there should be only one, named "40-usb_modeswitch.rules".

If there are more, then please report.


Offline
PostPosted: Wed Mar 22, 2017 5:16 pm Reply with quote
Posts: 1166 Joined: Wed Jul 11, 2012 3:14 pm Location: Koh Samui, TH
Which Linux kernel version number?


Offline
PostPosted: Wed Mar 22, 2017 5:57 pm Reply with quote
Site Admin Posts: 6423 Joined: Sat Nov 03, 2007 12:30 am
Ah, LOM, I think you are suspecting that specific kernel version which handles almost all Huawei modems in usb-storage ... (This was reversed in a later version.)


Offline
PostPosted: Wed Mar 22, 2017 6:26 pm Reply with quote
Posts: 9 Joined: Wed Mar 15, 2017 2:19 pm
Josh wrote:
It is pretty obvious that there are two 'authorities' fighting to mode-switch the modem.

Either there is annother tool similar to usb_modeswitch installed or there are two instances of usb_modeswitch present. Did you install any Huawei software perhaps?

Let's focus on the trigger for USB plug-in actions. Go to "/lib/udev/rules.d" and run "grep -i 12d1 *". This should reveal all files in which the Huawei vendor ID is used. Ideally, there should be only one, named "40-usb_modeswitch.rules".

If there are more, then please report.


here is the output of /lib/udev/rules.d

Code:
40-usb_modeswitch.rules:ATTRS{idVendor}=="12d1", ATTR{bInterfaceNumber}=="00", A                                                                                                                     TTR{bInterfaceClass}=="08", RUN+="usb_modeswitch '%b/%k'"
60-libgphoto2-6.rules:ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="360f", ENV{ID_                                                                                                                     GPHOTO2}="1", ENV{GPHOTO2_DRIVER}="proprietary", ENV{ID_MEDIA_PLAYER}="1", MODE=                                                                                                                     "0664", GROUP="plugdev"
60-libgphoto2-6.rules:ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="361f", ENV{ID_                                                                                                                     GPHOTO2}="1", ENV{GPHOTO2_DRIVER}="proprietary", ENV{ID_MEDIA_PLAYER}="1", MODE=                                                                                                                     "0664", GROUP="plugdev"
60-libgphoto2-6.rules:ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1051", ENV{ID_                                                                                                                     GPHOTO2}="1", ENV{GPHOTO2_DRIVER}="proprietary", ENV{ID_MEDIA_PLAYER}="1", MODE=                                                                                                                     "0664", GROUP="plugdev"
60-libgphoto2-6.rules:ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1052", ENV{ID_                                                                                                                     GPHOTO2}="1", ENV{GPHOTO2_DRIVER}="proprietary", ENV{ID_MEDIA_PLAYER}="1", MODE=                                                                                                                     "0664", GROUP="plugdev"
69-libmtp.rules:ATTR{idVendor}=="12d1", ATTR{idProduct}=="1051", SYMLINK+="libmt                                                                                                                     p-%k", MODE="660", GROUP="audio", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="                                                                                                                     1"
69-libmtp.rules:ATTR{idVendor}=="12d1", ATTR{idProduct}=="1052", SYMLINK+="libmt                                                                                                                     p-%k", MODE="660", GROUP="audio", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="                                                                                                                     1"
69-libmtp.rules:ATTR{idVendor}=="12d1", ATTR{idProduct}=="360f", SYMLINK+="libmt                                                                                                                     p-%k", MODE="660", GROUP="audio", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="                                                                                                                     1"
69-libmtp.rules:ATTR{idVendor}=="12d1", ATTR{idProduct}=="361f", SYMLINK+="libmt                                                                                                                     p-%k", MODE="660", GROUP="audio", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="                                                                                                                     1"


Yesterday, before i turned the raspberry pi off, i unplugged the usb dongle and plugged it into one of the other usb ports. Then i started the pi again, and it worked (Usb dongle was NOT in HiLink mode). Today when i start the raspberry pi, it is still working. Not sure if the problem is fixed, or there still is some stability issue and it is merely lucky that the dongle have been working 2 times in a row....


Offline
PostPosted: Wed Mar 22, 2017 6:30 pm Reply with quote
Posts: 9 Joined: Wed Mar 15, 2017 2:19 pm
LOM wrote:
Which Linux kernel version number?


pi@MirrorPi:/ $ uname -r
4.9.13-v7+


Offline

Display posts from previous:  Sort by:

All times are UTC+02:00
Page 1 of 2
17 posts
Go to page 1 2 Next
Users browsing this forum: Baidu [Spider] and 5 guests
Search for:
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum