Arducam 64MP and Raspberry Pi Kernel 6 (revisited)

Over a week after my first post and I was still without a working 64mp camera. The old method of running a script to install drivers still reported the same error, and the entry that used to be in my /boot/config.txt file wasn’t helping.

[all]
dtoverlay=arducam_64mp

I went back to look at the arducam forums and came across this post and found that when they went from the custom kernel module install to the standard module install they’ve changed from using an underscore to a hyphen:

[all]
dtoverlay=arducam-64mp

Now after booting, my camera is correctly recognized. The delay and lack of obvious information on their site has been frustrating, but at least I’m up and working and shouldn’t need to do anything special with further apt updates.

wim@WimPi4-Dev:~/WimsConstructionCam $ uname -a
Linux WimPi4-Dev 6.1.19-v8+ #1637 SMP PREEMPT Tue Mar 14 11:11:47 GMT 2023 aarch64 GNU/Linux
wim@WimPi4-Dev:~/WimsConstructionCam $ libcamera-still --list-cameras
Available cameras
-----------------
0 : arducam_64mp [9248x6944] (/base/soc/i2c0mux/i2c@1/arducam_64mp@1a)
    Modes: 'SRGGB10_CSI2P' : 1280x720 [30.00 fps - (0, 0)/0x0 crop]
                             1920x1080 [30.00 fps - (0, 0)/0x0 crop]
                             2312x1736 [30.00 fps - (0, 0)/0x0 crop]
                             3840x2160 [30.00 fps - (0, 0)/0x0 crop]
                             4624x3472 [30.00 fps - (0, 0)/0x0 crop]
                             9152x6944 [30.00 fps - (0, 0)/0x0 crop]

Raspberry Pi Kernel 6 and Arducam

I updated the software on my development machine this morning without thinking too much about it. After doing so, I checked my program that uses the camera to see if it was running properly. I’ve got an Arducam64mp camera that I’m using on that machine, and often when the kernel gets updated I need to reinstall the kernel drivers from Arducam. They have a script, so normally it runs easily enough.

wim@WimPi4-Dev:~ $ sudo ./install_pivariety_pkgs.sh -p 64mp_pi_hawk_eye_kernel_driver
=================================================
Hardware Revision: d03114
Kernel Version: 6.1.19-v8+
OS Codename: bullseye
ARCH: aarch64
=================================================

kernel:6.1.19-v8+
--2023-03-21 10:36:25--  https://github.com/ArduCAM/Arducam-Pivariety-V4L2-Driver/releases/download/install_script/64mp_pi_hawk_eye_kernel_driver_links.txt
Resolving github.com (github.com)... 192.30.255.112
Connecting to github.com (github.com)|192.30.255.112|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/353945933/a0487b40-ef2c-4923-b366-3e8d0b6f0c88?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230321%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230321T173626Z&X-Amz-Expires=300&X-Amz-Signature=f28c85b9e602c3789a04e891e7a91d43a0dd89759e7297b888093b54fee6670d&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=353945933&response-content-disposition=attachment%3B%20filename%3D64mp_pi_hawk_eye_kernel_driver_links.txt&response-content-type=application%2Foctet-stream [following]
--2023-03-21 10:36:26--  https://objects.githubusercontent.com/github-production-release-asset-2e65be/353945933/a0487b40-ef2c-4923-b366-3e8d0b6f0c88?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230321%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230321T173626Z&X-Amz-Expires=300&X-Amz-Signature=f28c85b9e602c3789a04e891e7a91d43a0dd89759e7297b888093b54fee6670d&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=353945933&response-content-disposition=attachment%3B%20filename%3D64mp_pi_hawk_eye_kernel_driver_links.txt&response-content-type=application%2Foctet-stream
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.108.133, 185.199.109.133, 185.199.110.133, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.108.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 11382 (11K) [application/octet-stream]
Saving to: ‘64mp_pi_hawk_eye_kernel_driver_links.txt’

64mp_pi_hawk_eye_kernel_driver_links.txt   100%[======================================================================================>]  11.12K  --.-KB/s    in 0.001s

2023-03-21 10:36:26 (15.6 MB/s) - ‘64mp_pi_hawk_eye_kernel_driver_links.txt’ saved [11382/11382]


Cannot find the corresponding package, please send the following information to support@arducam.com
Hardware Revision: d03114
Kernel Version: 6.1.19-v8+
Package: 64mp_pi_hawk_eye_kernel_driver -- bullseye-arm64-v5
You are using an unsupported kernel version, please install the official SD Card image(do not execute rpi-update):
https://www.raspberrypi.com/software/operating-systems/

wim@WimPi4-Dev:~ $ uname -a
Linux WimPi4-Dev 6.1.19-v8+ #1637 SMP PREEMPT Tue Mar 14 11:11:47 GMT 2023 aarch64 GNU/Linux

Today, it didn’t fix the problem. The script reports an unknown kernel version. I noticed that it’s reporting kernel version 6, which seemed unusual to me. That’s when I switched to my other Pi that I have most of my long term stuff running.

wim@WimPi4:~ $ uname -a
Linux WimPi4 5.15.84-v8+ #1613 SMP PREEMPT Thu Jan 5 12:03:08 GMT 2023 aarch64 GNU/Linux

A major bump in kernel version from 5 to 6 was unexpected. Now I’m left with the decision of either waiting to get the 64mp camera working with the new kernel or switching back to one of the PiCamera Model 3 units I have collected recently. Because this is on my development machine, the camera is less important to me than on some of my other units.

I attempted removing the special hooks for arducam to see if the 64mp driver had made it into the standard kernel source tree but no luck with that either.

IPv6 and Google Fi on SIM7600G-H and Raspberry Pi

I have been playing with a Raspberry Pi in a remote location that should be connected to a cellular network but I’ve had problems keeping it responding. I duplicated the system in my apartment to spend more time learning about what my options in configuring it may be. I’ve talked about the platform previously https://wimsworld.wordpress.com/2022/07/12/lte-wireless-on-sim7600g-h-4g-hat-b-for-raspberry-pi/ and https://wimsworld.wordpress.com/2022/07/16/more-networking-with-sim7600g-h-4g-hat-b-for-raspberry-pi/

The modem can be configured significantly differently via the CUSBPIDSWITCH command. According to the documentation, the available PIDS are:

  • 9000:Diag, NMEA, At, Modem, Audio, Rmnet
  • 9001:Diag, NMEA, At, Modem, Audio, Rmnet
  • 9002:Diag, NMEA, At, Modem, Audio, Rmnet
  • 9003:Diag, NMEA, At, Modem, Audio, MBIM
  • 9004:Diag, NMEA, At, Modem, Audio, GNSS, Rmnet
  • 9005:Diag, NMEA, At, Modem, Audio, GNSS, MBIM
  • 9006:Diag, NMEA, At,Modem
  • 9007:Diag, NMEA, At, Modem, Audio, Rmnet,mass_storage
  • 9011:RNDIS,Diag, NMEA, At, Modem, Audio
  • 9016:Diag, Rmnet
  • 9018:Diag, NMEA, At, Modem, Audio, Ecm
  • 9019:RNDIS
  • 901A: Diag, NMEA, At, Rmnet
  • 901B:NMEA, At, Rmnet
  • 9020: Diag, At, Modem
  • 9021: Diag, Modem
  • 9022: Diag, Modem, Rmnet
  • 9023: Modem
  • 9024: At, Modem
  • 9025: Modem,rmnet
  • 9026: Modem,Audio
  • 9027: Modem,Audio, Rmnet
  • 9028:Diag, Modem,Audio, Rmnet
  • 9029:Diag, Modem,Audio
  • 902A: At
  • 902B: Diag, NMEA, At, Modem, Rmnet,Usb-audio

If I query the modem possible modes, it responds with

AT+CUSBPIDSWITCH=?
+CUSBPIDSWITCH: (9000,9001,9002,9003,9004,9005,9006,9007,9011,9016,9018,9019,901A,901B,9020,9021,9022,9023,9024,9025,9026,9027,9028,9029,902A,902B),(0-1),(0-1)

OK

I’ve figured out I can switch between three different modem configurations on the linux system safely. 9001, 9011, and 9003. 9001 gives me qmi_wwan, 9011 gives me rndis_host, and 9003 give me cdc_mbim. RNDIS is the only one that is really plug and play on linux and produces the usb0 interface instead of wwan0. The method I’ve been configuring the device has been to connect to /dev/ttyUSB2 and issuing AT commands. When I have tried PID modes other than the ones I’ve called safe, Linux doesn’t provide /dev/ttyUSB* ports even though the device interfaces are displayed in the lsusb -t output.

Here’s what I get when I issue the command

AT+CUSBPIDSWITCH=9001,1,1

wim@WimPiZeroW-Wim:~ $ lsusb
Bus 001 Device 003: ID 1e0e:9001 Qualcomm / Option SimTech, Incorporated
Bus 001 Device 002: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
wim@WimPiZeroW-Wim:~ $ lsusb -t
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 1: Dev 3, If 0, Class=Vendor Specific Class, Driver=option, 480M
        |__ Port 1: Dev 3, If 1, Class=Vendor Specific Class, Driver=option, 480M
        |__ Port 1: Dev 3, If 2, Class=Vendor Specific Class, Driver=option, 480M
        |__ Port 1: Dev 3, If 3, Class=Vendor Specific Class, Driver=option, 480M
        |__ Port 1: Dev 3, If 4, Class=Vendor Specific Class, Driver=option, 480M
        |__ Port 1: Dev 3, If 5, Class=Vendor Specific Class, Driver=qmi_wwan, 480M
wim@WimPiZeroW-Wim:~ $ ip -o a
1: lo    inet 127.0.0.1/8 scope host lo\       valid_lft forever preferred_lft forever
1: lo    inet6 ::1/128 scope host \       valid_lft forever preferred_lft forever
2: wwan0    inet 169.254.128.15/16 brd 169.254.255.255 scope global noprefixroute wwan0\       valid_lft forever preferred_lft forever
2: wwan0    inet6 fe80::f9:71:4f35:8ef4/64 scope link \       valid_lft forever preferred_lft forever
3: wlan0    inet 192.168.0.63/24 brd 192.168.0.255 scope global dynamic noprefixroute wlan0\       valid_lft 5335sec preferred_lft 4660sec
3: wlan0    inet6 2604:4080:1304:8010:57c0:7b33:ef3:3f35/64 scope global dynamic mngtmpaddr noprefixroute \       valid_lft 1766sec preferred_lft 1766sec
3: wlan0    inet6 fe80::2f9e:ceef:76a0:1efa/64 scope link \       valid_lft forever preferred_lft forever

AT+CUSBPIDSWITCH=9011,1,1

wim@WimPiZeroW-Wim:~ $ lsusb
Bus 001 Device 003: ID 1e0e:9011 Qualcomm / Option SimTech, Incorporated
Bus 001 Device 002: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
wim@WimPiZeroW-Wim:~ $ lsusb -t
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 1: Dev 3, If 0, Class=Communications, Driver=rndis_host, 480M
        |__ Port 1: Dev 3, If 1, Class=CDC Data, Driver=rndis_host, 480M
        |__ Port 1: Dev 3, If 2, Class=Vendor Specific Class, Driver=option, 480M
        |__ Port 1: Dev 3, If 3, Class=Vendor Specific Class, Driver=option, 480M
        |__ Port 1: Dev 3, If 4, Class=Vendor Specific Class, Driver=option, 480M
        |__ Port 1: Dev 3, If 5, Class=Vendor Specific Class, Driver=option, 480M
        |__ Port 1: Dev 3, If 6, Class=Vendor Specific Class, Driver=option, 480M
wim@WimPiZeroW-Wim:~ $ ip -o a
1: lo    inet 127.0.0.1/8 scope host lo\       valid_lft forever preferred_lft forever
1: lo    inet6 ::1/128 scope host \       valid_lft forever preferred_lft forever
2: wlan0    inet 192.168.0.63/24 brd 192.168.0.255 scope global dynamic noprefixroute wlan0\       valid_lft 5371sec preferred_lft 4696sec
2: wlan0    inet6 2604:4080:1304:8010:57c0:7b33:ef3:3f35/64 scope global dynamic mngtmpaddr noprefixroute \       valid_lft 1767sec preferred_lft 1767sec
2: wlan0    inet6 fe80::2f9e:ceef:76a0:1efa/64 scope link \       valid_lft forever preferred_lft forever
3: usb0    inet 192.168.225.59/24 brd 192.168.225.255 scope global dynamic noprefixroute usb0\       valid_lft 43172sec preferred_lft 37772sec
3: usb0    inet6 2607:fb90:8069:ec7e:4a34:bb42:93a9:e27d/64 scope global mngtmpaddr noprefixroute \       valid_lft forever preferred_lft forever
3: usb0    inet6 fe80::b8ef:f02b:c580:1ebc/64 scope link \       valid_lft forever preferred_lft forever

AT+CUSBPIDSWITCH=9003,1,1

wim@WimPiZeroW-Wim:~ $ lsusb
Bus 001 Device 003: ID 1e0e:9003 Qualcomm / Option SimTech, Incorporated
Bus 001 Device 002: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
wim@WimPiZeroW-Wim:~ $ lsusb -t
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 1: Dev 3, If 0, Class=Vendor Specific Class, Driver=option, 480M
        |__ Port 1: Dev 3, If 1, Class=Vendor Specific Class, Driver=option, 480M
        |__ Port 1: Dev 3, If 2, Class=Vendor Specific Class, Driver=option, 480M
        |__ Port 1: Dev 3, If 3, Class=Vendor Specific Class, Driver=option, 480M
        |__ Port 1: Dev 3, If 4, Class=Vendor Specific Class, Driver=option, 480M
        |__ Port 1: Dev 3, If 5, Class=Communications, Driver=cdc_mbim, 480M
        |__ Port 1: Dev 3, If 6, Class=CDC Data, Driver=cdc_mbim, 480M
wim@WimPiZeroW-Wim:~ $ ip -o a
1: lo    inet 127.0.0.1/8 scope host lo\       valid_lft forever preferred_lft forever
1: lo    inet6 ::1/128 scope host \       valid_lft forever preferred_lft forever
2: wwan0    inet 169.254.175.62/16 brd 169.254.255.255 scope global noprefixroute wwan0\       valid_lft forever preferred_lft forever
2: wwan0    inet6 fe80::b43f:d4a3:f985:4f33/64 scope link \       valid_lft forever preferred_lft forever
3: wlan0    inet 192.168.0.63/24 brd 192.168.0.255 scope global dynamic noprefixroute wlan0\       valid_lft 5341sec preferred_lft 4666sec
3: wlan0    inet6 2604:4080:1304:8010:57c0:7b33:ef3:3f35/64 scope global dynamic mngtmpaddr noprefixroute \       valid_lft 1764sec preferred_lft 1764sec
3: wlan0    inet6 fe80::2f9e:ceef:76a0:1efa/64 scope link \       valid_lft forever preferred_lft forever

I have configured the modem to run the way I want with the following commands

AT&F
AT+CUSBPIDSWITCH=9011,1,1
AT+CGDCONT=1,"IPV4V6","h2g2"
AT+CGDCONT=6,"IPV4V6","h2g2"
AT+CGPSAUTO=1

There are multiple things I’m trying to understand about networking while running in 9011 mode. It gets a global scope ipv6 address that is reachable, but that address changes on a very frequent but random time. It gets a local ipv4 address that works for traffic over the internet. Obviously the ipv4 address is being converted by NAT between the raspberry and the internet. I don’t seem to have any way of configuring how that works. The post https://www.jeffgeerling.com/blog/2022/using-4g-lte-wireless-modems-on-raspberry-pi had a Built-in AP configuration that was accessible via http. I have run nmap against the internal gateway on my platform and the only port open is DNS.

Today I ran radvdump to listen for router advertisements from the internet and then later looked at my syslog results to see what happened on the network at the corresponding times.

# radvd configuration generated by radvdump 2.18
# based on Router Advertisement from fe80::fca7:efa4:eef4:655b
# received by interface usb0
#

interface usb0
{
        AdvSendAdvert on;
        # Note: {Min,Max}RtrAdvInterval cannot be obtained with radvdump
        AdvManagedFlag off;
        AdvOtherConfigFlag off;
        AdvReachableTime 0;
        AdvRetransTimer 0;
        AdvCurHopLimit 255;
        AdvDefaultLifetime 0;
        AdvHomeAgentFlag off;
        AdvDefaultPreference medium;
        AdvSourceLLAddress on;
        AdvLinkMTU 1500;

        prefix 2607:fb90:80ca:7753::ff00:0/0
        {
                AdvValidLifetime 2;
                AdvPreferredLifetime 1;
                AdvOnLink on;
                AdvAutonomous on;
                AdvRouterAddr off;
        }; # End of prefix definition

}; # End of interface definition


Nov 11 16:11:32 WimPiZeroW-Wim dhcpcd[701]: usb0: Router Advertisement from fe80::fca7:efa4:eef4:655b
Nov 11 16:11:32 WimPiZeroW-Wim dhcpcd[701]: usb0: adding address 5c5a:870:6182:d190:617e:1551:4cea:f6b6/0
Nov 11 16:11:32 WimPiZeroW-Wim dhcpcd[701]: ipv6_addaddr1: Invalid argument
Nov 11 16:11:32 WimPiZeroW-Wim dhcpcd[701]: usb0: adding route to 2607:fb90:80ca:7753::ff00:0/0
Nov 11 16:11:32 WimPiZeroW-Wim dhcpcd[701]: if_route (ADD): File exists

Almost immediately afterwards:

#
# radvd configuration generated by radvdump 2.18
# based on Router Advertisement from fe80::fc89:6dff:fe67:6dde
# received by interface usb0
#

interface usb0
{
        AdvSendAdvert on;
        # Note: {Min,Max}RtrAdvInterval cannot be obtained with radvdump
        AdvManagedFlag off;
        AdvOtherConfigFlag off;
        AdvReachableTime 0;
        AdvRetransTimer 0;
        AdvCurHopLimit 64;
        AdvDefaultLifetime 0;
        AdvHomeAgentFlag off;
        AdvDefaultPreference medium;
        AdvLinkMTU 1500;

        prefix 2607:fb90:80ca:7753::/64
        {
                AdvValidLifetime 2;
                AdvPreferredLifetime 1;
                AdvOnLink on;
                AdvAutonomous on;
                AdvRouterAddr off;
        }; # End of prefix definition


        RDNSS fd00:976a::9 fd00:976a::10
        {
                AdvRDNSSLifetime infinity; # (0xffffffff)
        }; # End of RDNSS definition

}; # End of interface definition

Nov 11 16:11:33 WimPiZeroW-Wim dhcpcd[701]: usb0: Router Advertisement from fe80::fc89:6dff:fe67:6dde
Nov 11 16:11:33 WimPiZeroW-Wim dhcpcd[701]: usb0: fe80::fc89:6dff:fe67:6dde: no longer a default router
Nov 11 16:11:33 WimPiZeroW-Wim dhcpcd[701]: usb0: adding route to 2607:fb90:80ca:7753::ff00:0/0
Nov 11 16:11:33 WimPiZeroW-Wim dhcpcd[701]: if_route (ADD): File exists
Nov 11 16:11:33 WimPiZeroW-Wim dhcpcd[701]: usb0: deleting default route via fe80::fc89:6dff:fe67:6dde
Nov 11 16:11:34 WimPiZeroW-Wim dhcpcd[701]: usb0: part of Router Advertisement expired
Nov 11 16:11:34 WimPiZeroW-Wim avahi-daemon[240]: Registering new address record for fe80::a3b3:ec14:47de:4692 on usb0.*.
Nov 11 16:11:35 WimPiZeroW-Wim dhcpcd[701]: usb0: expired address 2607:fb90:80ca:7753:ee71:7d12:766:2e98/64
Nov 11 16:11:35 WimPiZeroW-Wim dhcpcd[701]: usb0: part of Router Advertisement expired
Nov 11 16:11:35 WimPiZeroW-Wim dhcpcd[701]: usb0: deleting route to 2607:fb90:80ca:7753::/64
Nov 11 16:11:35 WimPiZeroW-Wim avahi-daemon[240]: Withdrawing address record for 2607:fb90:80ca:7753:ee71:7d12:766:2e98 on usb0.
Nov 11 16:11:35 WimPiZeroW-Wim avahi-daemon[240]: Leaving mDNS multicast group on interface usb0.IPv6 with address 2607:fb90:80ca:7753:ee71:7d12:766:2e98.
Nov 11 16:11:35 WimPiZeroW-Wim avahi-daemon[240]: Joining mDNS multicast group on interface usb0.IPv6 with address fe80::a3b3:ec14:47de:4692.

And a couple of minutes later:

# radvd configuration generated by radvdump 2.18
# based on Router Advertisement from fe80::fc89:6dff:fe67:6dde
# received by interface usb0
#

interface usb0
{
        AdvSendAdvert on;
        # Note: {Min,Max}RtrAdvInterval cannot be obtained with radvdump
        AdvManagedFlag off;
        AdvOtherConfigFlag on;
        AdvReachableTime 0;
        AdvRetransTimer 0;
        AdvCurHopLimit 64;
        AdvDefaultLifetime 65535;
        AdvHomeAgentFlag off;
        AdvDefaultPreference medium;
        AdvLinkMTU 1500;

        prefix 2607:fb90:80c8:82f8::/64
        {
                AdvValidLifetime infinity; # (0xffffffff)
                AdvPreferredLifetime infinity; # (0xffffffff)
                AdvOnLink on;
                AdvAutonomous on;
                AdvRouterAddr off;
        }; # End of prefix definition


        RDNSS fd00:976a::9 fd00:976a::10
        {
                AdvRDNSSLifetime infinity; # (0xffffffff)
        }; # End of RDNSS definition

}; # End of interface definition

Nov 11 16:13:42 WimPiZeroW-Wim dhcpcd[701]: usb0: Router Advertisement from fe80::fc89:6dff:fe67:6dde
Nov 11 16:13:42 WimPiZeroW-Wim dhcpcd[701]: usb0: adding address 2607:fb90:80c8:82f8:b87a:2c7a:ae2e:7e0e/64
Nov 11 16:13:42 WimPiZeroW-Wim avahi-daemon[240]: Leaving mDNS multicast group on interface usb0.IPv6 with address fe80::a3b3:ec14:47de:4692.
Nov 11 16:13:43 WimPiZeroW-Wim avahi-daemon[240]: Joining mDNS multicast group on interface usb0.IPv6 with address 2607:fb90:80c8:82f8:b87a:2c7a:ae2e:7e0e.
Nov 11 16:13:43 WimPiZeroW-Wim avahi-daemon[240]: Registering new address record for 2607:fb90:80c8:82f8:b87a:2c7a:ae2e:7e0e on usb0.*.
Nov 11 16:13:43 WimPiZeroW-Wim avahi-daemon[240]: Withdrawing address record for fe80::a3b3:ec14:47de:4692 on usb0.
Nov 11 16:13:43 WimPiZeroW-Wim dhcpcd[701]: usb0: adding route to 2607:fb90:80c8:82f8::/64
Nov 11 16:13:43 WimPiZeroW-Wim dhcpcd[701]: usb0: adding default route via fe80::fc89:6dff:fe67:6dde

Then it went almost a couple of hours before more changes to the network

