It took me a while to get this to work, on one machine it did work but not on the one I needed it (Nagios server, USB used as SMS device)
Before that I tried different USB sticks (E3276-601), but none of them worked on a CentOS6.9, Xeon CPU, Server MB, Adaptec hardware server.
I have tried to stick with this USB as it presents a eth interface that can be used with an API https://github.com/knq/hilink, and this really works!
I could not work it out why it worked on one but not the other, but then I read somewhere something about the "I" switch, and that finally did it!
It probably is due to this the iscssi??
Code: Select all
/usr/sbin/usb_modeswitch -I -v 12d1 -p 1f01 -c /etc/usb_huawei.conf -W
Code: Select all
# huawei E3372 usb modem
# it's huawei
HuaweiNewMode=1
# this are the current settings
DefaultVendor=0x12d1
DefaultProduct=0x1f01
# this is were we want to go
TargetVendor=0x12d1
TargetProductList="158e,14db,14dc"
# this is the message we are sending
MessageContent="55534243123456780000000000000a11062000000000000100000000000000"
I tried to reset the USB modem, i.e. from 14dc BACK to 1f01, I used a variety of ways, but none works.
A shell script:
Code: Select all
#!/bin/bash
for i in /sys/bus/pci/drivers/[uoex]hci_hcd/*:*; do
echo "Doing it on $i"
echo "${i##*/}" > "${i%/*}/unbind"
echo "${i##*/}" > "${i%/*}/bind"
done
Code: Select all
https://askubuntu.com/questions/645/how-do-you-reset-a-usb-device-from-the-command-line
Code: Select all
/usr/sbin/usb_modeswitch -R -I -v 12d1 -p 1f01 -c /etc/usb_huawei.conf -W
Code: Select all
[root /etc] #>/src/usb-modeswitch-2.5.1/usb_modeswitch -R -I -v 12d1 -p 1f01 -c /etc/usb_huawei_back.conf
Look for target devices ...
Error: entry in product ID list has wrong length: 0x1f01. Ignored
No devices in target mode or class found
Look for default devices ...
Found devices in default mode (1)
Access device 003 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
Any ideas how can I RESET this stick so it comes back as if it would have been JUST inserted?
It seems in the moment I can only do this buy pulling it out of the USB port and sticking it back in!
Which is not ideal.
thanks
Jobst