-
Notifications
You must be signed in to change notification settings - Fork 0
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
Creating USB symlinks for sensors #62
Comments
Doing the following to create predictable usb ref paths # observe device deets
lsusb
# Bus <num> Device <num>: ID <vendor_id>:<product_id> <product_name>
# create udev to map a UUID to a specified path
sudo nano /etc/udev/rules.d/99-esda-usb.rules
# Add rules as follows
# SUBSYSTEM=="tty", ATTRS{idVendor}=="<vendor_id>", ATTRS{idProduct}=="<product_id>", SYMLINK+="<custom_name>"
# Then reload the rules
sudo udevadm control --reload-rules
sudo udevadm trigger
# and finally double check it works
lsusb |
Run |
Today in Ricky's and I's working session, we are able to manually set the group of piksi to dialout, but when unplugging and replugging, the group then resets to root. At the moment still running into issues writing udev rules to automate the group to dialout but haven't been able to set piksi's group to dialout as of now. |
Additionally, we were able to assign the group of "ttyUSB0" to dialout but not the /dev/piksi symlink but not sure if this has any effect. |
/dev/piksi symlink now has dialout group but this fix is a bit hacky: the udev rule is now: SUBSYSTEM="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", SYMLINK+="piksi", GROUP+="dialout", RUN+="/usr/local/bin/piksi_group.sh" Where #!/bin/bash
sudo chown -h root:dialout /dev/piksi The |
@AbBaSaMo @Jiawei-Liao |
We're also wondering about the first point of the acceptance criteria "sensors launch must launch the piksi driver without issue while settings.yaml refers to the piksi symlink for connection as defined in the UDEV rule". How do we test this? |
Yep its in this readme. Just list down the steps needed to do this symlink as if starting from scratch on a new pc
You can test this by following the steps in running it in the readme. If it works I think there should be a topic under /navsatfix that outputs messages? |
Got the piksi driver to work with the symlink. Below are the complete steps taken to make it work. It turns out that the problem was with a dependency within the piksi driver code. The driver uses the external library "libserialport" to open and configure serial ports but the library didn't support udev defined symlinks until the most recent version (0.1.2). This version can only be downloaded from the github repo and not through the apt-get command. NOTE: it also seems like it doesn't actually matter if the piksi symlink is in dialout or not so the udev rule will not try and assign to the group.
# observe device deets
lsusb
# Bus <num> Device <num>: ID <vendor_id>:<product_id> <product_name>
# create udev to map a UUID to a specified path
sudo nano /etc/udev/rules.d/99-esda-usb.rules
# Add rules as follows
# SUBSYSTEM=="tty", ATTRS{idVendor}=="<vendor_id>", ATTRS{idProduct}=="<product_id>", SYMLINK+="<custom_name>"
# Then reload the rules
sudo udevadm control --reload-rules
sudo udevadm trigger
# DO NOT RUN THIS COMMAND
sudo apt-get install libserialport-dev
tar -xzf libserialport-0.1.2.tar.gz
cd libserialport-0.1.2
./configure
make
sudo make install
|
Overview
3 devices are connected to the computer via USB: the piksi, the dynamixel servo and the Zed2i. Atm the piksi has a config file where you supply it's /dev/ which is something like
/dev/ttyUSB0
but this sometimes changes depending on the order that devices are plugged in. Instead, what we want to do is create a symbolic link to the path and use the symbolic link which will be constant.The Zed2i and servo don't really need this as of now (15/07/24) and so will not be prioritised but for the sake of completeness we can still implement this for them.
Atm the udev rule for the piksi has been written on the hive5 but there are permission issues wherein the symlink group must be dialout but is stuck as root. Additionally, instructions taken to achieve everything must be documented in the project README.md for future replication on other systems
Relevant resources
Acceptance criteria
ls -l <path_to_symlink>
Todo
The text was updated successfully, but these errors were encountered: