Author Message

<  Device Information  ~  Huawei E3531 with PI Zero W - USB Mass storage [SOLVED]

PostPosted: Wed Jan 17, 2018 10:05 pm Reply with quote
Posts: 4Joined: Wed Jan 17, 2018 9:26 am
hi, i've tried to follow different advices but I can't arriver to switch my dongle.

I've connected a Huawei E3531 dongle to a PI Zero W.

Here is my configuration file :

Quote:
sudo nano /etc/usb_modeswitch.conf


Code:
DefaultVendor= 0x12d1
DefaultProduct= 0x14dc
MessageContent="55534243123456780000000000000011062000000100000000000000000000"


Here is the response :

Quote:
sudo usb_modeswitch -c /etc/usb_modeswitch.conf


Code:
Note: No target parameter given; success check limited
Look for default devices ...
   product ID matched
 Found devices in default mode (1)
Access device 006 on bus 001
Get the current device configuration ...
Current configuration number is 1
Use interface number 0
 with class 2
Error: can't use storage command in MessageContent with interface 0; interface class is 2, expected 8. Abort


Just in case some information :

Quote:
lsusb -v -d 12d1:14dc


Code:
Bus 001 Device 006: ID 12d1:14dc Huawei Technologies Co., Ltd.
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            2 Communications
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x12d1 Huawei Technologies Co., Ltd.
  idProduct          0x14dc
  bcdDevice            1.02
  iManufacturer           1
  iProduct                2
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           94
    bNumInterfaces          3
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         2 Communications
      bInterfaceSubClass      6 Ethernet Networking
      bInterfaceProtocol      0
      iInterface              5
      CDC Header:
        bcdCDC               1.10
      CDC Union:
        bMasterInterface        0
        bSlaveInterface         1
      CDC Ethernet:
        iMacAddress                      7 (??)
        bmEthernetStatistics    0x00000000
        wMaxSegmentSize               1514
        wNumberMCFilters            0x0000
        bNumberPowerFilters              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval               9
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      6
      bInterfaceProtocol      0
      iInterface              6
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk-Only
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x84  EP 4 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               1


Have you an idea of the problem ?


Last edited by trackingnewtech on Tue Jan 23, 2018 9:34 pm, edited 2 times in total.

Offline Profile
PostPosted: Thu Jan 18, 2018 5:27 am Reply with quote
Posts: 1156Location: Koh Samui, THJoined: Wed Jul 11, 2012 3:14 pm
You can not switch 12d1:14dc, it is a usb id after a successful switching and it can not be further switched.


Offline Profile
PostPosted: Thu Jan 18, 2018 4:40 pm Reply with quote
Posts: 4Joined: Wed Jan 17, 2018 9:26 am
LOM wrote:
You can not switch 12d1:14dc, it is a usb id after a successful switching and it can not be further switched.


Ok, When I plugged my 3G dongle I can see in syslog that this message :
Code:
root: usb_modeswitch: switched to 12d1:14dc on 001/004

and then :
Code:
dhcpcd[413]: eth0: carrier lost


I believe the problem is here !!!

Here is the complete syslog :

