[TUTO] Adaptateur pour SMEG/NAC/Matrice CAN2010 sur BSI CAN2004

[QUOTE = "VLud, post: 2607954, member: 108646"] I don't have the opportunity to dump frames for this (From a SMEG IV2 CAN2004), so no, not until someone makes the conversion code for it. [/ QUOTE]
THANK YOU :)
 

[QUOTE = "VLud, post: 2607954, member: 108646"] I don't have the opportunity to dump frames for this (From a SMEG IV2 CAN2004), so no, not until someone makes the conversion code for it. [/ QUOTE]
HW DO YOU GET NAC TO DSPLAY WARNING MESSAGES MAINTAINANCE FAULTS LOW FUEL ETC ?
 


noto i mean like the nac smeg etc does naturaly when fuel low or engine fault it comes up on the nac smeg screen ?
 


[QUOTE = "tech73, post: 2607961, member: 125627"] [QUOTE = "VLud, post: 2607957, member: 108646"] Build another Arduino for Diagnostic purposes and code the NAC for it [/ QUOTE]
no i mean like the nac smeg etc does naturaly when fuel low or engine fault it comes up on the nac smeg screen? [/ QUOTE]
?
 


[QUOTE = "tech73, post: 2608333, member: 125627"] hi have changed listen can2004 to false now the clock will not display on the nac? [/ QUOTE]
language and unit setting ok now though :) but no clock what am i doing wrong ?
 

if i use your original sketch that i downloaded last year that displays clock but cant change language units
ue the one that is there now no clock but can change units
also it gives me engine light invalid data on can from bsi
 

Seriously stop spamming ...
I don't know your setup, you don't give any useful information rather than "it does not work", not even debug informations, what do you expect ?
Depending on your shields you could have swapped CS_PINs earlier

also it gives me engine light invalid data on can from bsi

Short-circuit or reversed CAN-BUS, not related to the sketch itself.
 

[QUOTE = "VLud, post: 2608364, member: 108646"] Seriously stop spamming ...
I don't know your setup, you don't give any useful information rather than "it does not work", not even debug informations, what do you expect?
Depending on your shields you could have swapped CS_PINs earlier



Short-circuit or reversed CAN-BUS, not related to the sketch itself. [/ QUOTE]
very sorry do not intend to spam but do not understand arduino well when you say swapped cs pins or reverse can bus could you explain a little easier for me please

once again i am sorry no intention to spam
 

Code:
#define CS_PIN_CAN0 10
#define CS_PIN_CAN1 9

You could have swapped 10 & 9 earlier (in the code)

You could have physically reversed two wires (Low & High) or not having isolated the pins under the DB9 connector making the bottom shield short-circuited to ground or swapped the CAN order on the shields (one is CAN2004 the other one the converted CAN) fixable by modifying the code as mentioned earlier.

Set debugGeneral to true and check the console to see few things
 

[QUOTE = "VLud, post: 2608376, member: 108646"]
Code:
 #define CS_PIN_CAN0 10
#define CS_PIN_CAN1 9 [/ CODE]

You could have swapped 10 & 9 earlier (in the code)

You could have physically reversed two wires (Low & High) or not having isolated the pins under the DB9 connector making the bottom shield short-circuited to ground or swapped the CAN order on the shields (one is CAN2004 the other one the converted CAN) fixable by modifying the code as mentioned earlier.

Set debugGeneral to true and check the console to see few things [/ QUOTE]
hello i have checked the  cards and connections that you mention here no shorts all connected correctly i am using two lots of code the one you posted last year which i saved and the raw code that is there now 

10 and 9 have not been swapped if i use the old code i get clock but cant change language unless i change this line to 1 

byte languageID = 0; // Default is FR: 0 - EN: 1 / DE: 2 / ES: 3 / IT: 4 / PT: 5 / NL: 6 / BR: 9 / TR: 12 / RU: 14

but then i cannot change language or units but clock is displayed 

if i use the code in the link on github i have no clock display although every now and then it will display for a few seconds then dissapear 
then after a while my check engine light comes on 

