So after changing from 2.4 to 2.5 I got the following error message. Any ideas how to resolve this?
"
2019-12-17 20:15:41.035 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.initialize()' on 'org.openhab.binding.mcp23017.internal.handler.Mcp23017Handler@6a73f2': com.pi4j.io.file.LinuxFile.directIOCTL(IJI)I
java.lang.UnsatisfiedLinkError: com.pi4j.io.file.LinuxFile.directIOCTL(IJI)I
at com.pi4j.io.file.LinuxFile.directIOCTL(Native Method) ~[?:?]
at com.pi4j.io.file.LinuxFile.ioctl(LinuxFile.java:103) ~[?:?]
at com.pi4j.io.i2c.impl.I2CBusImpl.selectBusSlave(I2CBusImpl.java:291) ~[?:?]
at com.pi4j.io.i2c.impl.I2CBusImpl.runBusLockedDeviceAction(I2CBusImpl.java:258) ~[?:?]
at com.pi4j.io.i2c.impl.I2CBusImpl.readByte(I2CBusImpl.java:153) ~[?:?]
at com.pi4j.io.i2c.impl.I2CDeviceImpl.read(I2CDeviceImpl.java:205) ~[?:?]
at com.pi4j.gpio.extension.mcp.MCP23017GpioProvider.<init>(MCP23017GpioProvider.java:129) ~[?:?]
at com.pi4j.gpio.extension.mcp.MCP23017GpioProvider.<init>(MCP23017GpioProvider.java:113) ~[?:?]
at com.pi4j.gpio.extension.mcp.MCP23017GpioProvider.<init>(MCP23017GpioProvider.java:108) ~[?:?]
at org.openhab.binding.mcp23017.internal.handler.Mcp23017Handler.initializeMcpProvider(Mcp23017Handler.java:155) ~[?:?]
at org.openhab.binding.mcp23017.internal.handler.Mcp23017Handler.initialize(Mcp23017Handler.java:93) ~[?:?]
at sun.reflect.GeneratedMethodAccessor70.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_222]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_222]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?: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]
Thanks a lot for the quick reply. Did all of that before.
I managed to find the problem, I had to install the Pi4J library.
sudo apt-get install pi4j
&
Now the MC23017 Things are online, but a new error appeared:
2019-12-17 20:43:55.624 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.mcp23017.internal.handler.Mcp23017Handler@107c4f9': null
java.lang.NullPointerException: null
at org.openhab.binding.mcp23017.internal.handler.Mcp23017Handler.handleOutputCommand(Mcp23017Handler.java:116) ~[?:?]
at org.openhab.binding.mcp23017.internal.handler.Mcp23017Handler.handleCommand(Mcp23017Handler.java:83) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_222]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_222]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_222]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_222]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
at org.eclipse.smarthome.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [bundleFile:?]
at com.sun.proxy.$Proxy190.handleCommand(Unknown Source) [?:?]
at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:74) [bundleFile:?]
at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:48) [bundleFile:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_222]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_222]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_222]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_222]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?: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]```
I realized I can’t update JAVA, I do not know how (reading all the guides and trying with no success) I guess going back to 2.4 will be the best way, until someone can help…
Edit: Manually putting the org.openhab.binding.mcp23017-2.4.0.jar in usr\share\openhab2\addons solves the issue for the moment.
Bounty still up for this though - probably it’ll be an easy fix.
If you don’t have Samba file sharing on your OH system, a easy way to copy files to/from that device is to use WinSCP. A simple Norton Commander style GUI to copy files between two systems that can use the SSH connection.
Thank you noppes123, I copied jar file to addons but this error still persists
2020-01-02 14:52:45.280 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.mcp23017.handler.Mcp23017Handler@16e53bb': null
When I’m trying to create mcp23017 thing log viewer says no i2c available…
2020-01-02 21:54:56.812 [hingStatusInfoChangedEvent] - 'mcp23017:mcp23017:8c750ca1' changed from INITIALIZING to OFFLINE (CONFIGURATION_ERROR): Tried to access not available I2C bus: /dev/i2c-1 (Permission denied)
2020-01-02 21:54:56.818 [hingStatusInfoChangedEvent] - 'mcp23017:mcp23017:8c750ca1' changed from OFFLINE (CONFIGURATION_ERROR): Tried to access not available I2C bus: /dev/i2c-1 (Permission denied) to ONLINE
modifying boot/config.txt -> dtparam=i2c_arm=on
and
sudo apt-get install i2c-tools
did not help
As a PLC programmer I exptected that it is easier but seems I need to start with something more simple however onboard GPIO worked for me already
Hello,
I’m facing the same exact problem described by the thread starter.
I read about his solution to the problem, but when can I find the file discribed in the solution?
Does it work on OH3?
I can read pin values from command line but nothing in Paper UI
“sudo i2cget -y 1 0x20 0x12”
I found in other topic that old .jar bindings will not work with OpenHab 3.
Anyway I tried coping it to addon folder but no binding showed up on the list and lots of error in log viewer.
Anybody used MCP23017 on OH3.0?
The last binding version which works for me was 2.4 with Openhab 2.5. Binding version 2.5 was still not working. And openhab 3 version is not working, too. I didnt find a solution right now. Hopfully anybody can help…