whitecatboard / Lua-RTOS-ESP32

Lua RTOS for ESP32
Other
1.19k stars 221 forks source link

rework CAN to use esp-idf functionality #267

Closed the0ne closed 4 years ago

the0ne commented 5 years ago

only limited testing was posible. please especially verify that CAN networking still works as expected!

the0ne commented 5 years ago

This new CAN implementation turns out to work really well.

Is there any test script for testing CAN networking? I got two ESP32-EVB devices with CAN that I could wire together. Anything I need to be aware of with regards to CAN networking?

jolivepetrus commented 5 years ago

@the0ne,

I will focused again on CAN shortly.

the0ne commented 5 years ago

fantastic - let me know whenever I can help

the0ne commented 4 years ago

after having done quite some testing / using the CAN-bus, these are the improvements I have implemented.

jolivepetrus commented 4 years ago

Hi Thomas,

I'm working again with CAN on ESP32. Testing this PR with my current CAN nodes HW test, based on PIC18FK MCU doesn't work as expected.

Example code:

-- Attach CAN at 500 Kbps speed can.attach(can.CAN0, 500000)

-- Send a message can.send(can.CAN0, 0x200, can.STD, 1, string.pack("B", 0x01))

PIC18FK MCU nodes don't respond to the sended CAN message. May be something related to 500 Kbps?

jolivepetrus commented 4 years ago

Ok, I see the problem.

In current implementation:

https://github.com/whitecatboard/Lua-RTOS-ESP32/wiki/CAN-module

speed is expressed in bits/sec, but in your implementation it's expressed in Kbps.

No problem, I will change the wiki, it's more clear to express speed in Kbps.

Thanks.