From 7e76ea0c6fb9d2fc9e1ee169d5fe5eb365c42103 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Mon, 22 Mar 2021 10:12:40 +0100 Subject: [PATCH 1/9] More doc --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 78e14d5..8449daf 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,16 @@ make download make -j $(nproc) ``` +To inject a config file: +```bash +# Append changes to bottom of .config +cat config >> .config +# Apply changes +make defconfig +make download +make -j $(nproc) +``` ## Logs From 3385c48101f613a57535ba0958789a2143ceb422 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Mon, 22 Mar 2021 10:32:50 +0100 Subject: [PATCH 2/9] Add some doc --- README.md | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8449daf..74f6fa0 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Some challenges we have encountered so far: - OpenWRT stable misses a patch to enable our board ethernet port -> we compile from source - The Modem Manager simtech plugin does not declare 5GNR -## Flash the router +## Flash OpenWRT from uboot (Configure your computer with a static IP address 192.168.1.2/24 and make sure you have a running tftp server containing your image) @@ -59,6 +59,34 @@ make download make -j $(nproc) ``` +## Flash OpenWRT from OpenWRT (!) + +Copy the firmware in router's `/tmp`. +Why `/tmp`? Your router has more volatile storage than persistent one, moreover you will overwrite the persistent storage. +So, copy the firmware in `/tmp`! +Next, we will use the `sysupgrade` command. `-v` is verbose, `-n` ask openwrt to erase configuration files (ie. ask for a factory reset). + +``` +sysupgrade -v -n /tmp/openwrt-ipq40xx-generic-compex_wpj428-squashfs-sysupgrade.bin +``` + +## Get root on MimoAP + + 1. Download a backup from your router firmware + 2. Extract it, edit `/etc/shadow`, replace the hash of the `root` user with the one from the `admin` user + 3. Recompress the folder hierarchy + 4. Import this new archive as backup in MimoAP + 5. Run `ssh root@192.168.1.1` (replace with the IP address of your router) and use your `admin` password + 6. Enjoy! (But you should really install a vanilla OpenWRT instead) + +## Flash OpenWRT from Compex ROM (MimoAP) + +*Not written* + +## Flash MimoAP/OpenWRT with Compex tools on Uboot + +*Not written* + ## Logs uboot logs: From 467b91344d07097859ff6b1c6e081428b889425d Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Mon, 22 Mar 2021 11:02:13 +0100 Subject: [PATCH 3/9] WIP doc --- README.md | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/README.md b/README.md index 74f6fa0..0d1028f 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,91 @@ sysupgrade -v -n /tmp/openwrt-ipq40xx-generic-compex_wpj428-squashfs-sysupgrade. *Not written* +## Using ModemManager + +Wait for modems: + +``` +mmcli -M +``` + +Connect/Disconnect: + +``` +mmcli -m 0 --simple-connect="apn=free" +mmcli -m 0 --simple-disconnect +``` + +Set supported/preferred mode: + +``` +mmcli -m 0 --set-allowed-modes="3G|4G" --set-preferred-mode=4G +mmcli -m 0 --set-allowed-modes="5G" +``` + +## Error + +Despite patching ModemManager simtech plugin, we get an error if we force 5GNR. +We typed: + +``` +mmcli -m 0 --set-allowed-modes="5G" +mmcli -m 0 --simple-disconnect +mmcli -m 0 --simple-connect="apn=free" +``` + +We got: + +``` +Fri Mar 19 23:57:22 2021 daemon.warn [2633]: [modem0] couldn't load operator code: Current operator MCC/MNC is still unknown +Fri Mar 19 23:57:22 2021 daemon.warn [2633]: [modem0] couldn't load operator name: Current operator description is still unknown +Fri Mar 19 23:57:48 2021 daemon.info [2633]: [modem0] state changed (connected -> disconnecting) +Fri Mar 19 23:57:48 2021 daemon.info [2633]: [modem0] state changed (disconnecting -> registered) +Fri Mar 19 23:57:48 2021 daemon.info [2633]: [modem0/bearer1] connection #1 finished: duration 936s, tx: 79 bytes, rx :566 bytes +Fri Mar 19 23:57:57 2021 daemon.info [2633]: [modem0] simple connect started... +Fri Mar 19 23:57:57 2021 daemon.info [2633]: [modem0] simple connect state (4/8): wait to get fully enabled +Fri Mar 19 23:57:57 2021 daemon.info [2633]: [modem0] simple connect state (5/8): register +Fri Mar 19 23:57:57 2021 daemon.info [2633]: [modem0] simple connect state (6/8): bearer +Fri Mar 19 23:57:57 2021 daemon.info [2633]: [modem0] simple connect state (7/8): connect +Fri Mar 19 23:57:57 2021 daemon.info [2633]: [modem0] state changed (registered -> connecting) +Fri Mar 19 23:57:57 2021 daemon.info [2633]: [modem0/bearer1] couldn't start network: QMI protocol error (14): 'CallFailed' +Fri Mar 19 23:57:57 2021 daemon.info [2633]: [modem0/bearer1] call end reason (3): generic-no-service +Fri Mar 19 23:57:57 2021 daemon.info [2633]: [modem0/bearer1] verbose call end reason (3,2001): [cm] no-service +Fri Mar 19 23:57:57 2021 daemon.warn [2633]: [modem0/bearer1] connection attempt #2 failed: QMI protocol error (14): 'CallFailed' +Fri Mar 19 23:57:57 2021 daemon.info [2633]: [modem0] state changed (connecting -> registered) +Fri Mar 19 23:57:57 2021 daemon.info [2633]: [modem0/bearer1] connection #2 finished: duration 0s, tx: 0 bytes, rx :0 bytes +``` + +And the new bearer contains: + +``` +root@OpenWrt:/# mmcli -b 1 + ---------------------------- + General | path: /org/freedesktop/ModemManager1/Bearer/1 + | type: default + ---------------------------- + Status | connected: no + | suspended: no + | ip timeout: 20 + ---------------------------- + Properties | apn: free + | roaming: allowed + ---------------------------- + Statistics | attempts: 2 + | attempts: 1 + | total-duration: 936 + | total-bytes rx: 566 + | total-bytes tx: 79 +``` + + + +Next step: qmi-utils! + + - https://forum.sierrawireless.com/t/mc7354-got-qmi-error-callfailed-when-starting-network/9053 + - https://community.autopi.io/t/error-when-starting-qmi-connection/2338 + + ## Logs uboot logs: From 42c83376d3a4d6c297efaf91d3b1bb0536065686 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Mon, 22 Mar 2021 11:04:39 +0100 Subject: [PATCH 4/9] Add more info about error --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0d1028f..29b1c77 100644 --- a/README.md +++ b/README.md @@ -164,13 +164,23 @@ root@OpenWrt:/# mmcli -b 1 | total-bytes tx: 79 ``` +Errors : +``` +QMI protocol error (14): 'CallFailed' +``` + + +``` +call end reason (3): generic-no-service +verbose call end reason (3,2001): [cm] no-service +``` Next step: qmi-utils! - https://forum.sierrawireless.com/t/mc7354-got-qmi-error-callfailed-when-starting-network/9053 - https://community.autopi.io/t/error-when-starting-qmi-connection/2338 - + - https://lists.freedesktop.org/archives/libqmi-devel/2018-January/002707.html ## Logs From 88a9d4cacd5c8a6e1e50af9b27d33fdd05f34283 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Mon, 22 Mar 2021 11:36:48 +0100 Subject: [PATCH 5/9] Add some links --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 29b1c77..a2f1d69 100644 --- a/README.md +++ b/README.md @@ -265,3 +265,5 @@ eth0 - [All the commits in OpenWRT about the WPJ428](https://git.openwrt.org/?p=openwrt%2Fopenwrt.git&a=search&h=HEAD&st=commit&s=WPJ428) - https://openwrt.org/docs/guide-developer/build-system/use-buildsystem + - https://damow.net/5g-home-broadband/ + - https://techship.com/faq/how-to-step-by-step-set-up-a-data-connection-over-qmi-interface-using-qmicli-and-in-kernel-driver-qmi-wwan-in-linux/ From 19ffba0710928d00a61349ee0f3a9257101dc870 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Mon, 22 Mar 2021 11:59:20 +0100 Subject: [PATCH 6/9] Add qmicli --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index a2f1d69..ef8ccc7 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,13 @@ mmcli -m 0 --set-allowed-modes="3G|4G" --set-preferred-mode=4G mmcli -m 0 --set-allowed-modes="5G" ``` +Equivalent with `qmicli`: + +``` +qmicli --device=/dev/cdc-wdm0 --device-open-proxy --nas-get-system-selection-preference +qmicli --device=/dev/cdc-wdm0 --device-open-proxy --nas-set-system-selection-preference='5gnr|lte' +``` + ## Error Despite patching ModemManager simtech plugin, we get an error if we force 5GNR. From 533cb95bbd1dc62cb7988ec9b416b364a5db7081 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Mon, 22 Mar 2021 12:51:59 +0100 Subject: [PATCH 7/9] QMICLI connection --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index ef8ccc7..67349be 100644 --- a/README.md +++ b/README.md @@ -116,6 +116,27 @@ qmicli --device=/dev/cdc-wdm0 --device-open-proxy --nas-get-system-selection-pre qmicli --device=/dev/cdc-wdm0 --device-open-proxy --nas-set-system-selection-preference='5gnr|lte' ``` +## QMICLI Connect + +About our provider (Free Mobile), IPv4 is acquired through DHCP but IPv6 is statically provided. + +### IPv6 + +``` +qmicli --device=/dev/cdc-wdm0 --device-open-proxy --wds-start-network="ip-type=6,apn=free" --client-no-release-cid +qmicli --device=/dev/cdc-wdm0 --device-open-proxy --wds-get-current-settings +ip addr add 2a0d:e487:15f:f7f5:5c58:4e37:90c0:74d8/64 dev wwan0 +ip route add default via 2a0d:e487:15f:f7f5:49ec:2e4a:ca1:5b20 +echo -e "nameserver 2a0d:e480::1\nnameserver 2a0d:e480::2" > /etc/resolv.conf +``` + +### IPv4 + +``` +qmicli --device=/dev/cdc-wdm0 --device-open-proxy --wds-start-network="ip-type=4,apn=free" --client-no-release-cid +udhcpc -q -f -n -i wwan0 +``` + ## Error Despite patching ModemManager simtech plugin, we get an error if we force 5GNR. From e5549655f48014dbafbff4c8bda726190178fabe Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Mon, 22 Mar 2021 14:22:21 +0100 Subject: [PATCH 8/9] Add references --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 67349be..8c27df6 100644 --- a/README.md +++ b/README.md @@ -295,3 +295,4 @@ eth0 - https://openwrt.org/docs/guide-developer/build-system/use-buildsystem - https://damow.net/5g-home-broadband/ - https://techship.com/faq/how-to-step-by-step-set-up-a-data-connection-over-qmi-interface-using-qmicli-and-in-kernel-driver-qmi-wwan-in-linux/ + - [No 5GNR, many qmicli commands to help debug and compare!](https://forums.quectel.com/t/rm500q-gl-not-working/6594) From b9ac7cf457a3e7a7e4fc43c136658824b40821ad Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Mon, 22 Mar 2021 14:41:31 +0100 Subject: [PATCH 9/9] More doc --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README.md b/README.md index 8c27df6..0874594 100644 --- a/README.md +++ b/README.md @@ -210,6 +210,31 @@ Next step: qmi-utils! - https://community.autopi.io/t/error-when-starting-qmi-connection/2338 - https://lists.freedesktop.org/archives/libqmi-devel/2018-January/002707.html +## ModemManager + +We append the following to ModemManager: + +``` +config interface 'broadband' + option device '/sys/devices/platform/soc/60f8800.usb2/6000000.dwc3/xhci-hcd.1.auto/usb3/3-1' + option proto 'modemmanager' + option apn 'free' + option iptype 'ipv4v6' +``` + +Then we can start the interface with: + +``` +ifup broadband +``` + +Both IPv6 and IPv4 should work: + +``` +ping openwrt.org +ping -6 openwrt.org +``` + ## Logs uboot logs: