Problems with custom image on Rasberry pi

Hi,

We currently having some issues regarding updating of Balena OS. We made a custom image, where we added our bootup scripts, so that we know for sure that 4G is active. Luckly we are still in testing phase. This worked fine till Balena released BalenaOS 2.47.0+rev1.

In our test we had 2 devices offline on purpose. We put them online again and we see that one of the devices we changed to online again has the status. Online (VPN only) When we check the diagnostics tool, we get the following results:

We cannot update the image, because it overwrites the custom bash file that enables the 4G connection of our hardware. We where thinking about the following solutions:

  • Update our custom image and deploy through your platform.
  • Add patch to your balena-raspberrypi , so that it is always working and we don’t need a custom image
  • add container that activates sim module instead of the patched image

I would like to know what solution is best for us or that there is a possibility to execute the bash file outside your update mechanism.

Hi,

Creating a container that activates the SIM is the most “balena-like” way to resolve this. Creating a separate service can also help you isolate troubleshoot the specific SIM capabilities you’re looking for. Perhaps, too, you could use Device and Environment variables to customize your deployment without having to make customizations to your image. I’ll also raise in issue regarding 2.47.0+rev1. Can you tell us what device(s) you’re using and any specific HAT/SIM module?

Thanks,
John

Hi,

It’s this device:

https://www.waveshare.com/sim7600e-h-4g-hat.htm

It’s supported by Balena OS, but only the mini-pcie variant. It even gets unstable because of your modemManager.service. If we don’t disable the modemManager.service, there is a possiblity that the USB stops working completely. So we disable that one in your build . We use qmicli and set gpio pins on boot.

#P7 (BCM P4), Pull high enable flight mode

# Check if gpio is already exported
if [ ! -d /sys/class/gpio/gpio4 ]; then

  echo "4" >/sys/class/gpio/export
  echo "exported gpio4"
  sleep 1 # Short delay while GPIO permissions are set up
fi

echo "out" >/sys/class/gpio/gpio4/direction
echo "0" >/sys/class/gpio/gpio4/value

if [ ! -d /sys/class/gpio/gpio6 ]; then

  echo "6" >/sys/class/gpio/export
  echo "exported gpio6"
  sleep 1 # Short delay while GPIO permissions are set up
fi

echo "out" >/sys/class/gpio/gpio6/direction
echo "0" >/sys/class/gpio/gpio6/value

With these modifications we get a stable working OS for the last three months, until 6 days ago the 4G connection stopped working.

Hi @neonlink, reading through your issue, I would like to encourage you to go with your second suggested method, which is to PR a change to the balena-raspberrypi build. Since modifying the balenaOS is image is not recommended and could lead to all kinds of unintended issues and make it impossible for us to support you in the future.

My suggestion would be to look into creating a custom DT overlay named something like neolink-modem.dtb that would be included by default in our build and would enable all the GPIO with the right values on boot up, there by enabling your modem. This DT overlay would persist through HostOS updates, which other changes wouldn’t.

I would also strongly recommend using modemManager to bring up the modem, we test the SIM7600 with modemmanager (also under the hood it uses qmicli) and it works great, so I woudn’t disable modemManager either as again these types of changes make it difficult for OS updates and our team to support in the future.

My sense is that a simple custom DTB and modemmanager will get you a stable modem that doesn’t rely on OS modifications or rely on the containers to modify connection settings (which we also don’t recommend as the container engine can sometimes get into a corrupt state and not be able to start your container)

Let us know your thoughts and we can help guide you to add this custom DTB!

Hi, thank you for the reply. Update. I got the custom DT overlay working.
BalenaOS-2.47.0+rev1

config.txt

dtparam=i2c_arm=on

dtparam=spi=on

disable_splash=1

avoid_warnings=1

dtparam=audio=on

dtoverlay=pi3-miniuart-bt,neonlink-modem

enable_uart=1

max_usb_current=1

safe_mode_gpio=4

neonlink-modem.dts

