Emoncms bufferedwrite version not buffering?

Hello All,

I have been using Emoncms at home on my Raspberry Pi for a couple years and have been quite happy with it.

I have had SD card troubles at times, so the buffered-write approach which has been developed more recently appeals to me.  I just installed the latest emoncms bufferedwrite branch.  

I am updating my main power feed every 10 seconds from my EmonTx.  I selected PHPFINA as the engine type.  When I look at the data file the feed is stored in at ~/data/phpfina/2.dat, the timestamp updates every 10 seconds.

I expected that the file would be updated at a longer interval.  The doc at https://github.com/emoncms/emoncms/blob/bufferedwrite/readme.md shows a diagram that says "Writes to disc in buffered blocks at user defined interval: 60s, 5, 10, 30 mins".

Is there a way to set the amount of buffering?  Or maybe this isn't fully implemented yet.  Or maybe I am just confused and did something wrong.

Thanks for any insight anyone can give me.

-Ed

 

pb66's picture

Re: Emoncms bufferedwrite version not buffering?

I believe the buffered blocks are written to disc every 60 seconds although the datapoint frequency is user selectable when the feed is created, to suit the data feed. In your case the feed can change every 10secs so a FINA of 10 secs is ideal and those datapoints will be buffered and then written to disk every 60secs.

I think the interval is hardcoded in feedwriter.php, you could try editing it if you want to slow it down sme more, The tests Trystan did to arrive at a 60s default are documented here

Paul

edllew's picture

Re: Emoncms bufferedwrite version not buffering?

Thank you, Paul.

I was mistaken - the files were updated at 60 second intervals, as you say.

I tested modification of that interval, and indeed it does work to slow down the write interval in feedwriter.php.  I'll peruse the document you mention and think about why I might want to change the write interval from the default.

-Ed

Comment viewing options

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