question

edgargw22 avatar image
edgargw22 asked

Raspberry Pi Newbie & Python...

I have a new Pi 4 Model B Rev 1.4 32GB and would like to do some simple monitoring of my Victron devices with Python. I am a little confused because it looks like the first step is to create a Venus OS, but it looks like that turns my Pi into a CCGX, which I already have.

What libraries, firmware, setup, etc.. do I need to load onto my Pi to access Victron devices on my network?

Thanks.

Raspberry Pi
2 |3000

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

2 Answers
Kevin Windrem avatar image
Kevin Windrem answered ·

The CCGX works well for most systems but is limited on CPU power. Alternatives include Cerbo and a Raspberry PI running Venus OS. These are all considered a "Venus device". There are several methods of extracting data from Venus device. I don't know much about them but here's the list: MQTT, ModBus TCP, dbus via ssh.

You can also install the "large" version of Venus OS on any Venus device and gain access via Node Red and Signal-K.

You can also run programs on the Venus device and it's easy to set programs to run automatically at startup. The limitation is no direct user interface since the Venus GUI basically takes over the display.

Note that the v1.4 Raspberry PI 4 module currently will not boot Venus OS so it is recommended to run Venus on a Raspberry PI 3 for now.

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.

edgargw22 avatar image edgargw22 commented ·

Yes, it looks like my PI is a little too bleeding edge for Venos OS right now. I think I saw that v1.3 was working, but not with all memory amounts. What OS is the CCGX running on? I assume Linix.

0 Likes 0 ·
laurenceh avatar image
laurenceh answered ·

I have some experience of this:

Kevin is right about the installed interfaces but they do have limitations.

The most comprehensive access to what is going on under the hood of a ccgx is all the data which is available by what is known a d-bus. Basically d-bus is a comprehensive API and set of programs that provide the ability to read and modify almost anything that is going on or needs to be configured in the CCGX.

Hauling data out of d-bus is easy ( once you get the hang of it). If you have python experience it should be easy for you:

Python is already supported on the ccgx you can run python scripts so don’t thing python in you Rpi (yet). The ccgx is also running a web server and python can easily be enabled to run python scripted ( you need to uncomment one line in /etc/hiawatha/hiawatha.conf). Once you have python being served basically as a CGI then you can return anything to your pi in an http response.

I have written interfaces to basically run as a REST server returning content encoded as json. Which is then processed in the client using JavaScript if you're familiar with the concept.

Have a look through some of my articles in this forum to see what can be done.

You could start here.

https://community.victronenergy.com/articles/48977/simple-jsonrestajax-interface-to-venus-d-bus-writt.html


Laurence

2 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.

edgargw22 avatar image edgargw22 commented ·

Excellent information - thanks for posting your article. Good news about the API interface; any documentation? For coding questions like this, are we in the right forum? Is the "Raspberry Pi" topic the best one to use for questions like this?

0 Likes 0 ·
laurenceh avatar image laurenceh edgargw22 commented ·

At the risk of giving a jfgi response here are the links you need.

https://github.com/victronenergy/venus/wiki/dbus


0 Likes 0 ·