Closed MostHated closed 4 months ago
In principle, your concept should work, so let’s see what might be the problem. I see two major potential sources for the issue.
What you may also try is to connect two of the ESC1 (if you have two, and make sure they have different IDs!). If these work, the problem is reduced to the ESP.
I very much appreciate the reply.
I am for sure using s3 variants. I have both ESP32-S3-DevKitC-1-N16R8 and N8R2 standalone boards. A MaTouch ESP32-s3 2.1 inch Rotary, which uses a ESP32-S3-WROOM-1-N16R8, and the LilyGo T4 S3 is a ESP32-S3R8. The only thing about those two, though, is that they are custom boards, and after messing around with both for several hours, I tried to look it up online to see if either had the SJA1000, but I could not find info confirming or denying, so I was going to try it on one of the standalone boards next.
I didn't realize that only two terminations should/could have resistors. I will have to double-check my esp32 transceiver. I saw comments on amazon for the one I was using before my current one, that complained that it had a 120 ohm built into the board that they had to remove (Which certainly makes sense now as to why). That first one was cheap, and apparently a clone that would die often, so I replaced it with the WaveShare.
I don't know if the ESC1 has one already, but I didn't add a resistor at that end. I will try and confirm that, and add one if needed.
My USB device has a 120 Ohm switch you can turn on and off, which I did turn on, but didn't always have that device connected when troubleshooting to try and see if it was causing interference. I will turn that one off, since it won't always be a part of the bus system anyways.
I do have more ESC1's. One is still new in the box, and another I may have accidentally ruined while trying to solder on the wires for my encoder before I bought two 'desk clamp arm-rests' that steadied my hands tremendously. I can try to just add the CAN wires to that one and see if it works.
I should be able to confirm/test most of these things this afternoon and will report back. I also have this Digital Oscilloscope Kit being delivered today, that I saw someone on youtube using, which may be helpful in diagnosing (once I learn how to use it, lol).
The ESC1s have termination resistors which can be switched by software. My lib has a function for that purpose which you should see in the example. For the S3s make sure to use the latest version of the lib from last week. The older ones won’t work. Also, make sure to specify the correct IO pins for the CAN device. On the S3 you can use almost any pin for everything.
Boy, do I feel dumb. That's what I get for trusting the first image on google, not noticing that the image has "???" at the end...
I soldered my pins reflecting this image. Good thing I wasn't attempting to use the ground/power. I had everything backwards.
It's working great now that I reversed them, lol.
Sending Pong
Request int
Received: RTR from 0x21
Sending: 149011.609
Received: Pong from 0x21
Sending Pong
Request int
Rcvd int: 1234 from 0x21
Sending: 149011.609
Excellent news, good that it works now!
Hey there, I was trying out the sample and as far as I can tell, it seems to be working, but after a few iterations I end up getting an error of
CAN Error: Tx buffer overrun
. You will have to forgive me, as this is my first attempt to use/learn anything CAN related, so I only know the absolute minimum in terms of troubleshooting this, or what could/may go wrong.I am currently using a Lilygo T4 s3 device with a Waveshare SN65HVD230 transceiver, then also a B-G431B-ESC1. They are connected via two 3 way lever connectors, with the third connection being connected to my USB device.
Below is the output that I was seeing via platformio terminal.
Serial Output
``` Started CAN (ESP32): initializing, Tx=14, Rx=13, Speed=10 CAN: BTR0.B.BRP=4 CAN: initialized. CAN: setting filter single ID & mask, Std Frame CAN (ESP32): Start CAN: started. Setting CAN bus termination via software not possible Setup done, random device ID is 34 (0x22) New Status= -- -- TS RS TCS TBS --- --- ECC=0x0, RxErrors=0, TxErrors=0, Other=0 Sending: 2.500 New Status= -- -- TS RS --- --- --- --- ECC=0x0, RxErrors=0, TxErrors=0, Other=0 Sending Pong Request int Sending: 2.500 Sending Pong Request int Sending: 2.500 Sending Pong Request int Sending: 2.500 Sending Pong Request int Sending: 2.500 Sending Pong Request int Sending: 2.500 Sending Pong Request int CAN Error: Tx buffer overrun Sending: 2.500 CAN Error: Tx buffer overrun Sending Pong CAN Error: Tx buffer overrun Sending: 2.500 CAN Error: Tx buffer overrun Request int CAN Error: Tx buffer overrun ```I am not sure if it is something with the device choice, or if this is expected, etc. I figured it was worth an ask, just in case I am doing something incorrectly without realizing it. I wanted to use the LilyGo as it is a touchscreen and I wanted to make a small test UI with a slider or something to see if I could control a motor via SimpleFOC running on the b-g431b over CAN, so I do hope it is not an issue with the device, but if it is, then it is what it is.
Thanks, -MH
Side note:
I wanted to see if I could use a USB CANable device I just received (I followed their steps to install CANdleLight firmware, as I saw some posts and it seemed that was the usual things people did) to better view what was going on using:
But this does not show any sort of activity. I had tested it on it's own using an example I saw of how to write to the bus:
cansend can0 999#DEADBEEF
and I saw that show up on cansniffer, so I imagine that means it's working, but that is somewhat unrelated (unless I need to listen with settings specific to what the example sends?)