@msteigenberger
I’ve upgrade from my last installation of ”SML Reader Binding“ to the new one “Meter Reader Binding”.
With this step I’ve recognize a different for the same use.
I run openhab 2.x in a docker container.
To get access to my USB SML Reader I’ve setup an symlink (udev rule) to ttyUSB1.
In the past (with the SML Reader Binding) it was enough to link the device to the container with the argument
--device=/dev/<symlink>
But now with the new “Meter Reader Binding” this only works if I link directly to ttyUSB like
--device=/dev/ttyUSB1
If I still want to use my symlink within the container I need the additional argument
But this is only documantated for symlinks in openhab 1.x here.
And in my old configuration the “SML Reader Bindiung” works the symlink without the additional JAVA Argument…
I’m not good enough to understand why … But maby someone need the knowledge for his own configuration.
Or, maby, it is a bug in the “Meter Reader Binding”
@portboy: Formerly the binding just set this property by itself. But this caused problems when using more than one serial port, so I simply removed it to check whether the problem was fixed (yes).
I changed it to support multiple ports now (at least I hope). @mic.jaeger, @Marcello87: You faced that problem. Can you please try with the latest version?
Another note for the latest version:
The binding is now supporting Units Of Measurements that was introduced some days ago, hence you need to update your openhab to the latest version.
Also if you use the items in a rule you have to make sure to use QuantityTypes instead of DecimalTypes now!
I trying to set up a new system
I’ve installed openmediavault and tried to run openhab in a docker container.
With this setup I get the following error when I try to install/run MeterReader Binding:
[ERROR] [org.openhab.binding.meterreader ] - FrameworkEvent ERROR - org.openhab.binding.meterreader org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.meterreader [232] Unresolved requirement: Import-Package: javax.measure; version="1.0.0"
Maybe the reason is in the Serial Binding?
Update:
with debian 9 and docker and openhab 2.2 image --> same error.
but with this Version I get the following error: 2018-04-03 23:35:54.158 [ERROR] [erreader.internal.MeterValueListener] - java.lang.NullPointerException: null at java.util.Hashtable.put(Hashtable.java:459) ~[?:?] at java.util.Properties.setProperty(Properties.java:166) ~[?:?] at java.lang.System.setProperty(System.java:796) ~[?:?] at gnu.io.factory.SerialPortUtil.appendSerialPortProperty(SerialPortUtil.java:34) ~[?:?] at gnu.io.factory.RxTxPortCreator.createPort(RxTxPortCreator.java:45) ~[?:?] at gnu.io.factory.RxTxPortCreator.createPort(RxTxPortCreator.java:1) ~[?:?] at gnu.io.factory.DefaultSerialPortFactory.createSerialPort(DefaultSerialPortFactory.java:53) ~[?:?] at org.openhab.binding.meterreader.internal.sml.SmlSerialConnector.openConnection(SmlSerialConnector.java:102) ~[?:?] at org.openhab.binding.meterreader.connectors.ConnectorBase.getMeterValues(ConnectorBase.java:54) ~[?:?] at org.openhab.binding.meterreader.internal.MeterDevice.lambda$1(MeterDevice.java:136) ~[?:?] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?] at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:?] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:?] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?] at java.lang.Thread.run(Thread.java:748) [?:?]
Hi, I’m trying to get this working, unfortunately without luck. Sorry for maybe dumb questions
The type of my meter device is “EasyMeter Q3MB3220”, it is connected via USB to a raspi. On that raspi I tested with “vzlogger” and get response from the meter device:
openhab (2.3 Build 1248) is installed on another raspi. So I installed ser2net on the one with the meter device with this configuration:
2000:raw:60:/dev/ttyUSB0:9600 8DATABITS NONE 1STOPBIT
In the thing configuration I entered the port as rfc2217://192.168.19.63:2000. After saving the configuration I get Status: OFFLINE - COMMUNICATION_ERROR wrong crc
In the openhab.log
> 2018-04-04 19:40:20.759 [ERROR] [ader.internal.sml.SmlSerialConnector] - Error at SerialConnector.getMeterValuesInternal: wrong crc
> 2018-04-04 19:40:20.761 [ERROR] [erreader.internal.MeterValueListener] -
> java.io.IOException: wrong crc
> at org.openmuc.jsml.transport.MessageExtractor.waitForStopSequence(MessageExtractor.java:113) ~[?:?]
> at org.openmuc.jsml.transport.MessageExtractor.getSmlMessage(MessageExtractor.java:42) ~[?:?]
> at org.openmuc.jsml.transport.Transport.getSMLFile(Transport.java:101) ~[?:?]
> at org.openhab.binding.meterreader.internal.sml.SmlSerialConnector.getMeterValuesInternal(SmlSerialConnector.java:86) ~[?:?]
> at org.openhab.binding.meterreader.internal.sml.SmlSerialConnector.getMeterValuesInternal(SmlSerialConnector.java:1) ~[?:?]
> at org.openhab.binding.meterreader.connectors.ConnectorBase.getMeterValues(ConnectorBase.java:55) ~[?:?]
> at org.openhab.binding.meterreader.internal.MeterDevice.lambda$1(MeterDevice.java:139) ~[?:?]
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
> at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:?]
> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:?]
> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:?]
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
> at java.lang.Thread.run(Thread.java:748) [?:?]
Should this meter device work, maybe only a communication problem? Thanks for any help
2018-04-05 13:53:32.626 [ERROR] [st.core.internal.thing.ThingResource] - Exception during HTTP PUT request for update config at ‘things/meterreader:meter:4550ac1a/config’
java.lang.IllegalArgumentException: No enum constant org.openhab.binding.meterreader.internal.helper.ProtocolMode.C
at java.lang.Enum.valueOf(Enum.java:238) [?:?]
at org.openhab.binding.meterreader.internal.helper.ProtocolMode.valueOf(ProtocolMode.java:1) [216:org.openhab.binding.meterreader:2.3.0.201804040438]
at org.openhab.binding.meterreader.internal.MeterDeviceFactory.getDevice(MeterDeviceFactory.java:25) [216:org.openhab.binding.meterreader:2.3.0.201804040438]
at
…
When I choose Mode D I get an endless list of errors in the log (the start byte changes in every line)
2018-04-05 13:54:29.654 [ERROR] [.iec62056.Iec62056_21SerialConnector] - Exception while listening for mode D data message
java.io.IOException: Received unexpected identification message start byte: 01
at org.openmuc.j62056.internal.IdentificationMessage.(IdentificationMessage.java:49) [216:org.openhab.binding.meterreader:2.3.0.201804040438]
at org.openmuc.j62056.Iec21Port$ModeDReceiver.run(Iec21Port.java:70) [216:org.openhab.binding.meterreader:2.3.0.201804040438]
2018-04-05 13:54:30.149 [ERROR] [.iec62056.Iec62056_21SerialConnector] - Exception while listening for mode D data message
java.io.IOException: Received unexpected identification message start byte: 1B
at org.openmuc.j62056.internal.IdentificationMessage.(IdentificationMessage.java:49) [216:org.openhab.binding.meterreader:2.3.0.201804040438]
at org.openmuc.j62056.Iec21Port$ModeDReceiver.run(Iec21Port.java:70) [216:org.openhab.binding.meterreader:2.3.0.201804040438]
2018-04-05 13:54:30.189 [ERROR] [.iec62056.Iec62056_21SerialConnector] - Exception while listening for mode D data message
java.io.IOException: Received unexpected identification message start byte: 53
at org.openmuc.j62056.internal.IdentificationMessage.(IdentificationMessage.java:49) [216:org.openhab.binding.meterreader:2.3.0.201804040438]
at org.openmuc.j62056.Iec21Port$ModeDReceiver.run(Iec21Port.java:70) [216:org.openhab.binding.meterreader:2.3.0.201804040438]
As mentioned, when I try “vzlogger” on the raspi with the usb reader connected, I get data. vzlogger protocol type is configured as “sml” (protocol type for 62056-21 would be “d0” there). So I guess in the meter binding it should also be type SML and not some of the 62056-21 types.
I will try to do a test installation of openhab on the raspi with the usb device, to find out if it is a communication problem, maybe I missed something with the ser2net config / rfc2217
@msteigenberger
Hey, I get the following error when trying to install your 2.3 snapshot version with my freshly update 2.3 OpenHab.
Error while starting bundle: file:/usr/share/openhab2/addons/org.openhab.binding.meterreader-2.3.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.meterreader [246]
Unresolved requirement: Import-Package: gnu.io
I’ve read it has something to do with nrjavaserial? What’s the status on that?
//edit:
nrjavaserial doesn’t seem to have been packed with the meterreader bundle, so I tried installing zwave binding because it ships with it it. Now it works. At least a workaround
I thought it would work now and it looked like it, but the readings are not right. When starting the binding it’s reading the right values but from there on it’s only changing the read values by a few W even if I turn on a large consumer. When I restart the socat service to shut down the connection or restart the whole binding the real measurements are read again.
Trust me when I say the numbers are wrong. I know how much electricity all my devices draw, because I use your binding since a year now I believe. I will put some screenshots in this post.