DV, Raspberry Pi and python

179 views
Skip to first unread message

Ali Safa

unread,
Feb 15, 2021, 1:50:12 PM2/15/21
to dv-users
Hi, I just started playing with the DAVIS346 hooked to a raspberry pi running Ubuntu and DV runtime seems to work fine. I was able to configure it via my laptop by connecting via SSH and I was able to get timestamp data via Python.

Now, I am trying to have a stand alone system where I am not obliged to configure DV runtime using my laptop each time I boot the raspberry pi. But it seems that there is no way of doing that... I saw something called dv-control but I have not found a list of the commands that you can enter.

Finally, I tried to generate a config.XML file on my laptop (win10) and run it on the raspberry pi  by launching dv-runtime -c config.XML but it does not work, I get the message "Invalid root node. Exception: names don't match (required in 'strict' mode).

Could you please help me :-)

Best,
Ali

Luca Longinotti

unread,
Feb 15, 2021, 5:39:25 PM2/15/21
to dv-u...@googlegroups.com
Hello, on our supported Linux distributions, such as Ubuntu on
Raspberry Pi, we also install a systemd-service that can take care of
starting/stopping dv-runtime when the device boots/shuts-down, and
persist its configuration.
For more details, please read:
https://inivation.gitlab.io/dv/dv-docs/docs/getting-started.html#launching-dv-runtime-with-a-remote-gui
--
Luca Longinotti (llongi)

Software Engineer
iniVation AG - https://inivation.com/
Zurich, Switzerland
Office: +41 44 500 32 14

Support - https://inivation.com/support/

Luca Longinotti

unread,
Feb 18, 2021, 1:51:32 PM2/18/21
to dv-u...@googlegroups.com
If you are running DV 1.4.1, then the systemd service resuming from the
last configuration should be the case already.
The systemd-service internally executes the following command:

/usr/bin/dv-runtime -i <IP> -p 4040 -c /etc/dv-runtime.xml -l
/var/log/dv-runtime.log --systemservice 1 --console 0

meaning it uses /etc/dv-runtime.xml as a central configuration file and
/var/log/dv-runtime.log as a central log file.

On orderly shutdown it writes back the current configuration to
/etc/dv-runtime.xml, you can test this by configuring it via GUI and
then issuing the command 'systemctl stop dv-runtime.service', after
that you should see that /etc/dv-runtime.xml has changed.
If you shut off the Raspberry Pi by pulling the plug or any other type
of hard-reset, no configuration will be saved, as that doesn't count as
an orderly shutdown that will stop the systemd services.
SSH to it and shut it down gracefully using 'sudo halt' or similar.

Indeed the XML files as saved in the GUI as projects cannot directly be
used as startup-files for the runtime (-c abc.xml), only to load/save
projects through the GUI.

dv-control is a command-line utility that acts like another client for
the runtime, similar to the GUI. It simply allows you to query the
configuration parameters of a running runtime and changing their
values. It is meant for debugging and advanced command-line use
(scripts, etc.), so it's not documented in detail. We really recommend
using the GUI to change configuration in almost all cases.

Hope this answers your questions, have a nice day!


On Tue, 2021-02-16 at 08:36 +0100, Ali Safa wrote:
> Dear Luca,
>
> Thanks for your answer, that is exactly what I did till now, so I am
> using the systemd-service and it works well but when the raspberry pi
> boots and the systemd-service is launched, there is no "useful"
> configuration file loaded and when I try to launch it with -C by
> specifying a XML config file from Windows, it rejects it.
>
> On the link you sent me it says:
> "When the application is running change the configuration with dv-
> control or with a remote connection with the GUI (recommended for
> easy set up)"
>
> But it does not tell anything about that "dv-control" and how to use
> it via the command line to specify the configuration I want
> (connecting the events to a local IP address that I can read from
> Python). The remote connection with GUI works perfectly but I don't
> want to configure it each time with my computer, I want the thing to
> load the "last" config file when it boots up for example... How can
> we do that?
>
> Thanks,
> Ali
>
>
> Le lun. 15 févr. 2021 à 23:39, Luca Longinotti <
> luca.lo...@inivation.com> a écrit :
Reply all
Reply to author
Forward
Message has been deleted
0 new messages