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

CPU temp now missing from Local Diagnostics Screen #485

Closed
WayneNebra opened this issue Feb 9, 2023 · 9 comments · Fixed by #522
Closed

CPU temp now missing from Local Diagnostics Screen #485

WayneNebra opened this issue Feb 9, 2023 · 9 comments · Fixed by #522

Comments

@WayneNebra
Copy link

CPU temp now missing from Local Diagnostics Screen

cpu temp

@shawaj
Copy link
Member

shawaj commented Feb 9, 2023

What fleet is this on @WayneNebra ?

I think this was a temporary issue that has been resolved.

And did it show on RockPi before?

@WayneNebra
Copy link
Author

Oh sorry I should of posted more details about fleets etc. Noticed on the SB fleet this morning, funnily enough it's now gone, also on my RockPi and Outdoor that's in "Testnet" how ever just checked the Indoor 915 and 868 RockPi fleet and it's still missing.

I can check some more fleets and report back if you like?

@shawaj
Copy link
Member

shawaj commented Feb 9, 2023

Could you share some links to some devices that have this issue on Balena, from different fleets/variants?

@WayneNebra
Copy link
Author

@shawaj
Copy link
Member

shawaj commented Feb 10, 2023

@robputt can you look at this when you can?

@shawaj
Copy link
Member

shawaj commented Mar 14, 2023

@WayneNebra @robputt is this fixed now? Can we close it?

@shawaj
Copy link
Member

shawaj commented Apr 7, 2023

https://psutil.readthedocs.io/en/latest/#psutil.sensors_temperatures

def get_device_metrics():
try:
temperature = psutil.sensors_temperatures()['cpu_thermal'][0].current
except Exception:
temperature = 0
return {
'cpu': psutil.cpu_percent(),
'memory_total': psutil.virtual_memory().total,
'memory_used': psutil.virtual_memory().used,
'disk_total': psutil.disk_usage('/').total,
'disk_used': psutil.disk_usage('/').used,
'temperature': temperature
}

@shawaj
Copy link
Member

shawaj commented Apr 8, 2023

RockPi seems to have soc-thermal for soc and gpu-thermal for gpu

@shawaj
Copy link
Member

shawaj commented Apr 8, 2023

RockPi:

root@nebra-2D845E:/opt# python3
Python 3.11.1 (main, Dec  8 2022, 10:14:58) [GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import psutil
>>> psutil.sensors_temperatures()
{'soc-thermal': [shwtemp(label='', current=43.333, high=0.00010499999999999999, critical=0.00010499999999999999)], 'gpu-thermal': [shwtemp(label='', current=43.888, high=None, critical=None)]}
>>> 

Raspi:

root@b9f3779ff641:/opt# python3
Python 3.11.1 (main, Dec  8 2022, 10:14:58) [GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import psutil
>>> psutil.sensors_temperatures()
{'cpu_thermal': [shwtemp(label='', current=50.634, high=None, critical=None)]}
>>> 

shawaj added a commit that referenced this issue Apr 8, 2023
temp missing on rockpi

Closes: #485
shawaj added a commit that referenced this issue Apr 10, 2023
As per https://psutil.readthedocs.io/en/latest/#psutil.virtual_memory the best way to calculate available and used memory is by using the "total" and "available" metrics.

Also see https://github.com/giampaolo/psutil/blob/master/scripts/meminfo.py

Related to #485 and #522
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants