question

cedrock avatar image
cedrock asked

Raspberry Pi 3B+ Heat (temperature)

Hi All

Just installed a raspberry Pi 3B+ with Venus GX Firmware as a gataway for my solar system on my boat.

It works pretty fine!

I used the official Pi3 Case for it.

I didn't install any heatsink or fan.

As it can get pretty warm in my boat, just wondering how the device can handle the temperature?

What happen if it would overheat? It will power down automaticly?

Is it nessesary to install a heatsink or fan or I'am good to go how it is right now?


Does anyone has some exprerience on that topic?


Many thanks

Raspberry Pitemperature
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

9 Answers
powerace avatar image
powerace answered ·

Hi cedrock,


I've same RPi running in my RV without heatsinks. It is mounted in the 7 inch screen housing which allows a little airflow. When the RV is parked in the sun it becomes easily over 40 degree Celsius inside. Until now i did not experience a heat probleem with the RPI but it is well possible that the processor slows down its clockspeed although i cant really notice that using the gui. Ultimately i expect that the system simply locks up when it becomes to hot.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

cedrock avatar image
cedrock answered ·

Hi Power Ace

I could monitor the System now for a Week on the Lake with high outside temperature.

I agree with you. Couldn't notice any issues so far.


Thank you for your answer

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

bradfordharley avatar image
bradfordharley answered ·

I am on the hard in mexico and it's regularly 100 f in the boat. The 3b+ is fine within an enclosure. You can view/monitor the temperature by looking at /sys/devices/virtual/thermal/thermal_zone0#. It's in C and divide by 1000. I also have a rpi4 onboard serving a different function, and it does need a fan..


5 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

laurenceh avatar image laurenceh commented ·

Thanks for reminding me where to find the CPU temperature. I’ll write a dbus interface for it and being a temperature it will be visible to the VRM. I’ll post a link to the results here.

0 Likes 0 ·
laurenceh avatar image laurenceh commented ·

Well that went well:

I updated my temperature dbus service to include CPU temperature so it's now visible on the VRM and console.

I also checked the Rasberry pi advice and any CPU temperature below 80°C is fine. My Rasberry pi is in a 7" touch screen case with an analogue board attached.

If anyone would like the code I'll extract it form my other services and post it.

0 Likes 0 ·
kurtinge avatar image kurtinge laurenceh commented ·

Hi!

Great feature. Could you please share the configurations needed to accomplish this?


regards


0 Likes 0 ·
Kevin Windrem avatar image Kevin Windrem laurenceh commented ·

Please put your Venus mods up on GitHub. Links here tend to get buried.

Thanks.

0 Likes 0 ·
laurenceh avatar image laurenceh Kevin Windrem commented ·

I’ll see what I can do over the weekend I am away from my narrowboat at the moment.


I’m not used to GitHub so may need to set up an account and work out how to use it.

0 Likes 0 ·
laurenceh avatar image
laurenceh answered ·

Right all posted to GitHub - as I'm away from my boat at the moment and did not want to break anything in the code I have left in a lot of code (just commented it out) so you get free extras:

  • How to read data from I2c and publish it to DBus
  • How to read data from extra adc inputs
  • How to interface to the Victron persistent setting interface

(so that you can store names, offsets and slopes for extra devices)

39 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

powerace avatar image powerace commented ·

Thanks for sharing @laurenceh , i tried to find it on Github but could't. Do you have a link for me?

0 Likes 0 ·
laurenceh avatar image laurenceh powerace commented ·

Still getting to grips with GitHub I think I have made this under my own account it should be open for public reading.

https://github.com/LHardwick-git/Victron-Service

laurence

0 Likes 0 ·
powerace avatar image powerace laurenceh commented ·

Yes, now i found it. Will have a look and see if i can install it on my rpi3+ somewhere coming days.

0 Likes 0 ·
Show more comments
dirkmuc avatar image dirkmuc commented ·

Hello,

I just installed the addon to read the CPU temperature. Installation was easy thanks to the great tutorial from Laurence.

It directly integrates into the system (Venus Screen, VRM and Node-Red)

Next step is to use the code to integrate some BME280 Sensors. Hope I can manage it.

Thanks again for the great work!

Cheers

Dirk

vrm-cpu-temp.jpg

node-red-cpu-temp.jpg

venus-os-screen.jpg

0 Likes 0 ·
venus-os-screen.jpg (40.0 KiB)
vrm-cpu-temp.jpg (23.0 KiB)
vrm-cpu-temp.jpg (23.0 KiB)
kurtinge avatar image kurtinge dirkmuc commented ·

Looking forward to test this as well..... Also I am wondere how to get the tank levels into the gui as well. I have water and diesel, but not the waste tank. Is there a way to use the existing level sensors in the diesel and water tank? When it comes to the waste tank I am trying to figure out what I need besides of those: https://www.aliexpress.com/item/33041900609.html

0 Likes 0 ·
laurenceh avatar image laurenceh dirkmuc commented ·

BME280 appears to be i2c - you will need to add to config.txt.

Here is a line from my config shell script.

echo 'dtparam=i2c_arm=on' >> /u-boot/config.txt

You will need to add a new device class to the i2c.py lib to read the right registers of the BME280 as the device address and registers are different from the AM2320.

Good luck, I'm interested to hear how you get on.


0 Likes 0 ·
dirkmuc avatar image dirkmuc laurenceh commented ·

Yes the BME280 is an i2c sensor. I use this sensor in my esp32 projects and there integration is not an issue thanks to exzellent libaries.

I will keep you updated.

Thanks again for your effort!

0 Likes 0 ·
mehlers avatar image mehlers dirkmuc commented ·

Hi dirkmuc - have you managed to get your BME280 working....struggling with my limited knowledge....Best Mischa

0 Likes 0 ·
Show more comments

Took me a bit to get it running on a Pi4. Had to make /service/dbus-i2c/run executable.

Thanks for your effort!

0 Likes 0 ·
kurtinge avatar image kurtinge commented ·

@LaurenceH Hi, after upgrading til 2.66 this seems not to work anymore. I understand a upgrade will delete this hack so I installed it again according to your instructions, but still can't see it working... Did you verify it on the 2.66 ?

Kurt

0 Likes 0 ·
laurenceh avatar image laurenceh kurtinge commented ·

I have just installed a fresh 2.66 test system today, I have the core dbus-i2c code working without problem (returning Rpi CPU temperature). Analogue interface is also working. I don’t have any i2c devices on my bench right now. I was going to try interfacing some 1Wire devices using owfs.

Can you explain what is not working? Have you checked the log files in /var/log/dbus-i2c for any clues?

If dbus-i2c is not running, you can run it from the command line and see what it reports on the terminal.

Laurence



0 Likes 0 ·
kurtinge avatar image kurtinge laurenceh commented ·

Hmmm..... .strange. I have done upgrading earlier without problems so I was thinking there where something with that particular version. I did review the files, rights and executables and so on - so I don't know. I am not at the boat now, but will take a look at the logs as I do not remember the content except it did not make sense to my limited knowledge :-)

I am in the situation to look at forwarding shh through the router, but from a security perspective I do not like the idea... so, then I have to wait :-|


I'll come back to you later on.......

0 Likes 0 ·
Kevin Windrem avatar image Kevin Windrem kurtinge commented ·

I just installed this on an RPI 4 running v2.70~6 and it came right up.

If you are hand installing this, make sure the run files are executable or the service won't run.

0 Likes 0 ·
Show more comments
kurtinge avatar image
kurtinge answered ·

Thanks alot, @laurenceh !! Easy implementation. Really appreciate it. At the moment it is winter here so it stays at 44C. Theis feature will be very nice when summer is coming. The RPi is at the moment mounted in the same room as both the charger and the MPPT which is also neighbour room of the engine room. My guess is that this compartment will be quite warm if I go by engine for hours. Again, thanx alot !!!

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

bleydh avatar image
bleydh answered ·

Hi @LaurenceH ( @Kevin Windrem ) - I switched over from v2.70 to v2.80 large and for some reason I don't get it to work. It worked out of the box for me in v2.70, though in v2.80 the process just doesn't run. I'm using a RPi4 v1.2 4GB.

The temp is available /sys/devices/virtual/thermal/thermal_zone0/temp... I also tried to start dbus-i2c.py directly, though it complains about indentation errors etc.

I read elsewhere that the service needs to run now under /opt/victronenergy/service/dbus-i2c rather than /service/dbus- i2c - is that correct for v2.80 large?

The RPI cpu temp was only meant as a stepping stone, as I got the BME280 sensor, which I mainly wanted to get to work.

Many thanks,
B

18 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

laurenceh avatar image laurenceh commented ·

@Bleydh the indentation errors are indicative of Perl problems and I know the Perl version has changed so I may need to refactor the code for Perl 3. I am just finishing my summer narrowboat vacation so will be back in my home office from next week and looking forward to bringing all my code up to dat with Venus OS versions for myself and others. Thanks for the heads up.

Laurence

0 Likes 0 ·
bleydh avatar image bleydh laurenceh commented ·
Hi @LaurenceH - thanks for the quick reply and looking into it - once you've got the time. I'm also interested in the BME280 solution, if for any reason, that's on your radar as well.


Many thanks,
B

0 Likes 0 ·
lennycb avatar image lennycb laurenceh commented ·

@LaurenceH hello, could you "rebuild" something here? I would like to continue using it >v2.80. Thanks very much!

0 Likes 0 ·
laurenceh avatar image laurenceh lennycb commented ·
Hi Lenny

I've been a bit busy with other things. I have noticed your post and confirm that will try to get started on the work to fix this.

0 Likes 0 ·
lennycb avatar image lennycb laurenceh commented ·

@LaurenceH ah, great. I've already "adjusted" something here, as this was necessary when the Python version was changed. Please see if there is enough or if something is still missing. PS: Python is not my learned script language.

I have marked the changes with # ------------- in the file.

I also corrected tab errors and "indentations". No idea why this is important from version 3 onwards.

Just look at it :-)

dbus-i2c.zip

0 Likes 0 ·
dbus-i2c.zip (5.0 KiB)
Kevin Windrem avatar image Kevin Windrem lennycb commented ·

I made some tweaks to the code that allows it to run in both python 2 and 3:

dbus-i2c.py.zip

0 Likes 0 ·
dbus-i2cpy.zip (5.5 KiB)
Kevin Windrem avatar image Kevin Windrem lennycb commented ·

And one more tweak to make temp relays work (dbus service names can't include a dash (-)

dbus-i2c.py.zip

0 Likes 0 ·
dbus-i2cpy.zip (5.6 KiB)
crownroyal avatar image crownroyal laurenceh commented ·
@LaurenceH Would be nice if you accept the opened pull requests by kind contributors on github in order to make your code base compatible for 2.80+.
0 Likes 0 ·
laurenceh avatar image laurenceh crownroyal commented ·
Done
0 Likes 0 ·
johnny-brusevold avatar image johnny-brusevold commented ·


Tested this on v2.80-21-lage-23

Works fine without any modification in the files.


Has two problems

The first is the softlink to /service/dbus-i2c disappears after a reboot, since the service folder is read-only. Fixed by creating a softlink by mounting the memory chip on a linux machine.


The second problem is by entering dtoverlay=w1-gpio.dtbo in /u-boot/config.txt it only flashes in the temperature reading in Remote Console so fast that it is not readable.


modprobe -r w1-therm w1-gpio fixes the problem and everything is fine.


If I do not use dtoverlay=w1-gpio, but only run modprobe w1-therm w1-gpio after reboot everything is fine too


EDIT

The symlink became problematic since I also had to add this on some more installations with v2.80-21-lage-23 (rpi 3b +)

This worked fine for me

nano /etc/init.d/w1-wirestart.sh
#! /bin/sh
ln -s /opt/victronenergy/dbus-i2c/service /service/dbus-i2c
modprobe -r w1-therm w1-gpio


update-rc.d w1-wirestart.sh defaults
0 Likes 0 ·
Kevin Windrem avatar image Kevin Windrem johnny-brusevold commented ·
Your issue with the service is that as of v2.80~10, the root FS is read only and the services are handled as a file system overlay from /opt/victronenergy/service. Symlinks are no longer used. You need to COPY the service directory there. Then it will survive a reboot.


There are more details in the community post for the v2.80~10/11 release.

0 Likes 0 ·
johnny-brusevold avatar image johnny-brusevold Kevin Windrem commented ·

@Kevin Windrem

Thanks! it worked excellently


0 Likes 0 ·
ralph avatar image ralph johnny-brusevold commented ·

Hi everybody.

I'm not quite sure that my knowledge on programming is enough, but I´m not able to run the service on my Rpi3+ under v2.80~36 with BME 280 sensor(s). At first wich files including the latest dbus-i2c.py-file from here should i copy where?Maybe a short manual helps me to install and run the service on my system.

Reading all posts on here makes me more confused than it helps me, sorry for that.

Thanks in advance

0 Likes 0 ·
johnny-brusevold avatar image johnny-brusevold ralph commented ·

@Ralph

I use the dbus-i2c.py file that is posted over here in a zip file, as well as downloaded rest of the files from here

https://github.com/LHardwick-git/Victron-Service/tree/main/dbus-i2c

follow the instructions from readme

https://github.com/LHardwick-git/Victron-Service

Except the following point 3.

create a symlink from /service/dbus-i2c to /opt/victronenergy/dbus-i2c/service
ln -s /opt/victronenergy/dbus-i2c/service /service/dbus-i2c

should be

mkdir /opt/service/dbus-i2c
cp -r /opt/victronenergy/dbus-i2c/service/* /opt/service/dbus-i2c/


0 Likes 0 ·
olafd avatar image olafd johnny-brusevold commented ·

Hi


this Service is running:

https://github.com/LHardwick-git/Victron-Service


The cpu-Temp is displayed well but no Temp from a 1-Wire-Sensor!


The 1-Wire-Sensor is on raspis GPIO4 <— is that right?


Should something started additionally?


How do I get a identifierID of the 1-Wire-Sensor?


Is there a description for Venus OS and 1-Wire somewere ?


Could someone give me some hints with 1-Wire-Sensors please?


Thanks


Hardware: Raspberry 3B+

Software: VenusOS-2.8.2-Large

0 Likes 0 ·
johnny-brusevold avatar image johnny-brusevold olafd commented ·

Hi, @OlafD

I have asked the same question here in the forum myself, without receiving any answer.

Guess it's as you mention for a 1 wire sensor

temp-sensor1.png

temp-sensor2.png


0 Likes 0 ·
temp-sensor1.png (64.4 KiB)
temp-sensor2.png (44.4 KiB)
olafd avatar image olafd johnny-brusevold commented ·

Hi @Johnny Brusevold


one 1WireSensor is working now.

2022-02-1wire-temp.png

2022-02-1wire-info.png

Changes for that:

1. Copy this overlay to /u-boot/overlays/

https://drive.google.com/file/d/1CNDbKNRkZoLnMI109RHzxa6OIOvYGT4Z/view?usp=sharing


source:

https://community.victronenergy.com/questions/81215/connecting-1-wire-sensors-ds18b20-to-venus-os-on-a-1.html


add this to /u-boot/config.txt, for [all] at EndOfFile:

# 1-Wire Temperatursensor, Daten an Pin 4
dtoverlay=w1-gpio,gpiopin=4

and

chmod a+x /u-boot/overlays/w1-gpio.dtbo


2. Find the 1WireID (28-xxxxxxxxxxxx)

ls /sys/bus/w1/devices/
28-0123456789ab  w1_bus_master1


3. Add this to /opt/victronenergy/dbus-i2c/dbus-i2c.py and restart.

...
#update W1 temp
def update_W1():
...
-        ###sensor = W1ThermSensor()
-        ###temperature_in_celsius = sensor.get_temperature()
-        ###value =  temperature_in_celsius
+        fd  = open('/sys/bus/w1/devices/28-0123456789ab/hwmon/hwmon1/temp1_input','r')
+        value = float(fd.read())
+        value = round(value / 1000.0, 1)
        dbusservice['W1-temp']['/Temperature'] = value
+        fd.close


Caution:

If there is no 1WireSensor connected, the Temp reading flashes.


Hope that helps.

0 Likes 0 ·
johnny-brusevold avatar image johnny-brusevold olafd commented ·

@OlafD

Thank you for sharing well-detailed information

0 Likes 0 ·
mrhappy avatar image
mrhappy answered ·

Just a tip for node-red, for those who want a solution that does not include the mods in this thread. Using the "file in" node to read the contents of the temp sensor file in the linux file system of the raspberry Pi. The output of the node needs to be divided by 1000.

screenshot-2022-05-14-091037.png

screenshot-2022-05-14-090933.png


2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

vrm avatar image
vrm answered ·

Thanks for this great work. I will try it out immediately as it helps me reduce my RV by one extra Raspberry ;-)

NooB-question: This mod will disappear as soon as I update the firmware, right? Is there a chance to make it survive on the data-partition somehow?

3 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

kurtinge avatar image kurtinge commented ·
yes it will unfortunatly be gone after update. If I do not remember wrong I thin @LaurenceH wrote somthing that did it easier, but not sure. Anyway - the implementation is quite easy after you have done it once so you might just do it manually. Also I realized that the temparature did not got very high so I have skipped it here and there
0 Likes 0 ·
laurenceh avatar image laurenceh kurtinge commented ·

Hi @kurtinge

I’m in the process of re writing all my services. I have some new ones to add and putting them all into one file is getting silly. I have now it un the pipeline:

  • The cpu temperature
  • I2c services temperature, humidity and analogue including analogue voltage tank sensors.
  • 1-wire temperature and relays
  • An engine run time counter
  • A remote service to read other files via json.

Have a look at my Git hub for victron dbus services. I have not posted everything yet as I’m checking against 2.87 and 2.89 as I go.

To answer a question there are differences between 2.87 and 2.89 about how you get services to run and to re-install them after a firmware update. 2.87 need services to be added to /opt/victron energy/service but it is more difficult/complicated on 2.89. Apparently /data is safe for upgrades and scripts will need to be run to re-install the mods after an upgrade.



1 Like 1 ·
kurtinge avatar image kurtinge laurenceh commented ·

How is the implementation of analogue voltage tank sensors? Do I need a addon card? It would be great to have this implemented

0 Likes 0 ·
rikkert-rs avatar image
rikkert-rs answered ·

Hello for everyone who is still interested in 1 Wire Sensors in Venus OS, I have a first version of t the Repo from LHardwick converted in an Setup Helper Package from Kevin Windrem

https://github.com/Rikkert-RS/VenusOS-TemperatureService

1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

laurenceh avatar image laurenceh commented ·

@Rikkert-RS

This looks great thanks, I look forward to using it.

I had not quite got to grips with Kevin's setup tool.

Laurence

0 Likes 0 ·

Related Resources

Additional resources still need to be added for this topic

Raspberry Pi running Victron’s Venus firmware - Blog Post

Venus OS Large image: Signal K and Node-RED - Install

raspberrypi install venus image


Additional resources still need to be added for this topic