DIY cheap USB-cable to read P1 port of Dutch smart meter

User avatar
mlamie
Posts: 147
Joined: Friday 25 October 2013 17:12
Target OS: Raspberry Pi
Domoticz version: 3.5877
Location: The Netherlands
Contact:

Re: DIY cheap USB-cable to read P1 port of Dutch smart meter

Postby mlamie » Wednesday 11 January 2017 14:48

renerene wrote:I have managed to solve the permisseon denied issue on ttyAMA0 with help from this post

The cable is succesfully tested, using my Windows10 laptop, after fidling with some settings (baudrate, stop bits, etc) in the terminal program.
However: still no smart meter devices show up in Domoticz after clicking 'enable hardware for 5 minutes'
Also, in putty i can not get correct screendumps.

Two questions:
- which port to choose? (ttyAMA0, ttyUSB0, ttyUSB1 or ttyACM0)
- what is the correct CU command line for a Kaifa MA105C?


A small tip, look at the following wiki page: https://www.domoticz.com/wiki/PersistentUSBDevices

Use the lsusb command to see all the devices connected on your Raspberry Pi.
Raspberry Pi 3, RaZberry, RFXtrx433
Various Z-Wave devices, KlikAanKlikUit devices, ESP8266 NodeMCU, Sonoff POW and a Essent E-thermostaat
IP camera: Dahua 4MP IPC-HDBW4421R-AS, Vivotek FD8134V

renerene
Posts: 44
Joined: Wednesday 03 August 2016 11:36
Target OS: -
Domoticz version:
Contact:

Re: DIY cheap USB-cable to read P1 port of Dutch smart meter

Postby renerene » Wednesday 11 January 2017 23:17

A small tip, look at the following wiki page: https://www.domoticz.com/wiki/PersistentUSBDevices
Use the lsusb command to see all the devices connected on your Raspberry Pi.


1) Sorry, I don't get it. On which USB port is device 012?
Image

2) With help from my laptop I found out that handshake type is critical: it should be RTS/CTS. In the command line CU and in Domoticz there is no handshake parameter, that can be set. How to set the correct handshake type?
Image

pkessels
Posts: 1
Joined: Wednesday 22 February 2017 21:39
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: DIY cheap USB-cable to read P1 port of Dutch smart meter

Postby pkessels » Wednesday 22 February 2017 21:45

Nobody a clue regarding the issue with the handshake, I have exactly the same issue.
On my laptop with a terminal I got data, on the raspberry pi I got a message connected and then the screen starts scrolling but no text on the screen.
In Domoticz I see in the logging that the device get opened, but also closed.
Help!

User avatar
bbqkees
Posts: 407
Joined: Sunday 17 August 2014 21:01
Target OS: Raspberry Pi
Domoticz version: 3.5x
Location: The Netherlands
Contact:

Re: DIY cheap USB-cable to read P1 port of Dutch smart meter

Postby bbqkees » Friday 24 February 2017 12:07

Did you try a resistor between pin 2 and 5?

What you can also try is to connect pin 1 and 2.
This will drive RTS high all the time. This will force the meter to generate the datagram every 10 seconds.
RPi 2 (migrating to NUC), Philips Hue, Aeon Zwave stick V2, Qubino, Fibaro, Everspring, Philio, RFXCom, X10, Harmony Hub, Xiaomi Flora + Gateway, BS440. And P1 / Resol VBus / Nefit EMS bus / DHT21 / DS18B20 / Sonoff / I2C display, all via Arduino/ESP8266.

User avatar
mlamie
Posts: 147
Joined: Friday 25 October 2013 17:12
Target OS: Raspberry Pi
Domoticz version: 3.5877
Location: The Netherlands
Contact:

Re: DIY cheap USB-cable to read P1 port of Dutch smart meter

Postby mlamie » Friday 24 February 2017 13:08

renerene wrote:
A small tip, look at the following wiki page: https://www.domoticz.com/wiki/PersistentUSBDevices
Use the lsusb command to see all the devices connected on your Raspberry Pi.


1) Sorry, I don't get it. On which USB port is device 012?


The idea is that you will create a rule in the udev folder. That rule will contain the {idVendoridVendor}, {idProduct} and the {serial} of your USB device. Based on those device details you can plug the USB device in any of the RPI USB ports and will automatically be matched with the SYMLINK which you have given in the rule. That SYMLINK should be selected in Domoticz Hardware setup page.
Raspberry Pi 3, RaZberry, RFXtrx433
Various Z-Wave devices, KlikAanKlikUit devices, ESP8266 NodeMCU, Sonoff POW and a Essent E-thermostaat
IP camera: Dahua 4MP IPC-HDBW4421R-AS, Vivotek FD8134V

Jeff
Posts: 33
Joined: Tuesday 16 December 2014 0:39
Target OS: Windows
Domoticz version: 2.3674
Location: Weert, Netherlands
Contact:

Re: DIY cheap USB-cable to read P1 port of Dutch smart meter

Postby Jeff » Wednesday 17 May 2017 0:23

I've had a new gas+electricity meter installed last week and also made a new cable with a 2.2K resistor included, While doing the initial test with the 115200 7N1 parameters and inverted RXD i noticed that the data is not being displayed properly with this cable.
The only data that is coming trough is the following:

Code: Select all

||||||||||||||||||||

The board is correctly soldered since it works with fine with another FTDI 232 TLL232 5V cable.

Does anyone have a suggestion ?

Jeff
Posts: 33
Joined: Tuesday 16 December 2014 0:39
Target OS: Windows
Domoticz version: 2.3674
Location: Weert, Netherlands
Contact:

Re: DIY cheap USB-cable to read P1 port of Dutch smart meter

Postby Jeff » Wednesday 17 May 2017 0:32

I've had a new gas+electricity meter installed last week and also made a new cable with a 2.2K resistor included, While doing the initial test with the 115200 7N1 parameters and inverted RXD i noticed that the data is not being displayed properly with this cable.
The only data that is coming trough is the following:

Code: Select all

||||||||||||||||||||

The board is correctly soldered since it works with fine with another FTDI 232 TLL232 5V cable.

Now i only need to find a solution to the CRC/buffer error's

Code: Select all

2017-05-17 00:28:59.456 P1: dismiss incoming - value in line "1-0:2.8.2(�00000.000*kWh)" is not a number
2017-05-17 00:29:00.722 P1: dismiss incoming - CRC failed
2017-05-17 00:29:01.722 P1: dismiss incoming - CRC failed
2017-05-17 00:29:10.236 P1: WARNING: got new message but buffer still contains unprocessed data from previous message.
2017-05-17 00:29:10.236 P1: dismiss incoming - CRC value in message has trailing characters


Does anyone have a suggestion ?

snottt
Posts: 1
Joined: Sunday 21 May 2017 19:26
Target OS: -
Domoticz version:
Contact:

Re: DIY cheap USB-cable to read P1 port of Dutch smart meter

Postby snottt » Friday 26 May 2017 13:38

I have built a P1 cable with a Winchiphead HL-340 chip in a serial to usb cable like posted earlier on this forum. For some reason I get empty readings from it on my Raspberry Pi with cu. Every ten seconds I see the cursor moving forward, but without showing any data. In an attempt to check if my cable is faulty, I installed Domoticz on my windows computer and here Domoticz shows the information from my smart meter every ten seconds. Does anyone have an idea what could be the problem? I used 115200 baudrate. A power adapter 5V 2.0A for the RPI gives the same blank result every 10s.


Return to “Meters”

Who is online

Users browsing this forum: No registered users and 2 guests