CAN bus library for ESP32 and STM32

Time to give something back to the community. I have cleaned up the code and the repo and made it public now. It can be found here:

Support for STM32 and ESP32 is available and I added an extensive readme.md. Probably there is still a lot to be improved in the documentation, but for now it must suffice. I hope I won’t mess up things simce I am always fighting wit github, branches and pull requests…

Anyway, have fun with it and let me know if something doesn’t work as expected!

5 Likes

Thank you, this is great.

Cheers,
Valentine

PS In case anyone needs the ESP32 PCB DIY, with baked in CAN Transceiver:

image
image

1 Like

How can it be added to the Arduino library? I mean in Arduino ide rather than platform IO.

It should work if you add the files to your Arduino project folder… its not (yet?) packaged as an Arduino library, so it won’t work via the library manager…

1 Like

You can package it as a library yourself. Although I agree with @runger that it probably needs to be properly packaged as a library by @grizzly, who owns the project.

Cheers,
Valentine

1 Like

Unfortunately I am currently a bit short on time and not using Arduino, so I don’t know how to pack it as a lib for Arduino quickly. I think however, you should be good when copying it to Arduino’s lib folder and somehow set the defines as in the platformio.ini file (see the lines with -D). The Platfomio.ini files contains one configuration for STM32 and one for ESP32.

As soon as I find some time, I will try to add it as a lib as well or at least prepare some instructions.

Hm, bad news. I just checked if there is a simple way to use it in Arduino, but it seems there is no simple way in Arduino to set project specific defines through the compiler. I’ll probably find a way around somwow, but that means more time.

Whoever is going to use it will have to find a way. You did the hard part.

Cheers,
Valentine

1 Like

TBH, I’d say if you’re ready for CAN-bus, you’re ready to move on from ArduinoIDE. :smiley:

All its advantages when you’re new to programming really become disadvantages once you have a bit of experience…