vog / wwan-helper

wwan-helper is a script that establishes a UMTS connection using a Ericsson F3507g Mobile Broadband Module. It was designed to be used with a ThinkPad T420s.
https://vog.github.io/wwan-helper/
4 stars 5 forks source link

Netgear AirCard 340U #8

Closed cinderblock closed 4 years ago

cinderblock commented 4 years ago

Hello,

I'm trying to add support for Netgear's AirCard 340u.

I've created a symlink in usbids: 1199:9051 -> ../cards/netgear_aircard_340u

I started by trying to copy the ericsson_business_mobile_networks_bv to netgear_aircard_340u and making modifications.

First point of confusion, it's not clear what serial port I need to use. I see that the SERIAL_DEV needs to be set or the script throws.

When I plug in this USB based device, it's not clear to me what serial device to use.

From dmesg when plugging in the device:

[ 3059.363806] usb 1-1.1.2.3: new high-speed USB device number 17 using dwc_otg
[ 3059.504519] usb 1-1.1.2.3: config 1 has an invalid interface number: 9 but max is 0
[ 3059.504532] usb 1-1.1.2.3: config 1 has no interface number 0
[ 3059.505025] usb 1-1.1.2.3: config 2 has an invalid interface number: 12 but max is 1
[ 3059.505035] usb 1-1.1.2.3: config 2 has an invalid interface number: 13 but max is 1
[ 3059.505055] usb 1-1.1.2.3: config 2 has an invalid interface number: 13 but max is 1
[ 3059.505081] usb 1-1.1.2.3: config 2 has no interface number 0
[ 3059.505085] usb 1-1.1.2.3: config 2 has no interface number 1
[ 3059.505765] usb 1-1.1.2.3: New USB device found, idVendor=1199, idProduct=0fff, bcdDevice= 0.06
[ 3059.505775] usb 1-1.1.2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 3059.505779] usb 1-1.1.2.3: Product: AirCard 340U
[ 3059.505783] usb 1-1.1.2.3: Manufacturer: Sierra Wireless, Incorporated
[ 3059.505787] usb 1-1.1.2.3: SerialNumber: 013323001295437
[ 3059.507640] usb-storage 1-1.1.2.3:1.9: USB Mass Storage device detected
[ 3059.593929] usb-storage: probe of 1-1.1.2.3:1.9 failed with error -5
[ 3062.642381] usb 1-1.1.2.3: USB disconnect, device number 17
[ 3063.203920] usb 1-1.1.2.3: new high-speed USB device number 18 using dwc_otg
[ 3063.344291] usb 1-1.1.2.3: config 1 has an invalid interface number: 8 but max is 4
[ 3063.344336] usb 1-1.1.2.3: config 1 has an invalid interface number: 9 but max is 4
[ 3063.344342] usb 1-1.1.2.3: config 1 has no interface number 1
[ 3063.344346] usb 1-1.1.2.3: config 1 has no interface number 4
[ 3063.344637] usb 1-1.1.2.3: config 2 has an invalid interface number: 12 but max is 1
[ 3063.344643] usb 1-1.1.2.3: config 2 has an invalid interface number: 13 but max is 1
[ 3063.344648] usb 1-1.1.2.3: config 2 has an invalid interface number: 13 but max is 1
[ 3063.344652] usb 1-1.1.2.3: config 2 has no interface number 0
[ 3063.344656] usb 1-1.1.2.3: config 2 has no interface number 1
[ 3063.345528] usb 1-1.1.2.3: New USB device found, idVendor=1199, idProduct=9051, bcdDevice= 0.06
[ 3063.345537] usb 1-1.1.2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 3063.345601] usb 1-1.1.2.3: Product: AirCard 340U
[ 3063.345605] usb 1-1.1.2.3: Manufacturer: Sierra Wireless, Incorporated
[ 3063.345612] usb 1-1.1.2.3: SerialNumber: 013323001295437
[ 3063.364612] cdc_mbim 1-1.1.2.3:2.12: cdc-wdm0: USB WDM device
[ 3063.366332] cdc_mbim 1-1.1.2.3:2.12 wwan0: register 'cdc_mbim' at usb-3f980000.usb-1.1.2.3, CDC MBIM, fe:ba:26:7b:b9:86
[ 3063.733813] 8021q: adding VLAN 0 to HW filter on device wwan0

I do see that /dev/cdc-wdm0 is created however that doesn't seem to work as SERIAL_DEV.

I also noticed that ifconfig shows wwan0. So the interface is "working", I think it's just the connection to AT&T that I haven't figured out. One confusion is that this is the AT&T branded version of this device so I would expect any APN settings to be already correctly set.

I also tried plugging the AirCard into my Windows 10 based computer and it got online with no trouble at all.

Why is this so difficult in linux?!?

madduck commented 4 years ago

Hey @cinderblock, I am sorry you are finding this difficult. The answer to your last question is long and complicated, but maybe easily summarised as: because Linux does not have a lobby group. On the upside of things, you don't have to install a driver for every card that you install, most of which are buggy and bad quality, but you get to reuse the kernel drivers, which are really high quality … once you get it working.

