BMW R1200GS 2010 CAN xml file creation and questions

Hello everyone,
I successfully retrieve the CAN information of my motorcycle BMW R1200GS via an ODBLink in Bluetooth.
I’m now trying to make the CAN xml configuration file as complete as possible.
I have to be recovered different information on the net (reverse engeneering of my bike’s CAN information).
(Sorry my English is not a very good level)
I am successfully retrieving the following information for now:

<frame id="0x10C"> 
  <value targetId="42" offset="1" length="1" units="%"   conversion="(V/255) * 100"></value> <!-- TPS  -->
  <value targetId="37" offset="2" length="2" units="rpm" conversion="V/ 4"></value> <!-- RPM -->
</frame>

 <frame id="0x130">
  <value targetId="160" offset="7" length="1" units="bit" startbit="4" bitcount="1"></value> <!-- Turn Signal Left -->
  <value targetId="161" offset="7" length="1" units="bit" startbit="5" bitcount="1"></value> <!-- Turn Signal Right -->
  <value targetId="157" offset="6" length="1" units="bit" startbit="0" bitcount="1"></value> <!-- High Beam -->
</frame>

<frame id="0x2A8"> 
  <value targetId="64" offset="2" length="2" units="km/h" conversion="V * 0.06"></value> <!-- Speed -->
</frame>

I am stuck on:

1°) Warning Lights (Hazard?)
Indeed the left and right directioon indicator works very well but when the 4 flashing lights are working at the same time, it is a specific bit (startbit=0) that switches between 0 and 1.
How do I specify this in the file?

2°) the gear indicator engaged
The information I have is as follows:
Gear = 2BC/D5(High Nibble)
1=1st, 2=N, 4=2nd, 7=3rd, 8=4th, B=5th, D=6th, F=In between Gears
I suppose I have to use the TargetID 139 but what information do I need to specify ?

Thank you for your help

nb: If I get a satisfactory result I will not fail to provide my file to the community:-)

  1. This would require using OR operation when reading turn signals. This is my best guess, hope you can iterate from it if it does not work out of the box.
<frame id="0x130">
   <value targetId="160" offset="7" length="1" units="bit" conversion="(V>>4) || (V &amp; 1)"></value> <!-- Turn Signal Left -->
   <value targetId="161" offset="7" length="1" units="bit" conversion="(V>>5) || (V &amp; 1)"></value> <!-- Turn Signal Right -->
</frame>
  1. For this, more info is needed. Could you highlight the byte(s) that contain gear info on the CAN Monitor?

Hello,
Thank you for your quick reaction

For item 1, it’s a little more complicated than I thought
Values for the concerned byte are :

CF=Off
1100 1111

D7=Left On
1101 0111

E7=Right On
1110 0111

EF=Both On
1110 1111

I can’t find the “magic” conversion to make it work…

For item 2, below is a photo of the CAN Monitor.
This is the sixth byte at 0x02bc, the values are:
First gear: 16
Neutral: 26
Second gear: 46
Third gear: 76
Fourth gear: 86
Fifth gear: B6
Sixth gear: D6

Thank you for your help

I’ve try this :

 <value targetId="139" offset="5" length="1" units="Gear" enum="22:1,38:0,70:2,118:3,134:4,182:5,214:6"></value> <!-- Gear (Transmission) -->

it does not work :frowning:

How about turn signals:

<frame id="0x130">
   <value targetId="160" offset="7" length="1" units="bit" conversion="(V>>4) || (V = 239)"></value> <!-- Turn Signal Left -->
   <value targetId="161" offset="7" length="1" units="bit" conversion="(V>>5) || (V = 239)"></value> <!-- Turn Signal Right -->
</frame>

For the gear, I believe the enum is the right choise, but writing into ‘Body Electronics->Gear’ (id 200). All our dashboards use that input for gear display. If you want to write to ‘Transmission->Gear’, you also need to use Input Mapping from ‘Settings->Units & Values->Input Mapping’ to map 138 to 200.

Great for gear it works like I want, with this :

<value targetId="200" offset="5" length="1" units="Gear" enum="22:1,38:N,70:2,118:3,134:4,182:5,214:6,#:-"></value> <!-- Gear (Transmission) -->

Thanks :slight_smile:

For indicator lights, with this :

<value targetId="160" offset="7" length="1" units="bit" conversion="(V>>4) || (V=239)"></value> <!-- Turn Signal Left -->
<value targetId="161" offset="7" length="1" units="bit" conversion="(V>>5)"></value> <!-- Turn Signal Right -->

It works for the right (because the same bit change with “Right” and with “Warning light”)

But for Left it’s always ON…

When I try :

<value targetId="161" offset="7" length="1" units="bit" conversion="(V>>4)"

It works for Left signal light

When I try :

<value targetId="160" offset="7" length="1" units="bit" conversion="(V=239)"

It works for Warning light

It’s seems that when I put a OR condition it’s always ON
:worried:

There is something I have missed on how the flasher works. Please share the bits of the value when Emergency flasher is blinking. What are the bits when signals are off, and what are they when signal is on? Ie; what bits are blinking when flasher is on?

It’s in my previous post :slight_smile:

CF=Off
1100 1111

D7=Left On
1101 0111

E7=Right On
1110 0111

EF=Both On (Warnings)
1110 1111

Ran some internal tests and at least on simulator this works:

<value targetId="160" offset="7" length="1" units="bit" conversion="(V=0xD7) || (V=0xEF)"></value> <!-- Turn Signal Left -->
<value targetId="161" offset="7" length="1" units="bit" conversion="(V=0xE7) || (V=0xEF)"></value> <!-- Turn Signal Right -->

And in real life it works too! :smile:
Many thanks
I learn different techniques/methods through these problems

1 Like

Excellent. After you are happy with the XML file, would you be willing to share it for everyone?

Yes, I am for community sharing
It is thanks to this principle that I was able to find a lot of information about my motorcycle model.
At the moment there are only 8 information that is up and that (seems) to work.

  • Speed (km/h)
  • Engine RPM
  • Gear
  • Turn signals
  • High Beam
  • Odometer (Kilometers)
  • Throttle Valve Position (%)

This is the file in its current state.
BMW_R1200GS_K25_CAN.xml (3.9 KB)

I hope to be able to implement this information in the near future:

  • Fuel Level to reserve (%)
  • Engine Temperature (Celcius)
  • Air Temperature (Celcius)

Thank you, this will be included in next release of RealDash.

Could you test temperatures like this?

    <frame id="0x2BC">
      <value targetId="14" offset="2" length="1" units="C" conversion="V*0.75-24"></value> <!-- Coolant temperature -->
      <value targetId="200" offset="5" length="1" startbit="4" bitcount="4" enum="1:1,2:N,4:2,7:3,8:4,11:5,13:6,15:-"></value> <!-- Gear (Transmission) -->
      <value targetId="27" offset="7" length="1" units="C" conversion="V*0.75-48"></value> <!-- Intake air temperature -->
    </frame>

And fuel level:

    <frame id="0x2D0">
      <value targetId="170" offset="3" length="1" conversion="V/255*100"></value> <!-- Fuel Level -->
    </frame>

Hey!
I don’t know where you got this information but it’s exactly these calculations and sources that I had to implement
I will test them and come back to you
If you had an idea about:

  • Battery voltage
  • tripmeter (A and B?)
    I would be the happiest of men :smile:

I found this:

Unfortunately there seems to be no battery voltage or tripmeter listed.

You can also try tire pressure monitor and ambient temp:

    <frame id="0x3A0">
      <value targetId="240" offset="6" length="1" units="bar" conversion="V/50"></value> <!-- Tire pressure, front left -->
      <value targetId="242" offset="7" length="1" units="bar" conversion="V/50"></value> <!-- Tire pressure, rear left -->
    </frame>

    <frame id="0x3FA">
      <value targetId="173" offset="0" length="1" units="C" conversion="V*0.75-48"></value> <!-- Ambient temp -->
    </frame>

Ok I understand better, I work on the basis of the same document
I tested the 3 new information.

For the fuel level it seems plausible but as I compare to the gauge on the motorcycle, difficult to know if it is 56 or 58% for example. I will see in time if it seems to fit.
However I changed the file because the information is on 1 byte not 2.

For the engine temperature, I compared to a digital information that I find in Motoscan (app for BMW motorcycles that accesses ODB2 information) and it’s ok.

I was hoping to have the air temperature unfortunately it is the intake air temperature. This information is not of much interest to me on the dashboard.

Here I do not think I can get other interesting things.

I tried to capture data via the record function of the CAN Monitor but I could not really find other information, such as the outside temperature and battery voltage.

The above ambient temperature is not working?

Sorry I haven’t seen your second post.
I have set it up and I will take a great ride on my motorcycle today which will allow me to test in real life.
For the tyre pressure sensors (called RDC at BMW MOTORRAD) it is an option that I do not have on my vehicle so I will not be able to test.
Thank you for your time

1 Like

No, thank you for making this happen. This XML will be built-in into RealDash 2.4.7 - which we are building right now.

1 Like

I think the following information should be exploitable but of more limited interest:

Ignition On/Off
ABS (On/Off) - ABS WarningOn/Off [273]
Clutch Lever
Kill Switch
Side Stand (up/down)
Brake Levers (0x00=Off, 0x04=Front On, 0x08=Rear On, 0x0C=Both)
LAMP Fault (0=None,1=Low Beam,4=High Beam,8=Signals)
ESA Preload
Info Button (4=Off, 5=Short Press, 6=Long Press(>2secs))
Heated Grip Switch (C=Off, D=Low & E=High)