Raspbian and PCI cellular

OK - so I cheated and reflashed the FIN board with BalenaOS, just to see if the modem/SIM card was recognized.

It was.

---------------------------------------------------
root@18f3bf2:/resin-boot/system-connections# mmcli -m 0
  --------------------------------
  General  |            dbus path: /org/freedesktop/ModemManager1/Modem/0
           |            device id: 25564e2468d1e70306b433bf880c542656d7795d
  --------------------------------
  Hardware |         manufacturer: QUALCOMM INCORPORATED
           |                model: QUECTEL Mobile Broadband Module
           |             revision: EC25AFAR05A04M4G
           |         h/w revision: 10000
           |            supported: gsm-umts, lte
           |              current: gsm-umts, lte
           |         equipment id: 861641041224386
  --------------------------------
  System   |               device: /sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2
           |              drivers: option1, qmi_wwan
           |               plugin: Quectel
           |         primary port: cdc-wdm0
           |                ports: ttyUSB0 (qcdm), ttyUSB2 (at), cdc-wdm0 (qmi), wwan0 (net), 
           |                       ttyUSB3 (at)
  --------------------------------
  Status   |                 lock: sim-pin2
           |       unlock retries: sim-pin (3), sim-pin2 (10), sim-puk (10), sim-puk2 (10)
           |                state: enabled
           |          power state: on
           |       signal quality: 0% (cached)
  --------------------------------
  Modes    |            supported: allowed: 3g; preferred: none
           |                       allowed: 4g; preferred: none
           |                       allowed: 3g, 4g; preferred: 3g
           |                       allowed: 3g, 4g; preferred: 4g
           |              current: allowed: 3g, 4g; preferred: 4g
  --------------------------------
  Bands    |            supported: utran-4, utran-5, utran-2, eutran-2, eutran-4, eutran-12
           |              current: utran-4, utran-5, utran-2, eutran-2, eutran-4, eutran-12
  --------------------------------
  IP       |            supported: ipv4, ipv6, ipv4v6
  --------------------------------
  3GPP     |                 imei: 861641041224386
  --------------------------------
  3GPP EPS | ue mode of operation: csps-1
  --------------------------------
  SIM      |            dbus path: /org/freedesktop/ModemManager1/SIM/0

---------------------------------------------------------------

So, the card and the socket are probably OK.

Thoughts?

John

@xginn8 @imrehg Cellular service is showing connected on the same board I have been using under BalenaOS.

Partial mmcli -m 0 output:

Status | lock: sim-pin2
| unlock retries: sim-pin (3), sim-pin2 (10), sim-puk (10), sim-puk2 (10)
| state: connected
| power state: on
| access tech: lte
| signal quality: 63% (recent)

So, I would assume that all physical connections are good. What needs to happen with Raspbian to get the same result?

Thanks!

John

Hey @Jgilbert seems the core of the issue was that modemmanager is too old in the Raspbian Stretch image (v1.6.4). We tried out updating the OS to Buster on a device, and update to the latest modemmanager there (v1.10.0) which is much newer, and it worked fine.

The update in the current Raspbian image could be done roughly like:

grep -rl stretch /etc/apt/ | sudo xargs sed -i 's/stretch/buster/g'
sudo apt update
sudo apt full-upgrade
# If modemmanager is not yet installed, install it
sudo apt install modemmanager
reboot
...

After the update we have these results with mmcli -m 0:

 --------------------------------
  General  |            dbus path: /org/freedesktop/ModemManager1/Modem/0
           |            device id: b130f2d2dde606492da31a3cb603a16e6e7e2eba
  --------------------------------
  Hardware |         manufacturer: QUALCOMM INCORPORATED
           |                model: QUECTEL Mobile Broadband Module
           |             revision: EC25EFAR06A03M4G
           |         h/w revision: 10000
           |            supported: gsm-umts, lte
           |              current: gsm-umts, lte
           |         equipment id: 866758041493319
  --------------------------------
  System   |               device: /sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2
           |              drivers: option1, qmi_wwan
           |               plugin: Quectel
           |         primary port: cdc-wdm0
           |                ports: ttyUSB2 (qcdm), cdc-wdm0 (qmi), wwan0 (net), ttyUSB5 (at), 
           |                       ttyUSB4 (at)
  --------------------------------
  Numbers  |                  own: 423650940245
  --------------------------------
  Status   |                 lock: sim-pin2
           |       unlock retries: sim-pin (3), sim-pin2 (3), sim-puk (10), sim-puk2 (10)
           |                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, utran-1, utran-5, utran-8, eutran-1, eutran-3, 
           |                       eutran-5, eutran-7, eutran-8, eutran-20, eutran-38, eutran-40, 
           |                       eutran-41
           |              current: egsm, dcs, utran-1, utran-5, utran-8, eutran-1, eutran-3, 
           |                       eutran-5, eutran-7, eutran-8, eutran-20, eutran-38, eutran-40, 
           |                       eutran-41
  --------------------------------
  IP       |            supported: ipv4, ipv6, ipv4v6
  --------------------------------
  3GPP     |                 imei: 866758041493319
  --------------------------------
  3GPP EPS | ue mode of operation: csps-2
  --------------------------------
  SIM      |            dbus path: /org/freedesktop/ModemManager1/SIM/0

We are still working on the new official Fin Raspbian release, and that will definitely be based on Buster. That will solve this issue, based on the above experience. In the meantime you can take the existing image and do an update.

Would love to hear if you check it out, whether it works out for you!

@xginn8 @imrehg - I followed the suggestions above. On initial installation of Raspbian (standard), I had both wireless and LAN connectivity. Once I did the “apt update” and “apt full upgrade”, I lost both of those connections, and was unable to install modemmanager (although Raspbian did recognize that there was a modem in place, and had an IP for it). A reboot fixed the ETH0 conenction, so I was able to continue somewhat. This is already noted here: https://forums.balena.io/t/connect-to-wifi/4543

Reflashing with Raspbian (standard), and attempting to install modemmanager results in a number of errors, mostly because the latest version of modemmanager requires some of the updates noted above. I am able to bring up the modem, but I can’t see the SIM card at all (“unknown”).

The update issue is a real problem right now. I am going to try again with Raspbian Lite, and go pure command line. Hopefully the updates there will not lose the networking connections.

More to follow.

John

@xginn8 @imrehg - I reran through the steps above, and was able to connect the modem to the cell network using both modemmanager and networkmanager. I will put the directions here, once the issue with losing the wireless connection during upgrade has been answered. Not sure what will change, if anything, but I would like to ensure that my steps work prior to putting them out here.

Thanks!

John

Hi again @jgilbert, and thanks for the update! I’ve pinged some folks internally for more information on the other thread you mention, so stay tuned there for any updates. Please do provide those directions whenever you are comfortable posting them :slight_smile:

Hi there, I got EC-25 working in Raspbian on Fin 1.1 the other day. You need to set the interface to raw IP mode (ppp by default). I got the details from https://www.embeddedpi.com/documentation/3g-4g-modems/raspberry-pi-sierra-wireless-mc7455-modem-raw-ip-qmi-interface-setup

Works if connected directly to the PCI-e slot or via USB caddie.

Thanks for sharing @nzbypaul !

@xginn8 @imrehg There is an updated version of Raspian available at the end of this thread: Connect to wifi.

Everything seems to be working fine at this point. I am running through various configurations, and should be able to post the basic directions soon.

Thanks!

Hi

I’m at the same point (using ubuntu 16.04 due to other constraints, modem manager 1.6.4, no sim but otherwise shows the device - same output as you, slightly different Hardware.revision).

I’m currently building from source the libqmi, libmbim and ModemManager to the latest (1.2.4) and hope to have something working.

@Jgilbert - any updates?

Alon

Does anyone here know what to do with this policy kit error?

$ mmcli -m 0 -e
error: couldn’t enable the modem: ‘GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Failed: PolicyKit authorization failed: ‘GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Action org.freedesktop.ModemManager1.Device.Control is not registered’’

I’ve gotten a bit closer, I can now see the sim (btw - I had to reboot, the sim is not detected unless it is already inserted at boot-up), but I cannot enable the modem.

Here is the output of mmcli -m 0:

  --------------------------------
  General  |            dbus path: /org/freedesktop/ModemManager1/Modem/0
           |            device id: 0000000000000000000000000000000000000000 # replaced number with zeros
  --------------------------------
  Hardware |         manufacturer: QUALCOMM INCORPORATED
           |                model: QUECTEL Mobile Broadband Module
           |    firmware revision: EG25GGBR07A06M2G
           |         h/w revision: 10000
           |            supported: gsm-umts, lte
           |              current: gsm-umts, lte
           |         equipment id: 000000000000000 # replaced number with zeros
  --------------------------------
  System   |               device: /sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2
           |              drivers: option1, qmi_wwan
           |               plugin: Quectel
           |         primary port: cdc-wdm0
           |                ports: ttyUSB0 (qcdm), ttyUSB2 (at), cdc-wdm0 (qmi), wwan0 (net), 
           |                       ttyUSB3 (at)
  --------------------------------
  Status   |                 lock: sim-pin2
           |       unlock retries: sim-pin (3), sim-pin2 (3), sim-puk (10), sim-puk2 (10)
           |                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-4, utran-6, utran-5, 
           |                       utran-8, utran-2, eutran-1, eutran-2, eutran-3, eutran-4, eutran-5, 
           |                       eutran-7, eutran-8, eutran-12, eutran-13, eutran-18, eutran-19, 
           |                       eutran-20, eutran-25, eutran-26, eutran-28, eutran-38, eutran-39, 
           |                       eutran-40, eutran-41, utran-19
           |              current: egsm, dcs, pcs, g850, utran-1, utran-4, utran-6, utran-5, 
           |                       utran-8, utran-2, eutran-1, eutran-2, eutran-3, eutran-4, eutran-5, 
           |                       eutran-7, eutran-8, eutran-12, eutran-13, eutran-18, eutran-19, 
           |                       eutran-20, eutran-25, eutran-26, eutran-28, eutran-38, eutran-39, 
           |                       eutran-40, eutran-41, utran-19
  --------------------------------
  IP       |            supported: ipv4, ipv6, ipv4v6
  --------------------------------
  3GPP     |                 imei: 000000000000000 # replaced number with zeros
  --------------------------------
  3GPP EPS | ue mode of operation: csps-2
  --------------------------------
  SIM      |            dbus path: /org/freedesktop/ModemManager1/SIM/0

@alon Unfortunately, no. I had to step away for some time on that project, as our priorities shifted. Since the updated version of Raspbian handled my primary issue, I have not gotten back to it. If I recall correctly, I was still struggling with keeping the ETH0 and WLAN0 connections connected properly for our use cases. However, I am able to see the modem, and control its connection.

Sorry I am not much help. I will try this week or next to get back on this.

Thanks for the quick reply. I have since gotten to a point where I should see networks (i.e. towers) but I think since I have no antenna connected yet I did not.
Had to build ModemManager from source with disabling polkit to get over the problem I had (can probably install the right policy kit rule file too).

Hi @alon,

which version of the balenaFin are you using?

1.1

Hi @alon

Just following up on this - did you get your antenna connected? Is it working?

Thanks,
James.

I have not connected the antenna yet. I have tested that wifi works, and cellular is somewhat tested - I can see it via ModemManager, and I can see a sim (that was a struggle due to an older version of ModemManager and dependent libraries on the ancient Xenial we have to use due to ROS kinetic dependency), but I have not seen any stations, probably due to not connecting an antenna (and I believe there is no internal antenna, as opposed to the wifi - correct me if I am wrong).

[note - I know this is a forum, so the rest of this is probably better put somewhere else - but I’m hoping we can move it there later]

Actually the last week’s focus was on trying to get the Arducam working, but so far it has frustrated me greatly. I can work with the RPi camera (ov5467) but not with the Arducam UC-599 (ov9281). I can see the ov9281 via the I2C bus, so I know the cable is connected correctly, but I cannot initiate a MIPI 2 lane transfer - I always get a timeout, both with the arducam code and with a test I have done today based on raspiraw (code currently local but I can provide it) using the register tables to set the mode from a public nvidia kernel (otherwise the ov9281 requires an NDA we do not intend to get into to see the datasheet).

I would greatly appreciate any help on this matter. This is the number one blocker for using the balena. If there is any more information you need or suggestions I am all ears.

I have written a bit more on my attempts (not including the raspiraw which I have not posted about yet) on arducam forums:

https://www.arducam.com/forums/topic/ov9281-uc-599-not-being-detected-need-help/

Despite the title that thread started with no-detection on a RPi 3B, and turned into detection but timeouts on the Balena Fin v1.1

Alon

Hi Alon.

I’ve had a read through the tread on the arducam.com forums, but unfortunately this is not one of my areas of expertise. I’ll consult with some of our engineers and get back to you.

Thanks,
James.

Hi @alon ,

We’d be happy to help you out. In order for us to provide better support (and keep this thread on topic), I’d ask you to create a new thread for the Arducam issue.

When you do, please provide links to the exact cameras you’re trying. We’d like to order a few samples and test them internally.

Also, it would be very helpful if you can try the example on the latest balenaOS release instead of Raspbian. That would provide helpful debugging information.

Cheers,
Nico.

Thanks for waiting, here it is: