Skip to content
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

Feature Request: Raspberry Pi Performance Specs #20

Closed
SrgntBallistic opened this issue Sep 16, 2019 · 15 comments
Closed

Feature Request: Raspberry Pi Performance Specs #20

SrgntBallistic opened this issue Sep 16, 2019 · 15 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@SrgntBallistic
Copy link

I've been pretty surprised to see that there's no active plugins to view a Raspberry Pi (or other machine) system performance specs. Like CPU Temp/Speed/Utilization, Ram Utilization, Storage, Etc...

This would be particularly useful for Pi's. I've been using Octolapse and playing around with using a Wyze Cam as a camera source. This along with the other many plugins has me concerned with the Pi throttling and impacting prints.

I started designing/wireframing a possible tab to show these specs and... Voila your plugin popped up. Seems like it might be more worthwhile to try and add this to your plugin than make it a standalone plugin.

There's an older plugin that doesn't seem to work anymore. I was going to use this as a starting point:
https://github.com/myersCody/OctoPrint-Cpustatus

Looks like they were basically writing the results of psutil to a text file and reading that into the UI.

cpuUsage = psutil.cpu_percent(interval=1) testFile = open("test.txt", "w") testFile.write(cpuUsage) testFile.close()

I believe the author of that plugin pull some code from NavBarTemp. Looking at that he has a class for getting the system temp for different types of systems including Raspberry Pi's.

https://github.com/imrahil/OctoPrint-NavbarTemp/blob/master/octoprint_navbartemp/libs/sbc.py

@StefanCohen
Copy link
Collaborator

That sounds interesting and would be a nice fit I think. Would you like to collaborate on that?

@StefanCohen StefanCohen self-assigned this Sep 16, 2019
@StefanCohen StefanCohen added the enhancement New feature or request label Sep 16, 2019
@SrgntBallistic
Copy link
Author

That sounds interesting and would be a nice fit I think. Would you like to collaborate on that?

Quite possibly. I've never worked on an OctoPrint Plugin or contributed to a github for that matter. But I think I have the capacity to do so.

What would you recommend to do to start?

@StefanCohen
Copy link
Collaborator

StefanCohen commented Sep 16, 2019

Quite possibly. I've never worked on an OctoPrint Plugin or contributed to a github for that matter.

That makes two of us :)

I looked at psutil. It should be possible to include it in the plugin and have it installed at the same time using the plugin manager. I don't see why it would be necesary to write it to file unless you want time graphs.

What metrics would you like to include? Given the grid-based layout of the dasboard, I'm thinking multiples of three. Something like: CPU usage, Mem usage, Disk Usage.
After that: CPU Temp, Load, ???

Can you upload a wireframe of what you had in mind?

I'll play with psutil to see how it works in the meantime.

@StefanCohen
Copy link
Collaborator

Getting the CPU, MEM and HD/SD info via psutil was easy:
Screenshot 2019-09-16 at 15 30 50

Is this similar to what you had in mind?

@StefanCohen StefanCohen added this to the 1.1.2 milestone Sep 16, 2019
@SrgntBallistic
Copy link
Author

That's a pretty good turn around! Hahah. That's pretty much exactly what I had imaged and started writing up. I had names written out instead of icons but those seem perfect. Temp is really the only thing I can think of that would be useful at the moment. I'm sure the community might be able to suggest some others to keep the 3 column grid going.

You Rock!

@StefanCohen
Copy link
Collaborator

I added the CPU temp. That may unfortunately not work on anything other than an RPi as the sensor ID is hardcoded for now. I'll see if I can address that before the next release.
Screenshot 2019-09-16 at 21 51 49

@StefanCohen
Copy link
Collaborator

Fixed in 1.2.0

@vbz89
Copy link

vbz89 commented Sep 27, 2019

Does this work for any RPi? I have a RPi 3B and I get "0" Values for all 3 parameters.

image

@StefanCohen
Copy link
Collaborator

It should work on any RPi and it does work on my 3b and 3b+. Are you on OctopPi? What version in that case?

it looks like psutil doesn't return anything.

What happens if you try the following from a terminal:
source ~/oprint/bin/activate
python
>>>import psutil
>>>psutil.virtual_memory().percent

@vbz89
Copy link

vbz89 commented Oct 1, 2019

Sorry for the late reply, I am using octopi 0.14.0, octoprint 1.3.11

The above commands gave me "32.2"

@StefanCohen
Copy link
Collaborator

Ok. That means that psUtil is at least available. I wonder if there may be a difference between OctoPi 1.14 and 1.16 that I use? Do you have the possibility to try a later version?

@vbz89
Copy link

vbz89 commented Oct 1, 2019

I will take a backup image of my sd card and try a fresh installation tomorrow and get back to you on the results on 0.16. I appreciate the quick response. Thanks.

@vbz89
Copy link

vbz89 commented Oct 2, 2019

I tried today on a clean install of 0.16, it is working correctly. So I guess it's a problem with 0.14. Time to shift all my data to a new installation I guess.

@StefanCohen
Copy link
Collaborator

Ok. Good to know. I will set a minimum version in the installer

@o5
Copy link

o5 commented Sep 20, 2020

I've installed this plugin and enabled "Show RPi System Info" and it does not work :/

Screenshot 2020-09-20 at 20 27 57

Dashboard 1.14.0
OctoPrint 1.4.2
Python 3.7.3
Raspbian 5.4.51-v7l+ #1333
Raspberry Pi 4 Model B Rev 1.1

I tried to install psutil using pip and it looks work

pi@raspberrypi:~ $ python3
Python 3.7.3 (default, Jul 25 2020, 13:03:44)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import psutil
>>> psutil.virtual_memory().percent
14.7
>>>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants