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

Moderator: leecollings

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

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

Post by ThinkPad »

I sometimes see people buying expensive cables for reading out their smart meters. If you are handy enough, you can make your own for cheap!

I created a cable myself, i just bought the cheapest USB > Serial cable i could find from eBay, together with some RJ11 connectors.
Cut off the default connectors that were attached to the wires and crimped the connector to the USB>Serial cable (pinout can be found here: http://gejanssen.com/howto/Slimme-meter ... pinout.png) and you are done.
Ofcourse you also need an RJ11 crimping tool (mine is a combined RJ45/RJ11 crimping tool) but maybe your neighbour has it ;) ?

My cable has the Winchiphead HL-340 chip, and is detected fine by the Domoticz Raspberry image. My meter is a Kaifa MA105 (DSMR4 115200 baud, 8N1 with inverted data). The HL-340 chip automatically re-inverts the data to normal. Pay attention to which chip your cable has, the cables with PL2303 are advertised a lot, but they don't automatically invert the data. FTDI is the best, but also the most expensive compared to the others. HL-340 also works fine. For the PL2303 you need extra hardware (transistor + resistor) to re-invert the datasignal.

The colored rings of the resistor translate the value: http://www.weerstandcalculator.nl/
brown - black - orange - gold = 10K / 10 kilo Ohm

In the diagram an Arduino is shown, but you need to connect it like this:
- the line shown in yellow to the 'Rx' pin of the PL2303 board
- the line shown in red to the +5V line of the PL2303 board, can also be marked as Vcc / Vdd
- the line shown in blue to the ground (GND) of the PL2303 board



I think this approach will work for 90% of the modern Dutch smart meters, and will cost you no more than 3 - 4 euro. Only need to wait 2 weeks for the parts to arrive from China :lol:
Only for some Landis & Gyr meters it is sometimes a bit problematic to read their data, but i already saw a topic somewhere here on this forum that somebody got it working by adding an extra resistor.

Oh and if you bought a very cheap cable with an FTDI chip, pay attention as it might be a fake chip and it could be bricked by when you connect it to a Windows PC (due to a Windows update that contains a driver that will brick fake cables) Search for #FTDIgate
I am not active on this forum anymore.
Lieuwke
Posts: 15
Joined: Saturday 06 December 2014 19:25
Target OS: Linux
Domoticz version:
Contact:

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

Post by Lieuwke »

For the Landis/Gyr E350 with DSMR 4.0 Solder a pull up resistor between pin 2 and 5 of your RJ connector wiring. 1Kohm should suffice.
Sony Raspberry Pi B V2.0
Homemade P1 cable on Landis/Gyr E350
C&K/Honeywell Security system connected to Domoticz
AEON Labs USB Z-Wave
TCRT5000 sensor watermeter -> revived..... and in progress....
rhendriks
Posts: 44
Joined: Monday 23 December 2013 23:36
Target OS: Raspberry Pi / ODroid
Domoticz version: Newest
Location: Netherlands Helmond
Contact:

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

Post by rhendriks »

I have connect my smartmeter to the original serial port of the raspberry .
I can read out this with a little python script just as gejanssen.com .
The only problem is that I not self can implement in Domotics.
If there anyone can do that , you have an extra usb .
see this : http://home.versatel.nl/rolandhendriks/rpilink1.html
ThinkPad
Posts: 890
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

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

Post by ThinkPad »

It should be possible to use ttyAMA0, as the RaZberry board also uses it. I search on Google, and found this:
http://elinux.org/RPi_Serial_Connection ... peripheral

Also see this: http://www.raspberrypi.org/forums/viewt ... 44&t=17360 (look at the two links mentioned).
I am not active on this forum anymore.
rhendriks
Posts: 44
Joined: Monday 23 December 2013 23:36
Target OS: Raspberry Pi / ODroid
Domoticz version: Newest
Location: Netherlands Helmond
Contact:

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

Post by rhendriks »

@ ThinkPad I know this and I have a website with the values , they refresh every 10 seconds en is written in python and php.
I would like to implement it in Domoticz but my programming knowledge is not so good that I can do that.
ThinkPad
Posts: 890
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

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

Post by ThinkPad »

Ok, but you don't understand my point ;) What i mean, is that i think that by configuring your OS like on the elinux website, the ttyAMA0 should be also available to Domoticz.
It can't be that hard, as like i said, Razberry also uses it, and the Razberry can be used by Domoticz.
I am not active on this forum anymore.
rhendriks
Posts: 44
Joined: Monday 23 December 2013 23:36
Target OS: Raspberry Pi / ODroid
Domoticz version: Newest
Location: Netherlands Helmond
Contact:

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

Post by rhendriks »

If I configured my OS ,ttyAMA0 is not available in Domoticz if I look in the hardware tab.
I see only ttyUSB0 and ttyUSB1.
Nicap
Posts: 6
Joined: Sunday 14 December 2014 23:38
Target OS: Raspberry Pi / ODroid
Domoticz version: Latest B
Contact:

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

Post by Nicap »

Thinkpad, ik heb deze kabel gister ontvangen uit China. Image

Waar knip ik hem precies af?
Ik zie in de RS232 connector een chipje zitten, maar aan de usb kant zie ik zo niks. Heb toch wel de goeie kabel besteld he? :roll:
ThinkPad
Posts: 890
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

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

Post by ThinkPad »

Please talk in English, so others can also read this topic ;)

I think this cable can be used, no problem.

But you have two options:
  1. Remove the plastic of the RS232 connector, so you can reach the chip. Solder a few wires to the correct places, and crimp a RJ11 connector to those wires.
  2. Or make an adapter that connects to the RS232 connector and goes to an RJ11 connector. To make this you need a female DB9 connector, some wires and a RJ11 connector.
But i don't know if your cable (or mine) is going to work with your meter. Some meters spit their data out inverted.. If the cable doesn't automatically re-inverts this back to normal, the data is unreadable. You can fix this by adding some extra hardware (a transistor and a resistor is enough) or use a FTDI cable, which can be programmed to re-invert the data.

My Kaifa MA105 (DSMR4) meter spits the data out inverted, but my cheap eBay cable (with Winchiphead CH340) chips automatically re-inverts it back to a readable format.
I am not active on this forum anymore.
Nicap
Posts: 6
Joined: Sunday 14 December 2014 23:38
Target OS: Raspberry Pi / ODroid
Domoticz version: Latest B
Contact:

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

Post by Nicap »

Unfortunately i cannot send a PM on this forum yet. I will send you a DM on tweakers.net instead.

I have the same smart meter as you do, the Kaifa MA105.
kevyou
Posts: 1
Joined: Tuesday 03 March 2015 6:52
Target OS: Windows
Domoticz version:
Contact:

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

Post by kevyou »

Your post helped me a lot, but I didn't have the same parts as described here.
Here is my post of the pitfalls and solution I made that might help someone else like me ;-)
http://kevin--young.blogspot.cz/2015/03 ... -from.html
j0shua
Posts: 3
Joined: Sunday 29 March 2015 20:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by j0shua »

Hi Thinkpad, I am quite new to the whole smart metering business, and so is my 1 month old Smart Meter
that has been placed end of last February. Happens to be the same as yours. I have been reading about P1
cables all over the internet, but since you have the same meter as I do, I am willing to take you up on the offer
in your signature, as I want to go out and buy a Raspberry Pi myself, and start making data logs.

The forum however doesn't allow me to send you a PM, because I am new. So where do I go from here, I buy
a Pi, install the Domoticz SD image, and follow the Domoticz manual to get the internals running, then plug in
your cable and out come the graphs? Because that's not quite clear yet, the interval of the graphs, how tight
can it be set?

And last but not least, how decent is your (confirmed working) cable, compared to the 'neat' USB solution
(1st cable, 18,60 euro) available on the webshop here: http://www.smartmeterdashboard.nl/webshop
of which I don't have confirmation that it will work with a Pi and Domoticz ? I just want a better view of my
energy flow during the day, evening, and night.
ThinkPad
Posts: 890
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

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

Post by ThinkPad »

I have sent you a PM ;)

My cable looks exact the same, only uses a different chip (PL2303).
I am not active on this forum anymore.
j0shua
Posts: 3
Joined: Sunday 29 March 2015 20:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by j0shua »

ThinkPad wrote:I have sent you a PM ;)
Ok, got your message, reply is on its way to you now.
Last edited by j0shua on Sunday 29 March 2015 21:22, edited 1 time in total.
ThinkPad
Posts: 890
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

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

Post by ThinkPad »

Should be fixed now, you are now in the normal users group (instead of newly registered) and should be able to PM.
I am not active on this forum anymore.
j0shua
Posts: 3
Joined: Sunday 29 March 2015 20:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by j0shua »

Just to report back, the cable arrived today and I finally got the RPi up and running without messing up the micro sd card, and the Kaifa is now spitting data in to my Domoticz dashboard. Thanks for your efforts ThinkPad. Much appreciated.
ThinkPad
Posts: 890
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

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

Post by ThinkPad »

Great :mrgreen:
Have fun on saving energy 8-)
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: DIY cheap USB-cable to read P1 port of Dutch smart meter

Post by bbqkees »

I can confirm the cables with the HL-340 IC automatically invert the data.
I used a FTDI version before but you need to reprogram them before use. This HL-340 one is much easier to use.
However, if you cannot solder yourself you should stick to a FTDI version or similar without a DB9 connector because you can cut the wires and connect the RJ11 plug without soldering.

I bought 2 of the HL-340 cables and they work just fine with the Landis/Gyr E350 with DSMR 4.0.
http://www.ebay.nl/itm/New-USB-to-RS232 ... 1395736651

They indeed need a 1K pull-up resistor between pin 2 and 5 of the RJ11 wiring for the E350 meter. Otherwise no data shows up on the serial interface.

What you need to do is get a RJ11 telephone cable (with all 4 pins wired) and cut it off.
Also remove the blue plastic and the plug from the DB9 side of the serial cable.
This reveals the pcb, on which you can solder the wires.

Image
Image

Plug it in the meter and the Pi and it will work fine.
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: DIY cheap USB-cable to read P1 port of Dutch smart meter

Post by peterprinsen »

Hi,

I am trying something similar as described in this topic and I am having some problems getting it to work. 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). As I wasn't getting any data I connected the smart meter to a windows pc on which I am running Bray's Terminal to see what's coming in on the COM port. I am attaching a screen shot of the terminal. As you can see some characters look like they could be ok but there are also many that aren't. Does anyone know what's going on? Do I need to modify the cable? Or am I using the terminal wrong?

Any hint would be appreciated.

Peter
Attachments
Terminal Screenshot
Terminal Screenshot
terminalScreenshot.png (90.81 KiB) Viewed 90165 times
ThinkPad
Posts: 890
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

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

Post by ThinkPad »

Hi, welcome to this forum (see you just registered)

Have you tried 115200 as baud rate. And maybe try 'putty' also
Could be the cable otherwise....
I am not active on this forum anymore.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests