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

[Debian Bookworm] ARM64 Nvidia Jetson Orin Nano TypeError: float() argument must be a string or a real number, not 'NoneType' #2477

Open
evgenypim opened this issue Dec 18, 2024 · 0 comments

Comments

@evgenypim
Copy link

evgenypim commented Dec 18, 2024

Summary

  • OS: Debian BookWorm
  • Architecture: ARM64
  • Psutil version: 6.1.0
  • Python version: Python 3.13.0
  • Type: core

Description

Recently I have moved my Supervised installation of Home Assistant to Nvidia Jetson Orin Nano. And HW System monitor integration failed to start due to this error in psutil

Unexpected error fetching System Monitor update coordinator data
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 379, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/systemmonitor/coordinator.py", line 130, in _async_update_data
_data = await self.hass.async_add_executor_job(self.update_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/systemmonitor/coordinator.py", line 210, in update_data
temps = self._psutil.sensors_temperatures()
File "/usr/local/lib/python3.13/site-packages/psutil/init.py", line 2295, in sensors_temperatures
rawdict = _psplatform.sensors_temperatures()
File "/usr/local/lib/python3.13/site-packages/psutil/_pslinux.py", line 1453, in sensors_temperatures
current = float(bcat(path)) / 1000.0
~~~~~^^^^^^^^^^^^
TypeError: float() argument must be a string or a real number, not 'NoneType'

It looks like on this board or kernel some of the thermal zones are unavailable:

sudo grep '' /sys/class/thermal/thermal_zone*/temp
/sys/class/thermal/thermal_zone0/temp:48375
grep: /sys/class/thermal/thermal_zone1/temp: Resource temporarily unavailable
grep: /sys/class/thermal/thermal_zone2/temp: Resource temporarily unavailable
grep: /sys/class/thermal/thermal_zone3/temp: Resource temporarily unavailable
grep: /sys/class/thermal/thermal_zone4/temp: Resource temporarily unavailable
/sys/class/thermal/thermal_zone5/temp:46593
/sys/class/thermal/thermal_zone6/temp:48218
/sys/class/thermal/thermal_zone7/temp:48312
/sys/class/thermal/thermal_zone8/temp:48375

This causes the bcat to return None at this line:
current = float(bcat(path)) / 1000.0
https://github.com/giampaolo/psutil/blob/master/psutil/_pslinux.py#L1453

As a fast fix, I have added ignore of TypeError at
https://github.com/giampaolo/psutil/blob/master/psutil/_pslinux.py#L1456 and it looks helped.

Another option is to test bcat return value for a None and skip the sensor in case of None.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant