MCP2515-Library MicroPython

Discuss development of drivers for external hardware and components, such as LCD screens, sensors, motor drivers, etc.
Target audience: Users and developers of drivers.
Post Reply
timi257
Posts: 1
Joined: Tue Sep 18, 2018 1:18 pm

MCP2515-Library MicroPython

Post by timi257 » Tue Sep 18, 2018 1:25 pm

Hello,
I'm new to MicroPython and don't have much experience with it, so please pardon if any questions sound stupid.

I have a working Arduino-Sketch that uses this lib: https://github.com/autowp/arduino-mcp2515
To communicate via CAN-Bus.

Now I want to port this sketch to MicroPython on a ESP32, but I can't find any library for the MCP2515. What would be the best way to use it? Is there any possiblity to import the C-Code so that I can use it from within my main.py? I don't have experience with compiling my own micropython-version. But if there's some good tutorial how to do it for the ESP32 or something I could try that and I'd be grateful.
Or would it be easier to re-write the C-Code from the library into a python-Script and use this python-script?

Thanks for your answers!

jickster
Posts: 629
Joined: Thu Sep 07, 2017 8:57 pm

Re: MCP2515-Library MicroPython

Post by jickster » Tue Sep 18, 2018 5:25 pm

timi257 wrote:
Tue Sep 18, 2018 1:25 pm
Hello,
I'm new to MicroPython and don't have much experience with it, so please pardon if any questions sound stupid.

I have a working Arduino-Sketch that uses this lib: https://github.com/autowp/arduino-mcp2515
To communicate via CAN-Bus.

Now I want to port this sketch to MicroPython on a ESP32, but I can't find any library for the MCP2515. What would be the best way to use it? Is there any possiblity to import the C-Code so that I can use it from within my main.py? I don't have experience with compiling my own micropython-version. But if there's some good tutorial how to do it for the ESP32 or something I could try that and I'd be grateful.
Or would it be easier to re-write the C-Code from the library into a python-Script and use this python-script?

Thanks for your answers!
I have zero experience with ESP32 but solid experience with the C micropython programming.

Your first issue is that your lib is in C++.
According to https://www.esp32.com/viewtopic.php?t=362, C++ is iffy.

Jim_Merkle
Posts: 3
Joined: Wed Apr 28, 2021 11:24 pm

Re: MCP2515-Library MicroPython

Post by Jim_Merkle » Sun Jun 06, 2021 4:04 pm

Timi257,
I too am looking for a working MCP2515 library. Anyone create or find one yet?

Thanks

Post Reply