nlef / moonraker-telegram-bot

Telegram bot to interact with Moonraker (Klipper Web API Server)
Creative Commons Zero v1.0 Universal
255 stars 65 forks source link

High CPU usage causes mcu shutdown timer too close #73

Closed ste94pz closed 2 years ago

ste94pz commented 2 years ago

Hi, I'm using the latest version of fluiddpi with fluidd, moonraker and klipper all updated on a Raspberry Pi Zero 2. The printer is an Eryone Thinker S with an ATmega2560 based motherboard. I've had no problems until I installed the Telegram bot. During prints, I see high cpu usage by the bot process, it uses completely one of the four cores of the raspy, causing the print to fail after some time for timer errors with the mcu. In fluidd, I see an average of host cpu usage over 1.00, that falls rapidly around 0.20 if I stop the bot. In the bot's config, I enabled the notifications during the print only every 25% of completion and I included the temperatures of hotend and bed, no camera, timelapse or other functions. Is the high cpu usage normal? I'm here to help to diagnose the problem, if you need. Thank you!

aka13-404 commented 2 years ago

Hello,

Sorry for the long reply time. Christmas, holidays, the usual. We are looking into cpu usage right now, should be way less in the coming update. I'll keep you posted when there is stuff for you to test. Sit tight ;)

1n9i9c7om commented 2 years ago

I've had the same issue when I tested this bot last weekend on a Raspberry Pi 3B - I have therefore resorted to using the other moonraker telegram bot, but I like this one better. I had the timelapse feature enabled - should a Pi 3 be capable of running timelapse recording while also running Klipper (& Fluidd)? Or is the high CPU usage still a general issue, unrelated to the timelapses?

I'd be also willing to help you test something if needed. :-)

aka13-404 commented 2 years ago

It depends. Normally, if you are printing and simply take pictures for the lapse, the cpu load should be negligible. Now, BUILDING the lapse takes a lot of ressources. Maybe your system is already on the brink of failing, and the bot is simply "the last drop"? How do the loads look for you without the bot?

ste94pz commented 2 years ago

It depends. Normally, if you are printing and simply take pictures for the lapse, the cpu load should be negligible.

Now, BUILDING the lapse takes a lot of ressources.

Maybe your system is already on the brink of failing, and the bot is simply "the last drop"? How do the loads look for you without the bot?

The load without the bot is very very low, I never had this problem before. As I said, I don't use the timelapse function, and I don't have a camera connected.

adawalli commented 2 years ago

Glad this issue isn't just me - the moment I enabled this plugin, every single print fails with the timer error (thankfully only at the very end or very beginning). I have a raspberry pi3b, and don't even yet have my webcam plugged in (although I did configure it with fluidd and tested to make sure it worked)

ste94pz commented 2 years ago

Glad this issue isn't just me - the moment I enabled this plugin, every single print fails with the timer error (thankfully only at the very end or very beginning). I have a raspberry pi3b, and don't even yet have my webcam plugged in (although I did configure it with fluidd and tested to make sure it worked)

Do you have this problem even with the latest bot update? I haven't tried yet if it's solved now.

adawalli commented 2 years ago

I installed for the first time last night (fresh install), but if something was released since then, I have not

ste94pz commented 2 years ago

I installed for the first time last night (fresh install), but if something was released since then, I have not

So the issue isn't solved in the latest version πŸ˜…

nlef commented 2 years ago

Glad this issue isn't just me - the moment I enabled this plugin, every single print fails with the timer error (thankfully only at the very end or very beginning). I have a raspberry pi3b, and don't even yet have my webcam plugged in (although I did configure it with fluidd and tested to make sure it worked)

Could you upload bot, klippy, moonraker logs? Bot is being tested on orangepi zero2, raspberypi 4 (4gb), raspberypi 3b+ (with cam & without). I'm confused and can't figure out why you're having problems

aka13-404 commented 2 years ago

I installed for the first time last night (fresh install), but if something was released since then, I have not

So the issue isn't solved in the latest version πŸ˜…

The thing is, we can't reproduce it, and by now we have about 1000 people using the bot, +-. Let's assume we have 10 times more people than in this ticket having the issues, that would be like 30 peope, or 3%.

I don't understand, what exactly eats the memory in your setup. Is it the bot itself?

ste94pz commented 2 years ago

I installed for the first time last night (fresh install), but if something was released since then, I have not

So the issue isn't solved in the latest version πŸ˜…

The thing is, we can't reproduce it, and by now we have about 1000 people using the bot, +-. Let's assume we have 10 times more people than in this ticket having the issues, that would be like 30 peope, or 3%.

I don't understand, what exactly eats the memory in your setup. Is it the bot itself?

Please, don't get it wrong, I wasn't complaining. Anyway, I'll gather some infos to investigate the issue, it’s been a while since the last time that I used the printer. Thank you for the interest πŸ’ͺ✌️

adawalli commented 2 years ago

ACK - let me re-enable the plugin and I will get you the info you asked for if the issue still exists

adawalli commented 2 years ago

I no longer have this issue - I think it may have been related to having a camera configured through my klipper ecosystem but not actually plugged in

aka13-404 commented 2 years ago

Alright, I'll close for now, reopen this if the issue reappears.