IEC 62056 - 21 Meter Binding / ISKRA MT 174

Hi Daniel
I think i have another problem:
The Openhab.log file says:
2016-10-27 17:55:06.857 [ERROR] [iec6205621meter.internal.Meter] - Failed
to open serial port /dev/ttyUSB0: Serial port with given name does not exist

How can i adjust this ?
Thanks

Stefan Moser stefan1.moser@gmail.com schrieb am Do., 27. Okt. 2016 um
17:22 Uhr:

Well, try to do this on Linux shell:

stty 300 -F /dev/ttyUSB0 1:4:da7:a30:3:1c:7f:15:4:10:0:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0

Whats the output?

I’m not sure if this is right. If i enter your command direct in the
command line - nothing happens

Daniel bot@community.openhab.org schrieb am Do., 27. Okt. 2016 um
18:03 Uhr:

I’m not able to check, if the existing connection “ttyUSB0” works.
According the logFile “Failed to open serial port /dev/ttyUSB0: Serial port
with given name does not exist” it doesn’t work.
Does it make sense to test USB1, …USB2, … and so on, because i have
plugged off the port a few times
…Thanks for the help

Stefan

Stefan Moser stefan1.moser@gmail.com schrieb am Do., 27. Okt. 2016 um
18:44 Uhr:

Well, you can check easily by hitting the folder /dev and look how it looks like. Then you plugin your reader and check again…

Hi Daniel
WhatsApp Do You mean with hitting the folder?

Daniel bot@community.openhab.org schrieb am Do., 27. Okt. 2016 20:22:

Daniel https://community.openhab.org/users/daniel
October 27

Well, you can check easily by hitting the folder /dev and look how it looks
like. Then you plugin your reader and check again…

Visit Topic
https://community.openhab.org/t/iec-62056-21-meter-binding-iskra-mt-174/9059/25
or reply to this email to respond.
In Reply To
atmosest https://community.openhab.org/users/atmosest Stefan
https://community.openhab.org/users/atmosest
October 27
I’m not able to check, if the existing connection “ttyUSB0” works.
According the logFile “Failed to open serial port /dev/ttyUSB0: Serial port
with given name does not exist” it doesn’t work. Does it make sense to test
USB1, …USB2, … and so on, because i have plugged off the port a few
times ……

Visit Topic
https://community.openhab.org/t/iec-62056-21-meter-binding-iskra-mt-174/9059/25
or reply to this email to respond.

To unsubscribe from these emails, click here
https://community.openhab.org/email/unsubscribe/66023af9b3f922c854c275c461f07f12bf74e064538dc603f1a965d16673f475
.

Just do:

cd /dev
ls -artl
=> look how it looks like
=> plugin the reader
ls -artl
=> look how it looks now -> there must be a change on one port

Hi
I have plugged of and and after plugin again two entries appeared:
crw-rw—T 1 root dialout 188, 0 Okt 27 21:06 ttyUSB0
drwxr-xr-x 4 root root 80 Okt 27 21:06 serial
That means it should work.
But why do i get the error message ?
2016-10-27 21:15:36.440 [ERROR] [iec6205621meter.internal.Meter] - Failed
to open serial port /dev/ttyUSB0: Serial port with given name does not exist

Thanks

Daniel bot@community.openhab.org schrieb am Do., 27. Okt. 2016 um
20:59 Uhr:

Hi

I have changed the user authority. Now i use the user “Root”. The error
essages have changed now.
2016-10-28 18:18:42.622 [ERROR] [.service.AbstractActiveService] - Error
while executing background thread iec6205621meter Refresh Service
java.lang.ArrayIndexOutOfBoundsException: 65933
at org.openmuc.j62056.Connection.bytesToHex(Connection.java:602) ~[na:na]
at org.openmuc.j62056.Connection.read(Connection.java:426) ~[na:na]
at org.openhab.binding.iec6205621meter.internal.Meter.read(Meter.java:83)
~[na:na]
at
org.openhab.binding.iec6205621meter.internal.Iec6205621MeterBinding.execute(Iec6205621MeterBinding.java:121)
~[na:na]
at
org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute(AbstractActiveBinding.java:156)
~[na:na]
at
org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:173)
~[na:na]

Do you have an idea ?
Thanks
Stefan

Stefan Moser stefan1.moser@gmail.com schrieb am Do., 27. Okt. 2016 um
21:17 Uhr:

On what exactly you´ve changed the permission? There is actually no need to do so. You need to set the openhab user to the dialout group

sudo usermod -a -G dialout "openhabuser"

Hi, i had changed it in etc/default/openhab. But i set the standard again.
I also tried to execute your command with user pi
sudo usermod -a -G dialout pi
Is this right, or is there any other usergroup ?
Nevertheless i get the same message after reboot.
2016-10-29 08:46:14.400 [ERROR] [.service.AbstractActiveService] - Error
while executing background thread iec6205621meter Refresh Service
java.lang.ArrayIndexOutOfBoundsException: 65901
at org.openmuc.j62056.Connection.bytesToHex(Connection.java:606) ~[na:na]
at org.openmuc.j62056.Connection.read(Connection.java:426) ~[na:na]
at org.openhab.binding.iec6205621meter.internal.Meter.read(Meter.java:83)
~[na:na]
at
org.openhab.binding.iec6205621meter.internal.Iec6205621MeterBinding.execute(Iec6205621MeterBinding.java:121)
~[na:na]
at
org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute(AbstractActiveBinding.java:156)
~[na:na]
at
org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:173)
~[na:na]
2016-10-29 08:46:14.589 [WARN ] [.httpclient.HttpMethodDirector] - Unable
to respond to any of these challenges: {oauth=OAuth
oauth_problem=“OST_OAUTH_PARAMETER_ABSENT_ERROR”, realm=“yahooapis.com”}
2016-10-29 08:46:14.591 [WARN ] [g.openhab.io.net.http.HttpUtil] - Method
failed: HTTP/1.1 401 Unauthorized
2016-10-29 08:46:24.064 [WARN ] [.httpclient.HttpMethodDirector] - Unable
to respond to any of these challenges: {oauth=OAuth
oauth_problem=“OST_OAUTH_PARAMETER_ABSENT_ERROR”, realm=“yahooapis.com”}
2016-10-29 08:46:24.066 [WARN ] [g.openhab.io.net.http.HttpUtil] - Method
failed: HTTP/1.1 401 Unauthorized

Daniel bot@community.openhab.org schrieb am Fr., 28. Okt. 2016 um
19:40 Uhr:

Hi @kreutzer_peter and @Daniel - you somehow managed to get it working. Could you please help me too? I added the binding in openhab2 /PaperUi . I could not configure a Thing (empty Screen) and I did not add a thing manually. I am a beginner with openhab2 and an absolute programmer / Raspberry / newb I so please be kind with me :slight_smile:

  • My Meter is a smartmeter ISKRA MT174-D1A52 (Baud 300 7E1)
  • My IR Reader is a Weidmann Elektronik IR Schreib/Lesekopf USB (Optokopf)

I tried

Item:
Number Strom_Haupt “Strom” (GC_Office) {iec6205621meter=“meter1;1.8.1” } as well as Strom_Haupt “Strom” (GC_Office) {iec6205621meter=“meter1;1.8.1255" } or Strom_Haupt “Strom” (GC_Office) {iec6205621meter="meter1;1-0:1.8.1255” } and other variations

Service-Config of iec6205621meter.cfg:

  • iec6205621meter:meter1.serialPort=/dev/ttyUSB0
  • iec6205621meter:meter1.baudRateChangeDelay=0
  • iec6205621meter:meter1.echoHandling=false
  • iec6205621meter:refresh=6000

After adding the Item there is an error regularely occuring in my logfile:

[ERROR] [nding.iec6205621meter.internal.Meter] - IOException while trying to read: Serial Port does not support -1bd 7E1

following Errors sometimes occur in combination with the first one:

often: [ERROR] [b.core.service.AbstractActiveService] - Error while executing background thread iec6205621meter Refresh Service
java.lang.ArrayIndexOutOfBoundsException: 4

at org.openmuc.j62056.Connection.read(Connection.java:301) ~[?:?]
at org.openhab.binding.iec6205621meter.internal.Meter.read(Meter.java:81) ~[?:?]
at org.openhab.binding.iec6205621meter.internal.Iec6205621MeterBinding.execute(Iec6205621MeterBinding.java:121) ~[?:?]
at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute(AbstractActiveBinding.java:144) ~[208:org.openhab.core.compat1x:2.4.0]
at org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:166) [208:org.openhab.core.compat1x:2.4.0]

rarely: [ERROR] [nding.iec6205621meter.internal.Meter] - IOException while trying to read: Timeout while listening for Identification Message

thank you for your help,
Armin

Hello @Armin1

I just recently updated to OH 2 (2.4) and do not have set up the IEC Meter Binding so far, so its a bit hard to help here from my side.
When I look into the history of this thread, I can see that I´ve had once the same issue as you do right now. Maybe something is wrong in my answer, but I wrote:

I have left the settings all on default, like:

iec6205621meter:meter1.echoHandling=false
iec6205621meter:meter1.baudRateChangeDelay=0

But as I see, the default for echoHandling is “true”. So maybe you try to set this one to true and try again (after restarting!?). So just

iec6205621meter:meter1.echoHandling=true

regards
Daniel

Thanks a lot! I figured out an alternative. It problably will help others with similar problems.

  1. I run a second Pi with raspian and node-red (comes pre-installed)
  2. On Nodered (Link: your-raspberry-ip:1880) Install Smartmeter node via menu - manage palette
  3. Parameters which worked for me: /dev/ttyUSB0:300-7E1 (Source Type Serial; Serial Port /dev/ttyUSB0; Baud 300, Bits 7, Parity Even, Stop Bits 1)
  4. Protokoll DO, Transport SerialRequestResponseTransport, Request Interval 0. → Deploy
  5. Connect a Function to the Smartmeter-node to format the output:

return [
{payload: parseFloat(msg.payload[„6-0:1.8.1″].rawValue.replace(/[^\d.-]/,“))},
];

  1. Install Openhab Connect via menu - manage palette
  2. Connect Openhab-Out to the Function and define your openhab-parameters within the node