Score:0

Arduino Port Not detected and can not run it as root

cn flag

I have two Ubuntu one is 18.04 and another is 20.04, also i have some problem with Arduino boards,i have tried this instruction(pin connections and ...): enter image description here

But, the Arduino IDE can not detect the STM32f013c8t6 board with Arduino, so i tried to find the USB connection of the port by using this post commands of its answers, as you can see below:

sudo usermod -a -G dialout $USER
 ls -al /dev/USB*
ls: cannot access '/dev/USB*': No such file or directory

And by trying some others post instructions :


lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 0bda:0821 Realtek Semiconductor Corp. 
Bus 001 Device 004: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller
Bus 001 Device 003: ID 174f:2408 Syntek 
Bus 001 Device 006: ID 0483:3748 STMicroelectronics ST-LINK/V2
Bus 001 Device 002: ID 046d:c077 Logitech, Inc. M105 Optical Mouse
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

and by trign the lsb -v -d command i get the below result:

 lsusb -v -d  0483:3748

Bus 001 Device 006: ID 0483:3748 STMicroelectronics ST-LINK/V2
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x0483 STMicroelectronics
  idProduct          0x3748 ST-LINK/V2
  bcdDevice            1.00
  iManufacturer           1 STMicroelectronics
  iProduct                2 STM32 STLink
  iSerial                 3 &/26MCKN
  bNumConfigsudo journalctl -furations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           39
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              4 ST Link
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
Device Status:     0x0000
  (Bus Powered)

so can not see the port connection on the Arduino which has been installed by snap as you can see below :

enter image description here

Also, tried to run Arduino as root user but i get below error:

sudo arduino
mkdir: cannot create directory '/run/user/0': Permission denied

(process:22688): dconf-CRITICAL **: 19:29:51.179: unable to create directory '/run/user/0/snap.arduino/dconf': Permission denied.  dconf will not work properly.

(process:22688): dconf-CRITICAL **: 19:29:51.179: unable to create directory '/run/user/0/snap.arduino/dconf': Permission denied.  dconf will not work properly.
No protocol specified

(process:22688): dconf-CRITICAL **: 19:29:51.180: unable to create directorit is not worling!.y '/run/user/0/snap.arduino/dconf': Permission denied.  dconf will not work properly.
Picked up JAVA_TOOL_OPTIONS: 
Set log4j store directory /root/snap/arduino/56/.arduino15
No protocol specified
java.awt.AWTError: Can't connect to X11 window server using ':0' as the value of the DISPLAY variable.
    at java.desktop/sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
    at java.desktop/sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:102)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.desktop/sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:61)
    at java.base/java.lang.Class.forName0(Native Method)
    at java.base/java.lang.Class.forName(Class.java:315)
    at java.desktop/java.awt.GraphicsEnvironment$LocalGE.createGE(GraphicsEnvironment.java:101)
    at java.desktop/java.awt.GraphicsEnvironment$LocalGE.<clinit>(GraphicsEnvironment.java:83)
    at java.desktop/java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:129)
    at java.desktop/sun.awt.X11.XToolkit.<clinit>(XToolkit.java:231)
    at java.base/java.lang.Class.forName0(Native Method)
    at java.base/java.lang.Class.forName(Class.java:315)
    at java.desktop/java.awt.Toolkit$2.run(Toolkit.java:588)
    at java.desktop/java.awt.Toolkit$2.run(Toolkit.java:583)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.desktop/java.awt.Toolkit.getDefaultToolkit(Toolkit.java:582)
    at java.desktop/java.awt.SystemColor.updateSystemColors(SystemColor.java:473)
    at java.desktop/java.awt.SystemColor.<clinit>(SystemColor.java:465)
    at processing.app.Theme.init(Theme.java:343)
    at processing.app.Base.<init>(Base.java:250)
    at processing.app.Base.main(Base.java:150)


So i guess this is not working because of installing the Arduino by snap and trued to fix it by sudo snap connect arduino:removable-media command but i get the mkdir: cannot create directory '/run/user/0': Permission denied error again, so i asked here:

Update1:

Based of the first comment i tried the sudo journalctl -fand get the below results:

sudo journalctl -f
-- Logs begin at Thu 2020-11-19 13:24:37 +0330. --
ژوئن 13 20:24:57 so-Lenovo-ideapad-310-15IKB tunnel.service[4851]: add bridge failed: Operation not permitted
ژوئن 13 20:24:57 so-Lenovo-ideapad-310-15IKB nautilus-deskto[17909]: connect() failed
ژوئن 13 20:24:58 so-Lenovo-ideapad-310-15IKB nautilus-deskto[17909]: connect() failed
ژوئن 13 20:24:59 so-Lenovo-ideapad-310-15IKB nautilus-deskto[17909]: connect() failed
ژوئن 13 20:25:00 so-Lenovo-ideapad-310-15IKB nautilus-deskto[17909]: connect() failed
ژوئن 13 20:25:01 so-Lenovo-ideapad-310-15IKB nautilus-deskto[17909]: connect() failed
ژوئن 13 20:25:02 so-Lenovo-ideapad-310-15IKB nautilus-deskto[17909]: connect() failed
ژوئن 13 20:25:03 so-Lenovo-ideapad-310-15IKB nautilus-deskto[17909]: connect() failed
ژوئن 13 20:25:03 so-Lenovo-ideapad-310-15IKB sudo[30096]:       so : TTY=pts/0 ; PWD=/home/so ; USER=root ; COMMAND=/bin/journalctl -f
ژوئن 13 20:25:03 so-Lenovo-ideapad-310-15IKB sudo[30096]: pam_unix(sudo:session): session opened for user root by (uid=0)
ژوئن 13 20:25:04 so-Lenovo-ideapad-310-15IKB nautilus-deskto[17909]: connect() failed
ژوئن 13 20:25:05 so-Lenovo-ideapad-310-15IKB nautilus-deskto[17909]: connect() failed
ژوئن 13 20:25:06 so-Lenovo-ideapad-310-15IKB nautilus-deskto[17909]: connect() failed
ژوئن 13 20:25:07 so-Lenovo-ideapad-310-15IKB tunnel.service[4851]: add bridge failed: Operation not permitted


Also i have installed the last Arduino version by this link and is is running by sudo arduino command but is til have this problem!.

Update2:

It is strange i have seen the below post which is saying the ST-link V2 programmer could be fake and have some wrong pin connection, and if possible i like to ask, what would be happening if i change the 2,4,6 pins configuration based of that post? as you can see below:

enter image description here

Update 3:

I have checked the ST-Link V2 and the pins was labeled correctly. so the problem is not from the wrong st-link pins system!. Thanks.

waltinator avatar
it flag
Your guesses are wrong. `usermod` changes system files that are only consulted at `login`.
waltinator avatar
it flag
Your guesses are wrong. Watch `sudo journalctl -f` as you connect the Arduino. It's probably `/dev/ttyUSB*`.
cn flag
I have updated the question.
N0rbert avatar
zw flag
ST-LInk may not be recognized as ttyUSB and it is normal. You have to find specific guide for setting up ST-Link on Ubuntu. As starting point you can use [this document](https://github.com/stm32duino/wiki/wiki/Upload-methods). For more reproducible results please install Arduino IDE [using ubuntu-make](https://askubuntu.com/a/1025755/66509) and remove snap version (if any).
Score:0
cn flag

Based ofN0rbert Comment,The problem exist by snap version of Arduino which is said here:

enter image description here

So I have done the below step:

1- I have installed the last Arduino version by this link.

2-Based of this document, I have installed the STM32CubePrg

3-Selecting the below setting and codes for test :

enter image description here

#define LED_BUILTIN PC13
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
}
 
// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(2000);                       // wait for a second
  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);                       // wait for a second
}

4- Switch the BOOT 0 header from the '0' position to the '1' position before connecting the FTDI board to the computer for flashing the bootloader as said on this video from this post:

enter image description hereThank.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.