Enabling web access

In order to enable web access on your BeagleBone, you need to perform the following steps:

  1. Download the yalertunnel.service startup script.
    $ curl -L http://yalertunnel.s3.amazonaws.com/yalertunnel.service -o /lib/systemd/system/yalertunnel.service
    
  2. Create a symbolic link:
    $ ln -s  /lib/systemd/system/yalertunnel.service /etc/systemd/system/multi-user.target.wants/yalertunnel.service
    
  3. Edit the script using the built in editor called Nano to set YOUR_RELAY_DOMAIN, as well as the local IP (default: localhost), and port (default: 80) of the local web service you want to make accessible via Yaler (to save your changes press Ctrl + X, then Y, and then Enter).

    Note

    $ nano /lib/systemd/system/yalertunnel.service
    
    [Unit]
    Description=yalertunnel on port 80
    ConditionPathExists=|/home/root/yalertunnel
    
    [Service]
    Working directory=/home/root/yalertunnel
    ExecStart=/home/root/yalertunnel server localhost:80try.yaler.net:80 <YOUR_RELAY_DOMAIN> -min-listeners 4
    
    [Install]
    Wantedby=multi-user.target
    
  4. Restart the BeagleBone to run the script:

    Now that we have enabled web access to the BeagleBone from an external source, one of the clever things we can do is serve a web page that has a link to a wireless hub. When you click on the link, you will be directed to the hub's login screen, just as if you had done this from your home network. Cool, huh?

    Here is a very simple example:

    <html>
      <head>
        <title>Wireless Hub Access Page</title>
      </head>
      <body>
      <h1>Here is a simple way of accessing your Router via Yaler:</h1>
     
    
       	<a href="http:192.168.10.1"> Here is my Router Page </a>
    
      </body>
    </html>

What you have to do is set up your socket server on the BeagleBone to serve this page instead of the standard /var/lib/cloud9/bone101/index.html page by renaming the original file index.html to index2.html, and then adding the above code as the new index.html.

The previously configured, simple web page looks like the following screenshot:

Enabling web access

An example of a simple web page

You can now access your device from anywhere by simply entering http://<YOUR_RELAY_DOMAIN.yaler.net/ in your web browser.

For example, http://luke.skywalker.yaler.net/.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.116.14.245