-
-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rpi: High CPU usage with interval: 5 #74
Comments
how did you read the CPU usage? In general the ESP8266 will never become a battery powered MCU. More interesting than the CPU usage will be the view from a scheduler, how the functions are aligned together. |
@lumapu IMHO this is for the python version under Raspberry Pi @Sprinterfreak may know some more details too?
|
@stefan123t python does not use interrupts. Does not make sense because everything is synchronous in current transactions. I can confirm the usage around ~12% single core on a pi 2b using TMRh20's RF24 lib. I guess thats coming from the relatively high receive buffer poll rate and channel hopping frequency in the receive loop. This could be even sightly higher if the RF24 module ist not configured to use bcm hardware acceleration for spi. Bad news so far, I am currently in lack of time and being in the middle of the process, rewriting the code to support circuitpython's rf24l01 library, as this is purely pip installable. Also transforming the transaction handlers to support MI transactions. circuitpython's rf24l01 on my dut does bump up the cpu usage even up to 20% single core. I don't think it will go down in the meantime and that is also not at the very top of my priority list. I'm fine with my pi idling around 5% total cpu usage. Optimizations eventually come, after the protocol is well understood and settled. I don't want to waste much time on tweaking code which eventually has to be replaced again because of new discoveries. |
Thank for the feedback guys, and yes I meant the Raspberry PI 4 CPU. I only have 1 HM-800 inverter, not 5 :) My assumption was just that the high CPU usage is something trivial in the code of this project. Since I run multiple other services on this RPI, the CPU usage is noticable, but it's not dramatic. Thanks for all your effort! This is really a great thing for people that don't want to use an additional power metering wall plug and being independent from stupid manufacturer cloud services (yes pointing at you Hoymiles). |
Yes, maybe a safe / fool proof default minimum would be well above 30-60 seconds. Having it poll every 300-900 seconds (5-15 minutes) would be reasonable as you store and discard/rotate your data later anyway. |
I've now increased the interval to 15 seconds and the CPU usage seems to be acceptable now, thanks. |
@stefan123t just, no. That would mean to have poor quality data, You have to interpolate to get readable graphs out of. If I set an interval, I need that interval for every measurement. Interval is not to confuse with delay. What I did see tho is, there is continuous querying configured in the ahoy.yml template (interval: 0) which could be set to like 10 seconds. But leave it up to users how they require their data. I will change the template soon. |
@Sprinterfreak I dunno maybe we could use the 0x15 or 0x09 command to query the inverters internal history. Maybe we can use the sync-time to get old data from the inverter too ? Sub Command byte[10]
Gap (Collection interval time) byte[19]
|
Hallo,
I'm running the rpi tool with NRF24L01+ and HM-800 inverter.
You guys really did a great job and I'm forwarding a lot of data to my InfluxDB and displaying it in my Openhab.
However there is one thing I've noticed, the CPU usage is always quite high, around 12%. Well it's not ridiculous high, but still I wonder if this can be optimized somehow? Since all this tool does is sending and receiving data and forwarding it.
Danke! 👍
The text was updated successfully, but these errors were encountered: