BalenaFin and LTE with EC25 mPCIe

Hello,

I have the BalenaFin board v 1.1 with OS balenaOS 2.36.0+rev2 running on it. I’ve installed the EC25 mPCIe on the back of it. However, I’m unsure on how to change the the network to use the EC25 instead of the Wifi. I found a tutorial online about it, and it looks like I need to edit resin-boot/system-connections file. However, I’m unsure how to do that on Web’s terminal. All of the commands I’ve tried to get into anything, returns a command not valid. Can someone help with this?

Hello, we have comprehensive documentation on configuring the network here: https://www.balena.io/docs/reference/OS/network/2.x/#wifi-setup

Does the device appear online on the Dashboard? What errors exactly do you get when trying to use the Web Terminal?

I found this link, saying it’s not possible to edit it while the device is running and that it should be connected to a PC to access the files.

https://www.balena.io/docs/reference/OS/network/2.x/

My other question, is once I add this cellular file to the .img, what file extension should I have and is there any other changes I need to make to have it default to cellular?

Hi,
you can edit or add network manager files in /mnt/boot/system-connections while the device is running but you will need to reboot for the changes to take effect.
Changes can be made to the running configuration using nmcli but they will not persist and be lost after the next boot.
The only editor I am aware of that you can use to create files on the device is vi which unfortunately has a bit of a learning curve. You will find plenty of info about vi on the web.
As a tip: Open the file you want to write with vi , type i to get to insert mode. Paste your otherwise prepared content into the terminal (don’t bother trying to edit if you are not familiar with vi). Type [ESC] : wq to save it.
Regards
Thomas

Excellent, thanks for the tip. I was able to add the cellular file by connecting the device to my PC. It will work for what I’m trying to do for right now. I’ve followed the tutorial for setting up the tutorial here https://www.balena.io/docs/reference/OS/network/2.x/#cellular-modem-setup and I’m still unable to connect. My ACT light blinks 4 times, and according to the documentation I’ve found online means it can’t connect to a network. I’m assuming it can’t connect to the cellular network, as I’ve set the other files in the systems-connection folder to ignore. This isn’t able to connect to the cloud, due to the network error, so there are no logs to report on. Do you have any information or documentation that can be shared on this?

Hi @jmeyers2 are you running development build of balenaOS and have a serial cable, then you can easily hook up a serial cable and checkout the logs of both networkManager and modemManager. However if you are running a production build I would recommend hooking up the device to ethernet while debugging and then from the balena dashboard open a webterminal into the hostOS and pull out the NM and MM logs and past them here, the logs can be fetched by:

  • ModemManager: journalctl -u ModemManager --no-pager

  • NetworkManager: journalctl -u NetworkManager --no-pager

Those logs should be able to point to what the issue is with the modem

I hooked it up via ethernet to check the logs. After looking through all the logs, it appears the one is probably causing the issue.

May 27 13:08:23 dc1373c NetworkManager[747]: [1558962503.9626] keyfile: error loading connection from file /etc/NetworkManager/system-connections/CELLULAR: invalid connection: connection.type: connection type 'gsm ’ is not valid

I don’t understand why this isn’t working. The tutorial I found online had GSMin the connection type. I know I’m using Twilio instead of Hologram but I’ve updated the APN and Number fields. Is the container suppose to have the drivers for the EC25 installed in them or is that supported out of the box? My connection cellular file is below, I’ve removed the phone number for privacy purposes.

[connection]
id=Twilio
type=gsm
autoconnect=true

[gsm]
apn=wireless.Twilio.com
number=PhoneNumber

[serial]
baud=115200

[ipv4]
method=auto

[ipv6]
addr-gen-mode=stable-privacy
method=ignore

Any help would be appreciated, I’ve been working on this for a few days and I’m not making much progress

Yeah, our GSM examples look very similar to this. The log that you pasted is very little, I’m guessing it can also be that you see the connection file being applied to the available interfaces, and one that is not a gsm, throws the error that this file doesn’t apply - which is indeed correct behaviour.

Maybe can you paste the following information here:

  • mmcli -L (meaning does the device see the modem properly? )
  • nmcli c (meaning what connection files are being used for what interface)

Also mentioned earlier to grab some ModemManager logs, is there anything like that available (journalctl -a -u ModemManager --no-pager)?

@imrehg I’ve been using the GPS tracker project, to go get familiar with this concept, as it’s new to me. Please see the results below for the first two commands:

mmcli -L /org/freedesktop/ModemManager1/Modem/0 [QUALCOMM INCORPORATED] QUECTEL Mobile Broadband Module

nmcli c Wired connection 1 42e74e1d-5008-3db8-9041-1bedb8c89578 ethernet eth0
supervisor0 eb36d83a-dc53-4b20-ad37-8259082637c0 bridge supervisor0
resin-wifi-01 a58e405d-fdc2-3649-9339-5bbaea740c76 wifi –

According to the Modem Manager, the only things that seem to be causing an error are the following:

May 27 14:45:52 dc1373c ModemManager[700]: [/dev/cdc-wdm0] loaded driver of cdc-wdm port: qmi_wwan
May 27 14:45:52 dc1373c ModemManager[700]: cannot connect to proxy: Could not connect: Connection refused
May 27 14:45:52 dc1373c ModemManager[700]: spawning new qmi-proxy (try 1)…

May 27 14:45:53 dc1373c ModemManager[700]: Couldn’t check support for device ‘/sys/devices/platform/soc/3f300000.mmc/mmc_host/mmc1/mmc1:0001/mmc1:0001:1’: not supported by any plugin
May 27 14:45:53 dc1373c ModemManager[700]: Couldn’t check support for device ‘/sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.1’: not supported by any plugin
May 27 14:46:02 dc1373c ModemManager[700]: (tty/ttyUSB0) failed to parse QCDM version info command result: -7

May 27 14:46:08 dc1373c ModemManager[700]: Could not grab port (tty/ttyUSB1): ‘Cannot add port ‘tty/ttyUSB1’, unhandled serial type’

May 27 14:46:09 dc1373c ModemManager[700]: Unhandled QMI radio interface (9)
May 27 14:46:09 dc1373c ModemManager[700]: Unhandled QMI radio interface (9)
May 27 14:46:09 dc1373c ModemManager[700]: Unhandled QMI radio interface (9)
May 27 14:46:09 dc1373c ModemManager[700]: couldn’t load list of Own Numbers: ‘Couldn’t get MSISDN: QMI protocol error (16): ‘NotProvisioned’’

Everything else seems to be handled correctly.

@jmeyers2 is this a balenaFin v1.1 or v1.0? Could you share the output of lsusb ? Edit: sorry I see that it is a Fin v1.1 - but I’d still be interested to see the output of lsusb!

@chrisys The output is below. I’m not sure what these mean.
Bus 001 Device 004: ID 2c7c:0125
Bus 001 Device 003: ID 0424:ec00
Bus 001 Device 002: ID 0424:9514
Bus 001 Device 001: ID 1d6b:0002

FYI: we had success with the following connection file for twilio (note the number parameter is deprecated according to https://developer.gnome.org/NetworkManager/stable/settings-gsm.html)

file path and name: /etc/NetworkManager/system-connections/cellular

content:

[connection]
id=cellular
type=gsm
autoconnect=true

[gsm]
apn=wireless.twilio.com

[serial]
baud=115200

[ipv4]
method=auto

[ipv6]
addr-gen-mode=stable-privacy
method=ignore

Hi,

I just tried EC25 on a Fin device with the same OS version and everything worked properly for me.

If UDEV is enabled in a container (enabled by default in older resin base images), it may lead to modem initialization issues on boot.

Can you please try to activate the modem with an empty application (without any code pushed) and simply by defining the connection profile in the path you use.

I do not think the serial baud option is really needed. Also usually you may also avoid the gsm apn setting since it will be automatically picked up.

Please let us know whether you still have initialization issues with an empty application.

Thanks,
Zahari

Thanks for getting back to me. I’m a little confused on what you mean by “Simply by defining the connection profile in the path you use.” I’ve adjusted my file to match the one @dirk created. I’ve emptied my dockerfile to only have one command. That command is FROM balenalib/artik530-alpine-python:latest. I’m unsure on how to set something like you mentioned in my dockerfile. Can you provide the steps or an example of your Dockerfile so I can compare? Thanks for your help.

What majorz was suggesting was to use and empty application with no release pushed to it at all. I guess your dockerfile only containing a balenalib base image should work as well. I am not quite sure either, what @majorz meant by ‘simply by defining the connection profile in the path you use.’ . If your up to date connection-profile is in /mnt/boot/system-connections it should be used on next boot and that should be fine.

I’m not sure what that is or how to access it. Is it on the HostOS system? If so, what is the command to access it?

Hi @jmeyers2 , yeah the connection file can be added to /mnt/boot/system-connections from the hostOS. If you have your device connected to ethernet, you should be able to access the hostOS from the webdashboard. You can then use vi to add the connection file.

@shaunmulligan Thanks for the information. I’ve added a file named CELLULAR to that directory and rebooted the device. Unfortunately it still isn’t working. Did I miss a step somewhere?

This is the error I’m getting from Network Manager:
keyfile: error loading connection from file /etc/NetworkManager/system-connections/CELLULAR: invalid connection: connection.type: connection type 'gsm ’ is not valid.