for the last hours I’m trying to get a Huawei e3131 usb modem up and running on our container. We are using RPi3 as a hardware platform and running the resin/raspberrypi3-node base image.
With usb_modeswitch we were able to get the modem up and running on the RPi with a default Raspbian - no docker, no resinOS.
Back on our resin.io container, usb_modeswitch is working and showing the same results with lsusb. But the modem itself is not connecting to a cellular network. This is not happening on the default Raspbian.
I thing the problem is that the modem’s mode is not switched on the host OS itself or is now in an inconsistent state.
Is there a possibility to run the usb_modeswitch command on the host OS?
I know @shaunmulligan had a lot more experience with 4G modems. I think it’s easier on resinOS 2.x, which uses NetworkManager (as opposed to Connman on resinOS 1.x) To test it out, create an account on our beta site, http://dashboard.resinstaging.io, start a new application, download the latest Resin OS 2.0.0-beta.7 image. Now to add your cellular connection info you need to mount the resin-boot partition and add in a simple network configuration file in system-connection/ directory, for example system-connection/resin-cellular In the file drop in the following, changing the APN, password, etc for your GSM provider (this below is just on example for one particular provicer we’ve tested):
The current docs on cellular modems unfortunately still link to an old blogpost and a repo (that actually used usb_modeswitch, etc), but should not use that anymore, as noted in the blogpost too. Would highly recommend the resinOS 2.x approach. It is still in beta, but should be coming soon to the production service.
Hi @matt and @imrehg .
I haven’t messed around with many modems that require the usb_modeswitch. However I know one or two of the other users in the gitter.im chat. Unfortunately I can’t find the reference for the conversation right now because it appears gitter.im is having major outages , but I will come back and update here when I finally am allowed to find it. Failing that, I will try find the users that had it working and ask them to comment here.
Looks like someone tried the Huawei E3531i-2 modem that uses modeswitch and it works, though no specific details in that chat. Let’s see if they have more info, asked them on chat.
Thanks for keeping us informed of where you’re up to Matt.
We’ll continue our efforts to access prior community wisdom, and once the new week begins I’ll reach out to others on our team.
From experience on my end, wvdial won’t work inside a container, this is because the container cannot access all ppp functions.
The best way to connect with a 3G/4G dialup based modem is to use ResinOS 2 together with a GSM configuration, here’s an example of working network configuration on my end:
PS: ResinOS 2 automatically takes care of usb_modeswitch so no need to worry about it.
PS2: Otherwise, you can use a Huawei “HiLink” based modem which exposes a USB Ethernet interaface after usb_modeswitch > Which works in Resin OS 1 / containers
I am trying to connect with a E3531 Dongle, ID 12d1:155e, I have tried to run your command to set the modem to HiLink, but I get this error:
Look for target devices ...
No devices in target mode or class found
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 255
Error: can't use storage command in MessageContent with interface 0; interface class is 2, expected 8. Abort
and the device doesn’t change his Id nor it connects to internet, but it seems like it hangs:
usb_modeswitch -W -v 0x12d1 -p 0x155e -V 0x12d1 -P 0x1506 -M "55534243123456780000000000000011063000000100010000000000000000"
Take all parameters from the command line
* usb_modeswitch: handle USB devices with multiple modes
* Version 2.5.0 (C) Josua Dietze 2017
* Based on libusb1/libusbx
! PLEASE REPORT NEW CONFIGURATIONS !
DefaultVendor= 0x12d1
DefaultProduct= 0x155e
TargetVendor= 0x12d1
TargetProduct= 0x1506
MessageContent="55534243123456780000000000000011063000000100010000000000000000"
Look for target devices ...
found USB ID 12d1:155e
vendor ID matched
found USB ID 0424:7800
found USB ID 0424:2514
found USB ID 0424:2514
found USB ID 1d6b:0002
No devices in target mode or class found
Look for default devices ...
found USB ID 12d1:155e
vendor ID matched
product ID matched
found USB ID 0424:7800
found USB ID 0424:2514
found USB ID 0424:2514
found USB ID 1d6b:0002
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 255
Error: can't use storage command in MessageContent with interface 0; interface class is 2, expected 8. Abort
But still the ModemManager sees the Usb as a modem:
Hi, I pinged an engineer from our devices team who has experience with this modem and usb_modeswitch and we will follow up as soon as we have more information on this.
So looking at your output it says “bNumConfigurations 1”. So there’s only the one config you are using now, nothing else to be switched to. Can you check maybe there is a firmware update for you modem that would allow multiple configs? Also, just as a double check, this is the output you got after reboot without you doing any manual modeswitch, correct? In which case in looks like the modem is already running under the 12d1:155e vid:pid combination.