Troubles getting started - Holden Cruze Z-Series (2014)
  • 0
  • <b>EDIT: I got it working. I called the auto-baud command again and now I've got a metric ton of data flowing through. I've captured a bunch and just need to sit down and paw through it all.</b>

    I got my CBT in the mail yesterday, and have just had a chance to start tinkering tonight. I followed the instructions on the Getting Started page and hooked my CBT up to my car using the OBD-II connector. Power came on (without USB) and I plugged the CBT into my netbook and fired up CoolTerm. Probing the CBT for information worked, but probing CAN 1 for info netted me this error:

    <code>{"e":"busdgb", "name":"Bus 1", "canctrl":"4", "status":"0", "error":"1011"
    "Receive Error Warning - TEC or REC >= 96",
    "Receive Error Warning - REC >= 96",
    "Receive Error Warning - REC >= 128", "nextTxBuffer":"0"}</code>

    Probing CAN 2 and 3 got no errors though:

    <code>{"e":"busdgb", "name":"Bus 2", "canctrl":"7", "status":"0", "error":"0 - No Errors", "nextTxBuffer":"0"}
    {"e":"busdgb", "name":"Bus 3", "canctrl":"7", "status":"0", "error":"0 - No Errors", "nextTxBuffer":"0"}</code>

    I then fired up the car and tried to listen on all three busses. I got "ÿ" back, which in hex, is "FF 00", for all three.

    Being a programmer, but barely knowing what a car even is, let alone how it operates, I'm stumped. In general, do all cars expose at least one CAN bus via OBD-II (i.e. should I see at least something without having to wire this thing into my car?)

    For troubleshooting purposes, here's what I did:

    1. Download Arduino for Windows 8.1 (64 bit), Download CBT from GitHub and extracted the CBT zip into the hardware folder
    2. Opened Arduino, picked the CBT as the board, the COM port and verified / compiled the unmodified CanBusTriple sketch. No errors.
    3. Plug the CBT into the car / laptop and sent the HEX to auto-detect the baud rate. I don't remember the outcome, but it said it finished. I then rebooted the CBT by unplugging both sources of power and plugging it back in.
    4. Ran the commands to probe / start logging and got the commands above.

    Any clues?

  • 0
  • administrators

    Glad to hear you got it working!

  • 0
  • Thanks @Derek, indeed I did. What I'm now wondering is, is there any way to force the CBT to print to serial, whole lines only?

    I'm writing a node.js app that connects via serial, starts logging, parses the data received and then lists the frame IDs by frequency, so I can visually see what packets relate to which button presses on my steering wheel. The problem is, when the data comes through, it's only part of the message, and the rest comes in the next round of data. For example, I've modified the CBT sketch so the JSON output is closer to CSV (for import into Google Sheets / Excel), so a typical packet would look like this:

    <code>3, Bus 1, 3, 1F3, 1211206, 0, 0, 0, 0, 0, 0, 0, 0,</code>

    But when I connect in via my app (and even in CoolTerm), my data could look like this. Each "Data returned" is when my node.js app receives data:

    <code>
    Data returned:

    3, Bus 1, 7, 1C7, 1210981, 6, A0, 39, 60, 0, 0, 3F, 0;
    3, Bus 1, 2, 185, 1210983, 0, 0, 0, 0, 0, 0, 0, 0;
    3, Bus 1, 8, 191, 1210985, 6, 63, 6, 63, 6, 54, 0, 0;
    3, Bus 1, 8, 1F5, 1210987, F, F, 0, 21, 0, 0, 3, 0;
    3, Bus 1, 8, C5, 1

    Data returned:

    210989, 10, 0, 0, 0, 10, 0, 0, 0;
    3, Bus 1, 8, 3E9, 1210992, 0, 0, 80, 0, 0, 0, 80, 0;
    3, Bus 1, 7, 1E1, 1210994, 0, FF, 5, 0, 0, 0, 0, 0;
    3, Bus 1, 3, 1F3, 1210996, 40, 40, 0, 0, 0, 0, 0, 0;
    3, Bus 1, 8, 1ED, 1210998, 1, 90, 0, 0, 0, 0

    </code>

    And of course, same thing happens on CoolTerm, even with the unmodified sketch.

    I'm not yet 100% au fait with Arduino, so my tinkering has been limited so far, but can this be done?

  • 0
  • administrators

    @Grayda‌ Cool! I've actually done already that. Check out the repo:
    https://github.com/CANBus-Triple/CANBus-Triple-App

    If you look at the SerialService.js you will see how I handle the serial connection with the SerialPort module. The trick is giving the module the correct parser, so it only reports the data after a whole line comes in. Search for 'parser'. It gave me a bit of trouble initially as well.

    I just pushed up an adapter for wireshark also, written in JS for node. Check that out here, it may be a more connical example.
    https://github.com/CANBus-Triple/CANBus-Triple-Wireshark

    I hope to have the app in beta soon. It runs on Node-Webkit, maybe you can contribute to the code? :)

  • 0
  • administrators

    The specific setup that worked for me is setting the parser like this in the serialport config object:

    <blockquote>parser: serialport.parsers.readline("\r", "binary");</blockquote>

  • 0
  • Thanks @Derek, I got it running the other night. Very handy to know! I don't think the info I want (steering wheel controls) are on CAN 1, because my script doesn't show much when I sit there and press the controls, but I'm going to clean up my script and try again, possibly this weekend.

    I also downloaded and compiled the phone app (using Phonegap, not Cordova). It doesn't do anything for me at all (just a broken looking layout) but it is alpha software, so I'll have a poke around the code and see what else is going on. Thanks for releasing everything as open source. Makes hacking so much easier, and fun.

  • 0
  • administrators

    I've spend countless nights in my garage writing code and trying things. It's a lot of time, but a blast none the less.

    I've got a lot of updates to the app that aren't pushed to the repo yet. Trying to get a alpha release soon.

  • 7
    Posts
  • 1056
    Views
  • Log in to reply