Open koulombus opened 3 days ago
I suggest you also post this in the ESP-IDF repo, because it uses all their APIs. You should be able to get some help there. Let them know you are using IDF v5.1.4
Code works fine:
TX buffered: 0 Message queued for transmission
Alert: The Transmission was successful.
TX buffered: 0 Message queued for transmission
Alert: The Transmission was successful.
TX buffered: 0 Message queued for transmission
Alert: The Transmission was successful.
Have you connected any other device to CAN-H, CAN-L lines? There must be at least 2 devices for CAN bus to work. CAN bus sniffer does not count. It works in "listen" mode and does not influence the bus.
@aaarnas, I wouldn't have expected that, because at the time the device is started from pre-operational to operational, this information has to be sent. At this point I basically don't know whether a device is connected, basically only one NMT is serving, which is also just listening. But I will try it!
I had in mind second Node, physically connected to CAN lines.
If you leave H,L lines unconnected - ESP32 puts message to TX queue but fails to transfer, because there is no one on CAN bus network to receive and acknowledge it. This is indicated as "bus error".
Board
ESP32 WROOM 32
Device Description
on a own board. Analyzer 2.0.sch.zip
Hardware Configuration
CAN/TWAI communication
define RX_PIN GPIO_NUM_17
define TX_PIN GPIO_NUM_16
CAN driver: SN65HVD230
Version
v3.0.1
IDE Name
Arduino IDE 2.X
Operating System
MacOS 14.5
Flash frequency
80MHz
PSRAM enabled
no
Upload speed
115200
Description
It is not possible for me to send data for a long time with this original sketch. It works for the first few seconds, but then no longer. With my CAN bus sniffer I can see the data being sent.
Sketch
Debug Message
Other Steps to Reproduce
I used another library (ACAN_ESP32 - Arduino Reference), with this I could receive data but not send it, which led me to this library.
I have checked existing issues, online documentation and the Troubleshooting Guide