/dts-v1/;
/plugin/;

/ {
    compatible = "brcm,bcm2708,bcm2710,bcm2711";

    fragment@0 {
        target = <&gpio>;
        __overlay__ {
            pinctrl-names = "default";
            pinctrl-0 = <&modem_pins>;

            modem_pins: modem_pins {
                brcm,pins = <4 6>;     /* GPIO pins */
                brcm,function = <1 1>; /* Output */
                brcm,pull = <2 2>; /* pull high */
            };
        };
    };
};

config file for GSM

[connection]

id=cellular

type=gsm

autoconnect=true

[gsm]

apn=portalmmm.nl

[ipv4]

method=auto

Currently testing the modemmanager got this log back:

Feb 05 08:28:48 localhost ModemManager[708]: ModemManager (version 1.12.4) starting in system bus...
Feb 05 08:28:50 localhost ModemManager[708]: [/dev/cdc-wdm0] Opening device with flags 'version-info, proxy'...
Feb 05 08:28:50 localhost ModemManager[708]: [/dev/cdc-wdm0] loaded driver of cdc-wdm port: qmi_wwan
Feb 05 08:28:50 localhost ModemManager[708]: [/dev/cdc-wdm0] created endpoint
Feb 05 08:28:50 localhost ModemManager[708]: cannot connect to proxy: Could not connect: Connection refused
Feb 05 08:28:50 localhost ModemManager[708]: spawning new qmi-proxy (try 1)...
Feb 05 08:28:50 localhost ModemManager[708]: [/dev/cdc-wdm0] Checking version info (20 retries)...
Feb 05 08:28:50 localhost ModemManager[708]: [/dev/cdc-wdm0] QMI Device supports 21 services:
Feb 05 08:28:50 localhost ModemManager[708]: [/dev/cdc-wdm0]    ctl (1.5)
Feb 05 08:28:50 localhost ModemManager[708]: [/dev/cdc-wdm0]    wds (1.67)
Feb 05 08:28:50 localhost ModemManager[708]: [/dev/cdc-wdm0]    dms (1.0)
Feb 05 08:28:50 localhost ModemManager[708]: [/dev/cdc-wdm0]    nas (1.25)
Feb 05 08:28:50 localhost ModemManager[708]: [/dev/cdc-wdm0]    wms (1.10)
Feb 05 08:28:50 localhost ModemManager[708]: [/dev/cdc-wdm0]    at (1.2)
Feb 05 08:28:50 localhost ModemManager[708]: [/dev/cdc-wdm0]    voice (2.1)
Feb 05 08:28:50 localhost ModemManager[708]: [/dev/cdc-wdm0]    cat2 (2.24)
Feb 05 08:28:50 localhost ModemManager[708]: [/dev/cdc-wdm0]    uim (1.46)
Feb 05 08:28:50 localhost ModemManager[708]: [/dev/cdc-wdm0]    pbm (1.4)
Feb 05 08:28:50 localhost ModemManager[708]: [/dev/cdc-wdm0]    test (1.0)
Feb 05 08:28:50 localhost ModemManager[708]: [/dev/cdc-wdm0]    loc (2.0)
Feb 05 08:28:50 localhost ModemManager[708]: [/dev/cdc-wdm0]    sar (1.0)
Feb 05 08:28:50 localhost ModemManager[708]: [/dev/cdc-wdm0]    ts (1.0)
Feb 05 08:28:50 localhost ModemManager[708]: [/dev/cdc-wdm0]    tmd (1.0)
Feb 05 08:28:50 localhost ModemManager[708]: [/dev/cdc-wdm0]    wda (1.16)
Feb 05 08:28:50 localhost ModemManager[708]: [/dev/cdc-wdm0]    coex (1.0)
Feb 05 08:28:50 localhost ModemManager[708]: [/dev/cdc-wdm0]    pdc (1.0)
Feb 05 08:28:50 localhost ModemManager[708]: [/dev/cdc-wdm0]    rfrpe (1.0)
Feb 05 08:28:50 localhost ModemManager[708]: [/dev/cdc-wdm0]    dsd (1.0)
Feb 05 08:28:50 localhost ModemManager[708]: [/dev/cdc-wdm0]    unknown [0x36] (1.0)
Feb 05 08:28:51 localhost ModemManager[708]: [device /sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4] creating modem with plugin 'SimTech' and '7' ports
Feb 05 08:28:51 localhost ModemManager[708]: Modem for device '/sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4' successfully created
Feb 05 08:28:51 localhost ModemManager[708]: [/dev/cdc-wdm0] Opening device with flags 'version-info, proxy'...
Feb 05 08:28:51 localhost ModemManager[708]: [/dev/cdc-wdm0] loaded driver of cdc-wdm port: qmi_wwan
Feb 05 08:28:51 localhost ModemManager[708]: [/dev/cdc-wdm0] created endpoint
Feb 05 08:28:51 localhost ModemManager[708]: [/dev/cdc-wdm0] Checking version info (20 retries)...
Feb 05 08:28:51 localhost ModemManager[708]: [/dev/cdc-wdm0] QMI Device supports 21 services:
Feb 05 08:28:51 localhost ModemManager[708]: [/dev/cdc-wdm0]    ctl (1.5)
Feb 05 08:28:51 localhost ModemManager[708]: [/dev/cdc-wdm0]    wds (1.67)
Feb 05 08:28:51 localhost ModemManager[708]: [/dev/cdc-wdm0]    dms (1.0)
Feb 05 08:28:51 localhost ModemManager[708]: [/dev/cdc-wdm0]    nas (1.25)
Feb 05 08:28:51 localhost ModemManager[708]: [/dev/cdc-wdm0]    wms (1.10)
Feb 05 08:28:51 localhost ModemManager[708]: [/dev/cdc-wdm0]    at (1.2)
Feb 05 08:28:51 localhost ModemManager[708]: [/dev/cdc-wdm0]    voice (2.1)
Feb 05 08:28:51 localhost ModemManager[708]: [/dev/cdc-wdm0]    cat2 (2.24)
Feb 05 08:28:51 localhost ModemManager[708]: [/dev/cdc-wdm0]    uim (1.46)
Feb 05 08:28:51 localhost ModemManager[708]: [/dev/cdc-wdm0]    pbm (1.4)
Feb 05 08:28:51 localhost ModemManager[708]: [/dev/cdc-wdm0]    test (1.0)
Feb 05 08:28:51 localhost ModemManager[708]: [/dev/cdc-wdm0]    loc (2.0)
Feb 05 08:28:51 localhost ModemManager[708]: [/dev/cdc-wdm0]    sar (1.0)
Feb 05 08:28:51 localhost ModemManager[708]: [/dev/cdc-wdm0]    ts (1.0)
Feb 05 08:28:51 localhost ModemManager[708]: [/dev/cdc-wdm0]    tmd (1.0)
Feb 05 08:28:51 localhost ModemManager[708]: [/dev/cdc-wdm0]    wda (1.16)
Feb 05 08:28:51 localhost ModemManager[708]: [/dev/cdc-wdm0]    coex (1.0)
Feb 05 08:28:51 localhost ModemManager[708]: [/dev/cdc-wdm0]    pdc (1.0)
Feb 05 08:28:51 localhost ModemManager[708]: [/dev/cdc-wdm0]    rfrpe (1.0)
Feb 05 08:28:51 localhost ModemManager[708]: [/dev/cdc-wdm0]    dsd (1.0)
Feb 05 08:28:51 localhost ModemManager[708]: [/dev/cdc-wdm0]    unknown [0x36] (1.0)
Feb 05 08:28:51 localhost ModemManager[708]: [/dev/cdc-wdm0] Reading expected data format from: /sys/class/net/wwan0/qmi/raw_ip
Feb 05 08:28:51 localhost ModemManager[708]: [/dev/cdc-wdm0] Allocating new client ID...
Feb 05 08:28:51 localhost ModemManager[708]: Couldn't check support for device '/sys/devices/platform/soc/3f300000.mmcnr/mmc_host/mmc1/mmc1:0001/mmc1:0001:1': not supported by any plugin
Feb 05 08:28:51 localhost ModemManager[708]: Couldn't check support for device '/sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.1': not supported by any plugin
Feb 05 08:28:51 localhost ModemManager[708]: [/dev/cdc-wdm0] Registered 'wda' (version 1.16) client with ID '1'
Feb 05 08:28:51 localhost ModemManager[708]: [/dev/cdc-wdm0] Writing expected data format to: /sys/class/net/wwan0/qmi/raw_ip
Feb 05 08:28:51 localhost ModemManager[708]: [/dev/cdc-wdm0] Reading expected data format from: /sys/class/net/wwan0/qmi/raw_ip
Feb 05 08:28:51 localhost ModemManager[708]: [/dev/cdc-wdm0] Allocating new client ID...
Feb 05 08:28:51 localhost ModemManager[708]: [/dev/cdc-wdm0] Releasing 'wda' client with flags 'release-cid'...
Feb 05 08:28:51 localhost ModemManager[708]: [/dev/cdc-wdm0] Unregistered 'wda' client with ID '1'
Feb 05 08:28:51 localhost ModemManager[708]: [/dev/cdc-wdm0] Registered 'dms' (version 1.0) client with ID '1'
Feb 05 08:28:51 localhost ModemManager[708]: [/dev/cdc-wdm0] Allocating new client ID...
Feb 05 08:28:51 localhost ModemManager[708]: [/dev/cdc-wdm0] Registered 'nas' (version 1.25) client with ID '2'
Feb 05 08:28:51 localhost ModemManager[708]: [/dev/cdc-wdm0] Allocating new client ID...
Feb 05 08:28:51 localhost ModemManager[708]: [/dev/cdc-wdm0] Registered 'wms' (version 1.10) client with ID '1'
Feb 05 08:28:51 localhost ModemManager[708]: [/dev/cdc-wdm0] Allocating new client ID...
Feb 05 08:28:51 localhost ModemManager[708]: [/dev/cdc-wdm0] Registered 'uim' (version 1.46) client with ID '1'
Feb 05 08:28:51 localhost ModemManager[708]: [/dev/cdc-wdm0] Allocating new client ID...
Feb 05 08:28:52 localhost ModemManager[708]: [/dev/cdc-wdm0] Registered 'loc' (version 2.0) client with ID '1'
Feb 05 08:28:52 localhost ModemManager[708]: [/dev/cdc-wdm0] Allocating new client ID...
Feb 05 08:28:52 localhost ModemManager[708]: [/dev/cdc-wdm0] Registered 'pdc' (version 1.0) client with ID '1'
Feb 05 08:28:53 localhost ModemManager[708]: couldn't load list of Emergency Numbers: 'uninitialized emergency numbers list'
Feb 05 08:28:53 localhost ModemManager[708]: couldn't load supported assistance data types: 'LOC service: general failure'
Feb 05 08:28:54 localhost ModemManager[708]: Modem: state changed (unknown -> disabled)
Feb 05 08:28:54 localhost ModemManager[708]: Modem /org/freedesktop/ModemManager1/Modem/0: state changed (disabled -> enabling)
Feb 05 08:28:55 neonlink ModemManager[708]: Modem /org/freedesktop/ModemManager1/Modem/0: state changed (enabling -> enabled)
Feb 05 08:28:55 neonlink ModemManager[708]: Modem /org/freedesktop/ModemManager1/Modem/0: 3GPP Registration state changed (unknown -> registering)
Feb 05 08:28:55 neonlink ModemManager[708]: Modem /org/freedesktop/ModemManager1/Modem/0: 3GPP Registration state changed (registering -> home)
Feb 05 08:28:55 neonlink ModemManager[708]: Modem /org/freedesktop/ModemManager1/Modem/0: state changed (enabled -> registered)

