MicroPython CAN bus for ESP32

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Post Reply
aklein9999
Posts: 2
Joined: Sat Sep 21, 2019 2:07 pm

MicroPython CAN bus for ESP32

Post by aklein9999 » Sat Sep 21, 2019 2:19 pm

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

beyonlo
Posts: 31
Joined: Thu Nov 26, 2015 8:03 pm

Re: MicroPython CAN bus for ESP32

Post by beyonlo » Mon Sep 23, 2019 1:59 pm

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.

aklein9999
Posts: 2
Joined: Sat Sep 21, 2019 2:07 pm

Re: MicroPython CAN bus for ESP32

Post by aklein9999 » Mon Sep 23, 2019 2:39 pm

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.

beyonlo
Posts: 31
Joined: Thu Nov 26, 2015 8:03 pm

Re: MicroPython CAN bus for ESP32

Post by beyonlo » Mon Sep 23, 2019 11:22 pm

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.

User avatar
jimmo
Posts: 648
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia

Re: MicroPython CAN bus for ESP32

Post by jimmo » Tue Sep 24, 2019 12:11 am

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).

User avatar
roland_vs
Posts: 86
Joined: Tue Dec 08, 2015 8:28 pm
Location: Netherlands
Contact:

Re: MicroPython CAN bus for ESP32

Post by roland_vs » 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!

R

User avatar
jimmo
Posts: 648
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia

Re: MicroPython CAN bus for ESP32

Post by jimmo » Tue Sep 24, 2019 11:52 am

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 )

User avatar
jimmo
Posts: 648
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia

Re: MicroPython CAN bus for ESP32

Post by jimmo » Mon Oct 07, 2019 12:20 am


Post Reply