Why USB Mobile Modem works only on USB-HUB and seemed as SCSI driver & reseted frequently?

eaglehopes

Member
Joined
Jul 8, 2022
Messages
72
Reaction score
19
Credits
724
I have a USB mobile modem that I connect it to USB-HUB with 4 ports. When I looked to it by using lsusb, it shows that :

Bus 008 Device 010: ID XXX:YYYY Huawei Technologies

Sometimes connection errors occures with it and when I looked by using dmesg it says :

[ 1712.511790] usb-storage 2-5.3:1.2: USB Mass Storage device detected
[ 1712.514737] scsi host11: usb-storage 2-5.3:1.2
[ 1713.530899] scsi 11:0:0:0: CD-ROM [OperatorName] USB SCSI CD-ROM 2.31 PQ: 0 ANSI: 2
[ 3073.831108] cdc_ether 2-5.3:1.0 enx[MAC]: unregister 'cdc_ether' usb-0000:00:1a.7-5.3, Huawei CDC Ethernet Device
[ 2575.631187] usb 2-5.3: reset high-speed USB device number 20 using ehci-pci
[ 303.445244] usbcore: registered new interface driver cdc_ether
[ 1698.629126] usb 2-5.4: USB disconnect, device number 10
[ 1698.631316] cdc_ether 2-5.4:1.0 enx[MAC]: unregister 'cdc_ether' usb-0000:00:1a.7-5.4, Huawei CDC Ethernet Device
[ 1710.889404] usb 2-5.3: new high-speed USB device number 11 using ehci-pci
[ 1711.001135] usb 2-5.3: unable to read config index 2 descriptor/start: -32
[ 1711.001140] usb 2-5.3: chopping to 2 config(s)
[ 1711.001143] usb 2-5.3: can't read configurations, error -32
[ 1711.085413] usb 2-5.3: new high-speed USB device number 12 using ehci-pci
[ 1711.197002] usb 2-5.3: unable to read config index 2 descriptor/start: -32
[ 1711.197006] usb 2-5.3: chopping to 2 config(s)
[ 1711.197009] usb 2-5.3: can't read configurations, error -32
[ 1711.201406] usb 2-5-port3: attempt power cycle
[ 1711.805404] usb 2-5.3: new high-speed USB device number 13 using ehci-pci
[ 1711.837126] usb 2-5.3: unable to read config index 2 descriptor/start: -32
[ 1711.837129] usb 2-5.3: chopping to 2 config(s)
[ 1711.837132] usb 2-5.3: can't read configurations, error -32
[ 1711.921401] usb 2-5.3: new high-speed USB device number 14 using ehci-pci
[ 1711.953253] usb 2-5.3: unable to read config index 2 descriptor/start: -32
[ 1711.953257] usb 2-5.3: chopping to 2 config(s)
[ 1711.953259] usb 2-5.3: can't read configurations, error -32
[ 1711.957406] usb 2-5-port3: unable to enumerate USB device
[ 1712.397404] usb 2-5.3: new high-speed USB device number 15 using ehci-pci
[ 1712.507005] usb 2-5.3: New USB device found, idVendor=VID, idProduct=PID, bcdDevice=f0.55
[ 1712.507009] usb 2-5.3: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 1712.511686] cdc_ether 2-5.3:1.0 eth0: register 'cdc_ether' at usb-0000:00:1a.7-5.3, Huawei CDC Ethernet Device, [MAC]
[ 1712.511790] usb-storage 2-5.3:1.2: USB Mass Storage device detected


As you noticed that, I have some "frequently reset" problem with my usb modem. I want to ask questions :
1. why my Debian introduce USB modem as device as SCSI CD-ROM ? Is it related with Zero-CD feaure ot usb modems? I found similar problem in usb modem as SCSI. However, there is no clear solution/answer in step by step there(i.e just saying :
I would assume you could probably also set the configs to build udev and various other full-featured linux bits perhaps
that is not so helpful).

2. I have one power management installed in my OS : powertop , does that cause such a problem? I used problem since as you noticed from dmesg logs, In how to disable autosuspend webpage it says powertop can cause ausosuspend problem for usb devices. Does this cause frequent resets?
3. There are errors unable to read config index 2 descriptor/start: -32 & can't read configurations, error -32, what are they? How can I learn which code is represents what? I tried learn error codes but I could not find any file there. Is there any online documentation about these errors?
[Edited]
4. I also noticed that, when I unplug my modem from USB-HUB and directly connect it to a USB port of my computer, it disappears (although it blinks led light which shows it is working/signalling). How can I solve that problem too?

Thanks. Any help is appreciated.
 
Last edited:


Lord Boltar

Well-Known Member
Joined
Nov 24, 2020
Messages
1,760
Reaction score
1,175
Credits
13,099
First thoughts - Does the USB Hub have it's own external plug-in power or is it drawing power straight from the USB Port on your computer - if it is drawing power from the USB Port it is splitting that power between the 4 ports, especially if there are other thing plugged into it, so it probably is not getting enough power to function correctly and getting errors, most likely not enough amps to drive the device
When purchasing a multi-usb hub always make sure it has it's own power supply

Here is example of what NOT to buy - this uses the power from your usb port https://www.amazon.com/Sabrent-4-Port-Individual-Switches-HB-UMLS/dp/B00BWF5U0M/ref=sr_1_4?crid=19FWVXZSL3FZ6&keywords=USb+Hub&qid=1657723258&sprefix=usb+hub,aps,160&sr=8-4

Here is example of what TO buy - this has it's own power supply https://www.amazon.com/atolla-Charging-Splitter-Individual-Switches/dp/B083XTKV8V/ref=sr_1_5?crid=19FWVXZSL3FZ6&keywords=USb+Hub&qid=1657723291&refinements=p_n_feature_ten_browse-bin:23128713011&rnid=23128711011&s=pc&sprefix=usb+hub,aps,160&sr=1-5

This is the one I use - https://www.amazon.com/Splitter-Charging-Individual-Switches-Extension/dp/B07G8CMR18/ref=sr_1_3?crid=3A6CFWHZFPRYL&keywords=atolla+usb+hub+3.0+powered+7+port&qid=1657723661&s=electronics&sprefix=USb+Hub+atolla+7+port,electronics,151&sr=1-3
 
Last edited:
OP
eaglehopes

eaglehopes

Member
Joined
Jul 8, 2022
Messages
72
Reaction score
19
Credits
724
First thoughts - Does the USB Hub have it's own external plug-in power or is it drawing power straight from the USB Port on your computer - if it is drawing power from the USB Port it is splitting that power between the 4 ports, especially if there are other thing plugged into it, so it probably is not getting enough power to function correctly and getting errors, most likely not enough amps to drive the device
When purchasing a multi-usb hub always make sure it has it's own power supply

Here is example of what NOT to buy - this uses the power from your usb port https://www.amazon.com/Sabrent-4-Port-Individual-Switches-HB-UMLS/dp/B00BWF5U0M/ref=sr_1_4?crid=19FWVXZSL3FZ6&keywords=USb+Hub&qid=1657723258&sprefix=usb+hub,aps,160&sr=8-4

Here is example of what TO buy - this has it's own power supply https://www.amazon.com/atolla-Charging-Splitter-Individual-Switches/dp/B083XTKV8V/ref=sr_1_5?crid=19FWVXZSL3FZ6&keywords=USb+Hub&qid=1657723291&refinements=p_n_feature_ten_browse-bin:23128713011&rnid=23128711011&s=pc&sprefix=usb+hub,aps,160&sr=1-5

This is the one I use - https://www.amazon.com/Splitter-Charging-Individual-Switches-Extension/dp/B07G8CMR18/ref=sr_1_3?crid=3A6CFWHZFPRYL&keywords=atolla+usb+hub+3.0+powered+7+port&qid=1657723661&s=electronics&sprefix=USb+Hub+atolla+7+port,electronics,151&sr=1-3
Thanks Lord Boltar, I am using a Linksys's USB HUB having its own external power cable and I am using it.
What I did during this period :
1. I installed Modem Manager with GUI from Debian repository
However Modem-Manager could not show my usb modem !
I could not see my modem mounted as USB even... I can only see that, I can mount it as /dev/sr4.
I looked under /dev folder to see is there any ttyUSBX file, but there is not.
My usb modem seems as scsi device(like a DVD-CD rom etc.). This is very annoying. Do you know how can I introduce my modem to Debian?
My Debian 11 bullseye comes with ofono and connman installed already and their services are active. Can my problem be a "closed/malfunctioned service" problem?
 

Lord Boltar

Well-Known Member
Joined
Nov 24, 2020
Messages
1,760
Reaction score
1,175
Credits
13,099
Sounds like a kernel or USB controller issue
why my Debian introduce USB modem as device as SCSI CD-ROM ? Is it related with Zero-CD feaure ot usb modems?
Simple answer is Yes - Often these devices will have two modes (1) USB flash memory storage (2) USB modem. The first mode, sometimes known as ZeroCD, is often used to deliver an internet communications program for another operating system and is generally of no interest to Linux users. Additionally some have a slot into which the user can insert an additional flash memory card.
You can switch these devices into modem mode by using usb_modeswitch. It ships with udev rules /usr/lib/udev/rules.d/40-usb_modeswitch.rules that contain entries for many devices, which it will switch to modem mode upon insertion.
 
OP
eaglehopes

eaglehopes

Member
Joined
Jul 8, 2022
Messages
72
Reaction score
19
Credits
724
Thanks Lord Boltar.
I used lsusb to check my usb modem's product id and vendor id. Then I checked the file you have mentioned "/usr/lib/udev/rules.d/40-usb_modeswitch.rules" and my modem was not on the list!
Looks like change the modem or ... :)
 
OP
eaglehopes

eaglehopes

Member
Joined
Jul 8, 2022
Messages
72
Reaction score
19
Credits
724
By the way, I learned that, when network connection stucks (such as you can ping successfully but no internet etc.) usbreset command does the trick and re-establish lost network connection. I checked it ;)
 
OP
eaglehopes

eaglehopes

Member
Joined
Jul 8, 2022
Messages
72
Reaction score
19
Credits
724
I hope I find a solution : I solved "my frequently reseted usb modem problem" by installing program called connman. It is more stable now, not means that fully stable, only less frequent. Sometimes my device completely disappears(like unplugged), i could not find why? If someone help me to recover that problem(in my first post I showed the error whose code is -32) ,I and maybe lot more people will be thankful since in the internet I found lots of similar problems. Some solved uses Lord Boltar's suggestion (usb_modeswitch program), some like me(i.e. usb_modeswitch does not have a driver for her/his modem) waits for usb_modeswitch to support their lovely modems!

