Strange Data P1 Readings.

Moderator: leecollings

sanderr25
Posts: 2
Joined: Wednesday 08 April 2015 20:16
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Strange Data P1 Readings.

Post by sanderr25 »

I'm trying to read my P1 port using domoticz, but i get only strange data, can someone help me?

I have followed the site http://gejanssen.com/howto/Slimme-meter-uitlezen/ and bought my cable online.

When i try to test the connection i get the following: (60 seconds)

Code: Select all

pi@(none) ~ $ cu -l /dev/ttyUSB1 -s 9600 --parity=none
Connected.

pi@(none) ~ $ cu -l /dev/ttyUSB1 -s 9600 --parity=none
Connected.
Is there a possibility my P1 port is broken?

When i run this on the USB0 port (where the RFXCOM is located) i get the following data:

Code: Select all

pi@(none) ~ $ cu -l /dev/ttyUSB0 -s 9600 --parity=none

Connected.

 J??SJ0ZFPZ?hZ	~J0?SZFPZ?hJ0	~

                                 Z?SZ?hJ0ZI~ZFSZ?SJ0Z?hJJ0ZFPZSڂxZ	~J?0JZFSZ?hZ?S???0?FPZ?hZ?SJ0?0ڂh????h?J0ZFPZ?hJ?z?0?FhڂhJCJ 

pi@(none) ~ $ cu -l /dev/ttyUSB0 -s 9600 --parity=none

Connected.
?0Z?hJ0JZFS?0ڂh?Gh?C?0ZFSZ?hZ?h?0ZFsڂh?0Z?hJ?ZFSZ?h?0??Gh?I~J(Z?h
User avatar
gizmocuz
Posts: 2363
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Strange Data P1 Readings.

Post by gizmocuz »

You have to use the following serial parameters

Parity=Even
Bits=7
baudrate=9600
Quality outlives Quantity!
ThinkPad
Posts: 890
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

Re: Strange Data P1 Readings.

Post by ThinkPad »

Welcome to this forum, enjoy your stay here :)

Which cable and where did you bought it?

You will get this output also if the data isn't inverted back to normal (the smartmeter spits the datasignal out in a inverted way).
With a cable based upon a FTDI chip, you can program it (FT_PROG Windows utility) to invert the RxD line. Most sellers do this already for you if they use an FTDI cable, but maybe this one forgot it?

Oh and which smartmeter do you have btw?
I am not active on this forum anymore.
sanderr25
Posts: 2
Joined: Wednesday 08 April 2015 20:16
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Strange Data P1 Readings.

Post by sanderr25 »

Thanks:)

I have this cable http://www.kroonen.eu/wiki/Slimme%20Meter And bought is also there, i don't know more of the spec's.
The meter: iskra Type: ME382. The seller of the cable told me that it would work right out of the box.

I have looked on the internet for a program that does the same, but will work for mac. ( i don't have a windows pc, or can’t borrow one) But fount nothing. 




ThinkPad
Posts: 890
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

Re: Strange Data P1 Readings.

Post by ThinkPad »

Just ask him. He says it should work with the ME382 and also shows a screenshot of Domoticz. So it is up to him to get it working, you paid for a working cable.
I am not active on this forum anymore.
User avatar
gizmocuz
Posts: 2363
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Strange Data P1 Readings.

Post by gizmocuz »

Can you post the output of the 'strange data' ?
Did you try with the above serial port settings?

If the cable is supported in domoticz (as the website says) than it is opened with the above parameters.

It could be that you meter does not send 'decimals', if this is the case (you will see strange data in the domoticz graph of the day view),
you can change this in the settings (under the meter section)
Quality outlives Quantity!
ThinkPad
Posts: 890
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

Re: Strange Data P1 Readings.

Post by ThinkPad »

gizmocuz, the output isn't even readable. So it is the cable itself probably.

I have made cables for different meters for a while, also for ME382 and never had complaints (they also used it with Domoticz)
I am not active on this forum anymore.
User avatar
gizmocuz
Posts: 2363
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Strange Data P1 Readings.

Post by gizmocuz »

Again, if this cable is natively supported by domoticz, you have to use the serial parameters mentioned above.

This also includes the testing in the OP's first message !
Quality outlives Quantity!
peterprinsen
Posts: 8
Joined: Tuesday 09 June 2015 20:13
Target OS: Linux
Domoticz version: v2.2516
Location: The Netherlands
Contact:

Re: Strange Data P1 Readings.

Post by peterprinsen »

Hi,

I originally posted an issue with reading my P1 meter in domoticz.com/forum/viewtopic.php?f=14&t=4970. That was a while ago (June last year) but I wasn’t able to solve the problem back then. I hadn’t had a chance to look at it again until last week but I think I’ve come a bit closer to the solution now. I haven’t completely figured it out though and was hoping someone could help me.

My smart meter is a Kamstrup 382JxC and I am using a HL-340 USB to RS232 Serial Port Adapter Cable (from dx.com) to connect the smart meter to a pc running domoticz (on linux). I use a baud rate of 9600, which is the correct value based on some testing with a serial port reader. Domoticz doesn’t give me any meter reading however so I decided to have it output the strings it gets from the meter, see the figure below.
Screenshot from 2016-01-19  21_40_49.jpg
Screenshot from 2016-01-19 21_40_49.jpg (46.85 KiB) Viewed 6933 times
As you can see (ignore the time stamps) it gets some sensible numbers, but there are also some weird characters. This surprised me since I used Bray’s terminal on Windows to look at the meter readings and they seemed normal:
terminal.png
terminal.png (22.38 KiB) Viewed 6933 times
(the figure gives both the ASCII and the HEX output). I then did the same thing with a serial port reader for Linux and got this results:
Screenshot from 2016-01-19  21_42_35.jpg
Screenshot from 2016-01-19 21_42_35.jpg (29.69 KiB) Viewed 6933 times

So this reader recognizes the same characters as domoticz and doesn’t recognize the ones where domoticz displays a weird number (in other words, the problem doesn’t seem to be domoticz). If you look at the HEX representation it seems that the weird characters are the ones where the HEX representation under Windows differs from the one under Linux (1 for example has HEX code 31 under Windows but the reading under Linux is B1). I don’t understand this. How can I get different readings under Linux and Windows? Is there a problem with my Cable?

It seems that the problem is solvable by substituting HEX code AX by 2X, BX by 3X, and CX by 4X (where X=1,2,3,…), which I think I could do in the domoticz code, but I don’t know if that’s the right way to go (it seems more of a hack instead of getting to the root cause).

Peter
ThinkPad
Posts: 890
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

Re: Strange Data P1 Readings.

Post by ThinkPad »

Could it be that the 'Bray's terminal' software inverts the data? For my meter it was needed to solder an BS170-transistor + 10K resistor in the dataline (see my topic under 'Meters' subforum) to reinvert the data to a readable format.
I am not active on this forum anymore.
User avatar
bbqkees
Posts: 407
Joined: Sunday 17 August 2014 21:01
Target OS: Linux
Domoticz version: 4.1x
Location: The Netherlands
Contact:

Re: Strange Data P1 Readings.

Post by bbqkees »

You are really the only one with this problem.
I am reading out the same meter somewhere with a CH340 cable without any problem whatsoever.

Have you tried another cable? It seems like you already spend a considerable amount of time.
The cable is very cheap, so buy another.

What I think is your issue is your setting.

0x31= 00110001
0xB1= 10110001

it looks like it is trying to decode 8N1 where it should be 7E1.
Bosch / Nefit / Buderus / Junkers / Worcester / Sieger EMS bus Wi-Fi MQTT Gateway and interface boards: https://bbqkees-electronics.nl/
peterprinsen
Posts: 8
Joined: Tuesday 09 June 2015 20:13
Target OS: Linux
Domoticz version: v2.2516
Location: The Netherlands
Contact:

Re: Strange Data P1 Readings.

Post by peterprinsen »

Thanks bbqkees, I figured I was the only one since I haven't seen any other posts about this. I thought my cable was ok based on the readings under Windows so that's why I didn't buy a new cable. But maybe that was the wrong conclusion so I'll just buy a new cable. I did spend a few evenings on this but I also learned some stuff so it wasn't completely wasted :-).

Thinkpad, thanks for your reaction. Based on the fact that some numbers are correct under Linux while others are not I think it's not an inversion problem but, as bbqkees suggests, a problem with a misinterpretation of the parity bit.

I'll post an update when the problem is solved.
NLRad
Posts: 13
Joined: Sunday 20 December 2015 15:10
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Strange Data P1 Readings.

Post by NLRad »

Well, perhaps he's not the only one...
I was using the P1 Smart Cable (https://www.sossolutions.nl/slimme-meter-kabel) for over 2 months without any problems. Both Energy and gas meter worked fine and the corresponding devices in Domoticz worked correctly, graphs and all.

Now, since several weeks the gas readings do not work anymore. However the energy readings are still ok.
I've removed the cable, removed devices in Domoticz, reboot, different USB port, etc. Nothing worked.

A dump from cu -l /dev/ttyUSB1 -s 9600 --parity=none:
/KMP5 ZABF001521498011

0-0:96.1.1(205A414246303031353231343938303131)
1-0:1.8.1(23313.642*kWh)
1-0:1.8.2(16300.994*kWh)
1-0:2.8.1(00000.000*kWh)
1-0:2.8.2(00000.000*kWh)
0-0:96.14.0(0001)
1-0:1.7.0(0000.49*kW)
1-0:2.7.0(0000.00*kW)
0-0:96.13.1()
0-0:96.13.0()
0-2:24.1.0(3)
0-2:96.1.0(3238313031353431303034333539373131)
0-2:24.3.0(160124120000)(00)(60)(1)(0-2:24.2.1)(m3)
(09816.842)
!
~.
So, clearly the gas meter returns a value (9816.842 m3), which corresponds to the number on the gas meter itself. However, Domoticz only shows 0.00 for gas.

Now, I'm wondering: what changed? The cable? Domoticz (however I didn't notice any upgrade, now running version V2.3530) on my RaspberryPi2B)?
I tried everything I could think off, but yet clueless. Does anyone please have any suggestions? Fetching my meter readings was one of the main reasons I installed my domotica system.

Thanks in advance for any help!
User avatar
bbqkees
Posts: 407
Joined: Sunday 17 August 2014 21:01
Target OS: Linux
Domoticz version: 4.1x
Location: The Netherlands
Contact:

Re: Strange Data P1 Readings.

Post by bbqkees »

Is the gas value in the datagram getting updated?
So it gets higher when using gas?
There is currently a problem with a certain combination of gas and power meter and it stopped updating the gas because of it.
Bosch / Nefit / Buderus / Junkers / Worcester / Sieger EMS bus Wi-Fi MQTT Gateway and interface boards: https://bbqkees-electronics.nl/
NLRad
Posts: 13
Joined: Sunday 20 December 2015 15:10
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Strange Data P1 Readings.

Post by NLRad »

@bbqkees: yes, it gets updated.

new dump:
/KMP5 ZABF001521498011

0-0:96.1.1(205A414246303031353231343938303131)
1-0:1.8.1(23350.659*kWh)
1-0:1.8.2(16336.789*kWh)
1-0:2.8.1(00000.000*kWh)
1-0:2.8.2(00000.000*kWh)
0-0:96.4.0(0002)
1-0:1.7.0(0000.67*kW)
1-0:2.7.0(0000.00*kW)
0-0:96.13.1()
0-0:96.13.0()
0-2:24.1.0(3)
0-2:96.1.0(3238313031353431303034333539373131)
0-2:24.3.0(160127100000)(00)(60)(1)(0-2:24.2.1)(m3)
(09841.126)
!
~.

I have a Kamstrup Power and a Landis & Gyr gas meter.
User avatar
bbqkees
Posts: 407
Joined: Sunday 17 August 2014 21:01
Target OS: Linux
Domoticz version: 4.1x
Location: The Netherlands
Contact:

Re: Strange Data P1 Readings.

Post by bbqkees »

if it updates, then the meter is fine. Maybe send a PM to Gizmocus
Bosch / Nefit / Buderus / Junkers / Worcester / Sieger EMS bus Wi-Fi MQTT Gateway and interface boards: https://bbqkees-electronics.nl/
NLRad
Posts: 13
Joined: Sunday 20 December 2015 15:10
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Strange Data P1 Readings.

Post by NLRad »

Yep, my conclusion also.

I digged a little deeper. Also in the source code. And there I found something!!

From the dump of my serialport, the lines concerning the gas meter:
0-2:96.1.0(3238313031353431303034333539373131)
0-2:24.3.0(160127100000)(00)(60)(1)(0-2:24.2.1)(m3)
(09841.126)

in the sourcecode, P1MeterBase.cpp:

Code: Select all

#define P1GTS			"0-1:24.3.0" // timestamp gas usage sample
#define P1GTSDSMRv4		"0-1:24.2.1" // timestamp gas usage sample
#define P1GTSGyrE350	"0-2:24.2.1" // timestamp gas usage sample
So, in the sourcecode is being searched for 0-1:24.3.0, whilst my meter outputs 0-2:24.3.0 !!

Could this perhaps be the reason that since a couple of weeks, my P1 Smart Meter Gas only reports 0.000m3 ??
Could somehow the Gasmeter have changed its output??

My system:
RaspberryPi2B, Domoticz V2.3530, Kamstrup Energy Meter, Landis&Gyr G350 Gasmeter, P1 Smart Meter Cable on ttyUSB1
and RFXCom and Zwave controllers and devices
Browsers: Chrome, Firefox

Anyway,I was wondering if somebody could help me with this? I'm not a programmer, I know nothing about GitHub and don't know how to reach the developer of Domoticz (which is my favorite domotica system!).

Thnx in advance!
User avatar
bbqkees
Posts: 407
Joined: Sunday 17 August 2014 21:01
Target OS: Linux
Domoticz version: 4.1x
Location: The Netherlands
Contact:

Re: Strange Data P1 Readings.

Post by bbqkees »

NLRad wrote:
Anyway,I was wondering if somebody could help me with this? I'm not a programmer, I know nothing about GitHub and don't know how to reach the developer of Domoticz (which is my favorite domotica system!).
Well that is quite easy. Just send a PM to Gizmocuz http://domoticz.com/forum/memberlist.ph ... ofile&u=56
Bosch / Nefit / Buderus / Junkers / Worcester / Sieger EMS bus Wi-Fi MQTT Gateway and interface boards: https://bbqkees-electronics.nl/
Sarion
Posts: 7
Joined: Monday 14 December 2015 12:15
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Strange Data P1 Readings.

Post by Sarion »

I think I am having the exact same issue, for which I had started this thread: viewtopic.php?f=14&t=10020

I hope this can be fixed!
NLRad
Posts: 13
Joined: Sunday 20 December 2015 15:10
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Strange Data P1 Readings.

Post by NLRad »

Sarion wrote:I think I am having the exact same issue, for which I had started this thread: viewtopic.php?f=14&t=10020

I hope this can be fixed!
I checked your serial output. It shows exactly the same codings as mine.
The meter and cable work fine (at least give correct readings).
I sent a PM to Gizmocuz about this topic, hoping he has an idea about how to fix this, based on our findings.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest