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

Pyfirmata 2 AUTODETECT only returns none #17

Closed
AlboProgrammer opened this issue Jun 4, 2024 · 10 comments
Closed

Pyfirmata 2 AUTODETECT only returns none #17

AlboProgrammer opened this issue Jun 4, 2024 · 10 comments

Comments

@AlboProgrammer
Copy link

AlboProgrammer commented Jun 4, 2024

Im new in programming with pyfirmata 2.
I have a Arduino Uno and want to controll it python.
Because we have diffrent computer and the Arduino has always a other Port we wanted that the Program to auto detect the right Port.
We can find the Adress from the arduino but the Programm gives us none back. What can I do?

Screenshot 2024-06-04 133110

I comment the part out because to test the other things.
I am Programming on Windows with Python 3.12

@berndporr
Copy link
Owner

AUTODETECT is a constant (none):
https://github.com/berndporr/pyFirmata2/blob/master/pyfirmata2/pyfirmata2.py#L92
it makes the constructor to detect it. If successful then all good. If not it throws an exception.

@AlboProgrammer
Copy link
Author

yeah, but this is what i become when i try run the programm:
Error
when i do to find the comport myself , this i got in return:
Port

@berndporr
Copy link
Owner

https://github.com/berndporr/pyFirmata2/blob/master/pyfirmata2/pyfirmata2.py#L106
it's not using any com port but only those which have the word "USB" in it as com ports are also used for other purposes. Perhaps your computer has a different description than "USB"? Can you check what description it returns? It could also be that you have either a newer or older version of pyserial which just returns something different for the description. If pyserial is very old then description might be blank. Just put a print statement in there and see what description gives you and report back. Thanks.

@AlboProgrammer
Copy link
Author

AlboProgrammer commented Jun 5, 2024

I saw you changed the pyfirmata2 Libary for the windows part.
I downloaded it and start the programm again. Now it come this in return:
image
I have pyserial 3.5.
Is this what you mean with describtion?
image

@berndporr
Copy link
Owner

I would like to know what d.description contains in your case:
https://github.com/berndporr/pyFirmata2/blob/master/pyfirmata2/pyfirmata2.py#L106
Or just add a print(l) here:
https://github.com/berndporr/pyFirmata2/blob/master/pyfirmata2/pyfirmata2.py#L96
and tell me.

@berndporr
Copy link
Owner

berndporr commented Jun 5, 2024 via email

@AlboProgrammer
Copy link
Author

I ran the scan.py and this i got in return:
scan py

berndporr added a commit that referenced this issue Jun 6, 2024
@AlboProgrammer reported that the description string no longer
contains "USB" but now the make of the Arduino. I've added this
to the autodetect.
@berndporr
Copy link
Owner

thanks. I've just added "Arduino" as a valid description. If you check out the newest version it should detect the COM port. Can you try?

@berndporr
Copy link
Owner

967da5a it's here. Feel free to play around with it. Not at a computer with an Arduino so cannot check.

@AlboProgrammer
Copy link
Author

Thank you, its now working. Have a nice day

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