User Tools

Site Tools


open_source:ccgx:raspbian_deb

This is an old revision of the document!


Installing CCGX functionality on a raspberry pi (package based)

While Matthijs is having fun at https://www.victronenergy.com/live/open_source:ccgx:installing_ccgx_func_on_raspberry_pi this page is about deploying packages for a Raspberry PI. This is not something officially supported nor complete. This is tested on a Rpi B+ v1.2 with Raspbian.

First of all, the Rpi 1 is based on a armv6, while armhf has a minimum of ARMv7+VFP3, yet the Raspbian image believes it is running armhf. The answer seems simply that Raspbian redefined armhf to ARMv6+VFP but forgot to rename it somehow. Since these binaries are incompatible, it won't in general be enough to compile a package for Debian/armhf and expect it to work on a Rpi 1. A Rpi 2 can run Debian armhf and would be better of doing so instead of running Raspbian.

Anyway, it seems that supporting a package for a rpi needs rpi specific packages, so that is what is done. To get it (there is only 1 for testing) the following must be done:

sudo nano /etc/apt/sources.list

And add the following line

deb http://updates.victronenergy.com/feeds/raspbian/dists/wheezy/contrib binary-armhf/

e.g. vedirect-dbus can now be installed with

sudo apt-get update
sudo apt-get install vedirect-dbus

vedirect_dbus is an implementation of the design at https://www.victronenergy.com/live/open_source:ccgx:start. On a linux system it can send its obtained values to any language of your desire. You can start it with e.g.

vedirect-dbus -s /dev/ttyUSB0 -vvv

note: on a rpi it will connect to a SESSION dbus

To interact with it some dbus tool is needed, e.g.:

sudo apt-get install python-lxml
cd /usr/local/bin
sudo wget https://dbus-tools.googlecode.com/svn/trunk/dbus
sudo chmod +x ./dbus

`dbus` should now list besides others e.g.: com.victronenergy.battery.ttyUSB0

dbus com.victronenergy.battery.ttyUSB0 / GetValue

should list all values

From python (just type python and hit enter) you can now do:

import dbus
bus = dbus.SessionBus()
item = bus.get_object("com.victronenergy.battery.ttyUSB0", "/Dc/0/V")
print(item.GetValue())

https://github.com/victronenergy/velib_python contains python classes to interact with dbus items.

open_source/ccgx/raspbian_deb.1452268414.txt.gz · Last modified: 2016-01-08 16:53 by ictbeheer

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki