[obdgpslogger] Some questions

Gary Briggs chunky at icculus.org
Wed May 12 11:38:42 EDT 2010

On Wed, May 12, 2010 at 07:58:51AM -0500, Peter Buelow wrote:
> Ok, just want to use this project for a automotive HUD I'm building. You saved me, I tried to get a couple of other packages working, but never could, so I'm gonna use this project. This might be exactly what I've been looking for. However, a  quick question.
> Does the main app send it's log data over DBUS at any point?

Yep. It only sends signals, it doesn't actually "communicate" over DBus,
/per se/, but you can just listen and get updates.

The code is in the function obddbussignalpid in src/logger/obddbus.c

To understand how to read the signals, this code should explain:

#define OBDDBUS_INTERFACENAME "org.icculus.obdgpslogger"

// "/obd" is the path, and "value" is the name.
msg = dbus_message_new_signal("/obd", OBDDBUS_INTERFACENAME, "value");

dbus_message_append_args (msg,
    DBUS_TYPE_UINT32, &(cmd->cmdid), // PID
    DBUS_TYPE_DOUBLE, &val, // Actual value
    DBUS_TYPE_STRING, &(cmd->db_column), // Short name
    DBUS_TYPE_STRING, &(cmd->human_name), // Long name
    DBUS_TYPE_INVALID // Sentinel

You should be able to see signals being announced by using this at the
command prompt:
dbus-monitor --system

As a mere aside, I despise dbus. It's an awful API, and the developers
of the reference implementation documented it by saying "don't use this,
it sucks". If you have any better suggestions, I'm more than open to putting
them in and urging people to use them instead of dbus.

Other approaches that might work:
The current [hokey-as-hell] gui launches obdgpslogger and reads
obdgpslogger's stdout to see how to update the GUI. You could always
just scrape the latest values directly from the database, although
that may induce small amounts of lag. shared-memory.

> I don't much need the database, but will keep it so I can export it to save trip details and such. However, the primary use, being a HUD, I just need the near realtime updates of the ECU data (speed, tach, temp right now). I noticed the sim uses DBUS, and in main(), there's a DBUS init routine, but I'm not quite up to speed on exactly how it's used yet. Still perusing the code. If it doesn't do this, how hard would it be to make this ability an addon, enabled using a command line switch?

Should just magically work.

If you're not seeing anything, you should check that dbus support was
actually compiled in. You'll need your distro's dbus dev package [on
debian and friends it's libdbus-1-dev]. If it wasn't installed before,
you may need to purge your build dir and rebuild, as cmake usually won't
pick up changes like that. CMake tells you whether it finds it or not
when you run it.

> I'm more than willing to do the work, I'll have to anyway, I need some useful async messaging to get OBD data into my app, and this seems like it would be a good way to do it (although DBUS is kinda ulgy for small things like this).

DBus is kinda ugly for *everything* :-)

> Thoughts? Thanks for building this. I'm looking forward to being able to make it go with my stuff.

Coo, please let me know how it works out. I really am happy to help
where I can

Gary (-;

More information about the obdgpslogger mailing list