Skip to content
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

Forwarding to serial port issue (windows) #83

Open
swanepoeljan opened this issue Sep 1, 2014 · 1 comment
Open

Forwarding to serial port issue (windows) #83

swanepoeljan opened this issue Sep 1, 2014 · 1 comment

Comments

@swanepoeljan
Copy link

Hi,

I have been forwarding packets from my ardu connected to a com port to upd ports with no problem but when I forward to other com ports it's not working. I receive this error:

Init ArduCopter V2.9.1b

Free RAM: 1813

FW Ver: 120

load_all took 2876us

Press ENTER 3 times to start interactive setup

STABILIZE> Mode STABILIZE
Exception in thread Thread-2:
Traceback (most recent call last):
File "C:\Python27\lib\threading.py", line 810, in __bootstrap_inner
self.run()
File "C:\Python27\lib\threading.py", line 763, in run
self.__target(_self.__args, *_self.__kwargs)
File "C:\MAVProxy-1.3.12\MAVProxy\mavproxy.py", line 908, in main_loop
(rin, win, xin) = select.select(rin, [], [], 0.01)
TypeError: argument must be an int, or have a fileno() method.

I have looked at the code but since my python skills are not that good I am having a hard time figuring out whats wrong. From the error message I take it the function expects an integer type that its not getting.

I have also found this piece of information on python.org regarding "select" which might explain it:
"Note that on Windows, it only works for sockets;" and a com port is not a socket right... and fits the reason why it works when forwarding to UDP.

Any ideas or work-arounds that I could try?

@auxym
Copy link

auxym commented Jul 7, 2021

Old issue but I'm getting the same thing. It seems that the fd property for mavserial instances is None, though I am not sure if this is specific to Windows. I'm also not sure if select.select is even supported for serial ports on Windows.

I added the following snippet after this line:

continue

except TypeError:
    pass

Whcih skips the select call entirely. It appears to work correctly. Is the select call required?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants