Sponsored links

Go Back   MP3Car.com > Mp3Car Technical > Engine Management, OBD-II, Engine Diagnostics, etc. > OBDII GPS Logger


Reply
 
Share Thread Tools Display Modes
Old 07-22-2009, 10:16 PM   #1
Newbie
 
Join Date: Aug 2007
Posts: 17
bkuri is an unknown quantity at this point
Cannot initialize DBUS obdsim generator

I compiled the latest SVN copy using the OBD_ENABLE_DBUS flag, started obdsim with the following parameters:

Code:
$ obdsim -s bitofcoast.db -g DBus

And I received the following output:

Code:
DBus Config. interface= DBus Config. interface= Couldn't find any mappings in DBus config file, cannot continue Couldn't initialise data generator "DBus"

I don't have the OBD unit plugged into the car, just the PC. I am using a custom Ubuntu 9.04 i386 build with a USB ELM327 OBD module connected on /dev/ttyUSB0 and a USB GPS receiver connected on /dev/ttyUSB1

I am basically trying to build a custom realtime data visualizer using DBUS signals, so I am trying to receive random DBUS messages first before I move on to coding the UI.

It looks like I need to create/modify a DBus configuration file, but I'm not sure where it is located or under what format I should write it in. Any help would be appreciated.

Thanks for such a cool contribution, Gary! This will finally allow me to build my dream carpc.

Last edited by bkuri; 07-24-2009 at 01:18 AM.
bkuri is offline   Reply With Quote
Advertisement
 
Advertisement
Sponsored links

Old 07-27-2009, 12:26 AM   #2
Mod - OBDII GPS Logger forum
 
Join Date: Mar 2009
Location: Los Angeles
Posts: 408
chunkyks is on a distinguished road
That seed [bitofcoast.db] is most useful with the "Logger" generator. I also suggest using a more up to date logfile [at least while trying out sim, using "Logger" just to see *something* work], that's the first one I ever published.

A sample config for the dbus generator is in src/sim/generators/dbus/dbustest.simconf

Quote:
I am trying to receive random DBUS messages

OBDSim doesn't generate messages, it only listens for signals. If you are writing something that listens for dbus signals, obdgpslogger signals stuff.

Gary (-;
chunkyks is offline   Reply With Quote
Old 07-27-2009, 02:58 PM   #3
Newbie
 
Join Date: Aug 2007
Posts: 17
bkuri is an unknown quantity at this point
OK, I may be doing something wrong here...

I entered the following command:

Code:
obdsim -s dbustest.simconf -g DBus -o

and I got some encouraging "DBus Config" output. But right after the pty slave name was defined (/dev/pts/1 in case it makes any difference), the following message came up:

Code:
First argument isn't of type int

Everything looked pretty much OK after that, except that every value came out as 0.000000 (temp, rpm, vss, maf, and throttlepos), and dbus-monitor never triggered a signal.

Am I missing something here? Thanks in advance...
bkuri is offline   Reply With Quote
Old 07-27-2009, 11:21 PM   #4
Mod - OBDII GPS Logger forum
 
Join Date: Mar 2009
Location: Los Angeles
Posts: 408
chunkyks is on a distinguished road
OK, the way that obdsim's dbus plugin works is that it listens for signals on the path/member/interface 3-tuple. The source is in src/sim/generators/dbus/gen_dbus.c and should be pretty palatable. From the top:

Code:
/// Mappings and most-recently-seen values are stored in this list /** DBus messages are expected to come as two numbers; an integer then an integer or floating point number. The first is mapped onto a PID using this table. The second is the actual value to be passed. */

So, what happens is signals are INT32 then INT32 or DOUBLE. The first INT32 is mapped to a PID using "map" entries in the config file. The second is the value. The actual handling is done in dbus_simgen_msgfilter, lines 287 to 317.

The signals are processed as they're seen, and the most recently value is always remembered. When the OBDII tool talking to OBDSIM requests a value, it responds with the most recently seen version [line 261].

The error you saw, "First argument isn't of type int", is because it read the signal you configured, but the first value in the signal was a type other than DBUS_TYPE_INT32

Hope that's helpful,
Gary (-;
chunkyks is offline   Reply With Quote
Old 07-29-2009, 07:02 AM   #5
Newbie
 
Join Date: Aug 2007
Posts: 17
bkuri is an unknown quantity at this point
Thanks for the extra information. I guess I need to look more into C programming.

I tried figuring out how to send tuples through the command line, but I wasn't able to get it to work. My coding background deals with ActionScript, which I guess is similar to C in a few respects. Tuples look a lot like AS objects, which are sent in key/value pairs like so:

Code:
var tuple:Object = {key1:'key', value1:'value'}; sendDbusMessage(tuple);

Am I on the right track here? A sample command would be really helpful! Thanks again
bkuri is offline   Reply With Quote
Old 07-29-2009, 11:40 AM   #6
Mod - OBDII GPS Logger forum
 
Join Date: Mar 2009
Location: Los Angeles
Posts: 408
chunkyks is on a distinguished road
If you're trying to do stuff using actionscript, sorry, I've never used it at all.

To signal tuples using C, check src/logger/obddbus.c. That code sends UINT32, DOUBLE, STRING, STRING. So change it so it sends INT32, DOUBLE and you'll be set.

Gary (-;
chunkyks is offline   Reply With Quote
Old 07-29-2009, 05:04 PM   #7
Newbie
 
Join Date: Aug 2007
Posts: 17
bkuri is an unknown quantity at this point
Yeah I'm trying to get the UI done in Adobe AIR. But I meant that I'd like to see a CLI sample... Something like:

Code:
$ obdsim -s dbustest.simconf -g DBus -o

Where should the tuple be placed above, and in what format? Basically I want the AIR app to send shell commands behind the scenes. I could send something like the code above, or using dbus-send, whichever is best. TIA
bkuri is offline   Reply With Quote
Old 07-29-2009, 05:14 PM   #8
Mod - OBDII GPS Logger forum
 
Join Date: Mar 2009
Location: Los Angeles
Posts: 408
chunkyks is on a distinguished road
Can you post your .simconf file?

Gary (-;
chunkyks is offline   Reply With Quote
Sponsored links
Advertisement
 
Advertisement
Old 07-29-2009, 05:23 PM   #9
Newbie
 
Join Date: Aug 2007
Posts: 17
bkuri is an unknown quantity at this point
Sure. I haven't modified it at all however:

Quote:
# obdsim dbus plugin sample config file
#
# This sample works with fbd based signals from Fusion Brain devices
# Originally written by cgalpin on the mp3car forums
#
# fbd is a Linux daemon that listens talks to fusion brain devices. It's
# available here:
# http://www.mp3car.com/vbulletin/fusi...ram-linux.html
#
# We specifically listen to only one member from one path from
# one interface

# The message for the member-path-interface 3-tuple must come in as two
# numbers. The first is mapped to a PID using this file. The second
# is a real or integer that is the actual value.

# bus can be "session" or "system"
bus=system

interface=org.openice.fbd.fusionbrain

path=/org/openice/fbd

member=AnalogValueChanged

# Some sample mappings.
# Each mapping is of the form:
# map {decimal FB analog input} -> {hex PID}
# Where 0 >= {analog input} < 13
# and PID is the OBDII service command

# Map engine temperature
map 1 -> 0x05

# Map airflow mass
map 2 -> 0x10

# Map rpm
map 3 -> 0x0C

# Map vss
map 11 -> 0x0D

# Map throttlepos
map 12 -> 0x11

bkuri is offline   Reply With Quote
Old 07-29-2009, 05:51 PM   #10
Mod - OBDII GPS Logger forum
 
Join Date: Mar 2009
Location: Los Angeles
Posts: 408
chunkyks is on a distinguished road
perhaps this will work:
Code:
dbus-send --system \ --dest=org.openice.fbd.fusionbrain \ --type=signal \ /org/openice/fbd \ AnalogValueChanged \ int32:11 \ int32:2600

I haven't actually tried this, mind. From the config above, it should tell obdsim that the rpms are now 2600.

Gary (-;
chunkyks is offline   Reply With Quote
Old 07-30-2009, 08:35 PM   #11
Newbie
 
Join Date: Aug 2007
Posts: 17
bkuri is an unknown quantity at this point
The above command didn't seem to work, even after I fixed the syntax error to the following:

Code:
dbus-send --system \ --dest=org.openice.fbd.fusionbrain \ --type=signal \ /org/openice/fbd \ org.openice.fbd.fusionbrain.AnalogValueChanged \ int32:11 \ int32:2600

I opened up qdbusviewer in my desktop kde installation, downloaded/installed the latest SVN, and opened up obdsim prior to using the dbus-send command above, but nothing ever came up.

I'm looking for a way to receive a dbus signal from obdgpslogger every time it registers a new entry into the log so that I can display it on screen, so the above command will tunnel it through obdsim and end up in obdgpslogger, correct?

Thank you for your patience, Gary! I feel like I'm getting real close here.
bkuri is offline   Reply With Quote
Old 07-30-2009, 11:43 PM   #12
Mod - OBDII GPS Logger forum
 
Join Date: Mar 2009
Location: Los Angeles
Posts: 408
chunkyks is on a distinguished road
Quote:
I'm looking for a way to receive a dbus signal from obdgpslogger every time it registers a new entry into the log so that I can display it on screen

OK, I'm confused; could you exactly explain your situation? Are you in a car with an OBDII device, using obdgpslogger to read it? And then you want obdgpslogger to signal on dbus whenever it sees a new value?

If so... you don't want to use OBDSim for that; obdgpslogger already does it, all on its own. Check obddbus.c for the exact interface/path/member and the actual message

Gary (-;
chunkyks is offline   Reply With Quote
Old 07-31-2009, 12:57 AM   #13
Newbie
 
Join Date: Aug 2007
Posts: 17
bkuri is an unknown quantity at this point
Quote: Originally Posted by chunkyks View Post
OK, I'm confused; could you exactly explain your situation? Are you in a car with an OBDII device, using obdgpslogger to read it? And then you want obdgpslogger to signal on dbus whenever it sees a new value?

I am building a GUI that will be able to send/receive DBus messages to different areas of the OS. One of the areas deals with reading the OBD information and displaying it on screen. I think that obdgpslogger would help me out in achieving this really well.

Quote:
If so... you don't want to use OBDSim for that; obdgpslogger already does it, all on its own.

The only reason why I want obdsim to work right now is because the pc isn't hooked up to the car yet, so I would like to simulate some DBus data for obdgpslogger to consume and then throw a DBus signal that my GUI can pick up.

Hope this makes more sense.
bkuri is offline   Reply With Quote
Old 07-31-2009, 01:46 AM   #14
Mod - OBDII GPS Logger forum
 
Join Date: Mar 2009
Location: Los Angeles
Posts: 408
chunkyks is on a distinguished road
Ooooooooo

In that case, just use "obdsim -g Random -o"

Assuming obdgpslogger was build with dbus enabled, that should be all you need to actually generate dbus signals from obdgpslogger. If all you want to see it *something* output from obdgpslogger, then that should be sufficient

Gary (-;
chunkyks is offline   Reply With Quote
Old 07-31-2009, 01:48 AM   #15
Mod - OBDII GPS Logger forum
 
Join Date: Mar 2009
Location: Los Angeles
Posts: 408
chunkyks is on a distinguished road
Or, if you want to see some more realistic figures, download http://icculus.org/obdgpslogger/down-to-vista.db and use
Code:
obdsim -g Logger -s down-to-vista.db

You can also use obdgui to connect to the pty that obdsim announces, and verify that your dbus signal reader is reading the right thing by checking that obdgui and your gui say the same thing.

Gary (-;
chunkyks is offline   Reply With Quote
Sponsored links
Advertisement
 
Advertisement
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




All times are GMT -5. The time now is 02:03 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.2
Copyright © 1999 - 2008 Mp3Car.com Inc.Ad Management by RedTyger
Message Board Statistics