imrahil / OctoPrint-NavbarTemp

Plugin for OctoPrint - displays temperatures on navbar
GNU Affero General Public License v3.0
44 stars 50 forks source link

Navbar Temp not showing on raspberry pi 3b+ #81

Closed Jonijakob closed 3 years ago

Jonijakob commented 4 years ago

hi I am trying to check the SoC temperature on the raspberry pi 3b+ and it didn't show it Maybe because the Broadcom is BCM2837B0?

bepstein111 commented 4 years ago

Same here. Using /opt/vc/bin/vcgencmd measure_temp as the command works fine but adds an ugly temp= before the number. I'm not great with awk, but I think the following command is correct as it works in terminal, but not in Navbar: /opt/vc/bin/vcgencmd measure_temp | awk -F= '{printf("%d%s\n", $2, "°C")}' Not sure why I have to add the "°C" back in, but as I said, it works in terminal on the pi over ssh, but not when used as a command with this plugin.

BTW I'm using a Pi 4 4GB

rknobbe commented 4 years ago

Same here with Raspberry Pi 4

robertomilan commented 4 years ago

Rasperry Pi 4 1GB on OctoPrint 1.4.1/1.4.2, SoC not shown here too.

Anubisbe commented 4 years ago

same problem no more Soc temp after 1.4.2 release of octoprint and update of raspberry (Raps pi 4B) python2.7 try the fix ""if sys.platform.startswith("linux"):"" but no change

DodgeDeBoulet commented 4 years ago

I did a little digging in the source and believe I have located the issue. I've fixed it in my local installation and it appears to work for the Raspberry Pi 4.

Line 17 of ~/oprint/lib/python2.7/site-packages/octoprint_navbartemp/libs/sbc.py is:

    piSocTypes = (["BCM2708", "BCM2709", "BCM2835"])

And should be changed to:

    piSocTypes = (["BCM2708", "BCM2709", "BCM2835", "BCM2711"])

Line 104 is:

         self.temp_cmd = '/opt/vc/bin/vcgencmd measure_temp'

And may need to be changed to:

         self.temp_cmd = '/usr/bin/vcgencmd measure_temp'

The reason I say "may" is that vcgencmd exists in both locations and appears to produce the same output. I read another post on a related issue that indicated that the path may need to be updated, because changing it for that user fixed his/her issue.

ChaosBlades commented 4 years ago

Works for me on Pi4 and OctoPi 0.17.0

I only needed to add the new piSocType.

robertomilan commented 4 years ago

Works on Pi4 1GB OctoPi 0.17.0. Added piSocType only.

domhardt commented 3 years ago

Same problem here. Raspberry Pi 3B+, OctoPrint 1.4.2 running on OctoPi image, Navbar Temperature Plugin 0.14, Python 3

rippiedoos commented 3 years ago

My best guess is around line 40, as mentioned in #78 https://github.com/imrahil/OctoPrint-NavbarTemp/blob/0efd791a590b27b4ca281422be8395e6d1ff85a7/octoprint_navbartemp/__init__.py#L40

If you're running Python3, the SBC-code never get's called because of the undetected platform. I changed that line to:

if sys.platform.startswith('linux'):

And the SoC-temp get's displayed again.

LazeMSS commented 3 years ago

This is fixed in the current released version and should be closed :)