Smartmeter connection 'Remote IP'

198 views
Skip to first unread message

Stefan Pluis

unread,
Feb 5, 2014, 4:27:42 PM2/5/14
to webso...@googlegroups.com
Hello,
Could someone tell me what the connection type 'Remote IP' in Websolarlog means?
I'm using a RPI and connect now with the smart meter with a P1->USB converter. A converter for P1 to Ethernet is currently available.
The Remote IP seems to me as a possibility for Ethernet connection between RPI and SmartMeter? 

Anyone an idea?

Gr, Stefan

Martin Diphoorn

unread,
Feb 16, 2014, 1:50:40 PM2/16/14
to webso...@googlegroups.com
Hi Stefan,

the smart meter remote is an script i have created.

It wil try to connect on the given ip and port. It expects the same output as the p1 off the smart meter gives. So just one telegram.

In websolarlog you will find an utils folder. That folder contains the file SmartMeterAgent.php
I used that to connect with websolarlog.

Everything should still be working however im not using it anymore.

Greetings,

Martin

Jacco Steffens

unread,
Apr 5, 2014, 5:40:10 AM4/5/14
to webso...@googlegroups.com
Hello Martin,

I have a P1 to Ethernet convertor and I'm trying to get the SmartMeterAgent.php script to work. I just add the ip address and port to the script but apparently that's not the way to go. This is what I get:

php SmartMeterAgent.php 10.0.0.103 8899
PHP Warning:  Specified serial port is not valid in /usr/share/nginx/www/sse/utils/php_serial.class.php on line 141
PHP Warning:  Unable to set the baud rate : the device is either not set or opened in /usr/share/nginx/www/sse/utils/php_serial.class.php on line 234
PHP Warning:  Unable to set parity : the device is either not set or opened in /usr/share/nginx/www/sse/utils/php_serial.class.php on line 288
PHP Warning:  Unable to set length of a character : the device is either not set or opened in /usr/share/nginx/www/sse/utils/php_serial.class.php on line 336
PHP Warning:  Unable to set the length of a stop bit : the device is either not set or opened in /usr/share/nginx/www/sse/utils/php_serial.class.php on line 377
PHP Warning:  Unable to set flow control mode : the device is either not set or opened in /usr/share/nginx/www/sse/utils/php_serial.class.php on line 422
PHP Warning:  The device must be set before to be open in /usr/share/nginx/www/sse/utils/php_serial.class.php on line 167

What I understand from these error messages is that the script is unable to translate the IP address and port to a serial port and consequently it's unable to communicate (duh...). Can you please tell me the correct syntax to execute this script with a Remote Smart Meter device?

Thanks,
Jacco


Martin Diphoorn

unread,
May 9, 2014, 3:50:55 PM5/9/14
to webso...@googlegroups.com
Jacco,

you need to set the right usb poort in the script.

It looks like this:
$smartMeter->start("/dev/ttyUSB0");

I don't know which port you have added.

And can you please tell which p1 to ethernet converter you are using?

Martin

Jacco Steffens

unread,
May 10, 2014, 4:43:34 AM5/10/14
to webso...@googlegroups.com
Hi Martin,

I think I may have misunderstood the option for a remote smart meter. I already solved it in another fashion. Let me explain my setup first. I don't use a Raspberry any longer because it locked up to often, presumably because of write issues to the SD card (I thought I read this somewhere here on the forum). |

I moved my WSL installation to a virtual Debian machine running on my ESX hostwhich is located on the other side of my house. This of course means you can no longer use the USB cable for reading out the P1 port, so I ordered a converter online (just google "P1-ETH V3 Converter Module" , it's the first hit).

I have a basic understanding of Linux and I found out pretty quickly that the WSL scripts do not support ip addresses for P1 readouts out of the box. I did read something about creating virtual ports that can connect to an IP address so I tried that and it worked.

This is what I had to add to my rc.local to get it to work:

socat pty,link=/dev/virtS1 tcp:10.0.0.103:8899 &

And I created a communication with this uri:
usr/bin/php /usr/share/nginx/www/kostal/utils/wslP1.php /dev/virtS0

I did have to change parity to None and Characterlength to 8 in the wslP1.php scrip because it returned some error on the default values.

It works like a charm now.

Cheers,
Jacco
Reply all
Reply to author
Forward
0 new messages