@TrystanLea I did notice that the defaults do not move all rotated files off /var/log. If another process is generating large files, they will be rotated hourly at maxsize 500 but rotated in place. Some systems keep quite a few files and do not always compress them.
Also I think a maxsize in a subsystem logrotate config will override this.
We did discuss this at length and I think the olddir should be a default so all rotated files are moved out.
At Releases Ā· openenergymonitor/emonpi Ā· GitHub the pre compiled of V2.9.0 latest.hex has a file size of 50,332 bytes, but if build from the source I end up with a file size of 52,005 bytes.
Great, does the build on your desktop work when uploaded to the emonpi board? I saw your previous reply before last edit regarding jeelib library version making a difference?
@TrystanLea Unfortunately notā¦ My post before was wrong. I hadnāt noticed that the firmware had failed to upload. When I tried again and the upload worked the RF nodes dropped of my network.
Iāve had an opportunity to do some more digging around on this and have found that the RF nodes do report data for about 60 seconds from the EmonPI firmware booting before any noise from the RF side of things stops.
Here is a capture of the serial output of the EmonPI from boot. The point in the output below where the last noise from the RF side was reported was 57 seconds.
So at this stage it appears that my firmware build was more sucessful than id originally thought, however I still dont understand why the RF side stops working, as I am building at this stage from an unmodified source.
Thanks for the update @adtyne. I will try and extended test next time im in the office to see if I can replicate. Im not sure what is going wrong Im afraid.
@TrystanLea Many Thanks, I am continuing to experiment, and have temporarily commented out the RFM reset which means my RF nodes continue to return data, obviously iām sure that the RFM reset is there for a good reason but this does seem to have narrowed things down quite significantly.
@borpin Thereās quite a lot of general noise on 433Mhz in my area that I just cant avoid as I am in a complex of nearly 600 apartments, you can see a constant chatter in the log I posted for the first 60 seconds after the EmonPI firmware boots. Once the firmware does a reset of the RFM_69 module everything stops.
Iāve tried commenting out the line in src.ino that actually performs the RFM_69 module reset, and this keeps the data coming in, however I know thatās not a solution as the module will eventually hangā¦
It would mean modifying and reloading the sketch that runs on the Atmel ATMega 328P, thatās the part of the emonPi that does the energy measurement and handles the incoming data from other measurement nodes.
@borpin Unfortunatley Iāve got 5 EmonTH (like) devices reporting back, and its those that I loose, which isnāt an option, I can live with occasional missing data, which I get using the pre-compiled 2.9.0 hex firmware. What I cant live with is the data from the RF nodes stopping after approx 60 seconds when using a self built version of what is supposedly the same source code. I havenāt started making the changes to the code that I wanted yet so genuinely donāt understand whats going on.
If I cant solve this iāll end up buying an EmonTX to do the power monitoring, so I can make the firmware changes I want there, and leave the EmonPi using itās default firmware so that my RF nodes keep working, but that feels like admitting defeat.
In the meantime Iāve done a build of the firmware against the very latest JeeLib, with the routine to reinitialise the RFM every 60 seconds commented out, as iāve seen comments on other forums stating that this workaround should no longer be required. Itās been stable for 2 hours so far using this firmware and weāll see how long it lasts.
@adtyne
I donāt get what youāre trying to do. The emonTHās normally send their data via the 433 MHz ISM band - it would appear that this is the case for you because I can see a few of the default NodeIDs appearing, or have you done things differently?
A possible hardware solution would be to change to the 868 MHz band, but that would mean some tricky desoldering to remove the RFM modules, and every device would need to be changed.
Trying to think on my feet here, it also might be worth looking into the āgroupā that we use. That wonāt prevent the āchatterā being picked up, but as I understand it, it works as a first-stage filter to screen out irrelevant traffic, so the āchatterā wonāt even leave the front end processor. A big advantage of that is itās only a software change.
The emonPi front end is a 2-channel version of the emonTx, and by default the emonTx sends its data to the emonPi by radio. Again, I canāt quite see what that would achieve.
Some while ago, I contacted JeeLabs to ask for advice on what they meant in their documentation by the need to call rf12_recvDone() āfrequentlyā, but I never received a reply. What I question is whether not calling rf12_recvDone() often enough was perceived as a need instead to do the reset.
@Robert.Wall
First things first with the default, pre compiled firmware everything is working and iāve never had problems with my RF nodes going offline, however I wanted to modify the EmonPI firmware to send additional power monitoring details (current, pfc) which are from what I can see calculated but not sent.
Whenever I build my own version of the firmware (including when no changes have been made to the source downloaded from github) the RF nodes stop reporting back when the RFM_69 is reinitialised after 60 seconds. Iāve proven itās at this point the RF nodes stop working by commenting out the line in the source that performs the RF reset.
Switching my energy monitoring to an EmonTX would let me modify the TX firmware, and leave the EmonPI on itās default firmware where the RF does not stop working.
I donāt believe that this is a noise issue in the RF domain, as although I will admit there is a lot of unrelated traffic that iām not interested in, itās never fallen over with the stock firmware.
OK, I see now. I misunderstood what your aims were.
@glyn.hudson has to be the one to explain that. Heās moved away from the well-proven Arduino IDE to using platformio, but my experience with that is well documented here.
Yes, realPower, apparentPower, powerFactor, Vrms & Irms are all calculated in emonLib, but only one or two of those are passed forwards to emonHub. Which depends on whether the a.c. voltage is available.
My feeling is that re-initialising the RFM every minute was a fudge to hide a deeper problem that was never resolved - my comment about JeeLabs could relate to that and in any case, a more exact definition would be useful. One thing Iāve got to point out is JeeLib doesnāt make use of the internal buffer in the RFM69CW, treating it instead as an RFM12B that had a buffer precisely one character wide, so unless the main processor can handle the data as itās received, there will be a problem. This is something Iām interested in as it has a significant bearing on our hope of making the emonPi ācontinuous monitoringā.
@adtyne, I recently was having some issues with a new firmware build (I think it was PICNIC) but to try and remove variables I installed the Arduino IDE on Windows and it was very painless - It is actually available in the MS Store!
It was indeed added as a temp fix against occasional rfm lockups. But there is something odd about that āfixā as reading the code it actually resets after the first 60s from power up and then every single main loop iteration after that because the last reset counter is never incremented so now minus 0 will always be greater than the 60000ms interval.
I found it difficult to believe this aggressive resetting wasnāt causing issues and pointed out this error on a couple of occasions, but Iāve never heard of any actual cases where it was an issue, perhaps the pre-compiled hex uses a specific combination of Libs and/or PIO compiles the code in a way that this doesnāt manifest as a problem.
@adtyne Instead of deleting the reset line, try adding a line to set last_rf_rest (note the typo) when the rfm is reset to see if that yields different results eg
if ((now - last_rf_rest) > RF_RESET_PERIOD) {
last_rf_rest = now;
rf12_initialize(nodeID, RF_freq, networkGroup); // Periodically reset RFM69CW to keep it alive :-(
}
I donāt personally run any FWās that have this rather crude 60s reset in as I have never had the issue with rfmās locking out, it isnāt an issue that effected everyone so you maybe ok to just remove the reset, perhaps this too is a quirk of PIO and or the pre-compiled hexās? We never got to the bottom of the lockups due to this āfixā being rolled out!