CAN writeInterval and Static Values

I’m currently using pican2 connected to a vehicle, I can already successfully pull RPMs and the Speedometer off of the canbus. Not everything is currently being sent over canbus (actively). I need to be able to request the information I need. I’ve already successfully tested this with cansend and can get back what I want if I can send the right message.

This is my current can description xml file.

<?xml version="1.0" encoding="utf-8"?>
<RealDashCAN version="2">
    <frames>
        <frame id="0x201" endianess="big">
            <value name="rpm" targetId="37" units="RPM" offset="0" length="2"></value>
            <value name="speedometer" targetId="81" offset="4" length="2" conversion="V/100"></value>
        </frame>
    </frames>
</RealDashCAN>

What I need to be able to do is send a message every x interval to get the message back. Essentially, I’m doing obd2 over canbus for some of the values that are passive and that you can’t actively get just by parsing messages on the canbus.

So I tried the following to get the transmission fluid temperature

<?xml version="1.0" encoding="utf-8"?>
<RealDashCAN version="2">
    <frames>
        <frame id="0x7E1" writeInterval="10000">
            <value offset="0" length="8">0322167400000000</value>
        </frame>
        <frame id="0x201" endianess="big">
            <value name="rpm" targetId="37" units="RPM" offset="0" length="2"></value>
            <value name="speedometer" targetId="81" offset="4" length="2" conversion="V/100"></value>
        </frame>
    </frames>
</RealDashCAN>

Which doesn’t seem to work as I’m watching the canbus for messages and that doesn’t ever get sent. Which leads me to believe the xml file may not support what I’m trying to do here and that you can’t shove static data into . I didn’t see documentation anywhere on being able to do that.

If I do cansend can0 7e1#0322167400000000 I get the following back can0 7E9 [8] 05 62 16 74 02 59 00 00 which gives me the oil temperature of the transmission. I realize I’d have to look for that message and do conversions in the can xml file, but I’m trying to get it to send the request first.

And, yes, I know that I’m trying to do obd2 here with the can description file, but I want to be able to use the canbus directly and get passive values (which is what obd2 is over can). I don’t think the pican2 is even supported as an obd2 device anyways and I wouldn’t get the extremely fast responses on the speedometer and tach if I wasn’t using the canbus for those. I might eventually be able to pull some more values over the canbus without sending the request message, but I am certain I can’t get them all.

This also allows me to reuse the information that is already there from xguage/scanguage on this vehicle.
https://www.scangauge.com/x-gauge-commands/6-0l-diesel/

just thought of this but as a side note, I could run a process in the background that sends the messages I need if realdash won’t support it.

this is running on a raspberry pi as an fyi.

I’m testing the Initial Value parameter for fixed values, in my application with RealdashCAN, but the parameter only works with just one Byte, if I put a second it doesn’t work.

Your idea of the write interval is correct and frame will be written to CAN bus, but you still need to give the value a name and/or targetId. Then you need to set that value in RealDash actions.

I will take a look at what may be a problem with initialValue parameter in XML.

1 Like

@kcnz hi just wondering if you managed to get this working. I have managed to migrate all but five signals from obd2 to canbus (I have and OBD2 adapter and a CANBUS adapter on a splitter cable), but would be nice to eliminate the OBD2 adapter and cable