redragonx / can2RNET

This repo has code and documentation to control power-wheelchairs with R-Net electronics.
GNU General Public License v3.0
67 stars 26 forks source link

Use select() in wait_rnet_joystick_frame #7

Closed ysshah closed 2 years ago

ysshah commented 7 years ago

To fix the wait_rnet_joystick_frame function in JoyLocal.py, we can use Python's select module as described here to set a timeout on the recvfrom method.

redragonx commented 7 years ago

https://github.com/redragonx/can2RNET/blob/master/JoyLocal.py#L233

I'm assuming that's the function you're talking about?

ysshah commented 7 years ago

I'm talking about https://github.com/redragonx/can2RNET/blob/master/JoyLocal.py#L253, where you commented "#this is a blocking read.... so if there is no canbus traffic it will sit forever (to fix!)"

redragonx commented 7 years ago

Ah yes, this will be fixed, I will try select. I also had issues with select once at some point in the dev stage. :+1: