First task was figuring out how to read the data from this P1 communication port. We'll need some device that does the actual reading, preferably something small, since it has to be located in the meter cupboard. The Raspberry Pi was an obvious choice; it's a full-blown computer with the size of a deck of cards, which costs only 30 euro.
Next we'll need a cable that fits into the RJ11 socket and ideally plugs into one of the USB interfaces of the Pi. There's several tutorials on the internet that show you how to cobble together such a cable yourself, if you like soldering. I went for this ready-made P1 converter cable from www.smartmeterdashboard.nl, which works perfectly out-of-the-box.
In order to access and control the Pi once it's installed, it will have to be connected to the local network, either wired or wireless. I opted for a USB wifi dongle.... a tad oversized one, since it blocks 2 out of the 4 available USB connections. I'll start worrying about that when I need them.
The software
The software
I installed Raspbian on the Raspberry Pi, which is great if you're already totally familiar with Debian Linux. And then I followed these great guides from Embezon and Gejanssen to get it all configured.
Serial connections require several parameters in order to work correctly, or you'll only receive gibberish or nothing at all. The parameters for the P1 port are as follows:
Serial connections require several parameters in order to work correctly, or you'll only receive gibberish or nothing at all. The parameters for the P1 port are as follows:
Baud rate: | 9600 |
Data bits: | 7 |
Parity: | Even |
Stop bits: | 1 |
Also make sure the cable can handle an inverted signal (the 0's and 1's are swapped). According to this blogpost, the FTDI-chip based cables are programmable with a little utility. I didn't need this with my P1 converter cable.
We'll use the 'cu' command to test the serial connection; remember that the P1 port spits out information once every 10 seconds, so you may have to wait a little before the data appears.
It's plain text, awesome! We can already recognize some stuff in there, but let's dive deeper into this so-called P1 telegram in the next post.
No comments:
Post a Comment