@msteigenberger I have 3 EHZ with SML mode. One is working the other two didn’t connect.
I use them over network with ser2net (on raspberry pi) and socat.
The version is 2.3.0.201802060729
If I cat /dev/ttyS* the buffers of the two not working EHZ is full.
It looks like the initialization won’t work and closes the serial device:
2018-03-05 15:47:28.737 [WARN ] [erreader.internal.MeterReaderHandler] - OBIS null is not available in EHZ_MAIN!
2018-03-05 15:59:31.714 [ERROR] [ader.internal.sml.SmlSerialConnector] - Failed to close serial output stream
With vzlogger on raspberry they are working.
I tried 8n1 and 8e1, with same result.
Where is the source code of this binding?
meterreader:meter:EHZ_PV "EHZ_PV" [ port="/dev/ttyS11", refresh=1, mode="SML" ] {
Channels:
Type NumberChannel : 1-0#2-8-0 [
conversionRatio=1000
]
}
meterreader:meter:EHZ_MAIN "EHZ_MAIN" [ port="/dev/ttyS12", refresh=1, mode="SML" ] {
Channels:
Type NumberChannel : 1-0#1-8-0 [
conversionRatio=1000
]
Type NumberChannel : 1-0#2-8-0 [
conversionRatio=1000
]
}
meterreader:meter:EHZ_WP "EHZ_WP" [ port="/dev/ttyS13", refresh=1, mode="SML" ] {
Channels:
Type NumberChannel : 1-0#1-8-0 [
conversionRatio=1000
]
Type NumberChannel : 1-0#16-7-0 [
]
}
Part of vzlogger.conf
{
"enabled": true,
"allowskip": false,
"interval": -1,
"aggtime": -1,
"aggfixedinterval": false,
"channels": [
{
"api": "influxdb",
"uuid": "b0176b0b-ae91-4c63-acb5-4d3b4f4f62a0",
"identifier": "1-0:2.8.0",
"host": "http://openhab2.myhome.private:8086",
"database": "vzlogger",
"measurement_name": "EHZ1_2.8.0",
"username": "vzlogger",
"password": "vzlogger",
"max_batch_inserts": 4500,
"max_buffer_size": 450000,
"timeout": 30,
"aggmode": "none"
},
{
"api": "influxdb",
"uuid": "b0176b0b-ae91-4c63-acb5-4d3b4f4f62a3",
"identifier": "1-0:15.7.0",
"host": "http://openhab2.myhome.private:8086",
"database": "vzlogger",
"measurement_name": "EHZ1_15.7.0",
"username": "vzlogger",
"password": "vzlogger",
"max_batch_inserts": 4500,
"max_buffer_size": 450000,
"timeout": 30,
"aggmode": "none"
}
],
"protocol": "sml",
"device": "/dev/ehz/ehz1",
"pullseq": "",
"baudrate": 9600,
"parity": "8n1",
"use_local_time": true
},
{
"enabled": true,
"allowskip": false,
"interval": -1,
"aggtime": -1,
"aggfixedinterval": false,
"channels": [
{
"api": "influxdb",
"uuid": "a4f13855-0575-4e42-9ada-a6f3158f9720",
"identifier": "1-0:1.8.0",
"host": "http://openhab2.myhome.private:8086",
"database": "vzlogger",
"measurement_name": "EHZ2_1.8.0",
"username": "vzlogger",
"password": "vzlogger",
"max_batch_inserts": 4500,
"max_buffer_size": 450000,
"timeout": 30,
"aggmode": "none"
},
{
"api": "influxdb",
"uuid": "a4f13855-0575-4e42-9ada-a6f3158f9721",
"identifier": "1-0:2.8.0",
"host": "http://openhab2.myhome.private:8086",
"database": "vzlogger",
"measurement_name": "EHZ2_2.8.0",
"username": "vzlogger",
"password": "vzlogger",
"max_batch_inserts": 4500,
"max_buffer_size": 450000,
"timeout": 30,
"aggmode": "none"
},
{
"api": "influxdb",
"uuid": "a4f13855-0575-4e42-9ada-a6f3158f9726",
"identifier": "1-0:15.7.0",
"host": "http://openhab2.myhome.private:8086",
"database": "vzlogger",
"measurement_name": "EHZ2_15.7.0",
"username": "vzlogger",
"password": "vzlogger",
"max_batch_inserts": 4500,
"max_buffer_size": 450000,
"timeout": 30,
"aggmode": "none"
}
],
"protocol": "sml",
"device": "/dev/ehz/ehz2",
"pullseq": "",
"baudrate": 9600,
"parity": "8n1",
"use_local_time": true
},
{
"enabled": true,
"allowskip": false,
"interval": -1,
"aggtime": -1,
"aggfixedinterval": false,
"channels": [
{
"api": "influxdb",
"uuid": "bf200325-1d6d-427f-9f59-521238997b90",
"identifier": "1-0:1.8.0",
"host": "http://openhab2.myhome.private:8086",
"database": "vzlogger",
"measurement_name": "EHZ3_1.8.0",
"username": "vzlogger",
"password": "vzlogger",
"max_batch_inserts": 4500,
"max_buffer_size": 450000,
"timeout": 30,
"aggmode": "none"
},
{
"api": "influxdb",
"uuid": "bf200325-1d6d-427f-9f59-521238997b93",
"identifier": "1-0:16.7.0",
"host": "http://openhab2.myhome.private:8086",
"database": "vzlogger",
"measurement_name": "EHZ3_16.7.0",
"username": "vzlogger",
"password": "vzlogger",
"max_batch_inserts": 4500,
"max_buffer_size": 450000,
"timeout": 30,
"aggmode": "none"
}
],
"protocol": "sml",
"device": "/dev/ehz/ehz3",
"pullseq": "",
"baudrate": 9600,
"parity": "8n1",
"use_local_time": true
},
raspi# cat ser2net.conf
3003:raw:60:/dev/ehz/ehz1:9600 8DATABITS NONE 1STOPBIT
3002:raw:60:/dev/ehz/ehz2:9600 8DATABITS NONE 1STOPBIT
3001:raw:60:/dev/ehz/ehz3:9600 8DATABITS NONE 1STOPBIT
openhab#cat /etc/systemd/system/tty2tcp@.service
[Unit]
Description=socat tty to tcp bridge on %I
After=network.target
[Service]
EnvironmentFile=/etc/tty2tcp/%i
ExecStart=/usr/bin/socat pty,link=/dev/%i,raw,mode=660,user=openhab,group=openhab tcp:${TTYHOST},forever
Restart=always
RestartSec=3
[Install]
WantedBy=multi-user.target
openhab# cat /etc/tty2tcp/ttyS11
TTYHOST=192.168.180.131:3001
openhab# cat /etc/tty2tcp/ttyS12
TTYHOST=192.168.180.131:3002
openhab# cat /etc/tty2tcp/ttyS13
TTYHOST=192.168.180.131:3003
After restart of openhab
2018-03-05 15:47:28.712 [WARN ] [.core.thing.binding.BaseThingHandler] - BaseThingHandler.initialize() will be removed soon, ThingStatus can be set manually via updateStatus(ThingStatus.ONLINE)
2018-03-05 15:47:28.733 [WARN ] [.core.thing.binding.BaseThingHandler] - BaseThingHandler.initialize() will be removed soon, ThingStatus can be set manually via updateStatus(ThingStatus.ONLINE)
2018-03-05 15:47:28.737 [WARN ] [erreader.internal.MeterReaderHandler] - OBIS null is not available in EHZ_MAIN!
2018-03-05 15:47:28.737 [WARN ] [erreader.internal.MeterReaderHandler] - OBIS null is not available in EHZ_MAIN!
2018-03-05 15:47:28.768 [WARN ] [.core.thing.binding.BaseThingHandler] - BaseThingHandler.initialize() will be removed soon, ThingStatus can be set manually via updateStatus(ThingStatus.ONLINE)
2018-03-05 15:47:28.770 [WARN ] [erreader.internal.MeterReaderHandler] - OBIS null is not available in EHZ_WP!
2018-03-05 15:47:28.770 [WARN ] [erreader.internal.MeterReaderHandler] - OBIS null is not available in EHZ_WP!
2018-03-05 15:47:28.774 [INFO ] [ing.meterreader.internal.MeterDevice] - Read out following values: Device: meterreader:meter:EHZ_PV
Obis: 1-0:1.8.1 MeterValue [obis=1-0:1.8.1, value=4.25386007E7, unit=WATT_HOUR]
Obis: 1-0:16.7.0 MeterValue [obis=1-0:16.7.0, value=1202.0, unit=WATT]
Obis: 1-0:1.8.2 MeterValue [obis=1-0:1.8.2, value=1000.0, unit=WATT_HOUR]
Obis: 129-129:199.130.5 MeterValue [obis=129-129:199.130.5, value=&����k_^X��m�?��&]kZA�t�q^G
� ��r�vu�T^_3��^A��0, unit=EMPTY]
Obis: 129-129:199.130.3 MeterValue [obis=129-129:199.130.3, value=HAG, unit=EMPTY]
Obis: 1-0:0.0.9 MeterValue [obis=1-0:0.0.9, value=^FHAG^A^GT��y, unit=EMPTY]
Obis: 1-0:1.8.0 MeterValue [obis=1-0:1.8.0, value=4.25396007E7, unit=WATT_HOUR]
After saving of file
2018-03-05 15:59:31.674 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'meterreader.things'
2018-03-05 15:59:31.691 [ERROR] [ader.internal.sml.SmlSerialConnector] - Failed to close serial output stream
java.io.IOException: null
at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1225) [25:com.neuronrobotics.nrjavaserial:3.12.0.OH]
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:141) [?:?]
at java.io.DataOutputStream.flush(DataOutputStream.java:123) [?:?]
at java.io.FilterOutputStream.close(FilterOutputStream.java:158) [?:?]
at org.openhab.binding.meterreader.internal.sml.SmlSerialConnector.closeConnection(SmlSerialConnector.java:143) [282:org.openhab.binding.meterreader:2.3.0.201802060729]
at org.openhab.binding.meterreader.internal.MeterDevice$1.cancel(MeterDevice.java:149) [282:org.openhab.binding.meterreader:2.3.0.201802060729]
at org.openhab.binding.meterreader.internal.MeterReaderHandler.cancelRead(MeterReaderHandler.java:102) [282:org.openhab.binding.meterreader:2.3.0.201802060729]
at org.openhab.binding.meterreader.internal.MeterReaderHandler.dispose(MeterReaderHandler.java:97) [282:org.openhab.binding.meterreader:2.3.0.201802060729]
at org.eclipse.smarthome.core.thing.binding.BaseThingHandler.thingUpdated(BaseThingHandler.java:226) [116:org.eclipse.smarthome.core.thing:0.10.0.b1]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [109:org.eclipse.smarthome.core:0.10.0.b1]
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [109:org.eclipse.smarthome.core:0.10.0.b1]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
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) [?:?]
Suppressed: java.io.IOException
at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1225) [25:com.neuronrobotics.nrjavaserial:3.12.0.OH]
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:141) [?:?]
at java.io.FilterOutputStream.close(FilterOutputStream.java:158) [?:?]
at java.io.FilterOutputStream.close(FilterOutputStream.java:159) [?:?]
at org.openhab.binding.meterreader.internal.sml.SmlSerialConnector.closeConnection(SmlSerialConnector.java:143) [282:org.openhab.binding.meterreader:2.3.0.201802060729]
at org.openhab.binding.meterreader.internal.MeterDevice$1.cancel(MeterDevice.java:149) [282:org.openhab.binding.meterreader:2.3.0.201802060729]
at org.openhab.binding.meterreader.internal.MeterReaderHandler.cancelRead(MeterReaderHandler.java:102) [282:org.openhab.binding.meterreader:2.3.0.201802060729]
at org.openhab.binding.meterreader.internal.MeterReaderHandler.dispose(MeterReaderHandler.java:97) [282:org.openhab.binding.meterreader:2.3.0.201802060729]
at org.eclipse.smarthome.core.thing.binding.BaseThingHandler.thingUpdated(BaseThingHandler.java:226) [116:org.eclipse.smarthome.core.thing:0.10.0.b1]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [109:org.eclipse.smarthome.core:0.10.0.b1]
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [109:org.eclipse.smarthome.core:0.10.0.b1]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
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) [?:?]
2018-03-05 15:59:31.697 [WARN ] [.core.thing.binding.BaseThingHandler] - BaseThingHandler.initialize() will be removed soon, ThingStatus can be set manually via updateStatus(ThingStatus.ONLINE)
2018-03-05 15:59:31.697 [ERROR] [ader.internal.sml.SmlSerialConnector] - Failed to close serial output stream
java.io.IOException: null
<snip>
2018-03-05 15:59:31.702 [ERROR] [ader.internal.sml.SmlSerialConnector] - Failed to close serial output stream
java.io.IOException: null
<snip>
2018-03-05 15:59:31.703 [WARN ] [.core.thing.binding.BaseThingHandler] - BaseThingHandler.initialize() will be removed soon, ThingStatus can be set manually via updateStatus(ThingStatus.ONLINE)
2018-03-05 15:59:31.703 [ERROR] [ader.internal.sml.SmlSerialConnector] - Failed to close serial output stream
java.io.IOException: null
<snip>
2018-03-05 15:59:31.713 [ERROR] [ader.internal.sml.SmlSerialConnector] - Failed to close serial output stream
java.io.IOException: null
<snip>
2018-03-05 15:59:31.714 [WARN ] [.core.thing.binding.BaseThingHandler] - BaseThingHandler.initialize() will be removed soon, ThingStatus can be set manually via updateStatus(ThingStatus.ONLINE)
2018-03-05 15:59:31.714 [ERROR] [ader.internal.sml.SmlSerialConnector] - Failed to close serial output stream
java.io.IOException: null
<snip>
2018-03-05 15:59:33.564 [INFO ] [ing.meterreader.internal.MeterDevice] - Read out following values: Device: meterreader:meter:EHZ_PV
Obis: 1-0:1.8.1 MeterValue [obis=1-0:1.8.1, value=4.25388465E7, unit=WATT_HOUR]
Obis: 1-0:16.7.0 MeterValue [obis=1-0:16.7.0, value=1204.0, unit=WATT]
Obis: 1-0:1.8.2 MeterValue [obis=1-0:1.8.2, value=1000.0, unit=WATT_HOUR]
Obis: 129-129:199.130.5 MeterValue [obis=129-129:199.130.5, value=&����k_��m�?��&]kZA�t�q
� ��r�vu�T3����0, unit=EMPTY]
Obis: 129-129:199.130.3 MeterValue [obis=129-129:199.130.3, value=HAG, unit=EMPTY]
Obis: 1-0:0.0.9 MeterValue [obis=1-0:0.0.9, value=HAGT��y, unit=EMPTY]
Obis: 1-0:1.8.0 MeterValue [obis=1-0:1.8.0, value=4.25398465E7, unit=WATT_HOUR]