Page 1 of 1

MicroPython CAN bus for ESP32

Posted: Sat Sep 21, 2019 2:19 pm
by aklein9999
I have been searching up and down for a solid MicroPython library that allows the use of the internal CAN bus controller of an ESP32 board.

Unfortunately I couldn't find anything.

CAN bus is a very essential must have function, and I am genuinely surprised that is is not included in the machine library for the ESP32 hardware.

Does anyone have a solution? I would donate to this forum a reasonable sum if someone would implement it.

Additionally, I also couldn't find a MicroPython library to control an external CAN controller (e.g. for the MCP2515)…

I would appreciate any help.

Alex :D

Re: MicroPython CAN bus for ESP32

Posted: Mon Sep 23, 2019 1:59 pm
by beyonlo
Hello.

I agree, CAN Bus, like as MOD bus are very essential, and I am surprised too those it is not included in the micropython for ESP32.

For the CAN Bus, ESP32 has the MAC/Controller, but not the transceiver. But if you need just to communicate from a microcontroller to microcontroller, like as ESP32 to ESP32, or ESP32 to STM, and so on, you do not need the transceiver.

Re: MicroPython CAN bus for ESP32

Posted: Mon Sep 23, 2019 2:39 pm
by aklein9999
Dear beyonlo,

Thank you for your reply.

At this point I am not worried about the bus driver, this I would do externally of course.

Maybe someone can tell me if and how it would be possible to make an official request directly to the MicroPython developers who could be in charge of this.

Re: MicroPython CAN bus for ESP32

Posted: Mon Sep 23, 2019 11:22 pm
by beyonlo
Hi, you can to try to open a issue in the https://github.com/micropython/micropython

There has many open requests, and maybe more developers can see your request. I don't know if there is the best way, but is another place that you can to try.

Re: MicroPython CAN bus for ESP32

Posted: Tue Sep 24, 2019 12:11 am
by jimmo
aklein9999 wrote:
Mon Sep 23, 2019 2:39 pm
Maybe someone can tell me if and how it would be possible to make an official request directly to the MicroPython developers who could be in charge of this.
beyonlo wrote:
Mon Sep 23, 2019 11:22 pm
Hi, you can to try to open a issue in the https://github.com/micropython/micropython
Yup, this is the best way. Unfortunately the word "CAN" isn't very easy to search for in the existing bugs.

The feature you want is not terribly difficult to implement (compared to some of the other features that people are looking for!) and is supported by the ESP-IDF (see https://docs.espressif.com/projects/esp ... s/can.html ).

MicroPython is an open source project and the ESP32 port is almost entirely contributed by volunteers. CAN would obviously be a great feature. If you need this feature to be implemented then finding a way to fund someone else to do it might be a good option to get it done sooner. Whomever you find to implement it probably doesn't need that much MicroPython experience -- CAN and ESP-IDF experience is probably far more useful, so you could probably search outside of the MicroPython community.

I personally would love to see more of this "sponsored development of features" so I'm glad to see you offering. (But I understand that other people feel differently).

Re: MicroPython CAN bus for ESP32

Posted: Tue Sep 24, 2019 7:35 am
by roland_vs
For the STM32 port there is CAN support from the beginning and recently FDCAN is added for the H743. The python class/bindings with C are already there so that any effort for the ESP32 can get a head start!

R

Re: MicroPython CAN bus for ESP32

Posted: Tue Sep 24, 2019 11:52 am
by jimmo
roland_vs wrote:
Tue Sep 24, 2019 7:35 am
For the STM32 port there is CAN support from the beginning and recently FDCAN is added for the H743. The python class/bindings with C are already there so that any effort for the ESP32 can get a head start!
Yeah, that's a great point. And possibly some additional inspiration, the MCPWM implementation from this thread viewtopic.php?f=18&t=6998 is a great example of a self-contained implementation of making an ESP-IDF feature available to Python. (Specifically this commit: https://github.com/bskp/micropython_esp ... 4425fc7928 )

Re: MicroPython CAN bus for ESP32

Posted: Mon Oct 07, 2019 12:20 am
by jimmo

Re: MicroPython CAN bus for ESP32

Posted: Tue Jun 09, 2020 5:46 am
by triumvus
Seems like development stopped. Is anyone aware of a functional CAN implementation on esp32?