Can't upload sketches: "port not found" (Manjaro Linux)

Today I wanted to work with my Arduino again, but every time I want to upload a sketch I get

Sketch uses 11216 bytes (4%) of program storage space. Maximum is 262144 bytes.
Global variables use 2384 bytes (7%) of dynamic memory, leaving 30384 bytes for local variables. Maximum is 32768 bytes.
processing.app.debug.RunnerException
	at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:152)
	at cc.arduino.UploaderUtils.upload(UploaderUtils.java:77)
	at processing.app.SketchController.upload(SketchController.java:732)
	at processing.app.SketchController.exportApplet(SketchController.java:703)
	at processing.app.Editor$UploadHandler.run(Editor.java:2055)
	at java.base/java.lang.Thread.run(Thread.java:832)
Caused by: processing.app.SerialException: Error touching serial port '/dev/ttyACM0'.
	at processing.app.Serial.touchForCDCReset(Serial.java:107)
	at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:136)
	... 5 more
Caused by: jssc.SerialPortException: Port name - /dev/ttyACM0; Method name - openPort(); Exception type - Port not found.
	at jssc.SerialPort.openPort(SerialPort.java:167)
	at processing.app.Serial.touchForCDCReset(Serial.java:101)
	... 6 more

When I want to open the serial monitor, I also get Error opening serial port '/dev/ttyACM0'. (Port not found)

It worked before and I didn't change anything, so i guess maybe an update broke it. Anyway I'm pretty sure that the port is set correctly

~ >>> ls -l /dev/ttyACM*                                                       
crw-rw---- 1 root uucp 166, 0 22. Apr 23:26 /dev/ttyACM0
~ >>> groups                                                                   
network power users uucp storage lp input audio wheel autologin maeries

I already remove modemmanager as suggested in this thead Leonardo BareMinimum Upload Failure with Linux

It also works on Windows, thus the Arduino is not broken

System:

  • OS is Manjaro Linux
  • The Arduino is a Nano IoT

Update, as I found out how to reproduce the issue.

  1. Upload a sketch that includes keyboard.h using a different computer
    Everything works now and I can upload sketches using Manjaro

  2. Upload a sketch that does not include the keyboard.h. Could even be the same sketch as before, just without the line #include <Keyboard.h>
    Now I can't upload sketches anymore, until I upload something that includes the keyboard.h using a different computer

bump, so it doesn't get deleted

@maeries, your topic has been moved to the dedicated section for the Nano33 IoT. Hopefully it will get some better attention.

Are you saying that you can upload a sketch without #include keyboard.h once and not after that? Or not at all?

Right after I bought the Arduino I was able to upload sketches without a problem. I'm pretty sure the issue began when I uploaded a sketch containing the keyboard.h for the first time

Does the problem happen with any sketch? E.g. blink or empty sketch?

yes

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.