Code:
kernel: [  220.189812] usb 1-1: New USB device found, idVendor=12d1, idProduct=1f01
kernel: [  220.189846] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
kernel: [  220.189854] usb 1-1: Product: HUAWEI Mobile
kernel: [  220.189862] usb 1-1: Manufacturer: HUAWEI
kernel: [  220.189870] usb 1-1: SerialNumber: FFFFFFFFFFFFFFFF
kernel: [  220.229113] usb-storage 1-1:1.0: USB Mass Storage device detected
kernel: [  220.242807] scsi host0: usb-storage 1-1:1.0
mtp-probe: checking bus 1, device 3: "/sys/devices/platform/soc/20980000.usb/usb1/1-1"
mtp-probe: bus: 1, device: 3 was not an MTP device
systemd[1]: Created slice system-usb_modeswitch.slice.
systemd[1]: Starting USB_ModeSwitch_1-1:1.0...
kernel: [  221.335185] scsi 0:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2
kernel: [  221.371511] scsi 0:0:0:1: Direct-Access     HUAWEI   TF CARD Storage  2.31 PQ: 0 ANSI: 2
kernel: [  221.402964] scsi 0:0:0:0: Attached scsi generic sg0 type 5
kernel: [  221.403366] sd 0:0:0:1: Attached scsi generic sg1 type 0
kernel: [  221.487600] sd 0:0:0:1: [sda] Attached SCSI removable disk
usb_modeswitch: switch device 12d1:1f01 on 001/003
kernel: [  221.677627] sr 0:0:0:0: [sr0] scsi-1 drive
kernel: [  221.677643] cdrom: Uniform CD-ROM driver Revision: 3.20
kernel: [  221.681848] sr 0:0:0:0: Attached scsi CD-ROM sr0
systemd-udevd[621]: inotify_add_watch(9, /dev/sda, 10) failed: No such file or directory
systemd-udevd[621]: inotify_add_watch(9, /dev/sda, 10) failed: No such file or directory
kernel: [  222.018522] usb 1-1: USB disconnect, device number 3
kernel: [  222.268358] Indeed it is in host mode hprt0 = 00021501
kernel: [  222.478233] usb 1-1: new high-speed USB device number 4 using dwc_otg
kernel: [  222.478558] Indeed it is in host mode hprt0 = 00001101
kernel: [  222.729729] usb 1-1: New USB device found, idVendor=12d1, idProduct=14dc
kernel: [  222.729762] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
kernel: [  222.729771] usb 1-1: Product: HUAWEI Mobile
kernel: [  222.729778] usb 1-1: Manufacturer: HUAWEI
kernel: [  222.831147] usb-storage 1-1:1.2: USB Mass Storage device detected
kernel: [  222.835424] scsi host0: usb-storage 1-1:1.2
mtp-probe: checking bus 1, device 4: "/sys/devices/platform/soc/20980000.usb/usb1/1-1"
mtp-probe: bus: 1, device: 4 was not an MTP device
kernel: [  223.032140] cdc_ether 1-1:1.0 eth0: register 'cdc_ether' at usb-20980000.usb-1, CDC Ethernet Device, 00:1e:10:1f:00:00
kernel: [  223.033055] usbcore: registered new interface driver cdc_ether
root: usb_modeswitch: switched to 12d1:14dc on 001/004
dhcpcd[413]: eth0: waiting for carrier
dhcpcd[413]: eth0: carrier acquired
dhcpcd[413]: eth0: IAID 10:1f:00:00
dhcpcd[413]: eth0: adding address fe80::1472:5ded:a33b:2386
dhcpcd[413]: eth0: carrier lost
dhcpcd[413]: eth0: deleting address fe80::1472:5ded:a33b:2386
systemd[1]: Started USB_ModeSwitch_1-1:1.0.
kernel: [  223.902172] scsi 0:0:0:0: Direct-Access     HUAWEI   TF CARD Storage  2.31 PQ: 0 ANSI: 2
kernel: [  223.908060] sd 0:0:0:0: Attached scsi generic sg0 type 0
kernel: [  223.985809] sd 0:0:0:0: [sda] Attached SCSI removable disk
dhcpcd[413]: eth0: carrier acquired
dhcpcd[413]: eth0: IAID 10:1f:00:00
dhcpcd[413]: eth0: adding address fe80::1472:5ded:a33b:2386
dhcpcd[413]: eth0: soliciting an IPv6 router
dhcpcd[413]: eth0: rebinding lease of 192.168.8.100
dhcpcd[413]: eth0: NAK: from 192.168.8.1
dhcpcd[413]: eth0: soliciting a DHCP lease
dhcpcd[413]: eth0: offered 192.168.8.100 from 192.168.8.1
dhcpcd[413]: eth0: probing address 192.168.8.100/24
avahi-daemon[248]: Joining mDNS multicast group on interface eth0.IPv6 with address fe80::1472:5ded:a33b:2386.
avahi-daemon[248]: New relevant interface eth0.IPv6 for mDNS.
avahi-daemon[248]: Registering new address record for fe80::1472:5ded:a33b:2386 on eth0.*.
dhcpcd[413]: eth0: leased 192.168.8.100 for 86400 seconds
dhcpcd[413]: eth0: adding route to 192.168.8.0/24
dhcpcd[413]: eth0: adding default route via 192.168.8.1
avahi-daemon[248]: Joining mDNS multicast group on interface eth0.IPv4 with address 192.168.8.100.
avahi-daemon[248]: New relevant interface eth0.IPv4 for mDNS.
avahi-daemon[248]: Registering new address record for 192.168.8.100 on eth0.IPv4.
dhcpcd[413]: eth0: no IPv6 Routers available


As you see, it looks the dongle is still recognized as an USB Mass Storage device detected. Do you understand where is the problem ?


Offline Profile
PostPosted: Thu Jan 18, 2018 5:29 pm Reply with quote
Site AdminPosts: 6360Joined: Sat Nov 03, 2007 12:30 am
It's not unusual for current modems to provide their "CD" storage again even when in modem mode.

All in all, the syslog looks OK. Try to direct your browser to 192.168.8.1 afterwards.


Offline Profile
PostPosted: Thu Jan 18, 2018 11:11 pm Reply with quote
Posts: 4Joined: Wed Jan 17, 2018 9:26 am
Josh wrote:
It's not unusual for current modems to provide their "CD" storage again even when in modem mode.

All in all, the syslog looks OK. Try to direct your browser to 192.168.8.1 afterwards.


I've found a trick to unswitch !!!

You have to remove modeswitch and install it again

Code:
sudo apt-get remove usb-modeswitch usb-modeswitch-data
sudo apt autoremove
sudo reboot


Unplug your dongle and connect it again.
If you run lsusb you will get something like

Code:
Bus 001 Device 006: ID 12d1:1f01 Huawei Technologies Co., Ltd. E353/E3131 (Mass storage mode)


You can install modeswitch again again :

Code:
sudo apt-get install usb-modeswitch usb-modeswitch-data


then you add a configuration file like this :

Code:
sudo nano /etc/usb_modeswitch.conf


Code:
DefaultVendor= 0x12d1
DefaultProduct= 0x1f01
MessageContent="55534243123456780000000000000011062000000100000000000000000000"


Code:
sudo usb_modeswitch -c /etc/usb_modeswitch.conf


You should see this logs :

Code:
Look for default devices ...
   product ID matched
 Found devices in default mode (1)
Access device 006 on bus 001
Get the current device configuration ...
Current configuration number is 1
Use interface number 0
 with class 8
Use endpoints 0x01 (out) and 0x81 (in)

USB description data (for identification)
-------------------------
Manufacturer: HUAWEI
     Product: HUAWEI Mobile
  Serial No.: FFFFFFFFFFFFFFFF
-------------------------
Looking for active driver ...
 OK, driver detached
Set up interface 0
Use endpoint 0x01 for message sending ...
Trying to send message 1 to endpoint 0x01 ...
 OK, message successfully sent
Read the response to message 1 (CSW) ...
 Response successfully read (13 bytes), status 0
Reset response endpoint 0x81
Reset message endpoint 0x01
-> Run lsusb to note any changes. Bye!


And if you run again lsusb you will have this time something like

Code:
Bus 001 Device 007: ID 12d1:1001 Huawei Technologies Co., Ltd. E169/E620/E800 HSDPA Modem


Offline Profile
PostPosted: Fri Jan 19, 2018 9:44 am Reply with quote
Site AdminPosts: 6360Joined: Sat Nov 03, 2007 12:30 am
I really think you need to read the usb_modeswitch doc page and also the README files. What you suggest will screw up the configuration of the usb_modeswitch system.
  • "/etc/usb_modeswitch.conf" is the global configuration file. Don't put device config data in there.
  • To disable the automatic mode-switching (which is working well on your system), don't uninstall usb_modeswitch. Just set the respective option in the global config file, and nothing will happen when you insert the stick
  • If you want to customize the configuration for your modem, copy its default config file from "/usr/share/usb_modeswitch" to "/etc/usb_modeswitch.d", then edit it to your liking. It will be used automatically and take precedence over the default configuration.


Offline Profile
PostPosted: Sun Jan 21, 2018 9:09 pm Reply with quote
Posts: 4Joined: Wed Jan 17, 2018 9:26 am
Josh wrote:
I really think you need to read the usb_modeswitch doc page and also the README files. What you suggest will screw up the configuration of the usb_modeswitch system.
  • "/etc/usb_modeswitch.conf" is the global configuration file. Don't put device config data in there.
  • To disable the automatic mode-switching (which is working well on your system), don't uninstall usb_modeswitch. Just set the respective option in the global config file, and nothing will happen when you insert the stick
  • If you want to customize the configuration for your modem, copy its default config file from "/usr/share/usb_modeswitch" to "/etc/usb_modeswitch.d", then edit it to your liking. It will be used automatically and take precedence over the default configuration.


Thanks for your advice.

I've reinstalled my RPI to be sure to follow the installation procedure.

So this time I've create directly this file : sudo nano /etc/usb_modeswitch.d/12d1:1f01

Code:
MessageContent="55534243123456780000000000000011062000000100000000000000000000"


I've installed modeswitch as usual : sudo apt-get install usb-modeswitch usb-modeswitch-data

This command response : dmesg | grep tty | grep usb

Code:
last lines of output should now show it attached to ttyUSBX
[153.452085] option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0
[153.452879] option1 ttyUSB1: GSM modem (1-port) converter now disconnected from ttyUSB1
[153.458673] option1 ttyUSB2: GSM modem (1-port) converter now disconnected from ttyUSB2


My goal is to use "gammu" to send and receive SMS.

Here is my problem.

I've installed gammu like this : sudo apt-get install gammu gammu-smsd

I've edited the configuration file like this :

Code:
# Configuration file for Gammu SMS Daemon

# Gammu library configuration, see gammurc(5)
[gammu]
device = /dev/ttyUSB0
name = Téléphone sur le port USB série HUAWEIHUAWEI_Mobile
connection = at
# Debugging
#logformat = textall

[gammu1]
device = /dev/ttyUSB1
name = Téléphone sur le port USB série HUAWEIHUAWEI_Mobile
connection = at

[gammu2]
device = /dev/ttyUSB2
name = Téléphone sur le port USB série HUAWEIHUAWEI_Mobile
connection = at

# SMSD configuration, see gammu-smsdrc(5)
[smsd]
service = files
logfile = syslog
# Increase for debugging information
debuglevel = 0

# Paths where messages are stored
inboxpath = /var/spool/gammu/inbox/
outboxpath = /var/spool/gammu/outbox/
sentsmspath = /var/spool/gammu/sent/
errorsmspath = /var/spool/gammu/error/

CheckSecurity = 0
CheckBattery = 0


Then you have to restart the daemon : sudo /etc/init.d/gammu-smsd restart

Each time I send a SMS it works : sudo gammu-smsd-inject TEXT <MOBILE PHONE NUMBER> -text "Test"

But when I reply, the SMS doesn't arrived in the directory /var/spool/gammu/inbox/ each time

I've done this test before to have installed NODE-RED on my RPI Zero W.

I don't think the problem is still related to my dongle which is well recognized by the system now.

If I find the problem.. I will put the link to the resolution... here

I'm going to post this "new" problem in another forum focused on gammu.

Thank you very much for your support


Offline Profile

Display posts from previous:  Sort by:

All times are UTC + 1 hour [ DST ]
Page 1 of 1
7 posts
Users browsing this forum: No registered users and 1 guest
Search for:
Post new topic  Reply to topic
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