Try to read raw can messages with VI

124 views
Skip to first unread message

Augusto Pinto

unread,
Nov 2, 2020, 9:57:41 AM11/2/20
to OpenXC

Hi all,

I have a VI and I have been working with it. I test the stock firmware (the one already installed when I bought it) in a Ford Fiesta (mod 2016) and I was able to see only 4 fields:
- engine_coolant_temperature
- engine_load
- Engine Speed
- Vehicle Speed

After that, I found the ford firmware and I was able to see a lot of fields such as:
- steering_wheel_angle
- engine_speed

- transmission_gear_position

- gear_lever_position

- ignition_status

- brake_pedal_status

- parking_brake_status

- headlamp_status

- accelerator_pedal_position

- torque_at_transmission

- vehicle_speed

- fuel_consumed_since_restart

- door_status

- windshield_wiper_status

- odometer

- high_beam_status

- fuel_level

Now I want to see the raw can messages. I built a custom firmware following the documentation (http://vi-firmware.openxcplatform.com/en/master/getting-started/getting-started.html) and with this config:

{ "buses": { "hs": { "controller": 1, "speed": 500000, "raw_can_mode": "unfiltered" } } }

building with default build command: fab reference build

I modified the openXC enabler android app in order to see the messages and the messages I get have the following structure (I'm printing the CanMessage object):

CanMessage{timestamp=0, bus=1, id=74, data=[0, -40, -40, -40, -2, -40, -40, -40]}
CanMessage{timestamp=0, bus=1, id=616, data=[2, 0, 1, -1, 11, 24, 0, 0]}
CanMessage{timestamp=0, bus=1, id=576, data=[1, 0, 126, 0, 0, 0, 0, 0]}
CanMessage{timestamp=0, bus=1, id=529, data=[-1, -2, -127, -1, 72, 73, 0, 102]}
CanMessage{timestamp=0, bus=1, id=513, data=[3, 55, 64, 36, 0, 0, 0, -128]}
CanMessage{timestamp=0, bus=1, id=128, data=[38, -44, -128, 63, 0, 16, -18, 0]}

Now I'm trying to "parse" and understand the CanMessage object in order to know what is the ID to "translate" it from CAN message to OBDII message or something similar. I want to know, if it's possible, how to read that.

Could you please help me?


Thanks in advance,

Augusto





Eric Marsman

unread,
Nov 2, 2020, 10:58:05 AM11/2/20
to OpenXC
Hi Augusto,

Sounds like you've made great progress. Glad the platform is working out for you. Unfortunately, Ford cannot provide the information you are looking for. It is proprietary. The ID and Data you have in your example look correct, but we can't help you decode it. This is what the correct type firmware does for you. 

Regards,
Eric

Augusto Pinto

unread,
Nov 2, 2020, 4:19:48 PM11/2/20
to OpenXC
Hi Eric,

Thanks for the quick answer!
After some tests, I was able to see the can messages in the CAN tab in the enabler app. Actually I'm trying to understand the structure of the CAN messages I can see. As far as I know, with this documentation (https://github.com/openxc/openxc-message-format/blob/next/JSON.mkd#can-message) a CAN message has the following format:

{"bus": 1, "id": 1234, "data": "0x12345678"}

I read in different documentations that the data is could be divided in 8 bytes where the third byte should be the PID. Is that correct? Because it's strange for me that with the stock firmware I was able to see the Engine Speed param but when I see the CAN messages and I search for Engine Speed PID in them (based on the OBDII PID standards https://es.wikipedia.org/wiki/OBD-II_PID), I cannot find anything. I understand that you cannot help me with the IDs because it's propietary, I just want to undestand the structure and the format of the CAN messages and if the firmware is doing something else between reading the CAN message and display it in the enabler App.


Thanks in advance, again

Augusto

Eric Marsman

unread,
Nov 4, 2020, 10:37:30 AM11/4/20
to OpenXC
Hi Augusto,

The raw CAN messages do not follow the standard PID format. These are broadcast messages. If you want to do diagnostic requests with PIDs, use the OpenXC Diagnostic request format (https://github.com/openxc/openxc-message-format/blob/master/JSON.mkd#diagnostic-message). There is also a tab in Enabler to help with this. 

Also, if you want more details on the format, see this section on the 11-bit format from the page you linked: https://en.wikipedia.org/wiki/OBD-II_PIDs#CAN_(11-bit)_bus_format

Regards,
Eric

Reply all
Reply to author
Forward
0 new messages