Hello everyone
I got stuck on configuration MCP23017. I’ve configured i2c, privileges, i2ctools (https://www.waveshare.com/wiki/Raspberry_Pi_Tutorial_Series:_I2C - and of course it works on Pi cli. I read a lot of topics, checked a plenty of possible solutions, advice, but still got nothing
@namraccr is trying to help (I’m grateful for that), but maybe someone else had similar problem and will be able to help
https://community.openhab.org/t/mcp23017-error/74202
My configuration is very simple (fresh installation of OH 2.5.2-1)
MCP 23017 v 2.4 or 2.5 - the same result
.things
Thing mcp23017:mcp23017:shutter_1_8 "MCP23017 shutter 1_8" [address=20,bus=1] {
Type output_pin : output#A0 [default_state="LOW"]
Type output_pin : output#A1 [default_state="LOW"]
}
.items
Switch shutter_1_up "shutter_1_up" {channel="mcp23017:mcp23017:shutter_1_8:output#A0"}
Switch shutter_1_down "shutter_1_down" {channel="mcp23017:mcp23017:shutter_1_8:output#A1"}
log after rebooting
2020-03-08 23:43:38.626 [DEBUG] [3017.internal.Mcp23017HandlerFactory] - Trying to create handler for mcp23017:mcp23017
2020-03-08 23:43:38.629 [DEBUG] [3017.internal.Mcp23017HandlerFactory] - Handler match for mcp23017:mcp23017
2020-03-08 23:43:38.654 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler Mcp23017Handler tried updating the thing status although the handler was already disposed.
2020-03-08 23:43:38.656 [DEBUG] [ing.mcp23017.handler.Mcp23017Handler] - initializing mcp provider for busNumber 1 and address 32
2020-03-08 23:43:38.744 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler Mcp23017Handler tried updating the thing status although the handler was already disposed.
2020-03-08 23:43:38.746 [DEBUG] [ing.mcp23017.handler.Mcp23017Handler] - got mcpProvider null
==> /var/log/openhab2/events.log <==
2020-03-08 23:43:38.777 [hingStatusInfoChangedEvent] - 'mcp23017:mcp23017:shutter_1_8' changed from UNINITIALIZED to INITIALIZING
==> /var/log/openhab2/openhab.log <==
2020-03-08 23:43:38.796 [WARN ] [.core.thing.binding.BaseThingHandler] - BaseThingHandler.initialize() will be removed soon, ThingStatus can be set manually via updateStatus(ThingStatus.ONLINE)
2020-03-08 23:43:38.820 [DEBUG] [ing.mcp23017.handler.Mcp23017Handler] - channel linked mcp23017:mcp23017:shutter_1_8:output#A0
==> /var/log/openhab2/events.log <==
2020-03-08 23:43:38.821 [hingStatusInfoChangedEvent] - 'mcp23017:mcp23017:shutter_1_8' changed from INITIALIZING to ONLINE
==> /var/log/openhab2/openhab.log <==
2020-03-08 23:43:38.822 [DEBUG] [ing.mcp23017.handler.Mcp23017Handler] - Defined channel in group: output. Valid: true
2020-03-08 23:43:38.825 [DEBUG] [ing.mcp23017.handler.Mcp23017Handler] - Is channel A0 in supported channels: true
2020-03-08 23:43:38.828 [DEBUG] [ing.mcp23017.handler.Mcp23017Handler] - Received command: REFRESH on channelGroup output on channel A0
2020-03-08 23:43:38.830 [DEBUG] [ing.mcp23017.handler.Mcp23017Handler] - Defined channel in group: output. Valid: true
2020-03-08 23:43:38.832 [DEBUG] [ing.mcp23017.handler.Mcp23017Handler] - Is channel A0 in supported channels: true
2020-03-08 23:43:38.834 [DEBUG] [23017.handler.Mcp23017PinStateHolder] - Getting output pin for channel mcp23017:mcp23017:shutter_1_8:output#A0
2020-03-08 23:43:38.852 [DEBUG] [23017.handler.Mcp23017PinStateHolder] - initializeOutputPin for channel mcp23017:mcp23017:shutter_1_8:output#A0
2020-03-08 23:43:38.857 [DEBUG] [23017.handler.Mcp23017PinStateHolder] - initializing for pinState LOW
2020-03-08 23:43:38.898 [DEBUG] [ing.mcp23017.handler.Mcp23017Handler] - channel linked mcp23017:mcp23017:shutter_1_8:output#A1
2020-03-08 23:43:38.898 [ERROR] [ome.core.thing.link.ThingLinkManager] - Exception occurred while informing handler: null
java.lang.NullPointerException: null
at com.pi4j.io.gpio.impl.GpioControllerImpl.provisionPin(GpioControllerImpl.java:545) ~[?:?]
at com.pi4j.io.gpio.impl.GpioControllerImpl.provisionDigitalOutputPin(GpioControllerImpl.java:717) ~[?:?]
at org.openhab.binding.mcp23017.handler.Mcp23017PinStateHolder.initializeOutputPin(Mcp23017PinStateHolder.java:71) ~[?:?]
at org.openhab.binding.mcp23017.handler.Mcp23017PinStateHolder.getOutputPin(Mcp23017PinStateHolder.java:59) ~[?:?]
at org.openhab.binding.mcp23017.handler.Mcp23017Handler.handleOutputCommand(Mcp23017Handler.java:110) ~[?:?]
at org.openhab.binding.mcp23017.handler.Mcp23017Handler.handleCommand(Mcp23017Handler.java:79) ~[?:?]
at org.eclipse.smarthome.core.thing.binding.BaseThingHandler.channelLinked(BaseThingHandler.java:191) ~[?:?]
at org.openhab.binding.mcp23017.handler.Mcp23017Handler.channelLinked(Mcp23017Handler.java:221) ~[?:?]
at org.eclipse.smarthome.core.thing.link.ThingLinkManager.lambda$0(ThingLinkManager.java:267) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_222]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_222]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_222]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:1.8.0_222]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_222]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_222]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222]
2020-03-08 23:43:38.924 [DEBUG] [ing.mcp23017.handler.Mcp23017Handler] - Defined channel in group: output. Valid: true
2020-03-08 23:43:38.927 [DEBUG] [ing.mcp23017.handler.Mcp23017Handler] - Is channel A1 in supported channels: true
2020-03-08 23:43:38.929 [DEBUG] [ing.mcp23017.handler.Mcp23017Handler] - Received command: REFRESH on channelGroup output on channel A1
2020-03-08 23:43:38.932 [DEBUG] [ing.mcp23017.handler.Mcp23017Handler] - Defined channel in group: output. Valid: true
2020-03-08 23:43:38.934 [DEBUG] [ing.mcp23017.handler.Mcp23017Handler] - Is channel A1 in supported channels: true
2020-03-08 23:43:38.937 [DEBUG] [23017.handler.Mcp23017PinStateHolder] - Getting output pin for channel mcp23017:mcp23017:shutter_1_8:output#A1
2020-03-08 23:43:38.939 [DEBUG] [23017.handler.Mcp23017PinStateHolder] - initializeOutputPin for channel mcp23017:mcp23017:shutter_1_8:output#A1
2020-03-08 23:43:38.944 [DEBUG] [23017.handler.Mcp23017PinStateHolder] - initializing for pinState LOW
2020-03-08 23:43:38.948 [ERROR] [ome.core.thing.link.ThingLinkManager] - Exception occurred while informing handler: null
java.lang.NullPointerException: null
at com.pi4j.io.gpio.impl.GpioControllerImpl.provisionPin(GpioControllerImpl.java:545) ~[?:?]
at com.pi4j.io.gpio.impl.GpioControllerImpl.provisionDigitalOutputPin(GpioControllerImpl.java:717) ~[?:?]
at org.openhab.binding.mcp23017.handler.Mcp23017PinStateHolder.initializeOutputPin(Mcp23017PinStateHolder.java:71) ~[?:?]
at org.openhab.binding.mcp23017.handler.Mcp23017PinStateHolder.getOutputPin(Mcp23017PinStateHolder.java:59) ~[?:?]
at org.openhab.binding.mcp23017.handler.Mcp23017Handler.handleOutputCommand(Mcp23017Handler.java:110) ~[?:?]
at org.openhab.binding.mcp23017.handler.Mcp23017Handler.handleCommand(Mcp23017Handler.java:79) ~[?:?]
at org.eclipse.smarthome.core.thing.binding.BaseThingHandler.channelLinked(BaseThingHandler.java:191) ~[?:?]
at org.openhab.binding.mcp23017.handler.Mcp23017Handler.channelLinked(Mcp23017Handler.java:221) ~[?:?]
at org.eclipse.smarthome.core.thing.link.ThingLinkManager.lambda$0(ThingLinkManager.java:267) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_222]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_222]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_222]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:1.8.0_222]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_222]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_222]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222]
Thx in advance.