I prepared below script, it may help someone has similar connection lost problems like me, not including the case that device completely disappeared, :
[Edited since PID and VID's locations are not correct in code, and writing to site name such as google.com is more correct since when network stucks, you can ping all dns ips, maybe they cached or something...]
Bash:
#!/bin/bash
# internet connection checker and repair shell script
PID="" # enter lsusb result for your device's product id value
VID="" # enter lsusb result for your device's vendor id value
timein=7 # period of connection check in seconds
# enter into infinite loop, so one may want to work this program in the background
while true
do
# I used openDNS server's IP address to ping but no success, so I used google.com server
pingresult=$(ping -c 1 google.com 2>/dev/null | grep "0% packet loss")
if [ ! -z "$pingresult" ]
then
connection="ok"
# echo "nothing seen, to internet is working..."
else
connection="CONNECTION LOST" # for zenity window
sudo usbreset "$VID":"$PID"
echo "Internet LOST..." # output to terminal too
play /usr/share/sounds/freedesktop/stereo/complete.oga # you can use any sounds you want
zenity --info --title "Connection Status" --text "$connection" --width=200 --height=100
fi
sleep $timein
done

Maybe usb_modeswitch can do the same reset, i did not check but :

Bash:
sudo usb_modeswitch -p $PID -v $VID -R
 
Last edited:
OP
eaglehopes

eaglehopes

Member
Joined
Jul 8, 2022
Messages
72
Reaction score
19
Credits
724
Ok, my problems continues sometimes and I am looking forward for a new solution : creating a "udev rule" file for Zero-CD modem to be not seen as SCSI drive but usb.

I first installed my modem's own software and it creates a file /etc/udev/rules.d$9-cdrom.rules
In this file I saw these lines :


Code:
#
# udev rules file
#
#

#SUBSYSTEM!="usb_device", GOTO="phone_rules_end"
#ACTION!="add", GOTO="phone_rules_end"KERNEL=="sr*",SUBSYSTEMS=="scsi"
#ACTION!="remove", GOTO="phone_rules_end",KERNEL=="scd*",NAME="%k", ACTION=="add",

#################
#################
# disable NetworkManager/modem-manager
ATTRS{idVendor}=="19d2", ENV{ID_MM_DEVICE_IGNORE}="1"
#################
#################


#################
#################
#autorun#  ecm pid / do not add cdrom pid
#SUBSYSTEMS=="usb", ACTION=="add", SYSFS{idVendor}=="19d2",SYSFS{idProduct}=="yyyy", MODE="0666", RUN+="/bin/launch-gui.sh"
#SUBSYSTEMS=="usb", ATTRS{idVendor}=="19d2",ATTRS{idProduct}=="xxxx", MODE="0666", RUN+="/bin/launch-gui.sh"
#SUBSYSTEMS=="usb", ACTION=="remove", RUN+="/bin/launch-gui.sh"
#################
#################


LABEL="phone_rules_end"

Anyway, in this rule line containing "# disable NetworkManager/modem-manager" draw my attention... What is that? I changed it to 0 to make my driver seen in modem manager. I did not reboot my system, but nothing changed. After I reboot, I will say if there is any change. By the way, /bin/launnc-gui.sh does not work... I am investigating it too.

New question arises in my mind, if everything in Linux is a file, then can I say Linux that by using "udev rule file" such that : "Linux, device having ... product and vendor id is not a SCSI driver, but it is a USB device! treat it like a usb and show it in modem manager too" ? Is it possible?

Any help is appreciated in this topic.
 
OP
eaglehopes

eaglehopes

Member
Joined
Jul 8, 2022
Messages
72
Reaction score
19
Credits
724
Thanks @Lord Boltar.

I found some culprits about why modem does not work other ports of my computer except USB HUB ports !
Replication of the same error :
1. stopped connman service and disabled it
2. my modem works sometime(about 10 minutes) without any error/malfunction
3. after that period, my modem disappeared from devices list suddenly and connection lost
4. I unplugged my usb modem and re-plug but device not reappeared
5. I changed the usb ports of my usb modem on my pc chasis but nothing changed. EXCEPT any ports on USB HUB ! That is the point I was looking for! I aksed in my original post, why my modem does not work in any other ports other than HUB's ports, I found a real answer.

Reverse check :
1. I started connman while my modem is in HUB port
2. I unplugged my modem and plug into any other USB port back of my computer chasis
3. Modem worked

So process is repeatable. So, nothing related with power but it is Connman which releases/unlocks my usb modem free for any usb ports.

From here, I can only ask to experts, maybe developers of Debian or Connman; why does Connman do this? How can I prevent this unexpected behaviour(at least for me)?
 

Lord Boltar

Well-Known Member
Joined
Nov 24, 2020
Messages
1,760
Reaction score
1,175
Credits
13,099
My Expirion Linux that I developed is based on Debian 11 - I removed Connman from it and installed NetworkManager in it's place - you might want to do that yourself or at least give it a try and see what happens
 
OP
eaglehopes

eaglehopes

Member
Joined
Jul 8, 2022
Messages
72
Reaction score
19
Credits
724
My Expirion Linux that I developed is based on Debian 11 - I removed Connman from it and installed NetworkManager in it's place - you might want to do that yourself or at least give it a try and see what happens
Thanks :D you are great ! But first, I must ask this because I do not know the real difference :
What is the difference between removing connman and disabling its service(connmand)?
I asked because, although I disabled connman service same behaviour continues... [edit] do I really remove a program, why not simply closing its service did not work?
 
Last edited:

Lord Boltar

Well-Known Member
Joined
Nov 24, 2020
Messages
1,760
Reaction score
1,175
Credits
13,099
If you just simply stop a service from running and something else needs that service to run the disabled service may get started so the other service that is dependent on the stopped service can run or neither service will run - if you really want a service not to run you should mask it, but as always remember one service may affect another service, but not always

disable - makes the unit disabled during boot. But that unit can be started anytime after boot.

systemctl start, systemctl stop - starts or stops the unit in question immediately;

systemctl enable, systemctl disable - marks or unmarks the unit for autostart at boot time (in a unit-specific manner, described in its [Install] section);

systemctl mask, systemctl unmask: disallows or allows all and any attempts to start the unit in question (either manually or as a dependency of any other unit, including the dependencies of the default boot target). Note that marking for autostart in systemd is implemented by adding an artificial dependency from the default boot target to the unit in question, so "mask" also disallows autostarting.

this is why I removed Connman and installed NetworkManager to many service dependent - like Bluetooth - I replaced one with the other to avoid that - I installed NetworkManager first then removed Connman, then reboot
 
Last edited:
OP
eaglehopes

eaglehopes

Member
Joined
Jul 8, 2022
Messages
72
Reaction score
19
Credits
724
If you just simply stop a service from running and something else needs that service to run the disabled service may get started so the other service that is dependent on the stopped service can run or neither service will run - if you really want a service not to run you should mask it, but as always remember one service may affect another service, but not always

disable - makes the unit disabled during boot. But that unit can be started anytime after boot.

systemctl start, systemctl stop - starts or stops the unit in question immediately;

systemctl enable, systemctl disable - marks or unmarks the unit for autostart at boot time (in a unit-specific manner, described in its [Install] section);

systemctl mask, systemctl unmask: disallows or allows all and any attempts to start the unit in question (either manually or as a dependency of any other unit, including the dependencies of the default boot target). Note that marking for autostart in systemd is implemented by adding an artificial dependency from the default boot target to the unit in question, so "mask" also disallows autostarting.

this is why I removed Connman and installed NetworkManager to many service dependent - like Bluetooth - I replaced one with the other to avoid that - I installed NetworkManager first then removed Connman, then reboot
I can reply now, sorry for being late. I had a book but it is a handbook of Linux commands. If you do not know how Linux-services-programs works, such a book can not be very handyful. So I have to ask forums like here and get really good answers like yours, thanks again.
Do you suggest a book where can I learn such basics like you mentioned so that I can get deeper knowledge about Linux(or Debian distro specific one)?
 

Lord Boltar

Well-Known Member
Joined
Nov 24, 2020
Messages
1,760
Reaction score
1,175
Credits
13,099
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Linux.org Hosting Donations
Consider making a donation

Members online


Latest posts

Top