[ESP32] CAN bus and MOD bus master RTU.
Hello.
-
Are there support or plans to support CAN bus on ESP32? I see that there are a implementation for pyboard https://docs.micropython.org/en/latest/library/pyb.CAN.html - is that a similar implementation on the ESP32?
-
And about the MOD bus master RTU on micropython?
I think that, differently of CAN bus, MOD bus implementation is not a microcontroller dependent, just works over UART, is that correct?
I not found a implementation for the modbus master RTU in micropython libs and so on, anyone know if are there a third lib for that?
Thank you so much.
ports/esp32: CAN(TWAI) driver
Implemented CAN bus for esp32 controller.
This is based on https://github.com/micropython/micropython/pull/7381 and ports/stm32/pyb_can.c.
All TODOs were implemented and tested using both real devices and programming tests (loopback mode).
APIs between this two implementations (esp32 CAN and stm32 CAN) are made as close as possible.
Some misunderstandings:
- Tests on real esp32 works only if Rx and Tx pins for CAN bus connected together (as pointed in docs for
LOOPBACK_SILENTmode). I didn't find any examples of similar behaviour in another tests - The speed of CAN bus should be divided by two in
NORMALmode. So if you have 100k CAN bus the baudrate should be 50000. I think it is a bug in esp-idf -- esp-idf's arduino port works in the same way (should also divide boudrate by two)