Anyway, to your actual question: if after plugging in your card, you already see wwan0, maybe you don't need wwan-helper at all? Have you tried DHCP on that interface? Have you tried pppd?

The serial device is usually only needed to configure the card to get it to the point where a wwan interface becomes available. Maybe you don't need it, and it's just plug and play, as it should be?

cinderblock commented 4 years ago

No worries and nothing you need to apologies for!

Yes, it looks like the drives for the 340U have made it into the mainline kernel as of some time before 3.x so I trust that.

And yes, seeing wwan0 show up in ifconfig which made me think that it should "just work". It's nice to hear you think this software might not be necessary. I had some similar readings but had not confirmed that anywhere clearly. Unfortunately most of the documentation/guides are quite old and out of date.

I have, I believe, tried enabling DHCP, to no avail:

pi@sleepypi:/etc/network $ sudo ifdown wwan0; sudo ifup wwan0
ifdown: interface wwan0 not configured
Internet Systems Consortium DHCP Client 4.4.1
Copyright 2004-2018 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/wwan0/fe:ba:26:7b:b9:86
Sending on   LPF/wwan0/fe:ba:26:7b:b9:86
Sending on   Socket/fallback
DHCPDISCOVER on wwan0 to 255.255.255.255 port 67 interval 3
DHCPDISCOVER on wwan0 to 255.255.255.255 port 67 interval 3
DHCPDISCOVER on wwan0 to 255.255.255.255 port 67 interval 7
DHCPDISCOVER on wwan0 to 255.255.255.255 port 67 interval 7
DHCPDISCOVER on wwan0 to 255.255.255.255 port 67 interval 18
DHCPDISCOVER on wwan0 to 255.255.255.255 port 67 interval 16
DHCPDISCOVER on wwan0 to 255.255.255.255 port 67 interval 7
No DHCPOFFERS received.
No working leases in persistent database - sleeping.

That this worked first try on Windows makes me think it must be something simple. (I got a 10.x.x.x address in Windows).

This makes me think that it's the pppd link you're referencing. I'd seen talk of that daemon but it wasn't clear that it was necessary. I'll look into that. If you have any pointers, they'd be greatly appreciated.

This is what I get for using a headless Raspbian... All the super easy guides basically just say "click the Network Manager in the GUI" which doesn't work for me :'(

cinderblock commented 4 years ago

More reading, this suggests I need to change the firmware to make it work with Linux... But would it show up as wwan0 if this were needed?

There are some errors in kernel messages relating to this device... maybe that's the smoking gun?

madduck commented 4 years ago

The text you linked speaks of the QMI protocol. wwan-helper does not speak that. I am also not sure it can. Why not use ModemManager?

cinderblock commented 4 years ago

Because this is the first time I've setup WWAN on Linux and I'm not familiar with all the completing tools ;) I'll take a look at ModemManager.

It looks like pppd is for dial-up? It requires a phone number, username, and password. None of which were required on Windows. So I don't see how that would be different.

madduck commented 4 years ago

Yeah, I think ModemManager, maybe even together with NetworkManager, both of which can be run on headless rpi, might be your ticket.

pppd is most often used for Dial-up, but can do the whole serial dance too. It really depends on your provider and modem. Often, the proprietary modem drivers hard-code various credentials for providers, so as to hide these details from you. I am not sure this is the better way, because if your provider isn't hardcoded, it simply "won't be supported", and there is noone that can help you.

Anyway, I'll close this issue here for now, until you decide that wwan-helper is actually what you need, and we figure out your problem from the root again.

cinderblock commented 4 years ago

Thanks for being a sounding board. This has been very helpful.

In the off chance someone comes across this issue trying to solve this, ModemManager definately seems like the right tool. I'm getting somewhere here finally:

pi@sleepypi:~ $ mmcli -m 0
  --------------------------
  General  |      dbus path: /org/freedesktop/ModemManager1/Modem/0
           |      device id: 1ce087d286217eb7c1969d7b0...
  --------------------------
  Hardware |   manufacturer: Sierra Wireless, Incorporated
           |          model: AirCard 340U
           |       revision: NTG9X15C_01.13.12.14
           |   h/w revision: AirCard 340U
           |      supported: gsm-umts, lte
           |        current: gsm-umts, lte
           |   equipment id: 0133230...
  --------------------------
  System   |         device: /sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.1/1-1.1.2/1-1.1.2.3
           |        drivers: cdc_mbim
           |         plugin: Sierra
           |   primary port: cdc-wdm0
           |          ports: cdc-wdm0 (mbim), wwan0 (net)
  --------------------------
  Numbers  |            own: 1415xxxyyyy
  --------------------------
  Status   | unlock retries: sim-pin2 (3)
           |          state: disabled
           |    power state: on
           | signal quality: 0% (cached)
  --------------------------
  Modes    |      supported: allowed: 2g; preferred: none
           |                 allowed: 3g; preferred: none
           |                 allowed: 4g; preferred: none
           |                 allowed: 2g, 3g; preferred: 3g
           |                 allowed: 2g, 3g; preferred: 2g
           |                 allowed: 2g, 4g; preferred: 4g
           |                 allowed: 2g, 4g; preferred: 2g
           |                 allowed: 3g, 4g; preferred: 3g
           |                 allowed: 3g, 4g; preferred: 4g
           |                 allowed: 2g, 3g, 4g; preferred: 4g
           |                 allowed: 2g, 3g, 4g; preferred: 3g
           |                 allowed: 2g, 3g, 4g; preferred: 2g
           |        current: allowed: 2g, 3g, 4g; preferred: 4g
  --------------------------
  Bands    |      supported: egsm, dcs, pcs, g850, utran-1, utran-5, utran-2, eutran-2,
           |                 eutran-4, eutran-5, eutran-17
           |        current: egsm, dcs, pcs, g850, utran-1, utran-5, utran-2, eutran-2,
           |                 eutran-4, eutran-5, eutran-17
  --------------------------
  IP       |      supported: ipv4, ipv6, ipv4v6
  --------------------------
  3GPP     |           imei: 0133230...
           |  enabled locks: fixed-dialing
  --------------------------
  SIM      |      dbus path: /org/freedesktop/ModemManager1/SIM/0
