Wednesday 24 January 2018

Success Feels Good! (Part 2)

So following my weekend success (read about it here), I had a day of rest and recovery (Monday) and came home from work on Tuesday inspired and energized to start the next step.

Read before you Write
So what would be the next step? Let's review what I have done so far:

  1. Build and test interface
  2. Write and test my code
  3. Successfully read data from the vehicle and run logic on the data to activate an LED / buzzer on my Arduino breadboard

If you read carefully you will see that up to now I have only been reading the vehicle.

The next step is to write to the vehicle: send it a command to do something, and check that the command was properly executed.

If you do Write, Write Carefully
But you don't send it any sort of random data. You need to know what device you want to write to, know it's address, know the command, and be confident that the command is not dangerous. Ask yourself these questions:

  1. What are you instructing the vehicle to do? 
  2. What will be the expected outcome?
  3. Will it likely have any bad side effects?

For example, I do NOT want to send a random command to the SRS system that may activate the airbags! Neither do I want to send a command to stress any electrical component such as drive an electric motor beyond it's designed limits.

So you do very much need to prepare yourself with knowledge (there is a fair amount on the Internet, start looking) and it is always good to have experience (nothing beats hours in the saddle when learning to ride).

So that's what I did on Tuesday night: after careful study and consideration, I prepared some commands and executed them in the vehicle.

All I wanted to do was light a lamp, and sound a gong. That is a safe area to play in.

And by the end of the night I had achieved:

  • Control of all the lamps on the instrument cluster: low oil, charge lamp, indicator lamps, high-beam, park brake, ABS, general warning lamp, etc. etc. etc.
  • Control of the gong - turning it on and off
  • Knowledge of when the gong in the DIM is active and how it works in response to the commands I send it. It does remain active after the ignition is turned off and the key removed from the ignition for approximately 60 seconds, enough for me.

I also caused an SRS AIRBAG SERVICE URGENT fault and had to clear that with VIDA. Being forewarned is being forearmed as they say, I had VIDA by my side ready to go and deal with any problems when they happen. And that problem did happen.

I now have the knowledge on how to sound the gong and illuminate the yellow warning triangle - which is exactly what I need for my Lights On Ding app.

Time now to start building those commands into my code and test the Arduino... keeping in mind that I am working in a live environment in a fully functional car, and I don't have any intention of damaging anything....

Onwards and upwards!

2 comments:

  1. Hi - thanks for great blog. I have a P2 DIM (2005-2009) which is connected to my PC using Arduino and CANBUS shield using instructions from youtube. https://www.youtube.com/watch?v=wLj1aOPjB_4

    Controlling the DIM warning lamps is pure guess work right now, but I am able to light the high beam lamp, blinkers, headlight. Also my cluster has TPMS warning indicator on, it would be nice to clear this one.
    I would appreciate, if it is possible for you to share the address and message structure for the rest of the DIM warning lamps?

    ReplyDelete