LED A stays red with custom firmware when connected to the car's OBD-II

102 views
Skip to first unread message

Jack Van Hoecke

unread,
Jul 28, 2016, 5:03:14 PM7/28/16
to OpenXC


Hello, I am new to the OpenXC community and as such, I have a few mandatory questions haha. I've used the enabler app and the correct firmware to receive data on a 2015 MKS. So to turn it up a notch, I've been exploring custom firmware creation. My eventual goal is to receive raw CAN messages as depicted here (I would like to send as well but let's stick to this).

I believe to have everything working correctly (and I only had to try and install it on three different OS environments haha). However, when I flash my firmware onto the device using the default build from the compiler (I did change DEFAULT_POWER_MANAGEMENT to equal ALWAYS_ON because it's less annoying this way for development) I can't get my Ford VI to see the CAN (LED A turns blue). Upon putting the device on the OBD-II connector, it stays red. However, I have sent a diagnostic request with my firmware on the device and it did respond with the RPMs. After which, LED A will stay blue but it will not send me CAN updates unless I use a diagnostic request again. I have played around with different settings in the fabfile.py trying to see why I am unable to detect the CAN bus but my efforts have not be successful thus far.

Hopefully this isn't an already solved question, I have looked through many of the other questions on the forums but I did not find one that solved my issue. Moreover, I am using version 7.2.0 which out-dates many posts. Please see the attached JSON and fabfile.py I am using to compile my firmware.




Quirks I have found on my journey:

- There might be an issue with the windows USB driver with the current version of OpenXC Python library? I kept receiving connection errors when using either (pyusb1.0 or pyusb1.0a3). This was solved when I switched to Ubuntu 12.

- If I fab reference build with the "translated_obd2" settings. My computer is unable to recognize the device when it is not in program mode. Thus no openxc-dump or openxc-dashboard :( the device still doesn't see the CAN.
all_read_limit_one_second.json
fabfile.py

Zac

unread,
Jul 29, 2016, 11:49:33 AM7/29/16
to OpenXC
Hi Jack,

Allow me to help you with your Mandatory question :)

It looks like you're using a custom JSON config file to get the raw CAN data - this is correct. The issue is with the process to compile firmware based on that JSON config. Each JSON config is used to create a new signals.cpp file. The signals.cpp file is the way to get your configuration into the compiled firmware.

You will need to use the openxc-python tool to generate the signals.cpp file. The instructions are detailed here: http://vi-firmware.openxcplatform.com/en/master/getting-started/with-config.html

Once you have your signals.cpp file in the ../vi-firmware/src directory, then you should be able to use the FAB commands to build your firmware. Give that a try and let me know if you have some success. 

(This is the end of my mandatory response) :)
- Zac

Jack Van Hoecke

unread,
Jul 29, 2016, 1:10:17 PM7/29/16
to OpenXC
Hahaha, thank you for the quick reply Zac! 

Fortunately but unfortunately I have already been generating my signals.cpp file, so regrettably I think we're back to the drawing board. I've attached my signals.cpp file, it seems to of been generated correctly (at least from what I can read).

This morning I git cloned the master vi-firmware again. Made a fresh image with Vagrant and ran the default build with no JSON to see if it would see the CAN bus but still no luck! Something odd to note however, the openxc-obd2scanner command will print out the current values on the line even though LED A is red. I have yet to look into the OpenXC library to see if this command is just an advanced script variation of openxc-diag however. If that was the case then it would make sense, because I can use openxc-diag to receive data even with my current dilemma.

Maybe it is another step in my process however? My process is as follows:
  • ssh into the VM
  • Generate my signals.cpp with the following command: sudo openxc-generate-firmware-code --message-set all_read_limit_one_second.json > signals.cpp
  • Compile my .bin with the following command: fab reference build
  • Copy the .bin from ~/vi-firmware/src/build/ onto the Ford VI (after pressing the reset button while plugging in the USB)
  • Unplug from the computer (safely ;D), press the reset, plug into my cars OBD-II
  • Cry
I have also attached my .bin. I seriously doubt it, because it works with the given firmware, but maybe its my hardware? #paranoid
signals.cpp
vi-firmware-FORDBOARD.bin

Jack Van Hoecke

unread,
Aug 1, 2016, 10:34:45 AM8/1/16
to OpenXC
Yeah so I may or may not but definitely wasn't copying my generated signals.cpp into ~/vi-firmware/src/ ... Let's pretend like I didn't spend an exorbitant amount of time on this :)
Reply all
Reply to author
Forward
0 new messages