Nov 11 18:01:54 WimPiZeroW-Wim dhcpcd[701]: usb0: Router Advertisement from fe80::c1e7:222d:69eb:c90c
Nov 11 18:01:54 WimPiZeroW-Wim dhcpcd[701]: usb0: adding address 5c5a:870:6182:d190:617e:1551:4cea:f6b6/0
Nov 11 18:01:54 WimPiZeroW-Wim dhcpcd[701]: ipv6_addaddr1: Invalid argument
Nov 11 18:01:54 WimPiZeroW-Wim dhcpcd[701]: usb0: adding route to 2607:fb90:80c8:82f8::ff00:0/0
Nov 11 18:01:54 WimPiZeroW-Wim dhcpcd[701]: if_route (ADD): File exists
Nov 11 18:01:55 WimPiZeroW-Wim dhcpcd[701]: usb0: Router Advertisement from fe80::fc89:6dff:fe67:6dde
Nov 11 18:01:55 WimPiZeroW-Wim dhcpcd[701]: usb0: fe80::fc89:6dff:fe67:6dde: no longer a default router
Nov 11 18:01:55 WimPiZeroW-Wim dhcpcd[701]: usb0: adding route to 2607:fb90:80c8:82f8::ff00:0/0
Nov 11 18:01:55 WimPiZeroW-Wim dhcpcd[701]: if_route (ADD): File exists
Nov 11 18:01:55 WimPiZeroW-Wim dhcpcd[701]: usb0: deleting default route via fe80::fc89:6dff:fe67:6dde
Nov 11 18:01:56 WimPiZeroW-Wim dhcpcd[701]: usb0: part of Router Advertisement expired
Nov 11 18:01:56 WimPiZeroW-Wim avahi-daemon[240]: Registering new address record for fe80::a3b3:ec14:47de:4692 on usb0.*.
Nov 11 18:01:57 WimPiZeroW-Wim dhcpcd[701]: usb0: expired address 2607:fb90:80c8:82f8:b87a:2c7a:ae2e:7e0e/64
Nov 11 18:01:57 WimPiZeroW-Wim dhcpcd[701]: usb0: part of Router Advertisement expired
Nov 11 18:01:57 WimPiZeroW-Wim dhcpcd[701]: usb0: deleting route to 2607:fb90:80c8:82f8::/64
Nov 11 18:01:57 WimPiZeroW-Wim avahi-daemon[240]: Withdrawing address record for 2607:fb90:80c8:82f8:b87a:2c7a:ae2e:7e0e on usb0.
Nov 11 18:01:57 WimPiZeroW-Wim avahi-daemon[240]: Leaving mDNS multicast group on interface usb0.IPv6 with address 2607:fb90:80c8:82f8:b87a:2c7a:ae2e:7e0e.
Nov 11 18:01:57 WimPiZeroW-Wim avahi-daemon[240]: Joining mDNS multicast group on interface usb0.IPv6 with address fe80::a3b3:ec14:47de:4692.
Nov 11 18:04:04 WimPiZeroW-Wim dhcpcd[701]: usb0: Router Advertisement from fe80::fc89:6dff:fe67:6dde
Nov 11 18:04:04 WimPiZeroW-Wim dhcpcd[701]: usb0: adding address 2607:fb90:80c3:42cc:11b:d753:e52a:40bb/64
Nov 11 18:04:04 WimPiZeroW-Wim avahi-daemon[240]: Leaving mDNS multicast group on interface usb0.IPv6 with address fe80::a3b3:ec14:47de:4692.
Nov 11 18:04:04 WimPiZeroW-Wim avahi-daemon[240]: Joining mDNS multicast group on interface usb0.IPv6 with address 2607:fb90:80c3:42cc:11b:d753:e52a:40bb.
Nov 11 18:04:04 WimPiZeroW-Wim avahi-daemon[240]: Registering new address record for 2607:fb90:80c3:42cc:11b:d753:e52a:40bb on usb0.*.
Nov 11 18:04:04 WimPiZeroW-Wim avahi-daemon[240]: Withdrawing address record for fe80::a3b3:ec14:47de:4692 on usb0.
Nov 11 18:04:04 WimPiZeroW-Wim dhcpcd[701]: usb0: adding route to 2607:fb90:80c3:42cc::/64
Nov 11 18:04:04 WimPiZeroW-Wim dhcpcd[701]: usb0: adding default route via fe80::fc89:6dff:fe67:6dde
Nov 11 18:29:11 WimPiZeroW-Wim dhcpcd[701]: usb0: failed to renew DHCP, rebinding
Nov 11 18:29:11 WimPiZeroW-Wim dhcpcd[701]: usb0: adding route to 192.168.225.0/24
Nov 11 18:29:11 WimPiZeroW-Wim dhcpcd[701]: usb0: adding default route via 192.168.225.1
ov 11 19:52:16 WimPiZeroW-Wim dhcpcd[701]: usb0: Router Advertisement from fe80::459a:7427:b0ae:7848
Nov 11 19:52:16 WimPiZeroW-Wim dhcpcd[701]: usb0: adding address 5c5a:870:6182:d190:617e:1551:4cea:f6b6/0
Nov 11 19:52:16 WimPiZeroW-Wim dhcpcd[701]: ipv6_addaddr1: Invalid argument
Nov 11 19:52:16 WimPiZeroW-Wim dhcpcd[701]: usb0: adding route to 2607:fb90:80c3:42cc::ff00:0/0
Nov 11 19:52:16 WimPiZeroW-Wim dhcpcd[701]: if_route (ADD): File exists
Nov 11 19:52:18 WimPiZeroW-Wim dhcpcd[701]: usb0: Router Advertisement from fe80::fc89:6dff:fe67:6dde
Nov 11 19:52:18 WimPiZeroW-Wim dhcpcd[701]: usb0: fe80::fc89:6dff:fe67:6dde: no longer a default router
Nov 11 19:52:18 WimPiZeroW-Wim dhcpcd[701]: usb0: adding route to 2607:fb90:80c3:42cc::ff00:0/0
Nov 11 19:52:18 WimPiZeroW-Wim dhcpcd[701]: if_route (ADD): File exists
Nov 11 19:52:18 WimPiZeroW-Wim dhcpcd[701]: usb0: deleting default route via fe80::fc89:6dff:fe67:6dde
Nov 11 19:52:18 WimPiZeroW-Wim dhcpcd[701]: usb0: part of Router Advertisement expired
Nov 11 19:52:19 WimPiZeroW-Wim avahi-daemon[240]: Registering new address record for fe80::a3b3:ec14:47de:4692 on usb0.*.
Nov 11 19:52:20 WimPiZeroW-Wim dhcpcd[701]: usb0: expired address 2607:fb90:80c3:42cc:11b:d753:e52a:40bb/64
Nov 11 19:52:20 WimPiZeroW-Wim dhcpcd[701]: usb0: part of Router Advertisement expired
Nov 11 19:52:20 WimPiZeroW-Wim dhcpcd[701]: usb0: deleting route to 2607:fb90:80c3:42cc::/64
Nov 11 19:52:20 WimPiZeroW-Wim avahi-daemon[240]: Withdrawing address record for 2607:fb90:80c3:42cc:11b:d753:e52a:40bb on usb0.
Nov 11 19:52:20 WimPiZeroW-Wim avahi-daemon[240]: Leaving mDNS multicast group on interface usb0.IPv6 with address 2607:fb90:80c3:42cc:11b:d753:e52a:40bb.
Nov 11 19:52:20 WimPiZeroW-Wim avahi-daemon[240]: Joining mDNS multicast group on interface usb0.IPv6 with address fe80::a3b3:ec14:47de:4692.
Nov 11 19:52:27 WimPiZeroW-Wim systemd[1]: session-3.scope: Succeeded.
Nov 11 19:52:27 WimPiZeroW-Wim systemd[1]: session-3.scope: Consumed 24.275s CPU time.
Nov 11 19:54:27 WimPiZeroW-Wim dhcpcd[701]: usb0: Router Advertisement from fe80::fc89:6dff:fe67:6dde
Nov 11 19:54:27 WimPiZeroW-Wim dhcpcd[701]: usb0: adding address 2607:fb90:8069:47ff:69ad:1e37:6fb5:7fa0/64
Nov 11 19:54:27 WimPiZeroW-Wim dhcpcd[701]: usb0: adding route to 2607:fb90:8069:47ff::/64
Nov 11 19:54:27 WimPiZeroW-Wim dhcpcd[701]: usb0: adding default route via fe80::fc89:6dff:fe67:6dde
Nov 11 19:54:27 WimPiZeroW-Wim avahi-daemon[240]: Leaving mDNS multicast group on interface usb0.IPv6 with address fe80::a3b3:ec14:47de:4692.
Nov 11 19:54:27 WimPiZeroW-Wim avahi-daemon[240]: Joining mDNS multicast group on interface usb0.IPv6 with address 2607:fb90:8069:47ff:69ad:1e37:6fb5:7fa0.
Nov 11 19:54:27 WimPiZeroW-Wim avahi-daemon[240]: Registering new address record for 2607:fb90:8069:47ff:69ad:1e37:6fb5:7fa0 on usb0.*.
Nov 11 19:54:27 WimPiZeroW-Wim avahi-daemon[240]: Withdrawing address record for fe80::a3b3:ec14:47de:4692 on usb0.

