RS232 input on Linux

Hello all,

completely new to Emoncms so please forgive me if I'm asking questions that have already been answered. I have searched :-)

I am using a Kaco Powador Solar PV Inverter which outputs on RS232. The RS232 is received by my apache webserver (Linux)

It produces an input stream like the example below -

17.11.2012 06:50:15 3 255.6 0.03 9 243.6 1.12 9 13
17.11.2012 06:50:25 3 255.6 0.03 8 243.6 1.11 8 13
17.11.2012 06:50:35 3 255.6 0.03 9 243.5 1.12 9 13
17.11.2012 06:50:45 3 255.6 0.03 7 243.3 1.11 7 13
17.11.2012 06:50:55 3 255.6 0.03 8 243.8 1.11 8 13

The format according to the manual is -

1 Placeholder
2 Daily running time
3 Operating state
4 Generator voltage in V
5 Generator current in A
6 Generator power in W
7 Line voltage in V
8 Line current, feed-in current in A
9 Power fed into the grid in W
10 Temperature of the unit in °C

Can anybody give me guidance on how I feed this data into emoncms?

Thanks,
Chris.

ukmoose's picture

Re: RS232 input on Linux

I'm guessing the RS232 is connect directly to the linux box, and the "input stream" you see is taken from your web browser window?

One way to approach this would be to read the RS232 port , reformat the data and the send it on the emoncms database.

There are guide on how to read the serial console online such as:

http://www.cyberciti.biz/hardware/5-linux-unix-commands-for-connecting-t...

Then also have a look at:

https://github.com/openenergymonitor/EmoncmsPythonLink  

and https://github.com/openenergymonitor/EmoncmsPythonLink/blob/master/pylink.py 

this script does effectively the same thing as you want to do taking data from an emonbase using a raspberry pi written in python, by reading the serial port and sending it on to emoncms

I'm guessing you will need to do some formatting in python to get it into the right format.  Python is fairly easy to pick up, but if you post the serial console line here I'm sure somepeople will help you (the webbrowser might reformat it hence the suggestion for the serial console line)

Hopefully this is enough to get you started? 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.