i am really confused if someone could help me please nac install in 2012 c5x7 

thank you
 

Hello good morning ,I am using the rtc module memory power stack in arduino az- delivery and also using can-shield V2 boards my question is Can you connect RTC module with cables in arduino also appear scl, sda, 5v and gnd) instead from en can shield? Is the same ? Thanks.
 

Your message is not comprehensible

SCL SDA 5V & GND can be taken from the Arduino or any shield
 


Hello, I am the owner of a Citroen C5 X7, I have started modifying a smeg iV to NAC, I have already used the can converter, with arduino 1 and 2, can shield 2.0. I have already managed to modify the language, the browser information appears in speedometer screen, although I have not been able to get the height information, although my big concern is that I cannot make some keys on the steering wheel work, such as the menu or the wheel for example. Can you help me?
Thanks.
 

You may need to look at the frames sent to the Arduino from the BSI2004, when you push the buttons. Once you get the codes, modify your Arduino sketch to affect the observed frames to the correspond BSI2010 functions in the sketch (for the NAC). I admit I don't have such "complex" commands on the C3 A51 I upgraded thanks to the Lord and I didn't have to do so, using the famous "3 fingers on the NAC screen" to access the NAC menu.
 
Dernière édition:

You may need to look at the frames sent to the Arduino from the BSI2004, when you push the buttons. Once you get the codes, modify your Arduino sketch to affect the observed frames to the correspond BSI2010 functions in the sketch (for the NAC). I admit I don't have such "complex" commands on the C3 A51 I upgraded thanks to the Lord and I didn't have to do so, using the famous "3 fingers on the NAC screen" to access the NAC menu.
Thank you very much for answering, which program should I use to first identify these signals when pressing the buttons, we will leave the programming for later. Thank you and thus start.
 


[QUOTE = "VLud, post: 2608364, member: 108646"] Seriously stop spamming ...
I don't know your setup, you don't give any useful information rather than "it does not work", not even debug informations, what do you expect?
Depending on your shields you could have swapped CS_PINs earlier



Short-circuit or reversed CAN-BUS, not related to the sketch itself. [/ QUOTE]
very sorry do not intend to spam but do not understand arduino well when you say swapped cs pins or reverse can bus could you explain a little easier for me please

once again i am sorry no intention to spam
@VLud
i have found the problem well a solution my c5 had no telematic unit and the little emf orange display was not present
so the bsi detects a fault on the can bus and shuts the can bus down hence my engine light on all the time and other can errors

my solution i wired back the emf screen on the can2004 side lower card of the can bus and connected it back as per wiring diagram now no more errors of engine or can and nac working fine now.
maybe if anyone else encounter this if they remove the small screen this error will apear and give situation that i had
i am very happy now and your work is sent from the lord great work Vlud :)
 
Dernière édition:

Hi,
I have c5x7 with smegiv2. I want to change to nac. Is it possible to use the MENU, VOL + and VOL- buttons of the smegiv2 in Nac? These buttons are now connected directly to the smegiv2.
Thanks
 

Pièces jointes

  • 20210223_111945.jpg
    20210223_111945.jpg
    73.2 Ko · Affichages: 42


The debug in the sketch is compatible with the Python script / soft of Alexandre Blin which is extremely useful to find moving bytes pressing a button
Hello, can you tell me if this software should be installed on arduino? And if it is the arduino can shield that I use for diagnosis? or in which I use for communications from can 2004 - can 2010? Thank you.
I did a test this morning with arduino can reciver but did not know where to display the menu and back keys values, thinking it would be easier. Thanks again.
 


Hi all,

Took me a while (not enough time because of work). But i finally finished my CAN2010 to CAN2004 box.
3 digital inputs (with pullup enabled) are added on pin D4, D5 and D6 to work with the 3 buttons that are normally connected to the smeg or instrument cluster on newer DS3's. Below you will find the code i made, it includes a state machine for these buttons (MENU, VOL-, VOL+ and Mute). They behave like in the SMEG, they first go slow and then go faster if you keep pushing the buttons. also VOL-+VOL+ = Mute.
Ground for the buttons are connected to the INPUT ground of the power supply. Not after power supply as the ground is also used for the 12V for the light inside the buttons. Otherwise using ground after power supply might mix things up.

