'MicroPython ESP32 CanBus
Good morning, I've been wanting to use the CAN module from the machine library on an ESP32 based board, unfortunatelly, as I thought, I'm getting an error when trying to import it
>>> from machine import CAN
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'CAN'
Is there any way to enable the CAN module on an ESP32 board? I'm following this example and it's written:
[...] The ESP32 has a built-in CAN controller, but the transceiver needs to be added externally. [...]
It states that it should be possible to use the module on an ESP32 board.
Solution 1:[1]
According to the generic micropython documentation, it seems to have CAN only on the pyboard.
The documentation you reference is specific to the micropython firmware for pycom boards.
So whether a board does or does not support the CAN bus will depend on the hardware and firmware it comes with.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Roland Smith |
