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

Crash when finding printer ID when no printers attached #5

Closed
vladbabii opened this issue Aug 4, 2020 · 1 comment
Closed

Crash when finding printer ID when no printers attached #5

vladbabii opened this issue Aug 4, 2020 · 1 comment
Labels
Type: Bug Something isn't working as expected

Comments

@vladbabii
Copy link

I selected the option to get printer id with nothing attached

/=======================================================\
|     ~~~~~~~~~~~~~~~~~ [ KIAUH ] ~~~~~~~~~~~~~~~~~     |
|        Klipper Installation And Update Helper         |
|     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     |
\=======================================================/
<!!!!> Make sure your printer is the only USB device connected!

###### Press any key to continue ...


###### Identifying the correct USB port ...
ls: cannot access '/dev/serial/by-id/*': No such file or directory

Issue is at line https://github.com/th33xitus/kiauh/blob/b6c07fc3572fba3b9bfa82323c3f59be965123d0/scripts/functions.sh#L153

It needs to be something like

if  [ -e /dev/serial/by-id/* ]; then 
  if [ -e /dev/serial/by-id/* ]; then
      status_msg "The ID of your printer is:"
      title_msg "$USB_ID"
    else
      warn_msg "Could not retrieve ID!"
      return 1
    fi
else
   warn_msg "Printer not plugged in or not detectable by serial id!"
   return 1
fi
@dw-0 dw-0 added the Type: Bug Something isn't working as expected label Aug 5, 2020
@dw-0
Copy link
Owner

dw-0 commented Aug 12, 2020

I fixed the issue and extended the function to scan by path as well if it can't find the id for whatever the reason might be.
If you want to test the fix, you can find it in the dev-2.0 branch for now. Maybe you can give some feedback so i can already merge it into master if it works out for you.

@dw-0 dw-0 added in master and removed in dev-2.0 labels Aug 15, 2020
@dw-0 dw-0 closed this as completed Aug 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

2 participants