Queried some
mmcli -L
/org/freedesktop/ModemManager1/Modem/0 [QUALCOMM INCORPORATED] 0

Some more logging:

 -----------------------------------
  General  |               dbus path: /org/freedesktop/ModemManager1/Modem/0
           |               device id: dafa20eac1de58a392bf79324a04678bedccadc4
  -----------------------------------
  Hardware |            manufacturer: QUALCOMM INCORPORATED
           |                   model: 0
           |       firmware revision: LE11B11SIM7600M22
           |          carrier config: ROW_Gen_VoLTE
           | carrier config revision: 05010813
           |            h/w revision: 10000
           |               supported: gsm-umts, lte
           |                 current: gsm-umts, lte
           |            equipment id: 867584032421351
  -----------------------------------
  System   |                  device: /sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4
           |                 drivers: option1, qmi_wwan
           |                  plugin: SimTech
           |            primary port: cdc-wdm0
           |                   ports: ttyUSB0 (qcdm), ttyUSB1 (gps), ttyUSB2 (at), 
           |                          cdc-wdm0 (qmi), wwan0 (net), ttyUSB4 (audio), ttyUSB3 (at)
  -----------------------------------
  Numbers  |                     own: 31658894867
  -----------------------------------
  Status   |                    lock: sim-puk2
           |          unlock retries: sim-pin (3), sim-pin2 (0), sim-puk (10), sim-puk2 (10)
           |                   state: registered
           |             power state: on
           |             access tech: lte
           |          signal quality: 71% (recent)
  -----------------------------------
  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: 867584032421351
           |             operator id: 20408
           |           operator name: NL KPN
           |            registration: home
  -----------------------------------
  3GPP EPS |    ue mode of operation: csps-2
  -----------------------------------
  SIM      |               dbus path: /org/freedesktop/ModemManager1/SIM/0

