Some days ago installe the module in my emonSD running in a Rpi2 following the instructions provided.
Installed swiftmailer and updated&Checked the database.
All seemed to work but I get the following warning:
Not enough days returned in data request
Warning: Cannot modify header information - headers already sent by (output started at /home/pi/emailreport/emailreport-module/emailreportgenerator.php:51) in /var/www/emoncms/index.php on line 265
Notice: Array to string conversion in /var/www/emoncms/index.php on line 266
Array
If I exectute the script “by hand”:
sudo php /home/pi/emailreport/weekly-cron.php
I get the following:
Sending energy update emails
Myemoncmsusername
Not enough days returned in data request
Myemoncmsusername
For the avoidance of doubt: I have more than 3 weeks of data on the selected feed.
Same feed works in emoncms.org despite I’m not getting the automatic email (But I get the ttest email…)
The line “Not enough days returned in data request” can be generated in 3 different places in the code so I cannot be 100% sure where it is tripping up. I have no idea why they would be identical messages and have submitted a PR to change 2 of the 3 messages.
Assuming you have 3wks data for both the solar and use feeds, I suspect this might be caused by the changes made to the core feed api’s. I do not know that for sure, but the code used to work and it it’s now possibly not returning the right number of days data, that is too coincidental to overlook.
Commented it. Did not work.
So uncommented it and tried the next thing (changing the 8 first to 7 and then to 6) did not work.
So changed it to 9 and yes… did it!
You are right the expected days is 8, ideally the fix should be that the feed api requests 1 day less data as the recent core changes mean one extra day is returned for the same api call. Changing the “8” to “9” basically just allows the data to be the wrong number of days rather than fixing it properly.
That’s why I had hoped removing the “+ 1 day” would have worked hence my question about whether you had tried it. Hopefully @TrystanLea or @emrys will see this or the issue you raised on the emailreport repo (I have since added link back to here)
Also worth noting that when the fix is added, your local changes will block the git pull update. You will need to undo those edits or just use git stash to pull in the updates.
thanks @Jujonet on emoncms.org it looks like there’s a difference between the result from the phptimeseries engine and phpfina, I see your using phptimeseries, I will investigate in closer detail.