-
Notifications
You must be signed in to change notification settings - Fork 2
Debugging
This page will hold resources for common or possible issues you may run into while getting your ryder-cli-proto up and running
Shoutout to @whoabuddy for finding this issue and digging into possible solutions in Issue #1. The following advice is from him.
If running Linx Mint 20.1 (Ubuntu-based) and you're receiving the following permissions error:
$ ryder-cli-proto --ryder-port /dev/ttyRyder0 info
Error: ERROR_UNKNOWN_RESPONSE
at RyderSerial.serial_data (/...../ryderserial-proto/src/index.js:170:12)
at SerialPort.emit (events.js:315:20)
at addChunk (internal/streams/readable.js:309:12)
at readableAddChunk (internal/streams/readable.js:284:9)
at SerialPort.Readable.push (internal/streams/readable.js:223:10)
at /...../Ryder/ryderserial-proto/node_modules/@serialport/stream/lib/index.js:385:12There are two things you can change to make it work.
After removing the custom udev rule and reloading, the same user group assignment of root:users is present on /dev/ttyUSB0. I searched around and users does not appear to be a default group assignment in Ubuntu (and Mint), so adding the user to this group (with the following steps) and logging back out then in should resolve the permissions issue.
- List permissions for the device (change if necessary):
$ ls -l /dev/ttyUSB0
crw-rw---- 1 root users 188, 0 Mar 15 07:24 /dev/ttyUSB0- Check that your user is in the correct group (
usersin this case) by replacing it with your username below:
$ id -Gn username
username adm cdrom sudo dip plugdev lpadmin sambashare- If needed, add yourself to the correct group:
$ sudo usermod -aG users usernameThis was the road I was headed down first, although I suspect the change above may be enough. It depends on if the default permissions are root:root or root:users by default, but that can be updated through the use of udev rules. Plus, we get the bonus of creating a consistent device name for it — no more chasing down which ttyUSB!
On my system, udev rules are stored in two locations:
/etc/udev/rules.d
/usr/lib/udev/rules.dSince the majority of rules for my system are under /usr/lib, I'm going to put a new one in the same place.
- Open a text editor using sudo and create the file:
/usr/lib/udev/rules.d/70-ryder.rulesNote: 70 is used because 77 contains a default usb serial adapter greylist that also matches
- Copy the text below, paste it into the file, and save it:
SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", GROUP="users", MODE="0660", SYMLINK+="ttyRyder"Note: you can also match by ATTRS{serial}==XX to match a specific device, otherwise the filter above will catch any usb serial adapter that matches the one in a Ryder device. In that case, a numbering scheme could be helpful i.e. /dev/Ryder0
- Reload the udev rules
$ sudo udevadm control --reload- Trigger the udev rules
$ sudo udevadm trigger- Test that you can access the device
$ ryder-cli-proto --ryder-port /dev/ttyRyder info
Initialised Ryder FW version 0.0.1 on /dev/ttyRyder