Tried simple connect:

 mmcli -m 0 --simple-connect="apn=internet"

Feb 05 08:33:38 neonlink ModemManager[758]: [/dev/cdc-wdm0] Allocating new client ID...
Feb 05 08:33:38 neonlink ModemManager[758]: [/dev/cdc-wdm0] Registered 'wds' (version 1.67) client with ID '20'
Feb 05 08:33:38 neonlink ModemManager[758]: QMI IPv4 Settings:
Feb 05 08:33:38 neonlink ModemManager[758]:     Address: 100.93.3.161/30
Feb 05 08:33:38 neonlink ModemManager[758]:     Gateway: 100.93.3.162
Feb 05 08:33:38 neonlink ModemManager[758]:     DNS #1: 194.151.228.18
Feb 05 08:33:38 neonlink ModemManager[758]:     DNS #2: 194.151.228.50
Feb 05 08:33:38 neonlink ModemManager[758]:        MTU: 1500
Feb 05 08:33:38 neonlink ModemManager[758]: Modem /org/freedesktop/ModemManager1/Modem/0: state changed (connecting -> connected)
Feb 05 08:33:38 neonlink ModemManager[758]: Simple connect state (8/8): All done

udhcpc -q -f -n -i wwan0 creates DNS

if you can submit a PR to meta-raspberrypi with the dts formated as a kernel patch.

You will also need to add it in https://github.com/balena-os/meta-raspberrypi/blob/master/conf/layer.conf so that it gets built and installed in the image.

Yes, will do that. But ModemManager does not auto connect to the APN with udhcpc. So there is no wwan0 available on boot.

maybe take this to the PR discussion? maybe getting it into balenaOS will fix that already?

Will do. Thanks for your input!

P.s.

Just to clarify. Shouldn’t it be https://github.com/balena-os/balena-raspberrypi instead of meta–raspberrypi where I must make a pull request?

Hi there, you are right, it should be https://github.com/balena-os/balena-raspberrypi where you make your pull request. You need to add the dts there, and then add it to https://github.com/balena-os/balena-raspberrypi/blob/master/layers/meta-balena-raspberrypi/conf/layer.conf so it gets built and installed in the image. Once you open the PR the team will guide you through anything else that is missing. Thanks for contributing!

Hi,

I’ve created a draft https://github.com/balena-os/balena-raspberrypi/pull/478

Thanks, I think we can move the discussion in the PR and the team will try to review it as soon as possible. Have a nice day :slight_smile:

Hi @neonlink,

Thank you for your PR!

Can you please re-format it so that it builds the overlay from source and also adheres the yocto commit guidelines?

I wrote an example for you, here’s how your PR could look:

