Comments (7)
Original comment by Amr Bekhit (Bitbucket: amrbekhit, GitHub: amrbekhit):
You're right - it looks like I had a build issue where an old version was being built. I've compiled the latest version (1.4.3) from PyPi and timeouts work fine now, thanks!
from python-can.
Original comment by Tynan McAuley (Bitbucket: tymcauley, GitHub: tymcauley):
Huh, that's pretty strange. I've been using timeouts on recv()
successfully since bd3b159 (this uses a call to select
in the recv()
function). Can you make sure that whatever code branch you're using has this code in the recv()
function? If that's still not working for you, I'd recommend making sure that select
works on your platform. Let me know if you have any issues with that.
For the record, I'm running this on Python 3.4 on Ubuntu 14.04.
from python-can.
Original comment by Amr Bekhit (Bitbucket: amrbekhit, GitHub: amrbekhit):
Coming back to this after some time, it appears that the problem is still not resolved. I've tried this with both commit 8af9d8f and also with tag 1.4.2, but the recv function still hangs even with a timeout.
I tried running the following python code:
#!python
from can.interfaces.interface import Bus
bus = Bus('can0')
bus.recv(1)
When I press Ctrl+C to break execution, I get the following traceback:
#!python
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.4/site-packages/can/interfaces/socketcan_native.py", line 296, in recv
File "/usr/lib/python3.4/site-packages/can/interfaces/socketcan_native.py", line 229, in capturePacket
KeyboardInterrupt
from python-can.
Original comment by Tynan McAuley (Bitbucket: tymcauley, GitHub: tymcauley):
Receive timeouts have been implemented in socketcan_native, giving the same behavior on the recv function as socketcan_ctypes.
from python-can.
Original comment by Tynan McAuley (Bitbucket: tymcauley, GitHub: tymcauley):
Can you see if commit 8af9d8f resolves the issue?
from python-can.
Original comment by Amr Bekhit (Bitbucket: amrbekhit, GitHub: amrbekhit):
Hi Brian,
Thanks for your response, and I appreciate your restricted free time. I can most certainly test the patch, and wouldn't mind helping to write it with some help on how the code works.
from python-can.
Original comment by Brian Thorne (Bitbucket: hardbyte, GitHub: hardbyte):
Hi Amr,
Glad you like the library! Unfortunately as I've changed jobs I don't have access to any ARM systems with actual CAN devices anymore. But I see in the code that I hadn't gotten around to implementing the timeouts for native python. The relevant code in the ctypes backend is on line 50 of socketcan_ctypes.py
Would you be willing to try write a patch (I'm happy to help guide but am a bit short on time)? Or would you be willing to work with me to test a patch if I wrote it?
Cheers,
Brian
from python-can.
Related Issues (20)
- SizedRotatingLogger Filename Format Bug
- can not send the can FD message
- Optional use of ISA-L for zlib decode/encode operations
- AttributeError: property 'protocol' of 'RemoteBus' object has no setter HOT 2
- vcan_filtered example throws error
- can.player infinite loop support HOT 2
- Blf dummy file
- Vector XL library not found even though it is installed HOT 2
- [help!!!!]how can i get to know the messages (using the send(msgs, timeout) func) have been successfully acked on the CANBUS? HOT 1
- blf FIle Metadata
- ValueError: non-hexadecimal number found in fromhex() arg at position 15
- BLF reader CAN_MESSAGE and CAN_MESSAGE2 incomplete
- Adding Additional Documentation or Updating Documentation As Needed
- IXXAT: does not recover / no exceptions after CAN bus disconneted for a few seconds HOT 2
- a
- DLL load failed: HOT 1
- 支持更多的CAN工具 HOT 1
- Hardware Recommendations for python-can-bluetooth
- Support for LIN data also
- CAN Devices Not Detected When Executable Is Run
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-can.