Where does the RPI save received data from rfm12pi module?

As I understood, the radio module on the RPI shield is receiving data from emonTx station and just pull it through uart protocol (TX and RX ports). Where can I find the information about how it's made, because I'm developing a system which is supposed to work with the data received from the emonTx? Is it writing to the db using mysql? 

mharizanov's picture

Re: Where does the RPI save received data from rfm12pi module?

It outputs the raw byte data to serial and it it up to the next layer to process the data.

There are many ways to further process the data, 

emonhub being one of them: http://openenergymonitor.blogspot.com/2014/10/emonhub-installationupdate-replacing.html

The pre-build SD card image should get you going fairly fast: http://wiki.openenergymonitor.org/index.php?title=RFM12Pi_V2#RFM12Pi_V2_Setup

 

I personally use Node-RED for the business logic as most flexible, but then that is high-end geek stuff

 

 

alexlember's picture

Re: Where does the RPI save received data from rfm12pi module?

Thank you for your answer, but could you be more detailed?

I'm going to write some java server application on raspberry pi, which would take data received through serial interface and than send it to some client through Ethernet interface.

I see two ways to do it:

First one is to listen to the RX port and than parse row bits into correct values and send them, but I think it's pretty much complicated, I have no idea how to parse this date. 

Second variant - use emonhub as you recommended, but could you give an example od more detailed information how to use it?

Bill Thomson's picture

Re: Where does the RPI save received data from rfm12pi module?

It outputs the raw byte data to serial and it it up to the next layer to process the data.

Eh, ya lost me there, Martin...

alexlember's picture

Re: Where does the RPI save received data from rfm12pi module?

Anyway, the question is still opened

EricD's picture

Re: Where does the RPI save received data from rfm12pi module?

I'me getting towards the end of a project that monitors the power available from my solar panels and switches on a low power (1.5Kw) immersion heater when the power is there, and off again when it isn't. I can't do it continuously because I can only monitor pulses from my solar meter due to the installation wiring.

Anyway, I'm getting the raw data from the emonhub.log file.

Set loglevel = INFO

tail -1 emonhub.log

My last emonhub.log entry looks like:

2015-07-20 13:33:19,745 INFO emonCMS_local sending: http://localhost/emoncms/input/bulk.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y&data=[[1437395599.62,10,-252,24503,179,652,3]]&sentat=1437395599

The interesting items there are; 2015-07-20 13:33:19   and  -252,24503,179,652,3

I want the date: 2015-07-20 13:33:19, my real power: -252 and the solar power: 652

This bash script fragment does it:

emon_logfile=/var/log/emonhub/emonhub.log

lastentry=`tail -1 $emonlogfile`

realpower=`echo $lastentry | tr "," "\n" | sed -n 4p`
solarpower=`echo $lastentry | tr "," "\n" | sed -n 7p`
datetime=`echo $lastentry | tr "," "\n" | sed -n 1p`

Having fun,

 

 

Comment viewing options

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