Ich habe ein bestehendes System Pi3B+ auf Bookworm und WiringPi V3.10 umgestellt.
Der MCP23017 Portextender wird mit i2cdetect -y 1 problemlos erkannt.
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: 20 21 -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
Unter FHEM funktioniert aber der MCP23017 nicht mehr.
list RpiI2C_1
Internals:
CFGFN /media/hdd/fhem/mycfg/schnittstellen_rasp07.cfg
DEF 1
DeviceName /dev/i2c-1
ERRORCNT 6
FUUID 672652bf-f33f-f4d2-3ae9-3311449e57343192
NAME RpiI2C_1
NOTIFYDEV global
NR 436
NTFY_ORDER 50-RpiI2C_1
STATE regerror
TYPE RPII2C
ioctl_ph_exists 1
Attributes:
alias I²C Schnittstelle
devStateIcon Ok:it_net@0CFB0C initialized:it_net@yellow disconnected:it_net@red error:it_net@red
devStateStyle style="text-align:left;;font-weight:bold;;"
group Schnittstellen I2C
icon it_net
room _RxTx
list INT
Internals:
CFGFN /media/hdd/fhem/mycfg/GPIO/GPIO_rasp07.cfg
DEF 21
FUUID 5c695b7f-f33f-fcca-a381-7daf3cfd13a3dc14
GPIO_Basedir /sys/class/gpio
GPIO_Nr 21
NAME INT
NR 739
STATE off
TYPE RPI_GPIO
WiringPi_gpio /usr/bin/gpio
filehandle
READINGS:
2024-11-01 14:32:41 Dblclick off
2024-11-01 14:32:41 Longpress off
2024-11-01 14:32:41 interrupt egal
2024-11-01 14:32:41 state off
Pinlevel:
TIME 2024-11-02 11:25:05
VAL
fhem:
interfaces switch
Attributes:
active_low yes
alias RPI_GIPO 21 Interrupt für MCP23017 Modul
devStateIcon on:control_on_off@0CFB0C off:control_home@red
direction input
event-on-change-reading .*
icon control_on_off
interrupt both
room _GPIO,_IO
userReadings interrupt {fhem ("get mcp23017_B1_OG1,mcp23017_B2_OG1");;"egal"}
list mcp23017_B1_OG1
Internals:
CFGFN /media/hdd/fhem/mycfg/AD_Controller/I2C_MCP23017_rasp07.cfg
DEF 0x20
FUUID 5c695b80-f33f-e2b6-96cb-7300d343733fe4c6
NAME mcp23017_B1_OG1
NR 805
STATE defined
TYPE I2C_MCP23017
READINGS:
2024-06-27 13:12:10 PortA0 off
2024-06-27 13:12:12 PortA1 off
2024-10-19 09:46:45 PortA2 on
2024-07-24 18:59:31 PortA3 on
2024-09-21 09:48:55 PortA4 off
2024-09-07 14:59:28 PortA5 off
2024-10-19 13:28:02 PortA6 on
2024-10-19 13:28:02 PortA7 on
2024-02-06 16:16:11 PortB0 on
2024-04-01 11:38:31 PortB1 on
2024-04-01 11:38:31 PortB2 on
2022-12-08 12:04:28 PortB3 on
2024-11-01 14:32:04 PortB4 on
2024-02-06 11:30:34 PortB5 off
2024-10-31 09:15:40 PortB6 on
2024-02-06 11:30:30 PortB7 off
2024-11-01 14:32:41 state Ok
Attributes:
IODev RpiI2C_1
Interrupt A0,A1,A2,A3,A4,A5,A6,A7,B0,B1,B2,B3,B4,B5,B6,B7
InterruptOut separate_active-low
Pullup A0,A1,A2,A3,A4,A5,A6,A7,B0,B1,B2,B3,B4,B5,B6,B7
alias Digital I/O Bank 1 | Port A0-A7,B0-B7 (Input)
devStateIcon Ok:it_net@0CFB0C Initialized:it_net@yellow defined:it_net@yellow disconnected:it_net@red error:it_net@red
devStateStyle style="text-align:left;;font-weight:bold;;"
group Schnittstellen I2C
icon it_net
invert_input A0,A1,A2,A3,A4,A5,A6,A7,B0,B1,B2,B3,B4,B5,B6,B7
room _IO,_RxTx
list mcp23017_B2_OG1
Internals:
CFGFN /media/hdd/fhem/mycfg/AD_Controller/I2C_MCP23017_rasp07.cfg
DEF 0x21
FUUID 5c695b80-f33f-6785-639c-160ae8a2fc7d6149
NAME mcp23017_B2_OG1
NR 810
STATE defined
TYPE I2C_MCP23017
eventCount 21
READINGS:
2024-11-02 10:56:21 PortA0 off
2024-11-02 10:56:21 PortA1 off
2024-11-02 10:56:21 PortA2 off
2024-11-02 10:56:21 PortA3 off
2024-11-02 10:56:21 PortA4 off
2024-11-02 10:56:21 PortA5 off
2024-11-02 10:56:21 PortA6 off
2024-11-02 10:56:21 PortA7 off
2024-11-02 10:56:21 PortB0 off
2024-11-02 10:56:21 PortB1 off
2024-11-02 10:56:21 PortB2 off
2024-11-02 10:56:21 PortB3 off
2024-11-02 10:56:21 PortB4 off
2024-11-02 10:56:21 PortB5 off
2024-11-02 10:56:21 PortB6 off
2024-11-02 10:56:21 PortB7 off
2024-11-01 14:32:41 state Ok
Attributes:
IODev RpiI2C_1
OnStartup A0=off,A1=off,A2=off,A3=off,A4=off,A5=off,A6=off,A7=off,B0=off,B1=off,B2=off,B3=off,B4=off,B5=off,B6=off,B7=off
OutputPorts A0,A1,A2,A3,A4,A5,A6,A7,B0,B1,B2,B3,B4,B5,B6,B7
alias Digital I/O Bank 2 | Port A0-A7,B0-B7 (Output)
devStateIcon Ok:it_net@0CFB0C Initialized:it_net@yellow defined:it_net@yellow disconnected:it_net@red error:it_net@red
devStateStyle style="text-align:left;;font-weight:bold;;"
event-on-change-reading .*
group Schnittstellen I2C
icon it_net
poll_interval 10
room _IO,_RxTx
Hat sich da etwas für FHEM verändert bei Verwendung Bookworm oder WiringPi V3.10?
Schonmal die Forumsuche nach "bookworm wiringpi" bemüht?
Soweit ich mich erinnere, werden die Effekte dieser Kombination schon seit einem Jahr hier im Forum diskutiert.
Zitat von: betateilchen am 02 November 2024, 12:20:51Schonmal die Forumsuche nach "bookworm wiringpi" bemüht?...
Dazu habe ich hier im Forum noch nichts passendes gefunden.
WiringPi wurde für Pi4 & Pi5 angepasst, aber das es mit einem älteren Pis jetzt zu Probleme kommt ist für mich nicht nachvollziehbar.
Hallo Burny4600
Die GPIO werden unter Bookwoorm anders benannt können aber weiter mit den debug Nummern und den Modul RPI_GPIO verwendet werden. Unter anderen hat klausw hier erklärt wie es funktioniert.
https://forum.fhem.de/index.php?msg=1312147 (https://forum.fhem.de/index.php?msg=1312147)
dann sollte bei Dir der GPIO pin für den Interupt in der def nicht 21 lauten sondern 533.
Und es sollte die für bookworm tauglich wiringPi installiert sein
https://github.com/WiringPi/WiringPi/releases/tag/3.10 (https://github.com/WiringPi/WiringPi/releases/tag/3.10)
Dann sollte alles wieder so laufen wie gewohnt.
Gruß
Stephan
Den Interrupt habe ich jetzt auf 533 definiert.
Sind beim RPIO_GPIO für das MCP23017 Modul sonst noch Anpassungen zu machen?
$ cat /sys/kernel/debug/gpio
.
.
gpio-533 (GPIO21 |sysfs ) in hi IRQ ACTIVE LOW
.
.
Weitere Anpassungen brauchte ich nicht machen. Das einzige was gerne mal bei mir Probleme machte, waren die
GPIO´s die als Eingänge bei mir abgefragt werden. Das mit den pullup Wiederständen klappte nicht immer bei mir mit wiringpi.
Die pullup Wiederstände setzte ich bei mir mit einen kleinen bash script auf pullup.
z.b. so für Gpio17.
#!/bin/bash
pinctrl set 17 pu
Über pinctrl werden dann aber die Normalen GPIO Nummern verwendet und nicht die debug Nummer die das RPI_GPIO Modul jetzt braucht.
Gruß
Stephan
Ich habe auf Bookworm die Änderungen übernommen, und es gibt auch keine Probleme mehr.
Danke für die Infos.