Nissan CAN bus data help

It will be my first “enum” to be studied and understood (I hope) but, don’t you think that fuel level could be a broadcasted data in the bus?

And btw: you use “smoothing” and “filter” in your file: Can you explain me their meaning or what are they used for?

Fuel is completely transmitted through CAN. A friend of mine did a conversion calculation, but it didn’t work out due to the somewhat crazy values. Filters and smoothing aren’t valid for RealDash, as they’re not in the documentation. I only found this RedCAN frame because I bought a fuel level sensor and connected it externally. The value fluctuates a lot. When I started the engine, it starts fluctuating, similar to any other sensor except fuel. GPT is helping me a lot in this endeavor. Watch the video I attached, and if you have any, comment there. Best regards.

Ok. I have found and “easy” way to find the fuel level:

https://base.galileosky.com/resources/Storage/en-documentation/English%20manuals/can.%20receiving%20data%20on%20fuel%20level%20from%20the%20can%20bus%20(281009-v4).pdf

I was finally able to take a look at your xml file…

Unfortunatelly, the following frameIDs do not exist in my car: 0x174, 0x177, 0x351, 0x421, 0x560.

I have found some strange things which I don’t understand, but it may be due to my lack of knowledge:

frameID 0x174:
targetId 00 startbit 2 bitcount 1: you say this is “temperatura” but it should be “AFR1” as per targetIDs table.

frameID 0x177:
targetId 147 units 0/1 startbit 13 bitcount 1 you say this is “Indicador de overdrive” and it matches the targetIDs table, but you repeat this targetID in frame 0x421 as “Posição do câmbio”.

frameID 0x358:
targetId 180 startbit 26 bitcount 1: you say this is the “Engine Oil Level” (0/1), but this targetID uses “%” as its measure unit, How can it be a 0/1 value?
targetId 230 startbit 14 bitcount 1: you say this is “ventilador ligado” but it should be the “brake pedal position” as per targetIDs table. In fact, you repeat this targetID in frameID 0x2de as “Freio”.

frameID 0x35d:
targetId 172 startbit 0 bitcount 1: you say this is “ar condicionado Ligado” but it should be the “heater motor level” as per targetIDs table.
targetId 26 startbit 7 bitcount 2: you say this is “Ignicao on” but it should be the “ignition dwell” as per targetIDs table.

frameID 0x421:
targetId 147 units 0/1 offset 0 length 1: you say this is “Posição do câmbio”, but you also say “Posição do câmbio” at frameID 0x421 targetId 200. Besides that, you also use targetID 147 in frameID 0x177 for the “overdrive indicator”.

frameID 0x551:
targetId 65 startbit 29 bitcount 1: you say this is “Injeção” but it should be the “CHECK ENGINE LIGHT” as per targetIDs table.

frame ID 0x60d:
in this frame you use targetID 484 twice, both for “Porta direita diateira aberta” and for “ACC ligado”.

I hope you can help me to understand my doubts.

Using unit values is more for organizing the code. Or for making the gauges display a value range. For example: if I set units=“L”, it will display the values that the frame emits per 1000 liters. If it’s units=“%”, the value range is 0 to 100. Units=0/1 when the signal is Bit 0 or 1, for example: open gas station, fog light, and others. Which is actually not necessary. Regarding fuel, using Enum was the best way for Nissan, as the sequence is not linear. Mine is 100% functional. I’m still going to fix the code, so it’s confusing for you. And let’s talk.

I am sorry, but I still don’t undestand how “Engine oil level” is a 0/1 value, but units are “%”: only values of 0% or 100% are possible…

Regarding fuel level:
1.- I tried the method described in the link I shared, but I had not success: I guess is a problem with the length of the records, because I recorded only 1 second logs, but information regarding fuel level takes around 3 seconds to be displayed in the car dashboard. I will try again in the future.
2.- I found an indirect way to know it: I can read the average fuel consuptiom at frame 0x2de offset 3, lenght 2 (thanks to you), and I can read the remaining range at frame 0x2de offset=“6” length=“2” conversion=“v/10”; I get the remaining fuel level just by multiplying both values. I have tested it with the range showed in the car’s display after completely filled the tank and my average fuel consuptiom, and I get 63,74 liters, close to the theorical 65 liters tank capacity.

Can you share the code line for your fuel?

Of course, as soon as possible.

Hi; this is the code:

<frame id="0x2de" size="8">
  <value targetId="786" units="km/l" offset="3" length="2" endianess="big" conversion="1/(V/160)"></value>
  <!-- AVERAGE FUEL CONSUPTIOM CONVERTED TO L/KM||CONSUMO MEDIO CONVERTIDO A L/KM (Dummy 49) -->

  <value targetId="787" offset="6" length="2" endianness="big" conversion="v/10"></value>
  <!-- RANGE||AUTONOMÍA (Dummy 50) -->
</frame>

Note that I have converted your “km/l” to “l/km”.

The result:

I have multiplied the average consuptiom by 100 because I prefer to display it in L/100Km.

And the car data (Range 791Km - consuptiom 5.3 L/100Km):