Hello
Pi4B, OH3 and MCP23017…cant switch pins
Log shows:
2021-02-12 15:22:00.978 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘mcp23017:mcp23017:MCP23017’ changed from ONLINE to OFFLINE (CONFIGURATION_ERROR): Tried to access not available I2C bus: null
2021-02-12 15:22:00.983 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘mcp23017:mcp23017:MCP23017’ changed from OFFLINE (CONFIGURATION_ERROR): Tried to access not available I2C bus: null to ONLINE
But i2C bus is working can access it with i2cset and its possible to switch LEDs which are connected to the 23017.
.) Pi4J_1.3 is installed
.) “unofficial” version of wiringPi 2.6 for raspberryPi4B should be installed.
apt list wiringpi… shows —> wiringpi/testing, 2.50 armhf (installiert) ???
.) gpio command line tool is available
.) user “openhab” und “openhabian” where added to groups “i2c” and “gpio”.
NOTE: As of v1.3, Pi4J requires Java 8 JRE/JDK
Installed is 11
Maybe thats the problem ?
could anybody provide an example on thing, item, rule part. I am not an expert and would like to convert from OH2.5 to OH3… so I cannot wait to get the MCP23017 Binding issue (Pi4j) fixed. Appreciate your help!
Many Thanks…!
…and this OH3 command topic… roottopic/mcp23017-1/pin-a0/set
Or test it with
mosquitto_pub -d -t roottopic/mcp23017-1/pin-a0/set -m “ON” …switch GPA0 to ON.
mosquitto_pub -d -t roottopic/mcp23017-1/pin-a0/set -m “OFF” …switch GPA0 to OFF.
mosquitto_pub -d -t roottopic/mcp23017-1/pin-a1/set -m “ON” …switch GPA1 to ON.
Cant upload here .yml File. Where should i send it ?
So mqttany starts correctly, I can see topic elements in MQTT Explorer, even access output pins from OpenHub and they change for a moment but after polling interval pin-a0 which was set by hand to ON is OFF again so I cannot check if voltage really changed.
I tried read inputs from MCP2307 but no reaction however using
Read GPIO-Byte from Port B:
sudo i2cget -y 1 0x20 0x13
gives proper results
pin-b0:
pin: 08
direction: 'input'
### Pin Resistor
resistor: 'pulldown' # can be 'pullup', 'pulldown', or 'off'
The only thing that is fully correct is GPIO input read on pin 17, it immediately changes state on OH when I connect cable to Raspberry pin.
Now with v0.14.3 I can read inputs on MCP23017
My last problem is that outputs gets reset to OFF every polling interval…
no matter if I set it to ON from MQTT Explorer or OpenHab interface
2021-03-17 13:00:44,301 [INFO ] [core ] MQTTany 0.14.3-dev starting
2021-03-17 13:00:44,302 [WARN ] [core ]
2021-03-17 13:00:44,303 [WARN ] [core ] ######## DEVELOPMENT VERSION ########
2021-03-17 13:00:44,304 [WARN ] [core ] # #
2021-03-17 13:00:44,305 [WARN ] [core ] # This is a development version and #
2021-03-17 13:00:44,306 [WARN ] [core ] # may be incomplete or unstable #
2021-03-17 13:00:44,307 [WARN ] [core ] # #
2021-03-17 13:00:44,308 [WARN ] [core ] #######################################
2021-03-17 13:00:44,309 [WARN ] [core ]
2021-03-17 13:00:44,421 [INFO ] [core.gpio ] Detected board: RASPBERRY_PI_3B_PLUS
2021-03-17 13:00:44,771 [INFO ] [core ] Module 'mqtt' started successfully
2021-03-17 13:00:44,778 [INFO ] [core ] Module 'gpio' started successfully
2021-03-17 13:00:44,785 [INFO ] [gpio.digital ] Setting up 'gpio17' on GPIO17 as INPUT
2021-03-17 13:00:44,789 [INFO ] [gpio.digital ] Setting up 'gpio18' on GPIO18 as OUTPUT
2021-03-17 13:00:44,787 [INFO ] [core ] Module 'i2c' started successfully
2021-03-17 13:00:44,801 [INFO ] [mqtt ] Connected to broker '192.168.0.15:1883'