CAN on ESP32 Devkit V1 is Problematic - Many do not work

Transisted
Posts: 4
Joined: Mon Oct 02, 2023 10:41 pm

Re: CAN on ESP32 Devkit V1 is Problematic - Many do not work

Postby Transisted » Thu Feb 01, 2024 9:16 pm

Does anybody have anything? What I think is strange is, I can get the ESP32's that don't work on GM High Speed CAN to talk directly to each other as send/receive... but not on the GM High Speed Can network. My 6-7 original Devkit V1's work find though... just the newer ones don't work.


Last bumped by Transisted on Thu Feb 01, 2024 9:16 pm.

Transisted
Posts: 4
Joined: Mon Oct 02, 2023 10:41 pm

CAN on ESP32 Devkit V1 is Problematic - Many do not work

Postby Transisted » Thu Feb 01, 2024 9:22 pm

Hello, so I've had this 500kbps CAN network doing great for years, mainly using Devkit v1 ESP32's with MCP2551 and a 2.8" SPI TFT, with touch, etc. Working great. I probably have 3-4 of these, and they all work great reading CAN over GM OBD network, sending receiving, no problem. I chose the Devkit v1 because it auto-uploads without pushing the reset button. I think there is a resistor built into the button circuit, on the board. I'm stuck using these Devkit v1's because I made a 30 batch circuit boards for easy connection to the TFT.

Then, recently I ordered more of the Devkit v1's, and 99% do not work on the CAN network.. they simply dont show messages, like it's not connected!

I swap to a Devkit v4, no problems, or any other version ESP32 on my bench, it's just these Devkit V1 that are causing me problems.

I recently ordered 6 more from Amazon, two different vendors with slightly different silkscreen text appearance, but still only one of these 6 work with CAN.

Any ideas? Any help would be great. Below is the base example I use to show all CAN messages. I've even tried adding another 120ohm termination resistor... with no help.

Code: Select all

#include <ESP32CAN.h>
#include <CAN_config.h>

CAN_device_t CAN_cfg;


  char msgString[8];
  char dataString[8];

 

void setup() {
    Serial.begin(115200);
    Serial.println("ESP32Can_READ_EVERYTHING_v2");
    CAN_cfg.speed=CAN_SPEED_500KBPS;  // was 1000,  need 500
    CAN_cfg.tx_pin_id = GPIO_NUM_5;
    CAN_cfg.rx_pin_id = GPIO_NUM_4;
    CAN_cfg.rx_queue = xQueueCreate(10,sizeof(CAN_frame_t));
    //start CAN Module
    ESP32Can.CANInit();
    delay(2000); // delay to show the filename in serial monitor
}


void loop() {


  CAN_frame_t rx_frame;   // starts CAN Messages


  //receive CAN Data...
  if(xQueueReceive(CAN_cfg.rx_queue, &rx_frame, 3*portTICK_PERIOD_MS) == pdTRUE)
  {
  
                         
        Serial.print("Message ID: ");   
        //Serial.println(rx_frame.MsgID);   
        Serial.print(rx_frame.MsgID,HEX);
        Serial.print(", Data: "); 
        Serial.print(rx_frame.data.u8[0]);
                  Serial.print(" ");
          
                  Serial.print(rx_frame.data.u8[1]);
                  Serial.print(" ");
         
                  Serial.print(rx_frame.data.u8[2]);
                  Serial.print(" ");
                  
                  Serial.print(rx_frame.data.u8[3]);
                  Serial.print(" ");
         
                  Serial.print(rx_frame.data.u8[4]);
                  Serial.print(" ");
         
                  Serial.print(rx_frame.data.u8[5]);
                  Serial.print(" ");
         
                  Serial.print(rx_frame.data.u8[6]);
                  Serial.print(" ");

                  Serial.print(rx_frame.data.u8[7]);
                  Serial.print(" ");

                  Serial.print(rx_frame.data.u8[8]);
                  
                  Serial.println(" ");

          
                }

                
        else{
            Serial.println("Waiting for CAN data...");
            
            }    

} // EEND OF RECEIVE CAN MESSAGES LOOP

Who is online

Users browsing this forum: No registered users and 136 guests