# Command line control?

**URL:** <https://forum.arduino.cc/t/command-line-control/306687>\
**Category:** Yún\
**Created:** [April 22, 2015, 11:17pm UTC](https://forum.arduino.cc/t/command-line-control/306687 "2015-04-22T23:17:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mperkel](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@mperkel](https://forum.arduino.cc/u/mperkel)\
**Post date:** [April 22, 2015, 11:17pm UTC](https://forum.arduino.cc/t/command-line-control/306687/1 "2015-04-22T23:17:12Z")

</div>

Just wondering - how do I control pin 13 on and off from the command line? I want to SSH in - type a command and turn the LED on and off.

---

<div class="post-metadata">

**Author:** ![PCWorxLA](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/pcworxla/32/216912_2.png) [@PCWorxLA](https://forum.arduino.cc/u/PCWorxLA)\
**Post date:** [April 23, 2015, 12:24am UTC](https://forum.arduino.cc/t/command-line-control/306687/2 "2015-04-23T00:24:05Z")

</div>

> mperkel:  
> Just wondering - how do I control pin 13 on and off from the command line? I want to SSH in - type a command and turn the LED on and off.

Use the bridge ~~Luke~~ mperkel... 😁

Ok, a bit more seriously, you need to understand the concurrent nature of the Yun's two processors.  
You have SSH only on the MIPS/Linux side and any I/O pins are only accessible on the AVR/Leonardo side...

So to communicate from one side to the other, you have to use the "bridge", which is a software library on either side to exchange data over the internal serial connection, which is the only hardware that connects between the two parts.  
So on the Linux side, you need to use a Python/Lua/C(++) program to accept your "command" and send it via the bridge to a sketch on the Leonardo side, which then toggles the LED via I/O pin...

Ralf

---

<div class="post-metadata">

**Author:** ![jessemonroy650](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/jessemonroy650/32/1149818_2.png) [@jessemonroy650](https://forum.arduino.cc/u/jessemonroy650)\
**Post date:** [April 23, 2015, 1:38am UTC](https://forum.arduino.cc/t/command-line-control/306687/3 "2015-04-23T01:38:12Z")

</div>

> mperkel:  
> Just wondering - how do I control pin 13 on and off from the command line? I want to SSH in - type a command and turn the LED on and off.

@mperkel,

If you want to just play with the LEDs, there is more than pin 13. My notes are at the link below. I just made some minor updates to clarify what you are looking for.

FYI: You canNOT control pin 13 directly from the command line. You'll have to write a special script to do that, just as _PCWorxLA_ is alluding to. More information in my notes.

**Arduino Yun LEDs**  
[http://codesnippets.altervista.org/documentation/yun/leds/leds.html](http://codesnippets.altervista.org/documentation/yun/leds/leds.html)

Jesse

---

<div class="post-metadata">

**Author:** ![mperkel](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@mperkel](https://forum.arduino.cc/u/mperkel)\
**Post date:** [April 23, 2015, 4:03pm UTC](https://forum.arduino.cc/t/command-line-control/306687/4 "2015-04-23T16:03:51Z")

</div>

ok - thanks. That explains why I can't find how to do it.

---

<div class="post-metadata">

**Author:** ![sonnyyu](https://avatars.discourse-cdn.com/v4/letter/s/71e660/32.png) [@sonnyyu](https://forum.arduino.cc/u/sonnyyu)\
**Post date:** [April 23, 2015, 4:34pm UTC](https://forum.arduino.cc/t/command-line-control/306687/5 "2015-04-23T16:34:35Z")

</div>

If you have to go through AVR path;-

Arduino IDE, File-\>Examples-\>Bridge-\>Bridge upload it to Yun.

turn on LED:

```plaintext
/usr/bin/curl "http://127.0.0.1/arduino/digital/13/1"

```

turn off LED:

```plaintext
/usr/bin/curl "http://127.0.0.1/arduino/digital/13/0"

```

[http://forum.arduino.cc/index.php?topic=288769.msg2021847#msg2021847](http://forum.arduino.cc/index.php?topic=288769.msg2021847#msg2021847)

Since you are at MIPS/Linux side, jessemonroy650's way is the way to go.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 6, 2021, 5:55pm UTC](https://forum.arduino.cc/t/command-line-control/306687/6 "2021-05-06T17:55:28Z")

</div>


