-
Notifications
You must be signed in to change notification settings - Fork 53
configure_motor: Add automatic port detection for waveshare boards. #6
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
base: v2
Are you sure you want to change the base?
Conversation
|
If the board is not found it tries to connect using /dev/ttyACM0 and if that fails it prints out a message asking the user to provide the port manually. |
scripts/configure_motor.py
Outdated
|
|
||
| DEFAULT_ID = 1 # A brand new motor should have id 1 | ||
|
|
||
| # These are placeholders. Please replace these with your actual device's USB IDs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So these are the IDs of the BOM's waveshare boards ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
those are the vendor ID and product ID of the waveshare boards, if you do an lsusb you will see those printed out:
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 010: ID 1a86:55d3 QinHeng Electronics USB Single Serial
Bus 003 Device 004: ID 8087:0026 Intel Corp. AX201 Bluetooth
Bus 003 Device 003: ID 0c45:672e Microdia Integrated_Webcam_HD
Bus 003 Device 002: ID 27c6:63ac Shenzhen Goodix Technology Co.,Ltd. Goodix USB2.0 MISC
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hubLike this... the QinHeng Electronics USB Single Serial is how mine shows up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So if you try it with yours and the Vid:Pid comes out different it can be added to that table and it will be detected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'll try that on a single motor next week before merging !
scripts/configure_motor.py
Outdated
| return None | ||
|
|
||
| # Update the script to use a list of device IDs. | ||
| DEVICE_IDS = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To this table, this is what the second commit is for, so that if the IDs are different you can add as many IDs to this table.
|
Should be good, can anyone confirm that it still works on their duck ? Added the serial port in duck_config, but always defaults to @jmachuca77 are you happy with my modifications ? |
|
Looks good on paper, I cant actually check it at the moment my HW is all over the place. |
|
anything missing here? looks good to me. |
|
I wanted someone else to test before merging, to be sure we didn't miss something |
This PR adds automatic port detection for waveshare boards. It does so by checking for the PID/VID of the waveshare board, Hopefully all other boards match. If not it is possible that it might need to expand with several ID combinations but those can be added as needed to the DEVICE_IDS table.