OPNsense Forum

Archive => 21.7 Legacy Series => Topic started by: ogghi on November 29, 2021, 07:02:31 am

Title: usb_modeswitch Huawei E3372 not working
Post by: ogghi on November 29, 2021, 07:02:31 am
Hi, I am trying to get a 4G dongle as backup.
Now this Huawei E3372 is not yet configured as ethernet devices...or as it should be ;)

This is the device:
Code: [Select]
root@OPNsense:~ # lsusb
Protocol spec without prior Class and Subclass spec at line 23281
Bus /dev/usb Device /dev/ugen2.2: ID 12d1:1f01 Huawei Technologies Co., Ltd. E353/E3131 (Mass storage mode)
[truncated]

This is what I am trying:
Code: [Select]
root@OPNsense:~ # usb_modeswitch -v 12d1 -p 1f01 -c /usr/local/share/usb_modeswitch/12d1:1f01
Look for target devices ...
 No devices in target mode or class found
Look for default devices ...
 Found devices in default mode (1)
Access device 002 on bus 002
Get the current device configuration ...
Current configuration number is 1
Use interface number 0
 with class 8
Use endpoints 0x01 (out) and 0x81 (in)
Using standard Huawei switching message
Looking for active drivers ...
 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 reading failed (error -99)
 Device is gone, skip any further commands
-> Run lsusb to note any changes. Bye!

After a moment, checking again:
Code: [Select]
root@OPNsense:~ # lsusb
Protocol spec without prior Class and Subclass spec at line 23281
Bus /dev/usb Device /dev/ugen2.2: ID 12d1:1f01 Huawei Technologies Co., Ltd. E353/E3131 (Mass storage mode)
[truncated]

So still in MSD mode.

Any idea here?

Thanks
ogghi
Title: Re: usb_modeswitch Huawei E3372 not working
Post by: chemlud on November 29, 2021, 10:11:14 am
..I tried this recently and finally gave up. It worked definitely in the past. It's a mess. I want a FW based on Linux... ;-)
Title: Re: usb_modeswitch Huawei E3372 not working
Post by: ogghi on November 29, 2021, 10:31:31 am
OK, so it's not me doing something wrong  :D

Could any dev here maybe help out, or give some input?
Title: Re: usb_modeswitch Huawei E3372 not working
Post by: franco on November 29, 2021, 11:01:30 am
There's three commands for Huawei that can work:

       -H --huawei-mode
                 Send a special control message used by older Huawei devices

       -J --huawei-new-mode
                 Send a specific bulk message used by all newer Huawei devices

       -X --huawei-alt-mode
                 Send an alternative bulk message to Huawei devices

I tried this recently with an older surfstick and for some commands only disk becomes available but for others I got ue0 device.

This really isn't a problem BSD vs. Linux.


Cheers,
Franco
Title: Re: usb_modeswitch Huawei E3372 not working
Post by: ogghi on November 29, 2021, 11:21:02 am
Ciao Franco,

thanks for the answer.
Not working though. Without any additional parameter it actually shows as
Code: [Select]
Bus /dev/usb Device /dev/ugen2.2: ID 12d1:14db Huawei Technologies Co., Ltd. E353/E3131
for a couple seconds.
Then it's MSD again.

I would be happy to help debugging here, if I know how!
Title: Re: usb_modeswitch Huawei E3372 not working
Post by: franco on November 29, 2021, 01:18:28 pm
Though ugen2.2 isn't what you want or is it? Check dmesg to see what happens but in general what's your desired outcome? The ue0 device? Maybe I'm missing something obvious...


Cheers,
Franco
Title: Re: usb_modeswitch Huawei E3372 not working
Post by: ogghi on November 29, 2021, 01:54:15 pm
Hi Franco,

thanks for the answer!
Code: [Select]
(cd0:umass-sim0:0:0:0): Error 5, Unretryable error
(cd0:umass-sim0:0:0:0): cddone: got error 0x5 back
(cd0:umass-sim0:0:0:0): READ(10). CDB: 28 00 00 00 0d ff 00 00 01 00
(cd0:umass-sim0:0:0:0): CAM status: SCSI Status Error
(cd0:umass-sim0:0:0:0): SCSI status: Check Condition
(cd0:umass-sim0:0:0:0): SCSI sense: MEDIUM ERROR asc:11,0 (Unrecovered read error)
(cd0:umass-sim0:0:0:0): Info: 0xdff
(cd0:umass-sim0:0:0:0): Error 5, Unretryable error
(cd0:umass-sim0:0:0:0): cddone: got error 0x5 back
(cd0:umass-sim0:0:0:0): READ(10). CDB: 28 00 00 00 0d ff 00 00 01 00
(cd0:umass-sim0:0:0:0): CAM status: SCSI Status Error
(cd0:umass-sim0:0:0:0): SCSI status: Check Condition
(cd0:umass-sim0:0:0:0): SCSI sense: MEDIUM ERROR asc:11,0 (Unrecovered read error)
(cd0:umass-sim0:0:0:0): Info: 0xdff
(cd0:umass-sim0:0:0:0): Error 5, Unretryable error
(cd0:umass-sim0:0:0:0): cddone: got error 0x5 back
(cd0:umass-sim0:0:0:0): READ(10). CDB: 28 00 00 00 0d c1 00 00 04 00
(cd0:umass-sim0:0:0:0): CAM status: SCSI Status Error
(cd0:umass-sim0:0:0:0): SCSI status: Check Condition
(cd0:umass-sim0:0:0:0): SCSI sense: MEDIUM ERROR asc:11,0 (Unrecovered read error)
(cd0:umass-sim0:0:0:0): Info: 0xdc1
(cd0:umass-sim0:0:0:0): Error 5, Unretryable error
(cd0:umass-sim0:0:0:0): cddone: got error 0x5 back
(cd0:umass-sim0:0:0:0): READ(10). CDB: 28 00 00 00 0d ff 00 00 01 00
(cd0:umass-sim0:0:0:0): CAM status: SCSI Status Error
(cd0:umass-sim0:0:0:0): SCSI status: Check Condition
(cd0:umass-sim0:0:0:0): SCSI sense: MEDIUM ERROR asc:11,0 (Unrecovered read error)
(cd0:umass-sim0:0:0:0): Info: 0xdff
(cd0:umass-sim0:0:0:0): Error 5, Unretryable error
(cd0:umass-sim0:0:0:0): cddone: got error 0x5 back
(cd0:umass-sim0:0:0:0): READ(10). CDB: 28 00 00 00 0d ff 00 00 01 00
(cd0:umass-sim0:0:0:0): CAM status: SCSI Status Error
(cd0:umass-sim0:0:0:0): SCSI status: Check Condition
(cd0:umass-sim0:0:0:0): SCSI sense: MEDIUM ERROR asc:11,0 (Unrecovered read error)
(cd0:umass-sim0:0:0:0): Info: 0xdff
(cd0:umass-sim0:0:0:0): Error 5, Unretryable error
(cd0:umass-sim0:0:0:0): cddone: got error 0x5 back
umass0: at uhub3, port 3, addr 2 (disconnected)
cd0 at umass-sim0 bus 0 scbus2 target 0 lun 0
cd0: <HUAWEI Mass Storage 2.3M>  s/n 0123456789ABCDEF detached
(cd0:umass-sim0:0:0:0): Periph destroyed
umass0: detached
ugen2.2: <HUAWEIMOBILE HUAWEIMOBILE> at usbus2 (disconnected)
ugen2.2: <HUAWEIMOBILE HUAWEIMOBILE> at usbus2
cdce0 on uhub3
cdce0: <CDC Ethernet Control Model (ECM)> on usbus2
ue0: <USB Ethernet> on cdce0
ue0: Ethernet address: 00:1e:10:1f:00:00
ugen2.2: <HUAWEIMOBILE HUAWEIMOBILE> at usbus2 (disconnected)
cdce0: at uhub3, port 3, addr 2 (disconnected)
cdce0: detached
This is what I see in dmesg...
Title: Re: usb_modeswitch Huawei E3372 not working
Post by: chemlud on November 29, 2021, 02:36:43 pm
the Huawei works relably on Win and Linux...
Title: Re: usb_modeswitch Huawei E3372 not working
Post by: ogghi on November 29, 2021, 03:17:48 pm
So it's a thing of proper implementation in FreeBSD then?
Title: Re: usb_modeswitch Huawei E3372 not working
Post by: svenny on November 29, 2021, 05:57:02 pm
Your USB dongle could have 2 modes of switching depending on the firmware version: one is stick mode and the other is Hilink mode. With the first mode you have got a modem, with the second mode you have got a virtual ethernet device.

The following link describes it better:

https://jtanx.github.io/2018/12/28/huawei-e8372h-a5-v11-notes/ (https://jtanx.github.io/2018/12/28/huawei-e8372h-a5-v11-notes/)

Cheers,
Svenny
Title: Re: usb_modeswitch Huawei E3372 not working
Post by: chemlud on November 29, 2021, 07:25:29 pm
german only, but...

https://forum.opnsense.org/index.php?topic=25034.0
Title: Re: usb_modeswitch Huawei E3372 not working
Post by: ogghi on December 06, 2021, 08:32:52 am
As I borrowed this stick only, I will give it back I think.
Any recommendation for a better / easier working one?
Title: Re: usb_modeswitch Huawei E3372 not working
Post by: franco on December 06, 2021, 08:35:18 am
Just to follow up I had a stick here that works via:

# usb_modeswitch -v 0x12d1 -p 0x157d --huawei-new-mode

Looking at the cam errors it would seem there is something wrong in the USB communication or the hardware itself. It may also be why the device disappears after the kernel trying to configure it.


Cheers,
Franco
Title: Re: usb_modeswitch Huawei E3372 not working
Post by: ogghi on December 06, 2021, 08:45:44 am
I will try another USB port later!
Title: Re: usb_modeswitch Huawei E3372 not working
Post by: ogghi on December 13, 2021, 07:55:41 am
Tried another USB port, but as I expected, no change. Any (not expensive) 4G dongle you would recommend?

edited!
Title: Re: usb_modeswitch Huawei E3372 not working
Post by: QBANIN on December 13, 2021, 06:22:25 pm
Works fine for me, just reflash to non-hilink firmware.
Title: Re: usb_modeswitch Huawei E3372 not working
Post by: chemlud on December 13, 2021, 07:35:18 pm
hmmm, I have an E3372s (so stick mode, not hilink)...

https://www.0xf8.org/2017/01/flashing-a-huawei-e3372h-4g-lte-stick-from-hilink-to-stick-mode/

Will give it another try next weekend, as it worked in the past.
Title: Re: usb_modeswitch Huawei E3372 not working
Post by: ogghi on December 14, 2021, 05:54:33 am
Hi there, I bought now - for a good price, a used E3372h-153
I hope it will get to my home in a couple days, then I will know more :)
Title: Re: usb_modeswitch Huawei E3372 not working
Post by: chemlud on December 14, 2021, 09:36:15 am
Hi there, I bought now - for a good price, a used E3372h-153
I hope it will get to my home in a couple days, then I will know more :)

The E3372h is in hilink mode, i.e. will do NAT as described in the link in my last post. Re-flash with stick firmware is recommended, although I see currently no official source for the files needed.
Title: Re: usb_modeswitch Huawei E3372 not working
Post by: ogghi on December 14, 2021, 10:40:54 am
I will let you know once I have it at home :)