omriharel / deej

Set app volumes with real sliders! deej is an Arduino & Go project to let you build your own hardware mixer for Windows and Linux

Home Page:https://deej.rocks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Linux] Can't connect the the Arduino because the port is busy

RandomLegend opened this issue · comments

image

So i might need some help.

In Arduino IDE i flashed the software using the /dev/ttyUSB0 port and it worked. I can open the monitor and see the values. When i close everything that communicates with it and start deej i get this message.
How can i get this going?

Thanks in advance!

So i know that this:
image
is the arduino nano in question.

How can i define to use that specific device in the config.yaml ?

Hi there @Smart-Helper, thanks for writing.

You appear to have defined the port correctly in your config (it is indeed just the full device path such as /dev/ttyUSB0). However, the error you're getting seems to suggest that something else is already occupying that port. Only a single thing can connect to a given serial port at one time, so if you have anything else that potentially occupies that connection (such as the Arduino IDE, its serial monitor panel, another instance of deej that might be running in the background, or simply another program that interacts with serial ports) - deej won't be able to connect.

There is a way to use lsof to find out which process currently uses your device, if it doesn't seem like one of the options I listed I would suggest to look for an example of that. Please let me know if you need any help there.

Thanks!

Yeah i already checked with lsof and nothing used ttyUSB0

But i just found the culprit. I got some error on arduino when i started it and without thinking i just started it as root and it worked. And i only realized NOW that the issue i had with arduino was probably that my user didn't have permission to use the ttyUSB0

So i looked up the groupname to be used for ttyUSB0 (uucp) and put my user into it - now it works absolutely flawless and this thing is just amazing!

Thanks for the update, @Smart-Helper. Glad to hear it was just a permissions issue.

I guess that both missing permissions and the device being in active use result in us receiving the E_ACCESS error, so there is no great way to distinguish between the two and that'd explain why you received the "port busy" notification. I'll look into whether there's a better way to tell these apart in the future, but for now it's great to be aware of this solution.

I hope you'll enjoy deej!