From df3441a5526a28f06a1dc9f994e1d0ef610c884f Mon Sep 17 00:00:00 2001
From: User Name <user@email.io>
Date: Fri, 1 May 2020 14:39:08 +0200
Subject: [PATCH 1/2] linux-raspberrypi: Add Waveshare SIM7600 dtbo

This adds necessary overlay for the Waveshare SIM7600
modem

Changelog-entry: linux-raspberrypi: Add Waveshare SIM7600 dtbo
Signed-off-by: User Name <user@email.io>
---
 ...hare-sim7600-Add-dtbo-for-this-modem.patch | 57 +++++++++++++++++++
 .../linux/linux-raspberrypi_%.bbappend        |  1 +
 2 files changed, 58 insertions(+)
 create mode 100644 layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0001-waveshare-sim7600-Add-dtbo-for-this-modem.patch

diff --git a/layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0001-waveshare-sim7600-Add-dtbo-for-this-modem.patch b/layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0001-waveshare-sim7600-Add-dtbo-for-this-modem.patch
new file mode 100644
index 0000000..26a87bd
--- /dev/null
+++ b/layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0001-waveshare-sim7600-Add-dtbo-for-this-modem.patch
@@ -0,0 +1,57 @@
+From d83c8ded1a60d34e913a6b30b9ad3c99d9ea4558 Mon Sep 17 00:00:00 2001
+From: User Name <user@email.io>
+Date: Fri, 1 May 2020 13:17:42 +0200
+Subject: [PATCH] overlays: Add waveshare-sim7600 dtbo
+
+This adds dtbo necessary for GPIO setup
+for the waveshare-sim7600 modem.
+
+Upstream-status: Inappropriate [configuration]
+Signed-off-by: User Name <user@email.io>
+---
+ arch/arm/boot/dts/overlays/Makefile           |  1 +
+ .../boot/dts/overlays/waveshare-sim7600-overlay.dts   | 20 +++++++++++++++++++
+ 2 files changed, 21 insertions(+)
+ create mode 100644 arch/arm/boot/dts/overlays/waveshare-sim7600-overlay.dts
+
+diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile
+index 554756c3265f..a32f31486bc9 100644
+--- a/arch/arm/boot/dts/overlays/Makefile
++++ b/arch/arm/boot/dts/overlays/Makefile
+@@ -186,6 +186,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
+ 	vga666.dtbo \
+ 	w1-gpio.dtbo \
+ 	w1-gpio-pullup.dtbo \
++	waveshare-sim7600.dtbo \
+ 	wittypi.dtbo
+ 
+ targets += dtbs dtbs_install
+diff --git a/arch/arm/boot/dts/overlays/waveshare-sim7600-overlay.dts b/arch/arm/boot/dts/overlays/waveshare-sim7600-overlay.dts
+new file mode 100644
+index 000000000000..7295ecec1220
+--- /dev/null
++++ b/arch/arm/boot/dts/overlays/waveshare-sim7600-overlay.dts
+@@ -0,0 +1,20 @@
++/dts-v1/;
++/plugin/;
++
++/ {
++    compatible = "brcm,bcm2708,bcm2710,bcm2711";
++
++    fragment@0 {
++        target = <&gpio>;
++        __overlay__ {
++            pinctrl-names = "default";
++            pinctrl-0 = <&modem_pins>;
++
++            modem_pins: modem_pins {
++                brcm,pins = <4 6>;     /* GPIO pins */
++                brcm,function = <1 1>; /* Output */
++                brcm,pull = <2 2>; /* pull high */
++            };
++        };
++    };
++};
+-- 
+2.17.1
+
diff --git a/layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend b/layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend
index 9679f46..da28097 100644
--- a/layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend
+++ b/layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend
@@ -12,6 +12,7 @@ SRC_URI_append = " \
 	file://0003-leds-pca963x-Fix-MODE2-initialization.patch \
 	file://0001-Add-npe-x500-m3-overlay.patch \
 	file://0006-overlays-Add-Hyperpixel4-overlays.patch \
+	file://0001-waveshare-sim7600-Add-dtbo-for-this-modem.patch \
 "
 
 SRC_URI_append_raspberrypi4-64 = " \
-- 
2.17.1

