Access your Arduino Yún from the Web

Make your Arduino Yún accessible from anywhere via the Yaler relay.

Prerequisites

Setting up your device requires a relay domain. Please sign up to get one.

Setting up the hardware

Make sure the Arduino Yún is connected to the Internet via Ethernet or Wi-Fi.

Installing YalerTunnel on OpenWrt

Follow these steps to install YalerTunnel on the Arduino Yún.

  1. Open a shell on your Arduino Yún (default login is root, password arduino).
  2. Update opkg with
    $ opkg update
  3. Upgrade libopenssl with
    $ opkg upgrade libopenssl
  4. Download and install yalertunnel with
    $ opkg install http://s3.yaler.net/openwrt-yun/yalertunnel_1_ar71xx.ipk
  5. Done. Now install Daemontools.

Installing Daemontools on OpenWrt

Follow these steps to install Daemontools on the Arduino Yún.

  1. Download and install daemontools with
    $ opkg install daemontools
  2. Open the rc.local script with
    $ vi /etc/rc.local
    Use vi commands to add the following line
    4 wifi-live-or-reset
    5 boot-complete-notify
    6 /usr/bin/svscanboot &
    
  3. Done. Now either enable Web access or SSH access.


Web access

Prerequisites

A Web server is running (per default) on the Arduino Yún.

The built-in REST API can be used with the Bridge or Mailbox Arduino library.

Enabling Web access on OpenWrt

How to configure YalerTunnel on your Arduino Yún to make a local Web service accessible from anywhere.

  1. Create a yalertunnel service directory
    $ mkdir -p /service/yalertunnel
    $ cd /service/yalertunnel
  2. Download the yalertunnel run script and make it executable
    $ wget http://s3.yaler.net/openwrt-yun/run
    $ chmod a+x run
  3. Open the run script with
    $ vi /service/yalertunnel/run
    Use vi commands to set the port of the local Web service (default: 80), and set your relay domain
    1 #!/bin/sh
    2
    3 exec yalertunnel server 127.0.0.1:80 try.yaler.io:80 RELAY_DOMAIN -min-listeners 8 </dev/null 2>&1

    Do not change the local IP (default: 127.0.0.1), unless the Web service runs on a separate device in the same network.

  4. Reboot your Arduino Yún to run the script
    $ reboot
  5. Done. Now access your device from any Web browser or with Curl or from iOS or from Android (and resolve errors).


SSH access

Prerequisites

The SSH daemon sshd is running (per default) on the Arduino Yún.

Enabling SSH access on OpenWrt

How to configure YalerTunnel on your Arduino Yún to allow SSH access from anywhere.

  1. Create a yalertunnel service directory
    $ mkdir -p /service/yalertunnel-ssh
    $ cd /service/yalertunnel-ssh
  2. Download the yalertunnel run script and make it executable
    $ wget http://s3.yaler.net/openwrt-yun/run-ssh -O run
    $ chmod a+x run
  3. Open the run script with
    $ vi /service/yalertunnel-ssh/run
    Use vi commands to set the port of the local SSH service (default: 22), and set your relay domain
    1 #!/bin/sh
    2
    3 exec yalertunnel proxy 127.0.0.1:22 try.yaler.io:80 RELAY_DOMAIN </dev/null 2>&1

    Do not change the local IP (default: 127.0.0.1), unless the SSH service runs on a separate device in the same network.

  4. Reboot your Arduino Yún to run the script
    $ reboot
  5. Done. Now access your device with Putty or with SSH (for Linux, Mac OS X).


Troubleshooting

How to fix common issues.


To enable Web and SSH access at the same time, or tunnel another protocol, please get in touch.


Creative Commons License This work by Yaler GmbH is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.