Arduino Yun Password for Rest and Bridge Library

I am trying to access the Arduino Yun from a webpage with password protection. Can REST be used with the Bridge Library with Password protection turned on? If so, how do you do it?

Can you explain more?

Do you mean a captive portal for webpage with password protection?

Angelo,

I am new to the Yun. By turning off REST Password Protection I can access the YUN through bridge commands from my cell phone. The communication chain is as follows: "my cell phone Chrome Browser" to "AT&T" to "my Time Warner Router" to my "Yun via the Time Warner Router WiFi". All I am doing is sending a command to the Yun via my cell phone using the WebLed example code that you can find at the following address Project: Using Arduino YUN to control things remotely – Starter Kit. You can download the code as a zip file by going to the bottom of the webpage and clicking on "Google Drive".

I am just wondering why REST Password Protection needs to be turned off for this code to work. I am also wondering if the code can be modified so that it works with REST Password Protection on.

Thanks for your help,

Rich

  1. Start with REST API ACCESS with OPEN.
mkdir -p /www/led
nano /www/led/index.html
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function ledon()
{
$('#content').load('/arduino/digital/13/1');
}
function ledoff()
{
$('#content').load('/arduino/digital/13/0');
}
</script>
</head>
<body>
<span id="content"></span>


<button onclick="ledon()">LED ON</button> 
&nbsp;&nbsp;&nbsp;&nbsp;  
<button onclick="ledoff()">LED OFF</button>
<script src=zepto.min.js></script>
</body>
</html>
cd /www/led
wget http://zeptojs.com/zepto.min.js

From Arduino IDE File->Examples->Bridge->Bridge, upload it into Yun

Open http://ip_address_yun/led test turn on/off board D13 led (RED)

  1. REST API ACCESS with PASSWORD.
    Change File->Examples->Bridge->Bridge code.
void setup() {
...
  //server.listenOnLocalhost();
  server.noListenOnLocalhost();
  server.begin();
}

Upload to Yun. Turn on REST API ACCESS with PASSWORD.

Open http://ip_address_yun/led test turn on/off board D13 led (RED)

This time it will ask login id/password (root/arduino).

sonnyyu,

This is exactly what I was trying to do. I followed you directions and everything works perfectly!

Thanks

Rich