Hi @nokyyz
Thanks for your work !
I use your binding on openhab 2.5.0.M3 on docker with the previous (Alpha 20191015-1958) version. My teleinfo hardware is a Cartelectronic like @ysc. It works well but I noticed several issues/enhancements:
Same issue than @ysc[ERROR] [nternal.serial.TeleinfoReceiveThread] - Got invalid frame The groupLine seems corrupted (integrity not checked) during receiving. exiting thread.. I will try the new beta version next week.
Rules auto updating seems to be broken when using your binding: need a restart of my docker image to take into account modifications in my .rules files.
Could this binding directly support a ser2net device? For example with a device address like ip:port instead of /dev/ttyXXX. With that my docker image could be independent of the harware where he is running. Enocean binding seems to already support this.
Yes, the beta-20191029-2235 version should fix this issue
Iām using OpenHAB 2.5.0-M1 on Docker (āopenhab/openhab:2.5.0.M1-amd64-debianā image). I will check it in the next few days. I am very surprised that this problem is due to my teleinfo bindingā¦
I think OpenHAB supports the rfc2217 feature natively. If you want to try/test, I can update the binding configuration to replace Serial port dropdown list to a simple text field.
Ok ?
For my information, can you give me some details about your electricty meter ? single-phase or tree-phase ? your pricing option (Base, HC, Tempo, EJP) ?
My electricity meter is single phased and my pricing option is HC.
A text field instead of dropdown list would be great!
No time to test the new version for the momentā¦
Hi @nokyyz,
I am testing the new release and I am trying to have a working rfc2217 configuration. I receive this error:
[rial.TeleinfoSerialControllerHandler] - An error occurred during serial port connection. Detail: "gnu.io.UnsupportedCommOperationException"
org.eclipse.smarthome.io.transport.serial.UnsupportedCommOperationException: gnu.io.UnsupportedCommOperationException
at org.eclipse.smarthome.io.transport.serial.rxtx.RxTxSerialPort.enableReceiveThreshold(RxTxSerialPort.java:157) ~[?:?]
at org.openhab.binding.teleinfo.internal.serial.TeleinfoSerialControllerHandler.openSerialPortAndStartReceiving(TeleinfoSerialControllerHandler.java:176) [243:org.openhab.binding.teleinfo:2.5.0.201911041935]
at org.openhab.binding.teleinfo.internal.serial.TeleinfoSerialControllerHandler.access$5(TeleinfoSerialControllerHandler.java:148) [243:org.openhab.binding.teleinfo:2.5.0.201911041935]
at org.openhab.binding.teleinfo.internal.serial.TeleinfoSerialControllerHandler$1.run(TeleinfoSerialControllerHandler.java:89) [243:org.openhab.binding.teleinfo:2.5.0.201911041935]
at java.util.TimerThread.mainLoop(Timer.java:555) [?:?]
at java.util.TimerThread.run(Timer.java:505) [?:?]
Caused by: gnu.io.UnsupportedCommOperationException
at gnu.io.rfc2217.TelnetSerialPort.enableReceiveThreshold(TelnetSerialPort.java:948) ~[?:?]
at org.eclipse.smarthome.io.transport.serial.rxtx.RxTxSerialPort.enableReceiveThreshold(RxTxSerialPort.java:155) ~[?:?]
... 5 more
Here is my ser2net.conf: 5001:telnet:0:/dev/ttyUSB0:1200 7DATABITS EVEN 1STOPBIT remctl
Where is my mistake?
Do I need to add something to my docker image configuration?
Hi @hollysaiqs,
I could not test the RFC2217 feature⦠After some searchs on this forum, have you try with RAW option instead of Telnet ? E.g: 5001:telnet:0:/dev/ttyUSB0:1200 7DATABITS EVEN 1STOPBIT remctl
-> 5001:raw:0:/dev/ttyUSB0:1200 7DATABITS EVEN 1STOPBIT remctl
Hi @nokyyz,
With raw option, I receive this error:
[ERROR] [rial.TeleinfoSerialControllerHandler] - An error occurred during serial port connection. Detail: "gnu.io.UnsupportedCommOperationException"
org.eclipse.smarthome.io.transport.serial.UnsupportedCommOperationException: gnu.io.UnsupportedCommOperationException
at org.eclipse.smarthome.io.transport.serial.rxtx.RxTxSerialPort.enableReceiveThreshold(RxTxSerialPort.java:157) ~[?:?]
at org.openhab.binding.teleinfo.internal.serial.TeleinfoSerialControllerHandler.openSerialPortAndStartReceiving(TeleinfoSerialControllerHandler.java:176) [243:org.openhab.binding.teleinfo:2.5.0.201911041935]
at org.openhab.binding.teleinfo.internal.serial.TeleinfoSerialControllerHandler.initialize(TeleinfoSerialControllerHandler.java:74) [243:org.openhab.binding.teleinfo:2.5.0.201911041935]
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:152) [133:org.openhab.core:2.5.0.M3]
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [133:org.openhab.core:2.5.0.M3]
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) [?:?]
Caused by: gnu.io.UnsupportedCommOperationException
at gnu.io.rfc2217.TelnetSerialPort.enableReceiveThreshold(TelnetSerialPort.java:948) ~[?:?]
at org.eclipse.smarthome.io.transport.serial.rxtx.RxTxSerialPort.enableReceiveThreshold(RxTxSerialPort.java:155) ~[?:?]
... 12 more
During my searchs I didnāt see anyone who succeeds in making rfc2217 works⦠Everybody seems to use socat instead. Does rfc2217 actually work on openhab?
Thanks @nokyyz,
The value of Serial Port is /dev/ttyUSB21 (socat emulates an USB hardware). No need to have rfc2217 with socat, sorry for asking a functionality which was finally useless (for me).
I am currently trying to automate socat launching when running the docker image.
Is there any chance this binding will be official in openhab 2.5.0? Release seems to be closeā¦
It remains to write the documentation (iām struggling ), to merge/synchronize with the last source code of official openhab-addons github and then create a pull request
So, what is the command line to broadcast your Teleinfo serial port on TCP/IP ? I think it would be interesting to specify it in the binding documentationā¦
add the line 5001:raw:0:/dev/ttyUSB0:1200 7DATABITS EVEN 1STOPBIT remctl on the configuration file /etc/ser2net.conf. I think the remctl is useless with socat on the other side. /dev/ttyUSB0 is the serial port of my teleinfo modem.
Start the ser2net service with systemctl start ser2net and make it persistent at reboot with systemctl enable ser2net
On openhab computer:
Install socat: apt install socat
launch the command (I donāt know if options after port number 5001 are mandatory)
To be more robust to socat failure, I use this script:
#!/bin/bash
while true
do
socat pty,link=/dev/ttyUSB21,raw,user=openhab,group=dialout,mode=777 tcp:192.168.0.21:5001,reuseaddr,keepalive,connect-timeout=5,keepcnt=5,keepidle=5,keepintvl=5
sleep 1
done
Since socat is not a system service, you have to launch it after each reboot.
Your teleinfo device must be accessible from openhab on the /dev/ttyUSB21.
The UnsupportedCommOperationException you are seeing is due to the fact that the RFC2217 library (specifically TelnetSerialPort) does not support the enableReceiveThreshold method (and also doesnāt support enableReceiveTimeout). Iām not sure why they chose to throw an exception instead no-op, but the binding needs to be modified to catch and ignore that exception to have a chance of functioning with rfc2217 ports.
Hi
Using this binding works but intermittently ( I use a virtual serial port using VSPE connected to a serial port server on which the RS232 modem demodulating the electricity meter information is connected). May be you can help.
I have a second meter i would like to read. May be it is possible to have a second binding with another name?
Thanks for your help