Skip to content
This repository was archived by the owner on Oct 31, 2024. It is now read-only.

Debugging

Chaz Kiker edited this page May 28, 2021 · 1 revision

Debugging

This page will hold resources for common or possible issues you may run into while getting your ryder-cli-proto up and running

Linux / Linux Mint / Ubuntu | Permissions Error

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:12

There are two things you can change to make it work.

Checking Permissions (Try this First)

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.

  1. 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
  1. Check that your user is in the correct group (users in this case) by replacing it with your username below:
$ id -Gn username
username adm cdrom sudo dip plugdev lpadmin sambashare
  1. If needed, add yourself to the correct group:
$ sudo usermod -aG users username

udev Rules

This 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.d

Since the majority of rules for my system are under /usr/lib, I'm going to put a new one in the same place.

  1. Open a text editor using sudo and create the file:
/usr/lib/udev/rules.d/70-ryder.rules

Note: 70 is used because 77 contains a default usb serial adapter greylist that also matches

  1. 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

  1. Reload the udev rules
$ sudo udevadm control --reload
  1. Trigger the udev rules
$ sudo udevadm trigger
  1. 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

Clone this wiki locally