There needs to be also a second commit, as we’re triggering dtbo’s build from another yocto component:

From 7a8089f5423b06869bd59bd3dbd09968039a7848 Mon Sep 17 00:00:00 2001
From: User Name <user@email.io>
Date: Fri, 1 May 2020 14:40:47 +0200
Subject: [PATCH 2/2] conf/layer: Add Waveshare dtbo to overlays

Signed-off-by: User Name <user@email.io>
---
 layers/meta-balena-raspberrypi/conf/layer.conf | 1 +
 1 file changed, 1 insertion(+)

diff --git a/layers/meta-balena-raspberrypi/conf/layer.conf b/layers/meta-balena-raspberrypi/conf/layer.conf
index 1595d52..02e7da8 100644
--- a/layers/meta-balena-raspberrypi/conf/layer.conf
+++ b/layers/meta-balena-raspberrypi/conf/layer.conf
@@ -130,6 +130,7 @@ KERNEL_DEVICETREE_append = " \
     overlays/uart5.dtbo \
     overlays/vc4-fkms-v3d.dtbo \
     overlays/vga666.dtbo \
+    overlays/waveshare-sim7600.dtbo \
     overlays/wittypi.dtbo \
 "
 
-- 
2.17.1

Please don’t forget to use your name and desired email in the patches, and also feel free to re-word the commit messages as you find appropriate. Thanks!

Hi,

Next to the patch I figured out the system-connections GSM settings:

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

[gsm]
apn=internet
password-flags=1

[serial]
baud=115200

[ipv4]
method=auto

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

I have problems figuring out how to enable dhcp on the wwan0. even when the wwan0 is configured on boot, dhcp is not available.
I added these udevrules to config.json:

 "udevRules": {
      "90-netifchanges": "SUBSYSTEM==\"net\" , RUN+=\"/sbin/udhcpc -q -f -n -i wwan0\""
    },

Can you guys validate the udevrules for me? Is this possible?

Hi, for cellular connections once ModemManager registers and connects to a network creating the wwan0 interface, NetworkManager will ask ModemManager to handle IP configuration. The ipv4 method auto means that NetworkManager will await for DHCP configuration to arrive from the configured gateway. You do not need to add such an udev rule for this.

Will you be able to share support access with such a device, so that I can take a look? If you can please send me the device dashboard link in a private message and I will check it tomorrow (I am in a EU timezone).

Thanks,
Zahari

I just figure it out. I put autoconnect on false on the wifi config. Double checked the ip:

curl https://ipinfo.io/ip --interface wwan0

and

curl https://ipinfo.io/ip resulted in the same ip

setting autoconnect-priority didn’t work neither.

Hi Martijn,

Thanks for sharing support access with the device. I checked it now and it is all looking good. Currently the device only connects through cellular, and WiFi is not connected, and all is working well. NetworkManager is able to get an IP, gateway and DNS servers through DHCP.

Is there any issue you are facing with the modem?

Thanks,
Zahari

Hi, no not anymore. Think we are moving to production soon :slight_smile:

That is great to hear @neonlink ! Good luck with your production deployment and as always the team and community are here to help :slight_smile: