Arduino linux последовательный порт

Arduino Tools > Serial Port greyed out

I am running Debian 7 (Linux Crunchbang) and wanted to use The Arduino IDE to program my Arduino UNO. To do that I installed the package arduino . When I started the Arduino I was asked to add my user to the dialout group. So I did with sudo usermod -a -G dialout . However when I start the Arduino IDE using arduino in the commandline the IDE opens but I am not able to load my program to the Arduino. The error message is «Serial port COM1 not found. Did you select the right one from the Tools > Serial Port menu?» And when I went to select the Serial Port, the option «Tools > Serial Port» is greyed out. I thought it is because I did not grant read and write permissions on my usb port (ttyACM0). So I did sudo chmod a+rw /dev/ttyACM0 but the option is still greyed out.

18 Answers 18

chdmod works for my under debian (proxmox):

For installing arduino IDE:

# apt-get install arduino arduino-core arduino-mk 

Add the user to dialout group:

Try with the File > Examples > 01.Basic > Blink, change the 2 delays to delay(60) and click the upload button for testing on arduino, led must blink faster. 😉

Changing the permissions of a /dev file sounds as a «good» solution but it’s not. With this you are allowing any and every application access to the device, appart that is not permanent.

sudo arduino is the only way I get the Arduino IDE working (serial port and upload) on ubuntu 12.04 (64) Indeed the serial port to use is /dev/ttyACM0 in my case too. The other two (ttyS4 and ttyS0) gave an error when trying to upload to Uno. Have fun

It works probably because you aren’t added to the correct group and are running arduino as root. This will surelly give you a headache when you try to directly edit, copy, cut or delete a file, since they are owned by root. The correct solution is adding yourself to the group and log out and in.

OMG thank you, I have literally been struggling for the past hour trying to get this to work. sudo was all that was needed

Starting the Arduino IDE from terminal together with using «sudo» solved the problem for me too. I guess it’s essential that the IDE is runned with root privileges. So that it can access the driver-directory.

Try Disconnecting the usb and plugging it back in. Its only grayed out because the ide cannot find any com ports that the uno has been plugged into.

another solution is to try all the com ports and see which one works.

finally if all fails try restarting your computer.

Close all instances of the arduino IDE open ~/.arduino/preferences.txt and look for the line:

Читайте также:  What is using my cpu linux

and change it to your port:

you may have to log out for it to take effect

If it is helpful to anyone, I had this problem using Ubuntu 22.04. The issue stemmed from:

  • apparmor (apparmor denied error, logging with dmesg)
  • brltty (ch34x converter now disconnected from ttyUSB0)

Solved it by removing both:

You can disable apparmor and it should work, however this made applications like firefox useless. My recomendation would be to totally remove it

open $arduinoHome/arduino in text editor and modify last string:

java -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel processing.app.Base "$@" 
java -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -Dgnu.io.rxtx.SerialPorts="/dev/ttyACMN" processing.app.Base "$@" 

(set property gnu.io.rxtx.SerialPorts to /dev/ttyACMN,where ttyACMN is name of serial port which you use)

it may temporary fix bug in rxtx library. helped me to upload sketch with arduino1.0.5 IDE.

Maybe would helpful for someone.

(win)By context menu -> «open with. » or (linux) from terminal something like gedit $arduinoHome/arduino

In my case this turned out to be a bad USB hub.

The ‘lsusb’ command can be used to display all recognized devices. If the unit is not plugged in the option to set the speed will be disabled.

The lsusb command should output something like the string ‘Future Technology Devices International, Ltd Bridge(I2C/SPI/UART/FIFO)’ if your device is recognized. Mine was an RFDuino

In my case I solved this issue by uninstalling the version of Arduino that I installed via apt-get and instead installed via the official website.

With the latest version of Arduino I didn’t have the problem described on Ubuntu 18.04.

You need to log out after you add yourself to a group so those changes are applied. Just log out and log in again and the menu should be available.

install rx-tx lib for java run this command in terminal

sudo apt-get install librxtx-java -y 
sudo usermod -aG dialout $USER sudo apt-get install gnome-system-tools 

help regconize usb device

I solved following serial port related problems in ubuntu 18.04 as follows:

Problem 1 : Cannot open /dev/ttyACM0: Permission denied
Solution : Grant permissions to read/write to the serial port with this terminal command —> sudo chmod a+rw /dev/ttyACM0 Here replace tty port with your respective ubuntu port.

Problem 2 : Failed to open /dev/ttyACM0 (port busy) Solution : This problem appears when serial port is busy or already occupied. So kill the busy serial port with command —> fuser -k /dev/ttyACM0 . Here replace tty port with your respective ubuntu port.

Problem 3 : Board at /dev/ttyACM0 is not available Solution : In this case your serial port in tools menu will be greyed out. I googled a lot for this, but I none of solution worked for me. Atlast I tried different arduino board and usb connector and it was working for me. So, if you are having old arduino board (can be solved using required drivers) or defected arduino board then only this problem arises.

Источник

Arduino IDE нельзя выбрать последовательный порт

Добавлял в группы dialout, разрешал доступ на /dev/ttyUSB0, даже из под рута порт не активен.

Надо было описать обстоятельства происшествия. Но возможно, что вы подключаете к ПК фиговину (например, аналог Arduino от другого производителя) с хреновиной (микросхемой) CH340 (для поддержки USB). Обычный случай. Надо установить драйвер CH340. Он есть для Windows и Linux.

Читайте также:  Какая linux самая лучшая

Ещё есть вариант, что порт уже кто-то занял, например, ModemManager.

а кроме /dev/ttyUSB0 есть ещё порты?

Подоткни плату к компу, dmesg | tail -50 сюда.

 [ 8015.027622] usb 3-3: new full-speed USB device number 4 using xhci_hcd [ 8015.181564] usb 3-3: New USB device found, idVendor=0403, idProduct=6001 [ 8015.181569] usb 3-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 8015.181571] usb 3-3: Product: FT232R USB UART [ 8015.181574] usb 3-3: Manufacturer: FTDI [ 8015.181576] usb 3-3: SerialNumber: 00000000 [ 8015.207299] usbcore: registered new interface driver usbserial_generic [ 8015.207306] usbserial: USB Serial support registered for generic [ 8015.216228] usbcore: registered new interface driver ftdi_sio [ 8015.216234] usbserial: USB Serial support registered for FTDI USB Serial Device [ 8015.216283] ftdi_sio 3-3:1.0: FTDI USB Serial Device converter detected [ 8015.216314] usb 3-3: Detected FT232RL [ 8015.216454] usb 3-3: FTDI USB Serial Device converter now attached to ttyUSB0 [ 8027.925430] usb 3-3: USB disconnect, device number 4 [ 8027.925664] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0 [ 8027.925681] ftdi_sio 3-3:1.0: device disconnected [ 8250.889222] usb 3-3: new full-speed USB device number 5 using xhci_hcd [ 8251.043039] usb 3-3: New USB device found, idVendor=0403, idProduct=6001 [ 8251.043046] usb 3-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 8251.043050] usb 3-3: Product: FT232R USB UART [ 8251.043054] usb 3-3: Manufacturer: FTDI [ 8251.043058] usb 3-3: SerialNumber: 00000000 [ 8251.045991] ftdi_sio 3-3:1.0: FTDI USB Serial Device converter detected [ 8251.046011] usb 3-3: Detected FT232RL [ 8251.046256] usb 3-3: FTDI USB Serial Device converter now attached to ttyUSB0 [/code/

Какая версия Arduino IDE? У не очень новых были проблемы с правами на /run/lock, из-за чего не могли захватить порт (не создавался lock-файл).

Из-под рута насрать на блокировки! Сам напоролся, когда демон свой проверял. Оказалось, что рут хоть 100 раз может порт открыть и блокировки для него — не указ!

После добавления себя в какую-то группу надо логаут/логин сделать.

Источник

Setting Up Arduino Uno IDE on Ubuntu

enter image description here

I am new to Ubuntu (And I love it). I want to burn a code to my Arduino Uno. When uploading the code, there’s an error message saying, Serial Port COM1 not fount found. Did you select the correct one from tools -> serial port menu? . Now, visiting the tools, I can’t select serial port because it is disabled. I am attaching a screen-shot of how it looks. I have done something similar in windows. How to find the serial port on Ubuntu?

7 Answers 7

In my case this error was because in the newer versions of Ubuntu the built in braile reader (brltty) was grabbing the port. I could see this when I used the command

this showed the tty being disconnected from the port

[ 771.927380] usb 2-1.1: usbfs: interface 0 claimed by ch341 while ‘brltty’ sets config #1

[ 771.928207] ch341-uart ttyUSB0: ch341-uart converter now disconnected from ttyUSB0

the actual fix I applied was

sudo apt remove brltty (nb plug and replug the arduino afterwards) 

. as suggested by Jarosław Jaryszew in the thread above .. many thanks to him BTW

Читайте также:  Mint linux firefox нет звука

As far I see you are using the version 1.0.5 of arduino IDE, I assume that you installed the one in the apt repositories.

You can either try to install one from the snapcraft or the one from arduino’s website.

Personally I used the latter one and anything worked like a charm.

Also either the case you can try to loon on Tools -> Port if exists a port that is not a /dev/ttyS0 one. Try to play with these options. Finally by searching on dmesg you can find out which port has been located for arduno as well.

Finally an another approach is to unplug your arduino plug it again and type the following command:

In order to record the last event as the one that happens when arduino is plugged in to a usb port. The command above will show you the correct port.

For better results you can use the following:

And continioulsy plug and unplug the arduino from the usp port till you see any arduino related message. The -f parameter allows to show realtime the new logs.

Источник

How to communicate with an Arduino over its serial interface in C++ on Linux?

I have an RFID reader connected to an Arduino board. I’d like to connect to it over its serial interface, and whenever the RFID reader omits a signal ( when it has read an (RF)ID ), I’d like to retrieve it in my C++ program. I already have the code for simply printing the RFID to serial from the Arduino. What I don’t know, is how to read it from C++ in Linux ? I have looked at libserial, which looks straightforward. However, how can I have the C++ program react to a signal and then read the RFID, instead of listening continously? Is this necessary? EDIT: In most examples I have read, the (c++) program sends input, and recieves output. I just want to listen and recieve output from the Arduino.

4 Answers 4

On unix you use the select() call to wait for an input. The select() call acts like a sleep — using no CPU until the kernel receives the hardware interrupt and triggers the select().

I found the Boost::Asio library, which reads from serial interfaces asynchronously. Boost::Asio Documentation

The Communications part of the Interface section in the Arduino Playground has several examples of interfacing, including one with the Arduino as Linux TTY.

Try the Syntax and Programs forum and the Software Development forum on the Arduino site. There have been discussions about interfacing to many different languages and computers in the past.

And finally check out the Processing and Wiring sites. The Arduino IDE is based on the Processing language, and the Wiring environment and dev board is related to Arduino. Both sites have lots more examples and links to even more resources.

Edit: I just realized that I didn’t answer your actual question. These are all general communications resources, but some may have hints towards how to alert the computer of a new RFID input.

Источник

Оцените статью
Adblock
detector