-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TransmitFrame hanging sometimes #101
Comments
Note that writing multiple frames doesn't help. If I attach a timeout to the write call, I get a continual stream of "transmit frame: write can0: I/o timeout" until a frame is transmitted by another device on the bus, and then everything starts working again. |
This is possibly due to a "bus off" condition. If the bus is completely disconnected, it will hang, but if I even have a device monitoring the bus, it seems to turn back on. |
Hi @johnnyb, One of the prerequisites of the CAN protocol is that there must be at least two devices listening on the bus for correct communication (i.e. two devices must be "bus on"). Trying to transmit on a bus with only one device is not possible. |
I would think there would need to be something that happened besides "hang indefinitely" but since this is known and I have found a workaround for myself I'll close this out. |
This is probably a problem with Linux Socketcan (running on a Pi 4), but I thought I would note it in case anyone knew an easy answer. It's not a huge problem, but one I've found in testing. Essentially, on occasion, TransmitFrame doesn't return UNTIL I receive a frame on the bus. It's hard to replicate. But, in any case, when bus traffic is empty, then the TransmitFrame will, only sometimes, fail to return. When incoming traffic returns to the bus, TransmitFrame will finally complete.
The text was updated successfully, but these errors were encountered: