AxesOfEvil / VW_MkVI_Dynaudio

Dynaudio Amp control for VW MkVI GTI
2 stars 2 forks source link

Trying to simulate ignition #1

Open veso266 opened 6 months ago

veso266 commented 6 months ago

Hello there I have a test bench for PQ platform which you can see on the picture: https://imgur.com/fyGPqXu

On my Bench is RNS510 and 3C0 907 530 L gateway module

I would like to simulate ignition message I use MCP2515 module with my Arduino (seerduino the only difference is that u can also put it on 3.3V operation instead of 5V)

I also discovered that VW PQ cars have 3 canbuses: https://imgur.com/a/FAXZZzY Infotaiment - 100kbps Conveniences - 100kbps Drive train - 500kbps

I was able to throw together this little test program to trying to simulate ignition message I tried to use this library: https://github.com/autowp/arduino-mcp2515/tree/master

#include <SPI.h>
#include "mcp25151.h"

//MCP_CAN CAN0(10);     // Set CS to pin 10
MCP2515 mcp2515(10); // Set CS to pin 10

struct can_frame canMsg;

void sendCAN(uint32_t id, uint8_t length, uint8_t data0 = 0x00 , uint8_t data1 = 0x00 , uint8_t data2 = 0x00 , uint8_t data3 = 0x00 , uint8_t data4 = 0x00 , uint8_t data5 = 0x00 , uint8_t data6 = 0x00 , uint8_t data7 = 0x00);

void setup() {
  Serial.begin(115200);

  // Initialize MCP2515 running at 8MHz with a baudrate of 100kb/s and the masks and filters disabled.
  //if(CAN0.begin(MCP_ANY, CAN_500KBPS, MCP_8MHZ) == CAN_OK) Serial.println("MCP2515 Initialized Successfully!");
  //else Serial.println("Error Initializing MCP2515...");

  //CAN0.setMode(MCP_NORMAL);   // Change to normal mode to allow messages to be transmitted

  Serial.println("SetBitrate: " + String(mcp2515.setBitrate(CAN_500KBPS, MCP_8MHZ)));
  Serial.println("SetMode: " + String(mcp2515.setNormalMode()));
  Serial.println("VW CAN Interface");

}

void loop() {
  sendCAN(0x271, 2, 0x01, 0x80); //Ignition on

  //3 bytes 1. byte hat 0 wenn licht aus und 0x5C wenn licht an
  sendCAN(0x635, 3, 0x00, 0xFF, 0x00); //Light on

//7 bytes 1st byte bit 1 reverse gear
  //sendCAN(0x351, 7, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x7E, 0x7E); //Car is in reverse

  delay(100);

}

void sendCAN(uint32_t id, uint8_t length, uint8_t data0 , uint8_t data1 , uint8_t data2 , uint8_t data3 , uint8_t data4 , uint8_t data5 , uint8_t data6 , uint8_t data7) {
  struct can_frame canMsg1;
  canMsg1.can_id  = id;
  canMsg1.can_dlc = length;
  canMsg1.data[0] = data0;
  canMsg1.data[1] = data1;
  canMsg1.data[2] = data2;
  canMsg1.data[3] = data3;
  canMsg1.data[4] = data4;
  canMsg1.data[5] = data5;
  canMsg1.data[6] = data6;
  canMsg1.data[7] = data7;
  mcp2515.sendMessage(MCP2515::TXB1, &canMsg1);
}

The problem is that nothing happens If I disconnect the gateway, connect to 100kbps inforaiment bus according to this gateway pinout

1,2 - +12v (connection 30)
14 - +12v (connection 15 [Ignition])
11,12 - Ground connection
6 - powertrain CAN bus, low
16 - powertrain CAN bus, high
9 - DIAGNOSE can low
19 - DIAGNOSE can high
8 - Dashboard can low
18 - Dashboard can high
5 - convenience CAN bus, low
15 - convenience CAN bus, high
10 - infotainment CAN bus, low
20 - infotainment CAN bus, high
13 - to Dashboard pin15

my radio (RNS510 is not happy: https://imgur.com/B4BlY3l) if gateway is connected, this is what RNS510 displays: https://imgur.com/PAH2PBI

The problem is that I have no acsess to any PQ vehicle anymore so I don't have any real data so maybe am I not generating a proper message or my wiring is not correct, I don't know

So I would like to try to come to a common denominator, like SW is OK, my Hardware is faulty, so I was wondering if you maybe have some example code that would simulate ignition or turn lights on your radio on and you know that it does work so I could be sure, ok, this code should generate a proper walkup message and my hardware/connnections is not OK

BTW: if I connect to a drive train (500kbps bus), I can clearly see proper messages slika

so maybe I just am not generating a proper walkup signal or my timings are not correct, idk

Thanks for Anwsering and Best Regards

AxesOfEvil commented 6 months ago

I don't think I have exactly what you are looking for, but here are various codes captured from my vehicle. many of them are related to pressing buttons on the steering wheel (5x means I pressed it 5 times). I think the powerup/powerdown are turning on/off the amp, but I'm not 100% sure. They could be ignition on/off or radio on/off the 1 and 2 are just long captures which may or may not have me changing random things. This data is all a couple years old, so I don't remember the details of what I was capturing.

can.tar.gz