Hi All,
Has anyone encountered problems getting knxd to read the serial port on a Pi 5 / bookworm? (I’m using Tigl’s Pi HAT for my bus comm’s).
I can build fine repeatedly on a Pi 4, but every attempt at a Pi 5 fails to report any bus activity. [x64 bookworm, no desktop]
In preparing the udev rule I didn’t get a response to the ID for TTYAMA0, but I see I have a TTYAMA10 and that gave me the response I was looking for, so I added the rule using it instead:
pi@knxLoggerPi5:~ $ sudo udevadm info -a /dev/ttyAMA0 | grep KERNELS.*serial KERNELS=="1f00030000.serial" pi@knxLoggerPi5:~ $ sudo udevadm info -a /dev/ttyAMA0 | grep \{id\} pi@knxLoggerPi5:~ $ sudo udevadm info -a /dev/ttyAMA10 | grep KERNELS.*serial KERNELS=="107d001000.serial" pi@knxLoggerPi5:~ $ sudo udevadm info -a /dev/ttyAMA10 | grep \{id\} ATTRS{id}=="00241011"Have I chosen poorly?
I think my getty is good:
(venv) pi@knxLoggerPi5:~ $ sudo systemctl status *gett* ● system-getty.slice - Slice /system/getty Loaded: loaded Active: active since Sun 2024-06-16 19:44:31 AEST; 1 month 27 days ago Tasks: 1 CPU: 2ms CGroup: /system.slice/system-getty.slice └─ge...@tty1.service └─842 /sbin/agetty -o "-p -- \\u" --noclear - linux Notice: journal has been rotated since unit was started, output may be incomplete. ● getty.target - Login Prompts Loaded: loaded (/lib/systemd/system/getty.target; static) Active: active since Tue 2024-08-13 16:39:13 AEST; 23min ago Docs: man:systemd.special(7) man:systemd-getty-generator(8) https://0pointer.de/blog/projects/serial-console.html Aug 13 16:39:13 knxLoggerPi5 systemd[1]: Reached target getty.target - Login Prompts. ● ge...@tty1.service - Getty on tty1 Loaded: loaded (/lib/systemd/system/getty@.service; enabled; preset: enabled) Drop-In: /etc/systemd/system/ge...@tty1.service.d └─noclear.conf Active: active (running) since Tue 2024-08-13 16:39:13 AEST; 23min ago Docs: man:agetty(8) man:systemd-getty-generator(8) https://0pointer.de/blog/projects/serial-console.html Main PID: 842 (agetty) Tasks: 1 (limit: 4450) CPU: 2ms CGroup: /system.slice/system-getty.slice/ge...@tty1.service └─842 /sbin/agetty -o "-p -- \\u" --noclear - linux Aug 13 16:39:13 knxLoggerPi5 systemd[1]: Started ge...@tty1.service - Getty on tty1. (venv) pi@knxLoggerPi5:~I think my GPIOs are correct:
(venv) pi@knxLoggerPi5:~ $ pinctrl get 14-17 14: a4 pn | hi // GPIO14 = TXD0 15: a4 pu | hi // GPIO15 = RXD0 16: no pd | -- // GPIO16 = none 17: no pd | -- // GPIO17 = none (venv) pi@knxLoggerPi5:~Here’s /boot/firmware/cmdline.txt:
console=tty1 root=PARTUUID=5282b8a4-02 rootfstype=ext4 fsck.repair=yes rootwait cfg80211.ieee80211_regdom=AU… and /boot/firmware/config.txt:
[all] dtparam=uart0=on enable_uart=1 dtoverlay=disable-bt dtoverlay=pi3-disable-btOwnership/permissions?
(venv) pi@knxLoggerPi5:~ $ ls -la /dev/tty* crw-rw-rw- 1 root tty 5, 0 Aug 13 17:11 /dev/tty crw--w---- 1 root tty 4, 0 Aug 13 16:39 /dev/tty0 crw--w---- 1 root tty 4, 1 Aug 13 16:39 /dev/tty1 crw--w---- 1 root tty 4, 9 Aug 13 16:39 /dev/tty9 <EDIT> crw-rw---- 1 root dialout 204, 64 Aug 13 16:39 /dev/ttyAMA0 crw-rw---- 1 knxd dialout 204, 74 Aug 13 16:39 /dev/ttyAMA10 lrwxrwxrwx 1 root root 8 Aug 13 16:39 /dev/ttyKNX1 -> ttyAMA10 crw------- 1 root root 5, 3 Aug 13 16:39 /dev/ttyprintk crw-rw---- 1 root dialout 4, 64 Aug 13 16:39 /dev/ttyS0 (venv) pi@knxLoggerPi5:~I tried to sudo chown knxd:dialout /dev/ttyKNX1 and it didn’t err, but when I repeated the ls -la /dev/tty* it still shows as owned by root root.
Red herring, or staring me in the face elsewhere?
T[heaps]IA.
- Greig.
Solved it!!
Using AMA10 on the Pi5 - big mistake. But AMA0 no longer provides an ATTRS{id} value! Turns out it’s not needed. Simply omit it from the UDEV rule:
Pi4: ACTION=="add", SUBSYSTEM=="tty", ATTRS{id}=="00241011", KERNELS=="107d001000.serial", SYMLINK+="ttyKNX1", OWNER="knxd"
Pi5: ACTION=="add", SUBSYSTEM=="tty", KERNELS=="1f00030000.serial", SYMLINK+="ttyKNX1", OWNER="knxd"
KNXD is now a source of joy:
(venv) pi@knxLoggerPi5:~/knxLogger $ knxtool vbusmonitor1 ip:localhost L_Busmon: BC 11 0A 79 0A E3 00 80 0C 1A 5E :L_Data low from 1.1.10 to 15/1/10 hops: 06 T_Data_Group A_GroupValue_Write 0C 1A L_Busmon: BC 11 01 08 03 E1 00 85 3C :L_Data low from 1.1.1 to 1/0/3 hops: 06 T_Data_Group A_GroupValue_Write (small) 05 L_Busmon: BC 11 01 08 01 E1 00 81 3A :L_Data low from 1.1.1 to 1/0/1 hops: 06 T_Data_Group A_GroupValue_Write (small) 01 L_Busmon: BC 11 0C 08 02 E1 00 81 34 :L_Data low from 1.1.12 to 1/0/2 hops: 06 T_Data_Group A_GroupValue_Write (small) 01 L_Busmon: BC 11 0C 08 05 E2 00 80 66 57 :L_Data low from 1.1.12 to 1/0/5 hops: 06 T_Data_Group A_GroupValue_Write 66 L_Busmon: BC 11 0C 08 08 E3 00 80 16 A8 83 :L_Data low from 1.1.12 to 1/0/8 hops: 06 T_Data_Group A_GroupValue_Write 16 A8FYI here’s the relevant bit in my /boot/firmware/config.txt
dtparam=uart0 dtoverlay=disable-bt dtoverlay=pi3-disable-bt