Xinyuan-LilyGO / LilyGO-T-SIM7000G

LilyGO T-SIM7000G
https://pt.aliexpress.com/item/4000542688096.html
284 stars 123 forks source link

Different connection speed for CAN communication ? #207

Open vkcorp opened 1 year ago

vkcorp commented 1 year ago

As you may know I'm using SN65HVD230 with my TSIM7000G for CAN communication, and I got some strange thing with it.

I have 2 target devices and I usually use 500kbps as below :

CAN_cfg.speed = CAN_SPEED_500KBPS;

it didn't make any problem if I used it with esp32-dev board, but in case of using TSIM7000G I have a problem !

FYI. One of my devices is ECUSIM2000 and it doesn't make any problem while using 500kbps+7000g and 500kbps+esp32. https://www.obdsol.com/solutions/development-tools/obd-simulators/ecusim-2000/ The other one is real car and it has a problem with 500kbps even it's still working well with esp32-dev board.

After a few trials, I found I had to change the connection speed to 1000kbps (only for 7000G).

CAN_cfg.speed = CAN_SPEED_1000KBPS;

But if I try 1000kbps with esp32, it's failed and no data from the car. esp32 only works with 500kbps as it did.

Is ther any reason I can expect with above situation ? Why 7000G require to work with twice of connection speed(compared to esp32), or do I have to consider ANY special cases with 7000G ?

DevinCarpenter commented 1 year ago

What?

Ok, let's keep in mind that the SIM7000G is just a cellular board that the ESP32 communicates with.

You are trying to communicate over a CAN protocol data bus from your car or the ECUSIM2000 OBD-2 simulator to the ESP32 on the Lilygo Board...correct?

The ESP32-Wrover-E is the ESP32 model we're working with, and it's definitely not the best one on the market, so it could be that the one you're using is just better.

What is the ESP32-dev board you are using. Do you have a model number?

Also - have you tried connecting to the esp32 over USB? The default baud rate for the ESP32 is 115200...so unless you change that - you're gonna get back garbage.

tanker5595 commented 1 year ago

Hi, have you solved this problem?

I am also having difficulty with the CAN (TWAI) controller on LilyGO-T-SIM7000G. I cannot get the board to communicate with a car or any other CAN BUS device. I have tried both SN65HVD230 and MCP2551 transceivers.

I've also tried multiple libraries but none of them worked so far. eg. libraries https://github.com/collin80/esp32_can https://github.com/sandeepmistry/arduino-CAN

My intended purpose is to log some engine stats to an sd card and send the most critical togeather with GPS coordinates over GSM to a live dashboard.

vkcorp commented 1 year ago

@DevinCarpenter

What is the ESP32-dev board you are using. Do you have a model number?

Also - have you tried connecting to the esp32 over USB? The default baud rate for the ESP32 is 115200...so unless you change that - you're gonna get back garbage.

I'm using below chip from Ali :

1PCS ESP32 Development Board WiFi+Bluetooth Ultra-Low Power Consumption Dual Core ESP-32S ESP32-WROOM-32D ESP32-WROOM-32U ESP 32

Yes, usb connection speed is 115200, and CAN speed is 500KB. Well, no problem in esp32 chips, but 7000G didn't.

@tanker5595

I cannot get the board to communicate with a car or any other CAN BUS device. I have tried both SN65HVD230 and MCP2551 transceivers.

In my cases, I don't have any problem on esp32 chips, but I had some troubles to do same things on 7000G. No answer and no solution yet... But I recommend just try to change the CAN speed to various even it's not the value on the manual !