mhpetiwala commented 2 years ago

Thanks for being a sounding board. This has been very helpful.

In the off chance someone comes across this issue trying to solve this, ModemManager definately seems like the right tool. I'm getting somewhere here finally:

pi@sleepypi:~ $ mmcli -m 0
  --------------------------
  General  |      dbus path: /org/freedesktop/ModemManager1/Modem/0
           |      device id: 1ce087d286217eb7c1969d7b0...
  --------------------------
  Hardware |   manufacturer: Sierra Wireless, Incorporated
           |          model: AirCard 340U
           |       revision: NTG9X15C_01.13.12.14
           |   h/w revision: AirCard 340U
           |      supported: gsm-umts, lte
           |        current: gsm-umts, lte
           |   equipment id: 0133230...
  --------------------------
  System   |         device: /sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.1/1-1.1.2/1-1.1.2.3
           |        drivers: cdc_mbim
           |         plugin: Sierra
           |   primary port: cdc-wdm0
           |          ports: cdc-wdm0 (mbim), wwan0 (net)
  --------------------------
  Numbers  |            own: 1415xxxyyyy
  --------------------------
  Status   | unlock retries: sim-pin2 (3)
           |          state: disabled
           |    power state: on
           | signal quality: 0% (cached)
  --------------------------
  Modes    |      supported: allowed: 2g; preferred: none
           |                 allowed: 3g; preferred: none
           |                 allowed: 4g; preferred: none
           |                 allowed: 2g, 3g; preferred: 3g
           |                 allowed: 2g, 3g; preferred: 2g
           |                 allowed: 2g, 4g; preferred: 4g
           |                 allowed: 2g, 4g; preferred: 2g
           |                 allowed: 3g, 4g; preferred: 3g
           |                 allowed: 3g, 4g; preferred: 4g
           |                 allowed: 2g, 3g, 4g; preferred: 4g
           |                 allowed: 2g, 3g, 4g; preferred: 3g
           |                 allowed: 2g, 3g, 4g; preferred: 2g
           |        current: allowed: 2g, 3g, 4g; preferred: 4g
  --------------------------
  Bands    |      supported: egsm, dcs, pcs, g850, utran-1, utran-5, utran-2, eutran-2,
           |                 eutran-4, eutran-5, eutran-17
           |        current: egsm, dcs, pcs, g850, utran-1, utran-5, utran-2, eutran-2,
           |                 eutran-4, eutran-5, eutran-17
  --------------------------
  IP       |      supported: ipv4, ipv6, ipv4v6
  --------------------------
  3GPP     |           imei: 0133230...
           |  enabled locks: fixed-dialing
  --------------------------
  SIM      |      dbus path: /org/freedesktop/ModemManager1/SIM/0

did you get it working on RPi finally? I'm using a RPi4 with buster 5.10x RT and trying to get this same 340U Sierra wireless/Netgear modem to work... but stuck at the same inital point you had mentioned. Hence wanted to know if you finally got it working and did you need to upgrade the firmware on the 340U to the one with Linux support to get this working. Any help would really help instead of me trying to reinvent the wheel. TIA

cinderblock commented 2 years ago

@mhpetiwala I didn't end up getting it to work. We had a deadline and just went for an ethernet based LTE WAN device instead.

Flashing the older firmware didn't help, if memory serves.

mhpetiwala commented 2 years ago

Hi @cinderblock I was able to get it working after some google searches and some tinkering.... need it for some data analysis in realtime hence no other option (or find another card)... BTW didn't need to flash any s/w or f/w the latest linux kernel/ubuntu distro 5.10.xx contains most of the stuff to have this dongle working...

The steps to get it working are:

apt-get install libmbim-utils

scripted it in my init of RPi

echo "APN=Broadband" > /etc/mbim-network.conf mbim-network /dev/cdc-wdm0 start ifconfig wwan0 up dhclient wwan0

Trying to see if I can get it working via net interface bring up by writing some hook scripts for wwan0 interface v/s the above method but for now I can at least move forward...