Korrekte Einbindung von MCP23017 Porterweiterung

Begonnen von roli, 22 Oktober 2017, 19:24:22

Vorheriges Thema - Nächstes Thema

roli

Ich verwende ein PIFACE  mit   einem MCP23017  um mehr GPIO Pins verfügbar zu haben.

Scheint soweit auch zu funktionieren, allerdings  wundert mich seit dem letzten update, dass ich jedes mal dach sehr viele
Einträge in mein Logfile bekomme.


2017.10.22 19:10:33 1: *** NT- Signal   OFF ****************
2017.10.22 19:10:33 1: PERL WARNING: Interrupt userReadings test evaluated to undef at fhem.pl line 4290, <GEN886> line 2.
2017.10.22 19:10:33 3: eval: {fhem ("get icMCP23017");}
2017.10.22 19:10:52 1: PERL WARNING: Interrupt userReadings test evaluated to undef at fhem.pl line 4290, <GEN886> line 3.
2017.10.22 19:10:52 3: eval: {fhem ("get icMCP23017");}
2017.10.22 19:10:52 1: PERL WARNING: Interrupt userReadings test evaluated to undef at fhem.pl line 4290, <GEN886> line 4.
2017.10.22 19:10:52 3: eval: {fhem ("get icMCP23017");}
2017.10.22 19:10:53 1: *** NT- Signal   ON ****************
2017.10.22 19:10:53 1: PERL WARNING: Interrupt userReadings test evaluated to undef at fhem.pl line 4290, <GEN886> line 5.
2017.10.22 19:10:53 3: eval: {fhem ("get icMCP23017");}
2017.10.22 19:10:53 1: PERL WARNING: Interrupt userReadings test evaluated to undef at fhem.pl line 4290, <GEN886> line 6.
2017.10.22 19:10:53 3: eval: {fhem ("get icMCP23017");}
2017.10.22 19:10:54 1: PERL WARNING: Interrupt userReadings test evaluated to undef at fhem.pl line 4290, <GEN886> line 7.
2017.10.22 19:10:54 3: eval: {fhem ("get icMCP23017");}
2017.10.22 19:10:54 1: *** NT- Signal   OFF ****************
2017.10.22 19:10:54 1: PERL WARNING: Interrupt userReadings test evaluated to undef at fhem.pl line 4290, <GEN886> line 8.
2017.10.22 19:10:54 3: eval: {fhem ("get icMCP23017");}


Hierzu waren folgende Events:

2017-10-22 19:10:52 I2C_MCP23017 icMCP23017 Ok
2017-10-22 19:10:52 RPI_GPIO Interrupt Dblclick: off
2017-10-22 19:10:52 I2C_MCP23017 icMCP23017 Ok
2017-10-22 19:10:52 RPI_GPIO Interrupt Pinlevel: low
2017-10-22 19:10:52 RPI_GPIO Interrupt off
2017-10-22 19:10:52 RPI_GPIO Interrupt Longpress: off
2017-10-22 19:10:52 I2C_MCP23017 icMCP23017 Ok
2017-10-22 19:10:52 RPI_GPIO Interrupt Pinlevel: high
2017-10-22 19:10:52 RPI_GPIO Interrupt on
2017-10-22 19:10:53 I2C_MCP23017 icMCP23017 Ok
2017-10-22 19:10:53 RPI_GPIO Interrupt Longpress: on
2017-10-22 19:10:53 readingsProxy D1T7 on
2017-10-22 19:10:53 readingsProxy prxPortA4 on
2017-10-22 19:10:53 I2C_MCP23017 icMCP23017 PortA4: off
2017-10-22 19:10:53 I2C_MCP23017 icMCP23017 Ok
2017-10-22 19:10:53 RPI_GPIO Interrupt Dblclick: off
2017-10-22 19:10:53 I2C_MCP23017 icMCP23017 Ok
2017-10-22 19:10:53 RPI_GPIO Interrupt Pinlevel: low
2017-10-22 19:10:53 RPI_GPIO Interrupt off
2017-10-22 19:10:53 RPI_GPIO Interrupt Longpress: off
2017-10-22 19:10:53 I2C_MCP23017 icMCP23017 Ok
2017-10-22 19:10:53 RPI_GPIO Interrupt Dblclick: on
2017-10-22 19:10:53 I2C_MCP23017 icMCP23017 Ok
2017-10-22 19:10:53 RPI_GPIO Interrupt Pinlevel: high
2017-10-22 19:10:53 RPI_GPIO Interrupt on
2017-10-22 19:10:54 I2C_MCP23017 icMCP23017 Ok
2017-10-22 19:10:54 RPI_GPIO Interrupt Dblclick: off
2017-10-22 19:10:54 readingsProxy D1T7 off
2017-10-22 19:10:54 readingsProxy prxPortA4 off
2017-10-22 19:10:54 I2C_MCP23017 icMCP23017 PortA4: on
2017-10-22 19:10:54 I2C_MCP23017 icMCP23017 Ok
2017-10-22 19:10:54 RPI_GPIO Interrupt Pinlevel: low
2017-10-22 19:10:54 RPI_GPIO Interrupt off
2017-10-22 19:10:54 RPI_GPIO Interrupt Longpress: off
2017-10-22 19:10:54 I2C_MCP23017 icMCP23017 Ok
2017-10-22 19:10:54 RPI_GPIO Interrupt Dblclick: on
2017-10-22 19:10:54 I2C_MCP23017 icMCP23017 Ok
2017-10-22 19:10:54 RPI_GPIO Interrupt Pinlevel: high
2017-10-22 19:10:54 RPI_GPIO Interrupt on
2017-10-22 19:10:54 I2C_MCP23017 icMCP23017 Ok
2017-10-22 19:10:54 RPI_GPIO Interrupt Longpress: on
2017-10-22 19:10:55 I2C_MCP23017 icMCP23017 Ok
2017-10-22 19:10:55 RPI_GPIO Interrupt Longpress: on


Anbei meine  FHEm  Konfigurations Auszug :



###Interrupt A&B####    Pin 15  -- GPIO22
define Interrupt RPI_GPIO 22
  attr Interrupt direction    input
  attr Interrupt active_low   yes
  attr Interrupt interrupt    both
  attr Interrupt userReadings test {fhem ("get icMCP23017");;}


#  Am neuen  RAspi   Kommt alles auf Adresse 0  -- beim alten auf 1  !!
define i2cBus RPII2C 1

###MCP23017-0x20###
define icMCP23017 I2C_MCP23017  0x20
  attr icMCP23017 IODev i2cBus
# eingabe port definitionen   -- mit pullup
  attr icMCP23017 Pullup        A0,A1,A2,A3,A4,A5,A6,A7
  #attr icMCP23017 invert_input A0,A1,A2,A3
  attr icMCP23017 Interrupt    A0,A1,A2,A3,A4,A5,A6,A7
  attr icMCP23017 InterruptOut connected_active-low
# output port definitionen
  attr icMCP23017 OutputPorts   B0,B1,B2,B3,B4,B5,B6,B7
  # können nicht invertiert. Bei Startup  on= relais aus  ; off= relais an
  attr icMCP23017 OnStartup     B0=on,B1=on,B2=on,B3=on     




Die Logfile warnings werden durch das  "UserReadings test"  erzeugt  --- sprich wohl durch den  fhem Aufruf.
Ich  habe diese Methode mal von einem Beispiel übernommen und es funktioniert. Keine Ahnung ob irgend etwas  bei mir fehlt oder dann doch unsauber ist.

Rufe ich  {fhem ("get icMCP23017");;}
  im Command Fenster des UIs auf, so erscheint hier in der Logdatei kein Fehler  !

Was ist das Problem  bzw. wie komm ich hier weiter um nicht solche Meldungen im Log zu haben.?

FHEM auf Debian Wheezy(RASPI), 2 * CUL868/433 *  FS20 STR, 2 * HMS100 T, 2 * , 1* FS20 SU, 2 *  FS20 SM8, 2 ; 1-wire Temp, GPIO based Relais-Schalter;i2c Bus
Integration von Sonnenbatterie Eco8;
Elektro  Nachspeicher-Ofen Ladesteuerung,
Haus Lüftung,
Integration von HardwareAlarmanlag

klausw

Das Attribut userReadings soll entsprechende Readings modifizieren.
In Deinem Fall das reading "test".
"get icMCP23017" liefert aber nichts zurück.
Am Ende der userReadings ein return "irgendwas" setzen sollte helfen.
RasPi B v2 mit FHEM 18B20 über 1Wire, LED PWM Treiber über I2C, Luchtdruck-, Feuchtesensor und ein paar Schalter/LED\'s zum testen
Module: RPI_GPIO, RPII2C, I2C_EEPROM, I2C_MCP23008, I2C_MCP23017, I2C_MCP342x, I2C_PCA9532, I2C_PCF8574, I2C_SHT21, I2C_BME280