# USB Connection Problems. Ubuntu 14.04 \[Solved: use sudo\]

**URL:** <https://community.particle.io/t/usb-connection-problems-ubuntu-14-04-solved-use-sudo/10693>\
**Category:** Troubleshooting\
**Created:** [March 16, 2015, 12:18pm UTC](https://community.particle.io/t/usb-connection-problems-ubuntu-14-04-solved-use-sudo/10693 "2015-03-16T12:18:58Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![goingalong](https://avatars.discourse-cdn.com/v4/letter/g/ee7513/32.png) [@goingalong](https://community.particle.io/u/goingalong)\
**Post date:** [March 16, 2015, 12:18pm UTC](https://community.particle.io/t/usb-connection-problems-ubuntu-14-04-solved-use-sudo/10693/1 "2015-03-16T12:18:58Z")

</div>

Trying to debug I need to use serial out to a Ubuntu Terminal. But I get connection error.

Using the CLI: gives me

```
$ spark serial list
Found 1 core(s) connected via serial: 
1: /dev/ttyACM0

```

So the core is visible. But then:

```
$ spark serial monitor 1
Opening serial monitor for com port: "/dev/ttyACM0"
Serial err: Error: Cannot open /dev/ttyACM0
Serial problems, please reconnect the core.

```

I assume that reconnect means unplug then replug, which also removes power in my case.  
I am a member of the dialout group:

```
sudo usermod -a -G dialout xxxxx
```

---

<div class="post-metadata">

**Author:** ![kennethlimcp](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@kennethlimcp](https://community.particle.io/u/kennethlimcp)\
**Post date:** [March 16, 2015, 12:38pm UTC](https://community.particle.io/t/usb-connection-problems-ubuntu-14-04-solved-use-sudo/10693/2 "2015-03-16T12:38:05Z")

</div>

how about `sudo serial monitor 1`?

---

<div class="post-metadata">

**Author:** ![goingalong](https://avatars.discourse-cdn.com/v4/letter/g/ee7513/32.png) [@goingalong](https://community.particle.io/u/goingalong)\
**Post date:** [March 16, 2015, 1:57pm UTC](https://community.particle.io/t/usb-connection-problems-ubuntu-14-04-solved-use-sudo/10693/3 "2015-03-16T13:57:53Z")

</div>

kennethlimcp is correct - this works:

```
sudo spark serial monitor 1
Opening serial monitor for com port: "/dev/ttyACM0"
```

---

<div class="post-metadata">

**Author:** ![kennethlimcp](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@kennethlimcp](https://community.particle.io/u/kennethlimcp)\
**Post date:** [March 16, 2015, 2:08pm UTC](https://community.particle.io/t/usb-connection-problems-ubuntu-14-04-solved-use-sudo/10693/4 "2015-03-16T14:08:40Z")

</div>

🍻 😃

---

<div class="post-metadata">

**Author:** ![goingalong](https://avatars.discourse-cdn.com/v4/letter/g/ee7513/32.png) [@goingalong](https://community.particle.io/u/goingalong)\
**Post date:** [March 16, 2015, 4:17pm UTC](https://community.particle.io/t/usb-connection-problems-ubuntu-14-04-solved-use-sudo/10693/5 "2015-03-16T16:17:24Z")

</div>

Anyone know why sudo privilege is needed?

---

<div class="post-metadata">

**Author:** ![nrobinson2000](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/nrobinson2000/32/15624_2.png) [@nrobinson2000](https://community.particle.io/u/nrobinson2000)\
**Post date:** [April 18, 2015, 10:20am UTC](https://community.particle.io/t/usb-connection-problems-ubuntu-14-04-solved-use-sudo/10693/6 "2015-04-18T10:20:57Z")

</div>

> [@goingalong](#):
>
> I am a member of the dialout group:
> 
> sudo usermod -a -G dialout xxxxx

Good, but there are a few more more steps required to use the Spark CLI without having to use sudo for every command involving serial.

To fix this, run this command in the terminal:

```
sudo chmod a+rw /dev/ttyACM0

```

You will then be able to use all of the spark commands without sudo, but however this must be done each time you connect your core.

A better way is to create a **rule** in _/etc/udev/rules.d_. This enables the chmod command to be run automatically when your core is connected.  
**Here are the steps:**

```
sudo nano /etc/udev/rules.d/50-local.rules

```

_(Paste this line)_

```
ACTION=="add", ATTRS{idProduct}=="607d", ATTRS{idVendor}=="1d50", DRIVERS=="usb", RUN+="chmod a+rw /dev/ttyACM0"

```

Press **Control + o** and then **Control + x** to save.

Now whenever you plug in your Spark Core, the chmod command will be run, giving you full access to your spark core, making it so you never have to type in your sudo password when using your spark core again.

**Note:**  
Your device id **{idProduct}** , and your manufacturer id **{idVendor}** may be different. To check, run

```
lsusb

```

And substitute your results into the _/etc/udev/rules.d/50-local.rules_ file you created.

```
Bus 003 Device 026: ID 1d50:607d OpenMoko, Inc.

```

Was my Spark core when I ran **lsusb**.

When it says, ID 1d50:607d, the first hexadecimal value is the vendor, and the second is the Product ID.

If yours are different, change them in _/etc/udev/rules.d/50-local.rules_.

---

<div class="post-metadata">

**Author:** ![aceperry](https://avatars.discourse-cdn.com/v4/letter/a/35a633/32.png) [@aceperry](https://community.particle.io/u/aceperry)\
**Post date:** [April 18, 2015, 10:33am UTC](https://community.particle.io/t/usb-connection-problems-ubuntu-14-04-solved-use-sudo/10693/7 "2015-04-18T10:33:21Z")

</div>

> [@goingalong](#):
>
> Anyone know why sudo privilege is needed?

This is a device file on a unix system, which is a protected resource. Users are generally restricted in their control of these resources.

---

<div class="post-metadata">

**Author:** ![goingalong](https://avatars.discourse-cdn.com/v4/letter/g/ee7513/32.png) [@goingalong](https://community.particle.io/u/goingalong)\
**Post date:** [April 23, 2015, 5:52am UTC](https://community.particle.io/t/usb-connection-problems-ubuntu-14-04-solved-use-sudo/10693/8 "2015-04-23T05:52:32Z")

</div>

nrobinson2000, thank you for the recommendation. Seems like something that should be included in the spark documentation somewhere.

Still do not understand though why this is needed. I don’t need similar to access usb drives, arduino’s or multiple other devices. In response to aceperry I read that it is not a good thing to run processes using superuser authority as this can leave my linux kernel open to attack. The general advice I see is that Superuser should be limited to maintenance activities where kernel changes are needed.

---

<div class="post-metadata">

**Author:** ![nrobinson2000](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/nrobinson2000/32/15624_2.png) [@nrobinson2000](https://community.particle.io/u/nrobinson2000)\
**Post date:** [April 23, 2015, 3:16pm UTC](https://community.particle.io/t/usb-connection-problems-ubuntu-14-04-solved-use-sudo/10693/9 "2015-04-23T15:16:33Z")

</div>

> [@goingalong](#):
>
> I don't need similar to access usb drives, arduino's or multiple other devices.

I still need to do this when using my arduino.

---

<div class="post-metadata">

**Author:** ![kennethlimcp](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@kennethlimcp](https://community.particle.io/u/kennethlimcp)\
**Post date:** [April 23, 2015, 3:54pm UTC](https://community.particle.io/t/usb-connection-problems-ubuntu-14-04-solved-use-sudo/10693/10 "2015-04-23T15:54:12Z")

</div>

@nrobinson2000,

my guess would be that for Arduino in general on linux machines, the USB serial port appears as `/dev/ttyUSB0`

However for spark devices, it’s appearing as `/dev/ttyACM0` which might be requiring the `sudo` privilege.

I’m saying this cos on another development board that i tried tinkering with, there’s some issues even on Mac OSx where we have to mess with linking the USB profile to another alias in order to run it properly.

---

<div class="post-metadata">

**Author:** ![AndyW](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/andyw/32/686_2.png) [@AndyW](https://community.particle.io/u/AndyW)\
**Post date:** [April 23, 2015, 4:02pm UTC](https://community.particle.io/t/usb-connection-problems-ubuntu-14-04-solved-use-sudo/10693/11 "2015-04-23T16:02:53Z")

</div>

A lot of other packages come with rpm install scripts that will do things like add udev rules to change the permissions on USB devices they want to talk to.

What you hear is correct, as a rule you want to avoid running packages under sudo, because it will result in painful things like files/directories created in your $HOME that you cannot access, overwrite or delete.

The correct fix is adding and maintaining udev rules for the spark VID/PIDs, and automatically installing them as part of the install process. If this is supposed to happen already then it is broken, if not then it should be made to happen.

---

<div class="post-metadata">

**Author:** ![kennethlimcp](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@kennethlimcp](https://community.particle.io/u/kennethlimcp)\
**Post date:** [April 23, 2015, 4:05pm UTC](https://community.particle.io/t/usb-connection-problems-ubuntu-14-04-solved-use-sudo/10693/12 "2015-04-23T16:05:56Z")

</div>

Yup so there’s no default behavior/implementation for this.

Maybe @mdma can take care of this 😉

---

<div class="post-metadata">

**Author:** ![Dave](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/dave/32/181_2.png) [@Dave](https://community.particle.io/u/Dave)\
**Post date:** [April 23, 2015, 4:14pm UTC](https://community.particle.io/t/usb-connection-problems-ubuntu-14-04-solved-use-sudo/10693/13 "2015-04-23T16:14:45Z")

</div>

Great idea! I’d love if we could spend some time this summer and improve the install experience, I created a task for the cli linux bit here - [https://github.com/spark/spark-cli/issues/184](https://github.com/spark/spark-cli/issues/184)

Thanks,  
David

---

<div class="post-metadata">

**Author:** ![nrobinson2000](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/nrobinson2000/32/15624_2.png) [@nrobinson2000](https://community.particle.io/u/nrobinson2000)\
**Post date:** [April 24, 2015, 7:09am UTC](https://community.particle.io/t/usb-connection-problems-ubuntu-14-04-solved-use-sudo/10693/14 "2015-04-24T07:09:12Z")

</div>

I’m using Linux Mint 17.1, and my arduino shows up as /dev/ttyACMx

---

<div class="post-metadata">

**Author:** ![goingalong](https://avatars.discourse-cdn.com/v4/letter/g/ee7513/32.png) [@goingalong](https://community.particle.io/u/goingalong)\
**Post date:** [April 25, 2015, 9:18am UTC](https://community.particle.io/t/usb-connection-problems-ubuntu-14-04-solved-use-sudo/10693/15 "2015-04-25T09:18:06Z")

</div>

Ditto Lubuntu 14.10 where Spark Core shows up (in the Arduino IDE) as /dev/ttyACMx. This is probably the case for all Ubuntu derivative installs.

Another location choice that appears in the IDE is /dev/ttySn.

---

<div class="post-metadata">

**Author:** ![bko](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bko/32/20704_2.png) [@bko](https://community.particle.io/u/bko)\
**Post date:** [April 25, 2015, 1:38pm UTC](https://community.particle.io/t/usb-connection-problems-ubuntu-14-04-solved-use-sudo/10693/16 "2015-04-25T13:38:54Z")

</div>

I have not tried this but supposedly this is a group problem:

> <https://askubuntu.com/questions/58119/changing-permissions-on-serial-port>

---

<div class="post-metadata">

**Author:** ![omarojo](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/omarojo/32/690_2.png) [@omarojo](https://community.particle.io/u/omarojo)\
**Post date:** [July 28, 2015, 2:30am UTC](https://community.particle.io/t/usb-connection-problems-ubuntu-14-04-solved-use-sudo/10693/17 "2015-07-28T02:30:25Z")

</div>

I have this issue, in my MacOSX, I get “No devices available via serial”. I’ve tried connecting the USB in different sockets, but is still the same. How did you do that - linking profile - that you mention. ?

---

<div class="post-metadata">

**Author:** ![kennethlimcp](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@kennethlimcp](https://community.particle.io/u/kennethlimcp)\
**Post date:** [July 28, 2015, 2:59am UTC](https://community.particle.io/t/usb-connection-problems-ubuntu-14-04-solved-use-sudo/10693/18 "2015-07-28T02:59:03Z")

</div>

Which OSx version are you on? We rarely see issues with Mac. Can you try another can and use `particle serial list`? Also, make sure the device is in Listening mode.

---

<div class="post-metadata">

**Author:** ![omarojo](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/omarojo/32/690_2.png) [@omarojo](https://community.particle.io/u/omarojo)\
**Post date:** [July 28, 2015, 3:03am UTC](https://community.particle.io/t/usb-connection-problems-ubuntu-14-04-solved-use-sudo/10693/19 "2015-07-28T03:03:32Z")

</div>

Yosemite 10.10.4.  
Node v0.12.4

My device is an original CORE. I just can’t assign the Wifi Credentials using my phone, last year it was working fine with my phone… but now… it just keeps blinking blue. Thats why I want to use particle-cli. but “! serial: No devices available via serial” is all I get.

---

<div class="post-metadata">

**Author:** ![kennethlimcp](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@kennethlimcp](https://community.particle.io/u/kennethlimcp)\
**Post date:** [July 28, 2015, 3:06am UTC](https://community.particle.io/t/usb-connection-problems-ubuntu-14-04-solved-use-sudo/10693/20 "2015-07-28T03:06:23Z")

</div>

- Is the device blinking blue?
- Did you try changing a cable?
- Try `ls /dev/tty.*` and `ls /dev/cu.*`

[Next page](https://community.particle.io/t/usb-connection-problems-ubuntu-14-04-solved-use-sudo/10693.md?page=2)
