Skip to content

daemon on ccgx that reads info from a usb/serial gps in NMEA0183 format and publishes it on dbus

License

Notifications You must be signed in to change notification settings

victronenergy/dbus_gps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dbus_gps

Daemon on Venus OS that reads info from a usb/serial gps in NMEA0183 format and publishes it on dbus. More information on Venus OS here.

Building depends on:

  • python
  • dbus libs + headers
  • libevent libs + headers

For cross compiling, installing the Venus SDK is sufficient, it contains above dependencies. For a normal compile, to run the project on a pc, Google will help you installing above mentioned dependencies

Step 1. cloning incl. submodule

$ git clone https://github.com/victronenergy/dbus_gps.git
Cloning into 'dbus_gps'...
remote: Enumerating objects: 53, done.
remote: Counting objects: 100% (53/53), done.
remote: Compressing objects: 100% (35/35), done.
remote: Total 586 (delta 24), reused 35 (delta 16), pack-reused 533
Receiving objects: 100% (586/586), 113.58 KiB | 0 bytes/s, done.
Resolving deltas: 100% (340/340), done.
Checking connectivity... done.

$ cd ./dbus_gps

$ git submodule update --init
Submodule 'software/ext/velib' (git@github.com:victronenergy/velib.git) registered for path 'software/ext/velib'
Cloning into 'software/ext/velib'...
remote: Enumerating objects: 528, done.
remote: Counting objects: 100% (528/528), done.
remote: Compressing objects: 100% (186/186), done.
remote: Total 38046 (delta 312), reused 439 (delta 270), pack-reused 37518
Receiving objects: 100% (38046/38046), 34.83 MiB | 13.68 MiB/s, done.
Resolving deltas: 100% (28475/28475), done.
Checking connectivity... done.
Submodule path 'software/ext/velib': checked out '0c24aa8f2e894a664f5305ba903000a936e21886'

Step 2. Building

First, create the make file:

cd software
./configure

Now, there are two options:

  1. normal compile: build on a PC to execute on a PC
  2. cross compile: build on a PC, to later execute on a GX device.
Option 1 - normal compile
export CC=gcc
make
Option 2 - cross compile for running on a GX device

See https://github.com/victronenergy/venus/wiki/howto-install-and-use-the-sdk. And after installation of the SDK, follow the procedure in chapter 2.5, "Cross compiling velib projects".

Step 3. Copy it over to your GX Device

Typically, one would use scp for this. And see here for how to obtain root access.

Step 4. Running

Here, be aware that the serial-starter, aka the plug-and-play system on Venus OS, will have already automatically started dbus_gps. More info about that here. Therefore, two options:

  1. Copy your binary over the existing one in /opt/victronenergy/gps_dbus. And then restart that service, use svc -t somethingehere and then look at the log output, using either cat /data/log/andsoforth | tai64nlocal or tail -F /data/log/andsoforth | tai64nlocal. See the Venus OS commandline manual for usage of svc and why piping through tai64nlocal helps when looking at log files.

  2. Stop the serial starter svc -d /service/serial-starter, and then just start the binary using the right commandline arguments, ie. as a minimum the right serial port:

# ./gps-dbus/gps_dbus --help
./gps-dbus/gps_dbus

  -t, --timeout
   The time in seconds the program waits untill a device is connected. 0 is disabled.
   If no device is found the program will stop if the timeout is expired.

  -b, --baud
   The baud rate of the serial port.
   When omitted the baud rate is set to 4800.

COMMON OPTIONS:

  --banner
   Print the version during startup.

  --dbus address   Use specified address to connect to the dbus, e.g.
     - session
     - system
     - unix:abstract=/tmp/dbus-O4H8uXQdeA

  -h, --help
   Print this help.

  --log-before <count>
   When set to non zero <count> number of log lines, which are
   not enabled themselves, are nevertheless shown before an
   log which is enabled. For example an error message will be
   preceeded by <count> warning and info messages which occured
   before the error. Combined with -v also warning messages will
   be preceeded by info messages

  --log-after <count>
   Like -log-before, but temporarily enables tracing of disabled messages
   after a warning or error occured.

  -s, --serial
   The serial port to use (default /dev/ttyS0).

  -v --verbose
   Enable log messages. Specifying multiple times increases verbosity.

  -V --version
   Print the version number.

Victron Energy B.V.

About

daemon on ccgx that reads info from a usb/serial gps in NMEA0183 format and publishes it on dbus

Resources

License

Stars

Watchers

Forks

Packages

No packages published