Search code examples
bluetoothubuntu-14.04obd-ii

obdsim: invalid option -- 'b'


When I run

user:~$ obdsim -b

I get

obdsim: invalid option -- 'b'

I've already done this:

sudo rfcomm bind 0 14:30:C6:50:12:16 1
sudo sdptool add SP

When I run

user:~$ obdsim -h
Usage: obdsim [params]
   [-g|--generator=<name of generator>
       [-s|--seed=<generator-seed>]
       [-d|--customdelay=<ecu delay(ms)>]
     ]
   [-q|--logfile=<logfilename to write to>]
   [-V|--elm-version=<pretend to be this on ATZ>]
   [-D|--elm-device=<pretend to be this on AT@1>]
   [-L|--list-protocols]
   [-p|--protocol=<OBDII protocol>]
   [-o|--launch-logger]
   [-c|--launch-screen] ["EXIT" or C-a,k to exit]
   [-t|--tty-device=<real /dev/ entry to open>]
   [-e|--genhelp=<name of generator>]
   [-l|--list-generators]
   [-n|--benchmark=<seconds>]
   [-v|--version] [-h|--help]
The generators built into this sim:
 "Random"
 "Cycle" (default)
 "Logger"
 "dlopen"
 "Socket"
 "gui_fltk"
 "Error"

So it seems that -b is not there however it's here. So how am I suppose to connect to bluetooth?


Solution

  • Original OBDSim developer here.

    That's typical of not having bluetooth compiled in. The pertinent part of CMakeLists.txt is thus:

    SET(OBD_SIM_DISABLE_BLUEZ false CACHE BOOL "Disable bluetooth support in obdsim")
    IF(NOT OBD_SIM_DISABLE_BLUEZ)
        CHECK_SYMBOL_EXISTS(BTPROTO_RFCOMM
            bluetooth/bluetooth.h
                HAVE_BLUETOOTH)
        IF(HAVE_BLUETOOTH)
            MESSAGE(STATUS "Enabling bluetooth obdsim port")
            ADD_DEFINITIONS(-DHAVE_BLUETOOTH)
        ENDIF(HAVE_BLUETOOTH)
    ENDIF(NOT OBD_SIM_DISABLE_BLUEZ)
    

    So... unless you explicitly disabled bluetooth when you built OBDSim, it simply means you need to include your distribution's bluetooth-devel package.

    [Note that after installing, you will need to rerun cmake, having obliterated the cache. I usually just rm -rf build and start again]