question

fenix avatar image
fenix asked

RaspberryPi command for voltage that feed the RaspberryPi

Hello

i am running the Victron on a RaspberryPI

two questions:

-Is there a command to see the temperature of the RaspberryPi board

-Is there a command to see the voltage and Amp that feed the RaspberryPi board

VRM
2 |3000

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

1 Answer
laurenceh avatar image
laurenceh answered ·

Knowing about Raspberry pi's, getting the Power supply voltage seems to be a little difficult.

However getting the CPU temperature is fairly straightforward:

#cat /sys/class/thermal/thermal_zone0/temp

returns the temperature in deg C x 100 so a script to sort out the maths would be:


#!/bin/bash
temp=$(</sys/class/thermal/thermal_zone0/temp)
echo "CPU => $((temp/1000))'C"

So relatively easy to add this to a d-bus service to make it available on the bus.


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.

fenix avatar image fenix commented ·

hello

i am new to this.. Could you tell me how to add it to the d-bus?

0 Likes 0 ·
laurenceh avatar image laurenceh fenix commented ·

Where I start depends on where you are starting from - and where you want to get to.

Do you know how to use nano to edit files, how to check the execute permissions on files, how to configure /data/rc.local to replace files when new versions of software are installed, do you understand python, how to create and check a soft directory link. etc. etc ? It is quite possible you do, and in which case my description can be simple, but if not then there is more learning/teaching to be done.

I suggest you have a look at my post about getting an i2c dbus service running, I just about have that working now. The script you need dummy_vedbus.py is linked to from that post you then need to:

  • Change the service name and paths that you will publish.
  • Modify the update function in the code to write the temperature to the dbus path.
  • Remove the call to the increase count function.
  • Follow pretty much what I have done to get the service linked in to start on reboot.
  • Debug you code and add stuff to make it recover when it hits an error.

As to where it might get to... even if the values are on the d-bus. They won’t be visible on the screen of the Venus console or on the VRM so what will you do with the values when they are available from d-bus?

0 Likes 0 ·
fenix avatar image fenix laurenceh commented ·

hello Laurence... tks you for your feedback.. i have some homework to do ;-)

A

0 Likes 0 ·