docbender / openhab-simplebinary Goto Github PK
View Code? Open in Web Editor NEWSerial / TCP binding for openHAB
License: Eclipse Public License 2.0
Serial / TCP binding for openHAB
License: Eclipse Public License 2.0
Hello docbender,
i've read a posting in the openHAB-Community forum about removing the OH 1.X compatibility Layer in openHAB3. (https://community.openhab.org/t/removal-of-the-oh-1-x-compatibility-layer/67553) Do you still maintaining your SimpleBinary-Binding in the future? So are you planing to move your Binding to the new architecture if it wont work with future versions of openHAB?
Hello docbender,
i just installed the new openHAB-version 2.5 and no i get this error at startup of the OH system:
2019-12-21 15:19:10.187 [WARN ] [org.apache.felix.fileinstall ] - Error while starting bundle: file:/usr/share/openhab2/addons/org.openhab.binding.simplebinary-1.10.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.simplebinary [19]
Unresolved requirement: Import-Package: gnu.io
at org.eclipse.osgi.container.Module.start(Module.java:444) ~[org.eclipse.osgi-3.12.100.jar:?]
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) ~[org.eclipse.osgi-3.12.100.jar:?]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [bundleFile:3.6.4]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [bundleFile:3.6.4]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1221) [bundleFile:3.6.4]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:515) [bundleFile:3.6.4]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [bundleFile:3.6.4]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [bundleFile:3.6.4]
Is your binding working at your setup with OH 2.5? Do you have any suggestions where my problem is?
Hi,
I'm using the latest release of the SimpleBinary binding with a current openHAB 1.8.0 from the .deb repository. My system (a raspberry pi) runs oracle java.
Since I upgraded to openHab 1.8.0 (from... 1.7? Not sure...), I'm getting this error and the SimpleBinary binding stopped working:
Feb 17 23:47:29 harry openhab.sh[2042]: Exception in thread "SimpleBinary communication service" java.lang.NoSuchMethodError: java.lang.Byte.toUnsignedInt(B)I
Feb 17 23:47:29 harry openhab.sh[2042]: at org.openhab.binding.simplebinary.internal.SimpleBinaryProtocol.arrayToString(SimpleBinaryProtocol.java:680)
Feb 17 23:47:29 harry openhab.sh[2042]: at org.openhab.binding.simplebinary.internal.SimpleBinaryProtocol.evalCRC(SimpleBinaryProtocol.java:657)
Feb 17 23:47:29 harry openhab.sh[2042]: at org.openhab.binding.simplebinary.internal.SimpleBinaryProtocol.compileNewDataFrame(SimpleBinaryProtocol.java:52)
Feb 17 23:47:29 harry openhab.sh[2042]: at org.openhab.binding.simplebinary.internal.SimpleBinaryUART.sendNewDataCheck(SimpleBinaryUART.java:345)
Feb 17 23:47:29 harry openhab.sh[2042]: at org.openhab.binding.simplebinary.internal.SimpleBinaryUART.checkNewData(SimpleBinaryUART.java:929)
Feb 17 23:47:30 harry openhab.sh[2042]: at org.openhab.binding.simplebinary.internal.SimpleBinaryBinding.execute(SimpleBinaryBinding.java:233)
Feb 17 23:47:30 harry openhab.sh[2042]: at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute(AbstractActiveBinding.java:156)
Feb 17 23:47:30 harry openhab.sh[2042]: at org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:173)
I don't know Java very well, but that looks really strange. I'm pretty certain that java.lang.Byte.toUnsignedInt() exists?
Hello,
Whenever I have the system up and running, in case of communication issues (Arduino reboot or USB cable reconnection), the system is unable to recover.
Arduino reboot:
2023-06-19 11:10:22.843 [INFO ] [ernal.core.SimpleBinaryGenericDevice] - Port /dev/ttyUSB0 - Device 1 not responding
2023-06-19 11:10:23.844 [WARN ] [inary.internal.core.SimpleBinaryUART] - Port /dev/ttyUSB0 - Device1 - Receiving data timeouted. Thread=1301
2023-06-19 11:10:23.847 [INFO ] [ernal.core.SimpleBinaryGenericDevice] - Port /dev/ttyUSB0 - Device 1 not responding
2023-06-19 11:10:24.848 [WARN ] [inary.internal.core.SimpleBinaryUART] - Port /dev/ttyUSB0 - Device1 - Receiving data timeouted. Thread=1301
2023-06-19 11:10:24.851 [INFO ] [ernal.core.SimpleBinaryGenericDevice] - Port /dev/ttyUSB0 - Device 1 not responding
2023-06-19 11:10:25.853 [WARN ] [inary.internal.core.SimpleBinaryUART] - Port /dev/ttyUSB0 - Device1 - Receiving data timeouted. Thread=1301
2023-06-19 11:10:25.854 [INFO ] [ernal.core.SimpleBinaryGenericDevice] - Port /dev/ttyUSB0 - Device 1 not responding
2023-06-19 11:10:26.856 [WARN ] [inary.internal.core.SimpleBinaryUART] - Port /dev/ttyUSB0 - Device1 - Receiving data timeouted. Thread=1301
2023-06-19 11:10:26.859 [INFO ] [ernal.core.SimpleBinaryGenericDevice] - Port /dev/ttyUSB0 - Device 1 not responding
2023-06-19 11:10:27.861 [WARN ] [inary.internal.core.SimpleBinaryUART] - Port /dev/ttyUSB0 - Device1 - Receiving data timeouted. Thread=1301
2023-06-19 11:10:27.862 [INFO ] [ernal.core.SimpleBinaryGenericDevice] - Port /dev/ttyUSB0 - Device 1 not responding
2023-06-19 11:10:28.864 [WARN ] [inary.internal.core.SimpleBinaryUART] - Port /dev/ttyUSB0 - Device1 - Receiving data timeouted. Thread=1301
2023-06-19 11:10:28.866 [INFO ] [ernal.core.SimpleBinaryGenericDevice] - Port /dev/ttyUSB0 - Device 1 not responding
2023-06-19 11:10:29.868 [WARN ] [inary.internal.core.SimpleBinaryUART] - Port /dev/ttyUSB0 - Device1 - Receiving data timeouted. Thread=1301
In this situation, I can see Arduino TX led blinking but nothing on RX side. When connection is reestablished, both leds are blinking without issue.
When cable is removed, i can reestablish the communication only disabling the Thigs and reenabling in a specific order: first bridge, once it is online, the generic thing. The issue is not 100% but the workaround works all the time.
In some cases (maybe device is slow or controller to fast) data is split. Unnecessary warning level message is generated:
18:21:11.666 [DEBUG] [inary.internal.core.SimpleBinaryUART] - Port /dev/ttyUSB0 - received: [0x2 0xDC 0x1 0x0 0xE5 0x2]
18:21:11.667 [DEBUG] [ernal.core.SimpleBinaryGenericDevice] - Port /dev/ttyUSB0 - Reading input buffer, lenght=6 bytes. Thread=660
18:21:11.668 [WARN ] [ernal.core.SimpleBinaryGenericDevice] - Port /dev/ttyUSB0 - Cannot decompile incoming data
18:21:11.691 [DEBUG] [inary.internal.core.SimpleBinaryUART] - Port /dev/ttyUSB0 - received: [0x0 0x0 0x70]
Hello Vita,
i have just moved my system to OH3. First of all, thank you for your great work to upgrade your binding to OH3!! You have to add your binding description to the official website! I think this binding is the most important binding for selfmade wired smart home devices!!!
I have noticed, you changed the datetype of the Rollershutter command on the bus. In the legacy version of your binding you sent two bytes with the command ( UP, DOWN, STOP, MOVE) and the Percentage value. Now you are only send one byte with the command.
Is there a special reason why you have done this?
Because i think your first solution to have the additional possibility to send a desired position in percent for the rollershutter instead of only move, stop, up, down was better.
Best Regards!
Flo
I'm beginer in openhab2.
Can you give me manual for simple-binary bindings setup for openhab2?
Hello,
I'm starting with some PoC running openHAB-SimpleBinary and i've noticed that the items are not getting automatically updated in BasicUI. For Switches I could workaround it by setting autorefresh to true, but for Contact, it is not refreshing even when the status is updated over logs. Refreshing BasicUI the item is automatically refreshed. The status is also automatically refreshed in Channel view from Openhab Admin -> Things -> Generic Thing -> Channels
LED.things
Bridge simplebinary:uart_bridge:ttyUSB0 "ttyUSB0" [ port="/dev/ttyUSB0", baudRate="9600" ] {
Thing generic_device arduino "Arduino" {
Channels:
Type chSwitch: Item_1_0 [ stateAddress="1:1", commandAddress="1:0" ]
Type chContact: Item_1_1 [ stateAddress="1:2" ]
}
}
LED.items
Switch Item_1_0 "LED switch" { channel="simplebinary:generic_device:ttyUSB0:arduino:Item_1_0" }
Contact Item_1_1 "LED state [%s]" { channel="simplebinary:generic_device:ttyUSB0:arduino:Item_1_1" }
LED.sitemap
sitemap LED label="Main"
{
Frame label="Arduino LED"
{
Switch item=Item_1_0
Text item=Item_1_1
}
}
Hello,
i have problems to get the Binding running with OH 3.4.2. If i configure a Bridge and a Thing with textual configuration (an configuration over the Web interface i get the same errors):
Bridge simplebinary:uart_bridge:UART_RF_Bridge "UART_RF_Bridge" [ port="/dev/ttyAMA0", baudRate="115200" ] { Thing generic_device rollers "Rollershutters" { Channels: Type chRollershutter: DG_Balkon [ commandAddress="1:3" ] } }
If i enable the Bridge, it switches to online. If i endable the Thing i get some errors. You may see the log of this behaviour below:
2023-03-05 09:18:00.016 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'Simplebinary.things' 2023-03-05 09:18:16.298 [INFO ] [andler.SimpleBinaryUartBridgeHandler] - UART_RF_Bridge - Current charset UTF-8 2023-03-05 09:18:32.952 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.initialize()' on 'org.openhab.binding.simplebinary.internal.handler.SimpleBinaryGenericHandler@15f4482': null java.lang.NullPointerException: null at org.openhab.binding.simplebinary.internal.handler.SimpleBinaryBridgeHandler.updateConfig(SimpleBinaryBridgeHandler.java:300) ~[?:?] at org.openhab.binding.simplebinary.internal.handler.SimpleBinaryGenericHandler.initialize(SimpleBinaryGenericHandler.java:106) ~[?:?] at jdk.internal.reflect.GeneratedMethodAccessor101.invoke(Unknown Source) ~[?:?] at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?] at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?] at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?] at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?] at java.lang.Thread.run(Thread.java:829) [?:?] 2023-03-05 09:18:32.973 [ERROR] [core.thing.internal.ThingManagerImpl] - Exception occurred while initializing handler of thing 'simplebinary:generic_device:UART_RF_Bridge:rollers': null java.lang.NullPointerException: null at org.openhab.binding.simplebinary.internal.handler.SimpleBinaryBridgeHandler.updateConfig(SimpleBinaryBridgeHandler.java:300) ~[?:?] at org.openhab.binding.simplebinary.internal.handler.SimpleBinaryGenericHandler.initialize(SimpleBinaryGenericHandler.java:106) ~[?:?] at jdk.internal.reflect.GeneratedMethodAccessor101.invoke(Unknown Source) ~[?:?] at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?] at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?] at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?] at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?] at java.lang.Thread.run(Thread.java:829) [?:?]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.