NbuUL6N.jpg

WwoURc2.jpg

cCW2ZVq.jpg

bs35AoS.jpg

xkvd5aI.jpg

zniu79v.jpg


I used the following:
Arduino Nano - €1,78
2x MCP2515 module - €2,30
DS3231 RTC module - €1,22
LM2596 powersupply - €0,61

Total price, including shipping was below 10 euros.
 
Dernière édition:

Below are only the code changes, the code is to long to post.
Each section is just copy paste inside the latest sketch found on in the first post.
@VLud : sorry had to remove the copyright notice at the top also :(... It is still there in my mind!
Maybe add the buttons in your sketch? I also added the VIN changing part from my old post and temperature monitoring of the arduino box which throws a funny error on screen. Had to pick one that was unknown to my car.

Code:
/////////////////////
//    Libraries    //
/////////////////////

#include <EEPROM.h>
#include <SPI.h>
#include <Time.h>
#include <TimeLib.h>
#include <Wire.h>
#include <DS3232RTC.h> // https://github.com/PaulStoffregen/DS3232RTC
#include <mcp2515.h> // https://github.com/autowp/arduino-mcp2515 + https://github.com/watterott/Arduino-Libs/tree/master/digitalWriteFast


////////////////////
//   Variables    //
////////////////////

int buttonState = 0;   
int lastButtonState = 0;
long lastDebounceTime = 0;
long buttonPushTime = 0;
long buttonSendTime = 0;
long debounceDelay = 100;
long lastTempWarning = 0;
bool tempWarningState = false;

void setup() {
  //Initialize buttons - MENU/VOL+/VOL-
  pinMode(4, INPUT_PULLUP);
  pinMode(5, INPUT_PULLUP);
  pinMode(6, INPUT_PULLUP);
}

void loop() {
  int tmpVal;

  // Receive buttons from the car
  if (((millis() - lastDebounceTime) > debounceDelay)) {
    tmpVal = 0;
    if (!digitalRead(4)) tmpVal += 0b001;
    if (!digitalRead(5)) tmpVal += 0b010;
    if (!digitalRead(6)) tmpVal += 0b100;
    if(tmpVal != lastButtonState){
        buttonPushTime = millis();
        buttonSendTime = 0;
    }
    if((millis() - buttonPushTime) > 100){
      switch(tmpVal){
        case 0b001:
          canMsgSnd.data[0] = 0x80;
          canMsgSnd.data[1] = 0x00;
          canMsgSnd.data[2] = 0x00;
          canMsgSnd.data[3] = 0x00;
          canMsgSnd.data[4] = 0x00;
          canMsgSnd.data[5] = 0x02;
          canMsgSnd.data[6] = 0x00;
          canMsgSnd.data[7] = 0x00;
          canMsgSnd.can_id = 0x122;
          canMsgSnd.can_dlc = 8;
          // Menu button
          if(buttonSendTime == 0){
            CAN1.sendMessage( & canMsgSnd);
            if (SerialEnabled) {
              Serial.println("Menu");
            }
            lastDebounceTime = millis();
            buttonSendTime = millis();
          }
          break;
        case 0b010:
          canMsgSnd.data[0] = 0x04; //Volume down
          canMsgSnd.data[1] = 0x00;
          canMsgSnd.data[2] = 0x00;
          canMsgSnd.can_id = 0x21F;
          canMsgSnd.can_dlc = 3;
          // Menu button
          if(buttonSendTime == 0){
              CAN1.sendMessage( & canMsgSnd);
              if (SerialEnabled) {
                Serial.println("Vol -");
              }
              lastDebounceTime = millis();
              buttonSendTime = millis();
          }else if(millis() - buttonPushTime > 800 && ((millis() - buttonPushTime < 2000 && millis() - buttonSendTime > 600) ||(millis() - buttonPushTime > 2000  && millis() - buttonSendTime > 350))){
              CAN1.sendMessage( & canMsgSnd);
              if (SerialEnabled) {
                Serial.println("Vol -");
              }
              buttonSendTime = millis();
              lastDebounceTime = millis();
          }
          break;
        case 0b100:
          canMsgSnd.data[0] = 0x08; //Volume down
          canMsgSnd.data[1] = 0x00;
          canMsgSnd.data[2] = 0x00;
          canMsgSnd.can_id = 0x21F;
          canMsgSnd.can_dlc = 3;
          // Menu button
          if(buttonSendTime == 0){
              CAN1.sendMessage( & canMsgSnd);
              if (SerialEnabled) {
                Serial.println("Vol +");
              }
              lastDebounceTime = millis();
              buttonSendTime = millis();
          }else if(millis() - buttonPushTime > 800 && ((millis() - buttonPushTime < 2000 && millis() - buttonSendTime > 600) ||(millis() - buttonPushTime > 2000  && millis() - buttonSendTime > 350))){
              CAN1.sendMessage( & canMsgSnd);
              if (SerialEnabled) {
                Serial.println("Vol +");
              }
              buttonSendTime = millis();
              lastDebounceTime = millis();
          }
          break;
        case 0b110:
          canMsgSnd.data[0] = 0x0C; //Mute
          canMsgSnd.data[1] = 0x00;
          canMsgSnd.data[2] = 0x00;
          canMsgSnd.can_id = 0x21F;
          canMsgSnd.can_dlc = 3;
          // Menu button
          if(buttonSendTime == 0){
              CAN1.sendMessage( & canMsgSnd);
              if (SerialEnabled) {
                Serial.println("Mute");
              }
              lastDebounceTime = millis();
              buttonSendTime = millis();
          }
          break;
       default:
          lastDebounceTime = millis();
       }
    }
    lastButtonState = tmpVal;
  }

  tmpVal = RTC.temperature();
  if(tmpVal / 4.0 > 80 && millis() - lastTempWarning > 30000){
      canMsgSnd.data[0] = 0x80;
      canMsgSnd.data[1] = 0xEA;
      canMsgSnd.data[2] = 0x80;
      canMsgSnd.data[3] = 0x00;
      canMsgSnd.data[4] = 0x00;
      canMsgSnd.data[5] = 0x00;
      canMsgSnd.data[6] = 0x00;
      canMsgSnd.data[7] = 0x00;
      canMsgSnd.can_id = 0x1A1;
      canMsgSnd.can_dlc = 8;
      if (SerialEnabled) {
        Serial.println("Arduino temp to high");
      }
      CAN1.sendMessage( & canMsgSnd);
      tempWarningState = true;
      lastTempWarning = millis();
  }else if (tempWarningState && millis() - lastTempWarning > 8000){
      canMsgSnd.data[0] = 0xFF;
      canMsgSnd.data[1] = 0xEA;
      canMsgSnd.data[2] = 0x00;
      canMsgSnd.data[3] = 0x00;
      canMsgSnd.data[4] = 0x00;
      canMsgSnd.data[5] = 0x00;
      canMsgSnd.data[6] = 0x00;
      canMsgSnd.data[7] = 0x00;
      canMsgSnd.can_id = 0x1A1;
      canMsgSnd.can_dlc = 8;
      if (SerialEnabled) {
        Serial.println("Clear arduino temp to high");
      }
      CAN1.sendMessage( & canMsgSnd);
      tempWarningState = false;
  }
}
 
Dernière édition:

[QUOTE = "VLud, post: 2607954, member: 108646"] [/ ЦИТИРОВАТЬ]
please tell me, I own a Peugeot 407 and would like to install NAC. But my question is, will my rt4 device no longer be used like the buttons on it?


dites-moi, je possède une Peugeot 407 et je souhaite installer NAC. Mais ma question est la suivante: mon appareil rt4 ne sera-t-il plus utilisé comme les boutons dessus?
 

@V3nn3tj3 Good job ! Thank's, I will check how I can add your code (with credit) while keeping the sketch generic I will also add my code for VIN rewrite
 
  • J'aime
Reactions: V3nn3tj3