I do not understand why it gets router advertisements that change as frequently as it does, and especially why sometimes it gets a /0 prefix occasionally.

Here is a series of commands I’ve found useful to checking status on the modem

AT&V
AT+COPS?
AT+CPSI?
AT+CFUN?
AT+CGPSAUTO?
AT+CSQ
AT+CUSBPIDSWITCH=?
AT+CUSBPIDSWITCH?
AT+CGDCONT?

The command AT+CSQ returns the signal strength of the device. Possible values are:

  • 0 113 dBm or less
  • 1 111 dBm
  • 2…30 109… 53 dBm
  • 31 51 dBm or greater
  • 99 not known or not detectable

Value RSSI dBm Condition

  • 2 -109 Marginal
  • 3 -107 Marginal
  • 4 -105 Marginal
  • 5 -103 Marginal
  • 6 -101 Marginal
  • 7 -99 Marginal
  • 8 -97 Marginal
  • 9 -95 Marginal
  • 10 -93 OK
  • 11 -91 OK
  • 12 -89 OK
  • 13 -87 OK
  • 14 -85 OK
  • 15 -83 Good
  • 16 -81 Good
  • 17 -79 Good
  • 18 -77 Good
  • 19 -75 Good
  • 20 -73 Excellent
  • 21 -71 Excellent
  • 22 -69 Excellent
  • 23 -67 Excellent
  • 24 -65 Excellent
  • 25 -63 Excellent
  • 26 -61 Excellent
  • 27 -59 Excellent
  • 28 -57 Excellent
  • 29 -55 Excellent
  • 30 -53 Excellent

Some of the values on my system

AT&V
&C: 2; &D: 2; &E: 1; &F: 0; &S: 0; &W: 0; E: 1; L: 0; M: 0; Q: 0; V: 1;
X: 1; Z: 0; \Q: 3; \S: 0; \V: 0; O: 0; S0: 0; S2: 43; S3: 13; S4: 10;
S5: 8; S6: 2; S7: 0; S8: 2; S9: 6; S10: 14; S11: 95; S30: 0; S103: 1;
S104: 1; +FCLASS: 0; +ICF: 3,3; +IFC: 0,0; +IPR: 115200; +DR: 0;
+DS: 0,0,2048,6; +CMEE: 2; +WS46: 25; +CFUN:; +IPREX: 115200;
+CBST: 0,0,1; +CRLP: (61,61,48,6,0),(61,61,48,6,1),(240,240,52,6,2);
+CV120: 1,1,1,0,0,0; +CHSN: 0,0,0,0; +CSSN: 0,0; +CREG: 0; +CGREG: 0;
+CEREG: 0; +CSCS: "IRA"; +CSTA: 129;  +CR: 0; +CRC: 0;
+CGDCONT: (1,"IPV4V6","h2g2","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0),(2,"IPV4V6","","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0),(3,"IPV4V6","","0.0.0.0.0.0.0;
+CGDSCONT: ; +CGTFT: ; +CGEQREQ: ; +CGEQMIN: ; +CGEQOS: ; +CGQREQ: ;
+CGQMIN: ; +CGEREP: 0,0; +CGDATA: "PPP"; +CGCLASS: "A";  +CGPIAF: 0,0,0,0;
+CGSMS: 1; +CSMS: 0; +CMGF: 0; +CSAS: 0; +CRES: 0; +CSCA: "",;
+CSMP: ,,0,0; +CSDH: 0; +CSCB: 0,"",""; +CMGP: 4098,0,,0,; +ES: ,,;
+ESA: 0,,,,0,0,255,; +CMOD: 0; +CEMODE: 2; +CVHU: 1; ; ; ; ; ; ;
+CSCLK: 0; +CCUART: 0; +CFGRI: 0,60,120; +CUARTSD: 500; +CURCD: 0;
+CUARTLOG: 0; +CUARTRM: 0; +CFGRIDTM: 60,120; +CATR: 0; +CNMP: 2;
+CNRP: 255; +CNAOP: 0; +CNSDP: 2; +CNSMOD: 0; +CNLSA: 0; +CEXTEPLMN: 1;
+CSQFMT: 1; +AUTOCSQ: 0,0; +CSQDELTA: 5; +CPSI: 0; +CMGSI: 2;
+CMGRMI: 4,0; +MONI: 0; +CRUPSI: 0;  +CRUSET: 0; +CGPS: 1,1; +CGPSMSB: 1;
+CGPSINFO: 0; +CGPSINFOCFG: 0,0,0; +CGPSHOR: 50; +CGPSPMD: 65407;
+CGPSXD: 0; +CGNSSINFO: 0; +CSOCKAUTH: 1,0,""; +CGAUTH: 1,0,""; ;
+CIPHEAD: 1; +CIPSRIP: 1; +CIPCCFG: 10,0,0,1,0,0,500; +CIPENSRXGET: 0;
+CIPMODE: 0; +CPIN: ÿÿÿÿÿÿÿÿ,ÿÿÿÿÿÿÿÿ; +CMEC: 0,0,0,0;
+CIND: 0,3,1,1,0,0,1,0; +CMER: 0,0,0,0,0; +CGATT: 1;
+CGACT(1,1),(2,0),(3,0),(4,0),(5,0),(6,0); +CPBS: "SM";
+CPMS: "SM","SM","SM"; +CNMI: 2,1,0,0,0; +CMMS: 0; +CCUG: 0,0,0;
+COPS: 0,0,""; +CUSD: 0; +CAOC: 1; +CCWA: 0;  +CPOL: 0,2,"",0,0,0,0;
+CPLS: 0; +CTZR: 0; +CTZU: 0; +CLIP: 0; +COLP: 0; +CDIP: 0; +CLIR: 0;
+CSDF: 1; +CEN: 0; +CPSMS: 0,"","","",""; +CEDRXS: 0,1,""; +CCARDMA: 0;
+STK: 0; +CSALPHA: 0; +MORING: 0; +CWAKEUPSMSSWITCH: 0;
+CFILTERSMSSWITCH: 0; +EB: 1,0,30; +EFCS: 1; +ER: 0; +ESR: 1;
+ETBM: 1,1,20; +MA: ; +MR: 0; +MS: ; +MV18R: 0; +MV18S: 0,0,0; +CXT: 0;
+CDR: 0; +CDS: 0,1,2048,6; +CFC: 0; +CFG: ""; +CQD: 10; +CCRC: 0;
+QCMUX: C,2; +CTA: 0; +ILRR: 0; +QCPIN: ,; *CNTI: 0; ^PREFMODE: 0;
^DSCI: 0; ^MODE: 0;  ^CPIN: ,

OK
AT+COPS?
+COPS: 0,0,"Google Fi",7

OK
AT+CPSI?
+CPSI: LTE,Online,310-260,0x2C13,45023373,3,EUTRAN-BAND41,39874,5,5,-68,-947,-680,16

OK
AT+CGDCONT?
+CGDCONT: 1,"IPV4V6","h2g2","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0
+CGDCONT: 2,"IPV4V6","","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0
+CGDCONT: 3,"IPV4V6","","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0
+CGDCONT: 4,"IPV4V6","","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0
+CGDCONT: 5,"IPV4V6","","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0
+CGDCONT: 6,"IPV4V6","h2g2","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0

OK
AT+CSQ
+CSQ: 22,99

OK

If you have any suggestions to make my networking more stable, I would appreciate any help. When I tried these two PID modes I lost access to the ttyUSB ports and had to connect the device to a windows machine, force install questionable drivers for the device and then issue commands to reset the modem back to a PID mode I could work with. I would also appreciate any information on how to send AT commands to a USB port/device/interface if the operating system didn’t install tty drivers to make it easily accessible.

AT+CUSBPIDSWITCH=9002,1,1

wim@WimPiZeroW-Wim:~ $ lsusb -t
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 1: Dev 4, If 0, Class=Vendor Specific Class, Driver=, 480M
        |__ Port 1: Dev 4, If 1, Class=Vendor Specific Class, Driver=, 480M
        |__ Port 1: Dev 4, If 2, Class=Vendor Specific Class, Driver=, 480M
        |__ Port 1: Dev 4, If 3, Class=Vendor Specific Class, Driver=, 480M
        |__ Port 1: Dev 4, If 4, Class=Vendor Specific Class, Driver=, 480M
        |__ Port 1: Dev 4, If 5, Class=Vendor Specific Class, Driver=, 480M

AT+CUSBPIDSWITCH=9018,1,1

wim@WimPiZeroW-Wim:~ $ lsusb
Bus 001 Device 003: ID 1e0e:9018 Qualcomm / Option SimTech, Incorporated
Bus 001 Device 002: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
wim@WimPiZeroW-Wim:~ $ lsusb -t
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 1: Dev 3, If 0, Class=Vendor Specific Class, Driver=, 480M
        |__ Port 1: Dev 3, If 1, Class=Vendor Specific Class, Driver=, 480M
        |__ Port 1: Dev 3, If 2, Class=Vendor Specific Class, Driver=, 480M
        |__ Port 1: Dev 3, If 3, Class=Vendor Specific Class, Driver=, 480M
        |__ Port 1: Dev 3, If 4, Class=Vendor Specific Class, Driver=, 480M
        |__ Port 1: Dev 3, If 5, Class=Communications, Driver=cdc_ether, 480M
        |__ Port 1: Dev 3, If 6, Class=CDC Data, Driver=cdc_ether, 480M

Yanmar Diesel Hour Meter fix

When I bought my sailboat Sola a year and a half ago the hour meter for the diesel engine was nonfunctional. It is an LCD readout on the lower part of the tachometer. In the totality of the boat purchase this was not a major issue for me, but something that I’d like to get fixed to better keep track of engine maintenance.

Recently I had a major problem with my transmission, and the lack of knowledge about the condition of my engine became something I was very aware of while talking with mechanics. I spent a week sitting around in Port Townsend waiting on parts to get my boat fixed and had plenty of time to watch YouTube videos about fixing things on boats. I came across this one related to possibly fixing my hour meter with a $30 part. It explains what appears to be a common problem with Yanmar control panels, the LCD display of the hour meter fails while everything else continues working, including the counter chip in the background. Replacing the LCD panel gets a working counter without losing the underlying data. $30 is inexpensive compared to everything else I was spending to get the boat fully functional again, so I ordered the part. I paid via PayPal and was able to have PayPal specify my delivery address directly which made the purchase process very easy.

Instead of taking the entire panel out of my cockpit, I crawled into the lazarette, unplugged the cable, and removed the four screws holding the tachometer in place. Mine used Torx T10 screws.

Once the tachometer was sitting at my table, it’s held together by three torx T10 screws. After losening the screws, I was able to push on the screws, popping the lens and gasket out of the front of the housing. The lens itself is only held in place by friction.

Here you can see the internals. The upper plate holds the LCD connected by the ribbon cable, and has curved light guides coming towards incandescent lamps on the lower plate, but is primarily clear plastic with an opaque sticker gauge display on the top. The pin from the needle stepper motor protrudes through. I had to pry the needle off the pin with more force than I hoped, but it went back in place afterwards.

Replacement part in antistatic package, existing condition of the tachometer, and me slowly prying the display sticker from the front of the clear plastic.

I wish I’d ordered a replacement for the tachometer lens. It’s been scratched for the entire time I’ve owned it. Not a significant issue, but it would have improved the appearance.

I waited till I had put everything back in place before I started the engine and was quite pleased to see a display. 12,984 is more hours than I expected, but at least now I have a reference going forward.

The original LCD has the numbers LPH3930-2 05215235 printed on the edge, which is useful to recognize for future web searches. Simply based on that I was able to come across references to fixes for tachometers used on other brand engines. I also came across mention of a calibration menu, which might be useful. I noticed that there is a momentary switch button on the back of the unit. I only noticed it when I pressed it by mistake. Searching for “Siemens VDO Tachometer Installation and Operation Instructions for Programmable Tachometer with Hourmeter N 02 012 195” helped me find details on the calibration button itself.

iOS 16 Volume Control Change

I hate change for change sake. Apple seems to have modified the volume control for music playing on the Lock Screen and I can’t see a good reason for the change.

Music playing via AirPods

While listening to music via AirPods it seems the only way to adjust the volume is to press the physical up/down buttons on the phone.

Music playing via AirPlay on speakers

When music is playing on external speakers the volume control line is visible below the play control.

My cardio workout has me using AirPods with the phone resting horizontally on the machine in front of me. In the past if I needed to adjust the volume I could tap the screen to wake it up, then adjust the volume with the slider. I also had visual feedback as to where the volume was set. With the new layout I have to pick up the phone, press the volume button, and return the phone to its resting location. It may sound like a minimal change but has to do a lot with balance and cadence, plus a much larger chance of dropping the phone.

Arducam Red Tint Issue on Raspberry Pi

no tuning file

After writing up my issue yesterday I posted the question on the amazon product details. I received an answer with a link to this page overnight. It references a page with several custom tuning files for their lenses. There did not seem to be a tuning file that matched the 175° FOV lens on the package I got, but there was both a 160° and a 200° version. I downloaded both files and ran a test capture with each. On initial viewing, either will work for my solution. I need to focus the lens to see if there are any noticeable differences.

–tuning-file imx219_160.json
–tuning-file imx219_200.json

The commands I used to download and test the tuning files are

wget https://www.arducam.com/wp-content/uploads/2022/05/imx219_160.json
wget https://www.arducam.com/wp-content/uploads/2022/05/imx219_200.json
libcamera-still -v 2 --nopreview --hflip --vflip --thumb none --tuning-file imx219_160.json --output `hostname`-160.jpg
libcamera-still -v 2 --nopreview --hflip --vflip --thumb none --tuning-file imx219_200.json --output `hostname`-200.jpg

I got a message about the tuning file being an older version, with pointers on how to convert it to the updated version.

WARN RPiController controller.cpp:43 This format of the tuning file will be deprecated soon! Please use the convert_tuning.py utility to update to version 2.0.

I still need to decide how I want to handle this in my automated photo processing, but having the information is hugely useful.

Links in one place:

Arducam 8MP IMX219 175 Degree Ultra Wide Angle Raspberry Pi Camera Module

I’ve been playing with several cameras attached to raspberry pi recently. Getting cameras is easy right now while getting Raspberry Pi is not. I purchased this model from Amazon and have it connected to a Raspberry Pi4. I had to upgrade the unit from running Raspian Buster to Raspian Bullseye to get support for this particular camera.

Amazon Listing

I was doing some searching for red tint problems and fixing them, and it seems to be something that should be able to fix in software. Most of the fixes refer to Jetson Nano, which is not the platform I’m working with, so the fixes don’t align with my platform.

Red Tint Problem on IMX219

I still need to manually focus the lens on this camera. It’s always a frustrating process on a small lens like this because my fingers obscure the view. I’m running with camera_auto_detect=1 while https://www.arducam.com/docs/cameras-for-raspberry-pi/native-raspberry-pi-cameras/8mp-imx219-standard-camera-modules/ recommends modifying /boot/config.txt and setting both camera_auto_detect=0 and dtoverlay=imx219. exiftool reports Camera Model Name : /base/soc/i2c0mux/i2c@1/imx219@10 with the current settings. I’ve verified that using the explicit camera overlay produces the same red tint as well as having exactly the same Model Name in the exif data.

I was able to find the file /usr/share/libcamera/ipa/raspberrypi/imx219.json which may be similar to the ISP files the Jetson platforms were using. I’m still working on the red tint.

I upgraded to iOS 16 today

I haven’t found anything that significantly annoyed me yet.

When I’m playing music and there’s cover art, it’s now displayed on the Lock Screen, which is nice.

When the cover art is missing, the controls are now at the bottom of the screen. Each time I see them there I start to rotate my phone, thinking I’ve picked it up upside down.

I’m sure I’ll get used to the new layout. I find this problem funny, at least today.

More Networking with SIM7600G-H 4G HAT (B) for Raspberry Pi

I initially set up my Waveshare SIM7600G-H 4G HAT (B) for Raspberry Pi as described in the post last week.

Partly because the original web article I was following mentioned different modes of connecting to the internet, and partly because of my infatuation with IPv6, I decided to try to see the performance of different modes I might be able to set up with the device I have.

The support wiki for the device has four pages related to networking setup with the Raspberry Pi, RNDIS, NDIS, SIM868 PPP, and “3G Router“. I’d looked up definitions of NDIS and RNDIS on Wikipedia and didn’t really understand the differences, but the SIM868 page is titled “SIM7600X ECM dial-up Internet” and the ECM led me to believe it was the same as the second type of networking defined in the original article I’d been following. (Choosing QMI or ECM)

I’d been able to issue commands to the board by echoing the correct AT command to /dev/sttyUSB2. I was using the command echo AT+CGPS=1 >/dev/ttyUSB2 to enable the GPS on each boot. Following the Waveshare RNDIS instructions I blithely issued the command echo AT+CUSBPIDSWITCH=9011,1,1 >/dev/sttyUSB2 on my raspberry. The wwan0 device that I’d had set up and running went away and was replaced by a usb0 network device that Raspbian automatically enabled and acquired a valid internet address for. It had a routing metric that was lower than my wlan0 interface, but I figured it might be easier to organize this later without adding udhcpc into the mix of networking software on my raspberry. It also acquired an IPv6 address, which I’d not figured out how to do with the QMI setup and qmicli tools in my initial configuration. The original article mentioned possibly a lower networking latency using ECM vs QMI, so because one of the Waveshare pages had ECM in the title, I tried echo AT+CUSBPIDSWITCH=9018,1,1 /dev/sttyUSB2.

The latency seemed to be slightly different, and I wanted to switch back and do some real testing. That’s when I realized that I no longer had any /dev/ttyUSB devices to be able to send commands to. Completely power cycling the device made no difference. This is when I realized there are no reset jumpers on the device at all, and it had been able to remember the carrier APN that I’d initially set up before switching modes. Looking at the support web page, the only way I could figure out to recover the device was to connect it to a windows machine and install their drivers. I was not interested in downloading drivers from an unknown source and installing them on my primary workstation but realized my old Windows7 machine that hadn’t been turned on in close to a year was a good sacrifice if I could get things working.

First, I had to download the SIM7600X Driver, then I had to get their software.

Initial look at software

It took me a while to figure out that I had to hit the “Tools->STC/IAP15 ISP Programmer” menu, followed by the “Send Multi Char” tab on the resulting window pane to get the list of AT commands it could send.

Simcom Software

It also took me a while to recognize that while I could type commands into the primary window on the left, when I pasted commands that I’d typed in notepad, they were displayed but not executed by the card. The program also didn’t let me easily copy the contents of the main window so I could keep track of what commands I’d used and gotten as a result. After a while, I realized that this was essentially just a specialized serial terminal, and I had serial terminals I’m much more familiar with on my machine already. The Simcom HS-USB ports are visible in the windows device manager as COM12, COM13, COM14, and COM16. The purpose of each port is visible in the naming of the port in the current mode, NMEA, AT PORT, Diagnostics, and Audio.

AT+CRESET appeared to be a good command to get me back to a reasonable working state, but it only seemed to reboot the card, without changing any of the settings that had been stored. I was finally able to figure out that the AT&F command would set all the settings back to the factory defaults. After doing that I was no longer automatically connecting to Google FI, which at least meant I was no longer using up my data allowance while I was figuring things out.

I’d originally gotten into trouble by issuing the command AT+CUSBPIDSWITCH=9018,1,1. I came across the list of all available commands, which is much larger than what was listed in the Simcom Software itself. Issuing the command AT+CUSBPIDSWITCH? returns the current mode, and AT+CUSBPIDSWITCH=? lists the possible modes.

After the factory reset and switch back to 9011 mode, I got some of these results:

AT&F
OK
ATI
Manufacturer: SIMCOM INCORPORATED
Model: SIMCOM_SIM7600G-H
Revision: SIM7600M22_V2.0.1
SVN: 01
IMEI: 868822042540193
+GCAP: +CGSM

AT+CGDCONT?
+CGDCONT: 1,"IPV4V6","Telstra.internet","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0
+CGDCONT: 2,"IPV4V6","","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0
+CGDCONT: 3,"IPV4V6","","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0
+CGDCONT: 4,"IPV4V6","","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0
+CGDCONT: 5,"IPV4V6","","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0
+CGDCONT: 6,"IPV4V6","","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0

OK
AT+CGDCONT=?
+CGDCONT: (1-24),"IP",,,(0-2),(0-4),(0-1),(0-1)
+CGDCONT: (1-24),"PPP",,,(0-2),(0-4),(0-1),(0-1)
+CGDCONT: (1-24),"IPV6",,,(0-2),(0-4),(0-1),(0-1)
+CGDCONT: (1-24),"IPV4V6",,,(0-2),(0-4),(0-1),(0-1)

OK
AT+CUSBPIDSWITCH?
+CUSBPIDSWITCH: 9011

OK
AT+CUSBPIDSWITCH=?
+CUSBPIDSWITCH: (9000,9001,9002,9003,9004,9005,9006,9007,9011,9016,9018,9019,901A,901B,9020,9021,9022,9023,9024,9025,9026,9027,9028,9029,902A,902B),(0-1),(0-1)

Following some instructions I found on a post written by Mathieu Leguey, I was able to reconfigure the APN to connect to Google Fi. That page is also where I found the link to the complete list of commands. This other page is what led me to believe I need to set the APN twice to get IPv6 operating properly.

AT+CGDCONT?
+CGDCONT: 1,"IPV4V6","h2g2","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0
+CGDCONT: 2,"IPV4V6","","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0
+CGDCONT: 3,"IPV4V6","","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0
+CGDCONT: 4,"IPV4V6","","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0
+CGDCONT: 5,"IPV4V6","","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0
+CGDCONT: 6,"IPV4V6","h2g2","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0

I later realized I could configure the GPS to automatically start with the command AT+CGPSAUTO=1. The final configuration commands I decided to use that seem to work for my purposes are as follows:

AT&F
AT+CUSBPIDSWITCH=9011,1,1
AT+CGDCONT=1,"IPV4V6","h2g2"
AT+CGDCONT=6,"IPV4V6","h2g2"
AT+CGPSAUTO=1
SecureCRT Display

By doing this, I was able to avoid installing any networking drivers or configuration on Raspian that wasn’t automatically installed with the minimal system image. I should have been able to issue all of the commands via the echo command and the /dev/sttyUSB2 port if I’d not initially put the unit into 9018 mode and removed the USB control port.

ip a
ifconfig -a
route -v -n
wim@WimPiZeroW-Hope:~ $ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b8:27:eb:7c:6a:80 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.53/24 brd 192.168.0.255 scope global dynamic noprefixroute wlan0
       valid_lft 10481sec preferred_lft 9131sec
    inet6 2604:4080:1304:8010:347f:5b74:9cac:5a2/64 scope global dynamic mngtmpaddr noprefixroute
       valid_lft 27sec preferred_lft 17sec
    inet6 fe80::7a98:f2b1:147d:36d0/64 scope link
       valid_lft forever preferred_lft forever
3: usb0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 1000
    link/ether fe:5c:c9:12:f4:3a brd ff:ff:ff:ff:ff:ff
    inet 192.168.225.31/24 brd 192.168.225.255 scope global dynamic noprefixroute usb0
       valid_lft 42884sec preferred_lft 37484sec
    inet6 2607:fb90:8062:ac89:b44d:ec7e:82c0:b337/64 scope global mngtmpaddr noprefixroute
       valid_lft forever preferred_lft forever
    inet6 fe80::5ade:a00c:113f:dfcd/64 scope link
       valid_lft forever preferred_lft forever
wim@WimPiZeroW-Hope:~ $ ifconfig -a
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 14  bytes 1876 (1.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 14  bytes 1876 (1.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

usb0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.225.31  netmask 255.255.255.0  broadcast 192.168.225.255
        inet6 2607:fb90:8062:ac89:b44d:ec7e:82c0:b337  prefixlen 64  scopeid 0x0<global>
        inet6 fe80::5ade:a00c:113f:dfcd  prefixlen 64  scopeid 0x20<link>
        ether fe:5c:c9:12:f4:3a  txqueuelen 1000  (Ethernet)
        RX packets 74  bytes 6149 (6.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 100  bytes 14461 (14.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.53  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::7a98:f2b1:147d:36d0  prefixlen 64  scopeid 0x20<link>
        inet6 2604:4080:1304:8010:347f:5b74:9cac:5a2  prefixlen 64  scopeid 0x0<global>
        ether b8:27:eb:7c:6a:80  txqueuelen 1000  (Ethernet)
        RX packets 3068  bytes 458727 (447.9 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 956  bytes 151187 (147.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wim@WimPiZeroW-Hope:~ $ route -v
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         mobileap.qualco 0.0.0.0         UG    203    0        0 usb0
default         192.168.0.1     0.0.0.0         UG    302    0        0 wlan0
192.168.0.0     0.0.0.0         255.255.255.0   U     302    0        0 wlan0
192.168.225.0   0.0.0.0         255.255.255.0   U     203    0        0 usb0
wim@WimPiZeroW-Hope:~ $ route -v -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.225.1   0.0.0.0         UG    203    0        0 usb0
0.0.0.0         192.168.0.1     0.0.0.0         UG    302    0        0 wlan0
192.168.0.0     0.0.0.0         255.255.255.0   U     302    0        0 wlan0
192.168.225.0   0.0.0.0         255.255.255.0   U     203    0        0 usb0
wim@WimPiZeroW-Hope:~ $ ping -I usb0 www.google.com -c 4
PING www.google.com(nuq04s43-in-x04.1e100.net (2607:f8b0:4005:810::2004)) from 2607:fb90:8062:ac89:b44d:ec7e:82c0:b337 usb0: 56 data bytes
64 bytes from nuq04s43-in-x04.1e100.net (2607:f8b0:4005:810::2004): icmp_seq=1 ttl=116 time=68.0 ms
64 bytes from nuq04s43-in-x04.1e100.net (2607:f8b0:4005:810::2004): icmp_seq=2 ttl=116 time=67.1 ms
64 bytes from nuq04s43-in-x04.1e100.net (2607:f8b0:4005:810::2004): icmp_seq=3 ttl=116 time=65.2 ms
64 bytes from nuq04s43-in-x04.1e100.net (2607:f8b0:4005:810::2004): icmp_seq=4 ttl=116 time=65.5 ms

--- www.google.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 65.217/66.449/68.012/1.159 ms
wim@WimPiZeroW-Hope:~ $ ping -I wlan0 www.google.com -c 4
PING www.google.com(nuq04s43-in-x04.1e100.net (2607:f8b0:4005:810::2004)) from 2604:4080:1304:8010:347f:5b74:9cac:5a2 wlan0: 56 data bytes
64 bytes from nuq04s43-in-x04.1e100.net (2607:f8b0:4005:810::2004): icmp_seq=1 ttl=50 time=68.0 ms
64 bytes from nuq04s43-in-x04.1e100.net (2607:f8b0:4005:810::2004): icmp_seq=2 ttl=50 time=27.3 ms
64 bytes from nuq04s43-in-x04.1e100.net (2607:f8b0:4005:810::2004): icmp_seq=3 ttl=50 time=30.4 ms
64 bytes from nuq04s43-in-x04.1e100.net (2607:f8b0:4005:810::2004): icmp_seq=4 ttl=50 time=44.7 ms

--- www.google.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3008ms
rtt min/avg/max/mdev = 27.330/42.629/68.048/16.072 ms
wim@WimPiZeroW-Hope:~ $ lsusb
Bus 001 Device 003: ID 1e0e:9011 Qualcomm / Option SimTech, Incorporated
Bus 001 Device 002: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
wim@WimPiZeroW-Hope:~ $ lsusb -t
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 1: Dev 3, If 0, Class=Communications, Driver=rndis_host, 480M
        |__ Port 1: Dev 3, If 1, Class=CDC Data, Driver=rndis_host, 480M
        |__ Port 1: Dev 3, If 2, Class=Vendor Specific Class, Driver=option, 480M
        |__ Port 1: Dev 3, If 3, Class=Vendor Specific Class, Driver=option, 480M
        |__ Port 1: Dev 3, If 4, Class=Vendor Specific Class, Driver=option, 480M
        |__ Port 1: Dev 3, If 5, Class=Vendor Specific Class, Driver=option, 480M
        |__ Port 1: Dev 3, If 6, Class=Vendor Specific Class, Driver=option, 480M
ping results

One thing that jumped out when using the USB interface is that the default gateway is an internal Qualcomm name, mobileap.qualco.

lsusb results

I still need to figure out how to change the metric of usb0 to be higher than wlan0 probably installing the ifmetric program, following directions similar to this answer.

Update 7/17/2020

Adding an interface and metric line to the end of /etc/dhcpd.conf got me the routing I wanted without having to add any new programs. It also means the IPv6 stuff is taken care of automatically.

wim@WimPiZeroW-Hope:~ $ tail -5 /etc/dhcpcd.conf
#interface eth0
#fallback static_eth0

interface usb0
metric 400
wim@WimPiZeroW-Hope:~ $ route -n -v
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.0.1     0.0.0.0         UG    302    0        0 wlan0
0.0.0.0         192.168.225.1   0.0.0.0         UG    400    0        0 usb0
192.168.0.0     0.0.0.0         255.255.255.0   U     302    0        0 wlan0
192.168.225.0   0.0.0.0         255.255.255.0   U     400    0        0 usb0
wim@WimPiZeroW-Hope:~ $ route -n -v -6
Kernel IPv6 routing table
Destination                    Next Hop                   Flag Met Ref Use If
::1/128                        ::                         U    256 2     0 lo
2604:4080:1304:8010::/64       ::                         U    302 1     0 wlan0
2607:fb90:80c7:b02e::/64       ::                         U    400 2     0 usb0
fe80::/64                      ::                         U    256 1     0 usb0
fe80::/64                      ::                         U    256 1     0 wlan0
::/0                           fe80::b27f:b9ff:fe83:6591  UG   302 1     0 wlan0
::/0                           fe80::6c86:c4b4:1f1:c09    UG   400 2     0 usb0
::1/128                        ::                         Un   0   4     0 lo
2604:4080:1304:8010:347f:5b74:9cac:5a2/128 ::                         Un   0   2     0 wlan0
2607:fb90:80c7:b02e:b86b:f626:1fa9:3a62/128 ::                         Un   0   4     0 usb0
fe80::7a98:f2b1:147d:36d0/128  ::                         Un   0   3     0 wlan0
fe80::88be:29ff:2c84:e5a0/128  ::                         Un   0   5     0 usb0
ff00::/8                       ::                         U    256 2     0 usb0
ff00::/8                       ::                         U    256 2     0 wlan0
::/0                           ::                         !n   -1  1     0 lo
usb0 routing metric fixed

References: