Hi 2 all :).
It’s my first post here, so here’s a word about me. Just started to migrate from msw7 to manjaro and slowly rebuilding my os toolkit. I managed to solve some riddles myself with existing knowledge base (stuck screen brightness or vpn) and now I have a bigger problem. My arduino IDE and the board don’t want to cooperate. Some details:
the board appears as /dev/ttyACM0
arduino IDE can see the board, and can identify it (showing proper ID window)
arduino IDE can write to the board in root mode but shows errors for a normal user
An error occurred while uploading the sketch avrdude: ser_open(): can't open device "/dev/ttyACM0": Permission denied
arduino IDE serial monitor doesn’t work at all (root or not)
Exception in thread “EventThread /dev/ttyACM0” java.lang.NoSuchMethodError: java.nio.ByteBuffer.flip()Ljava/nio/ByteBuffer;
at processing.app.Serial.processSerialEvent(Serial.java:210)
at processing.app.Serial.serialEvent(Serial.java:183)
at jssc.SerialPort$LinuxEventThread.run(SerialPort.java:1299)
but cat /dev/ttyACM0 showing output (when arduino IDE monitor isn’t started)
Now, what I’ve tried and checked so far:
I added myself to the uucp group (logout and reboot) - no success
This is blocked by default probably in all Linux distributions – I don’t know details, but I think it’s security issue.
Solution is simply, every moment when you plug-in Arduino and want programming you need run these commands:
sudo groupadd dialout
sudo gpasswd -a USER dialout
sudo usermod -a -G dialout USER
sudo chmod a+rw /dev/ttyACM0
Instead USER you should put your username. This solution work with other devices, but you may need put other name instead ttyACM0 – you should always read error message in IDE.
I did a search on internet and came across this post, that suggest to use the MODE= keyword inside the udev rule.
So you could try to add , MODE=0666 to the udev rule to give it rw-rw-rw- permissions…
PS:
If i’m not mistaken that udev you showed creates a symbolic link to somewhere right?
You would need to add the above to the udev rule that creates the device-node instead of the one that creates a symbolic-link…
The mystery is solved (partially).
The errors mentioned only java code errors and access denied to the port. Today, after a good sleep and a couple of pints I’ve got a spark of genius :). I removed the original Arduino IDE packet (from manjaro repo) and reinstalled it form SNAP. Magic happened and it is working … err… almost. With SNAP version the serial monitor is working, but uploading is impossible ( port access denied error ) even under root. I removed the SNAP version and downloaded and installed a fresh copy form arduino project web page. Now I have a working serial monitor and I can upload to the MC from under root. Not perfect but working.
Conclusion: something is screwed up in linux version of Arduino ICE or there are some incompatibilities with XFCE Manjaro.
Logged out and back in again and it works as expected.
Arduino IDE crashed on startup with java errors if the arduino-avr-core package wasn’t installed.
Either way if adding your user to uucp or chmod isn’t working for you there’s a problem with your system, or what you’re doing.
I’ll happily try to troubleshoot with you.
EDIT: I didn’t try the serial monitor though.
Just tried the serial monitor and it doesn’t work, everything else does though.
Exception in thread "EventThread /dev/ttyUSB0" java.lang.NoSuchMethodError: java.nio.ByteBuffer.flip()Ljava/nio/ByteBuffer;
at processing.app.Serial.processSerialEvent(Serial.java:210)
at processing.app.Serial.serialEvent(Serial.java:183)
at jssc.SerialPort$LinuxEventThread.run(SerialPort.java:1299)
Last check for today. I added myself to uucp group as the 1st step, even before the first attempt. installing arduino-avr-core didn’t change a thing. the same with java (ver 14 installed previously). Manjaro is fresh out of the box, just starting migration.
As I can see you have a different board. Yours appears as ttyUSB. I have ProMicro (leonardo) and it appears as ttyACM. I think there is the same issue as with uno and mega sth (cannot remember the exact model). The board as direct usb not as virtual com port.
I believe it is a write permit issue. read (monitor mode) is ok under root and normal user, write is working only as root and normal user got permission denied.
Will be very grateful for help with troubleshooting this. It is a small but annoying thing, not the extra step starting the arduino ide as root but because it doesn’t work as I want it to .
Is /dev/ttyACM0 a sumbolic link or device node?
Symbolic links start with an l when viewed using ls -la , eg. lrw-rw-rw …
If it is a symbolic link it won’t apply the mode changes by definition…
That means the character device, because of starting c, is created read/write for only root and users in group uucp, before your chmod.
So if you start your application using sudo --group=uucp it should still run as your user but with group uucp which should be enough to allow read/write access to that device.
See man sudo :
-g group, --group=group
Run the command with the primary group set to group instead of the primary group specified by the target user's
password database entry. The group may be either a group name or a numeric group-ID (GID) prefixed with the
‘#’ character (e.g., #0 for GID 0). When running a command as a GID, many shells require that the ‘#’ be es‐
caped with a backslash (‘\’). If no -u option is specified, the command will be run as the invoking user. In
either case, the primary group will be set to group. The sudoers policy permits any of the target user's
groups to be specified via the -g option as long as the -P option is not in use.
before chmod 666 - nothing, the cursor jumps to next prompt line ready to next comman
after chmod 666 - the cursor jumped to the next line but the line stay empty. to get out from the empty line ctrl+c