ironsheep / RPi-Reporter-MQTT2HA-Daemon

Linux service to collect and transfer Raspberry Pi data via MQTT to Home Assistant (for RPi Monitoring)
GNU General Public License v3.0
460 stars 64 forks source link

Provide Temperature on Orange Pi Zero 2 #72

Closed jandamf closed 1 year ago

jandamf commented 1 year ago

Is your feature request related to a problem? Please describe. I installed this on a Raspberry Pi 4B (Bullseye) and it works great. So, I installed it also on an Orange Pi Zero 2. It works but doesn't display the correct Temperature. See attached file containing results from Raspberry Pi 4b and Orange Pi Zero 2.

After reviewing the data published when running in Verbose mode, it shows that the temperature reading is -1.0 I combed through the data from both the Raspberry Pi and the Orange Pi and noticed that the Raspberry pi is showing an entry for vcgencmd before the temperature readings are recorded correctly. However, this is absent on the Orange Pi.

I searched the web and discovered that the vcgencmd is proprietary to the firmware on the Raspberry pi. Would it be possible to make an update to support the Orange Pi so that temperature would be provided?

Describe the solution you'd like Modification to provide temperature value on Orange Pi Zero 2

Describe alternatives you've considered n.a.

Additional context n.a. Results from Raspberry Pi and Orange Pi - RPi-Reporter-MQTT2HA-Daemon - 1 28 2023.txt

bsimmo commented 1 year ago

My opinion, you should clone the project, add these (and maybe remove the Pi specific code) and rename it as a generic version. It would then work on most the other SBC and computers with debian distro. As there are other Pi specific parts in there.

Though if you go to line 787 with the temp file location and edit that to whatever you OS/OPi uses it should work for you.

ironsheep commented 1 year ago

I agree with @bsimmo in that this is for the Raspberry Pi and an Orange Pi is different hardware.

And for REF: https://github.com/ironsheep/Omega2-Reporter-MQTT2HA-Daemon is where I've done this for the Omega2 boards.

However, if you know of a means to get temperature (exactly which commands can be used?) I might be incentivized to add a means to specify the tool/script to be run for specific hardware if the output can be coerced into what the script is expecting.

Also, please let us know what OS you are using. (I'm seeing that Ubuntu and Debian distros are supported.)

Have you found a way to get the temperature?

ironsheep commented 1 year ago

I've adjusted the temperature read feature to use the proc data if present when the vcgencmd is not present on the system thanks to contributor @OasisOfChaos. This should fix the temp on the Orange Pi devices. Please let me know.

Changes committed. Will appear in v1.7.5 and later.

ironsheep commented 1 year ago

Changes committed and now avail. in v1.8.0 and later. (decided on larger release number)