← index #8129Issue #2386
Related · high · value 0.228
QUERY · ISSUE

Document values of CAN bus Constants

openby keelung-yangopened 2021-12-31updated 2024-09-08
docs

Hi,
Since CAN.send() have no error code returned, I've to check CAN.state() and got 4. But what 4 stand for? Then I've to search code to figure out this error code.
So, it's very convenient if values of CAN bus Constants can be documented clearly.
image

CANDIDATE · ISSUE

PyBoard CAN doesn't work?

closedby kamikazeopened 2016-09-03updated 2016-09-03

When trying following code:

from pyb import CAN

can1 = CAN(1, CAN.NORMAL)
can2 = CAN(2, CAN.NORMAL)

can1.setfilter(0, CAN.LIST16, 0, (123, 124, 125, 126))
can2.setfilter(0, CAN.LIST16, 0, (123, 124, 125, 126))

can1.send('magic', 123)
can2.recv(0)

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: [Errno 110] ETIMEDOUT

and after many send() calls I'm getting

OSError 16 which is device or resource busy.

I've tried to connect Y3-Y6 and Y4-Y5 (CAN1 - CAN2) directly. I've tried to connect with the following scheme of two transceivers: https://easyeda.com/kamikaze/CAN_bus_shield_for_PyBoard_v1_1-CusOLJ53N

for me it seems that something is wrong with the code, board or micropython... please help me to figure out )

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied