Create Button for KWP protocol

Hi everyone,
I’ve been working with RealdDash for some time now, and I think it’s a great project. In my Custom XML, I’ve already experimented and set up several things to work, such as reading mileage, outside temperature, battery, displaying various indicators, turn signals, low beams, open doors, etc.

Before continuing further with the development, I got stuck on creating a button and sending a command from RealDash to my ECU in order to control various actuators, turn on relays, locks, AC, lights, etc., like everything that can be done with various terminals, for example, the Bluetooth Serial Console App (for testing). Can Realdash do this at all on the KWP protocol?

Namely, here is my initial code where I created a name for my target ID, but I’m not able to connect the button to work with this command, for example, “30910001”. I tried creating a button with various actions like toggle on/off, setvalue, Send Terminal Command, CanFame, and similar, but unfortunately without success.
Please give your opinion, assistance, and help. Thank you.

<OBD2>
  <init> <!-- init section) -->
    <command send="atd"/>
	<command send="atz"/>
	<command send="atat1"/>
    <command send="atst62"/>
	<command send="atsp5"/>
	<command send="ate0"/>
    <command send="atl0"/>
	<command send="ats0"/>
	<command send="ath1"/>
    <command send="atdpn"/>
	<command send="ATAL"/>
	<command send="ATSH8226F1"/>
    <command send="10C0"/>
  </init>

  <rotation> <!-- Loop section) -->
    <command send="21DF" skipCount="0">
      <values>
        <value targetId="173" conversionABC="C-40.0"/> <!-- Outdoor Temperature) -->
        <value targetId="310" conversionABC="Y*65536+Z*256+AA"/> <!-- Odometer) -->
        <value targetId="12" conversionABC="(A*256+B)/1000"/> <!-- Battery Voltage) -->
      </values>
    </command>

    <command send="21DD" skipCount="0">
      <values>
        <value targetId="160" conversionABC="(D!=12)(D!=28)(((D>>3)&amp;1)|((D>>1)&amp;1))"/> <!-- Turn Signal Left indicator) -->
        <value targetId="161" conversionABC="(D!=12)(D!=28)(((D>>2)&amp;1)|((D>>1)&amp;1))"/> <!-- Turn Signal Right indicator) -->
        <value targetId="166" conversionABC="(D!=12)(D!=28)((D>>1)&amp;1)"/> <!-- Hazard Switch indicator) -->
        <value targetId="156" conversionABC="(C>>7)&amp;1"/> <!-- Low Beam indicator) -->
        <value targetId="162" conversionABC="(D>>4)&amp;1"/><!-- Door Ajar indicator) -->
      </values>
    </command>

    <command send="30910001" name="MYECU: RELAY ON"></command> <!-- This should be a command for sending "30910001" when button on Realdash is pressed) -->
  </rotation>
</OBD2>

Currently OBD2 connection type does not support UI triggered commands. Adding commands to OBD2 XML file sends them constantly like any other PID request.

In order to have ‘true’ 2-way communication with your vehicle you would need to move into a CAN connection instead. With all the complexities of OBD2 connections, we have no plans to make it truly 2-way from RealDash.

Thanks for the reply, appreciate it!

By the way, it already works bidirectionally. If you try to send commands via the garage terminal, it is executed perfectly. It is also executed only once (first time) when you set the name of the source from the XML file, on the newly created button (toggle on/off). It seems that the logic in the backend is already set and works, but the button does not have a proper action, or we are not able to set it. Also, in this scenario, the command to send “30910001” would be placed outside of the rotation, or it would be declared as “actions” “triggers” XML tags, then it would not be executed every time in the loop, but only if it is called by something.

Is there any open source code or some access to this part, so I could try to develop this part by myself? Although it seems a bit complicated and tricky, I would shoot a try!

Thank you very much!

Yes, sure. The issue is not sending the commands, its handling the dozens of different replies that may come from the vehicles. No to mention up to 5 second delays it takes for the OBD2 adapters to handle some commands. And all these work very fluently on some vehicles, but cause a lot of issues on others. Its not a trivial task.

Yes, of course, I understand your point of view on this. Basically, the session is open for about 3500ms-4500ms. Sending a command that waits for a longer response will break the session and break the rotation loop (Probably something else in the backend too), therefore also breaking the connection, and you are not even able to send a “3E KeepAlive”, because the execution is in progress. That is not an issue in this specific case, because these specific requests and responses are quick and short, but generally speaking, yes, you are absolutely right. However, thank you, I am still looking for any kind of solution regarding this.
Cheers,