yun not speaking between web server and sketch

I have the following code loaded into the yun.

0

Lights ON

Lights OFF

The webpage loads fine and I have total control of all things on the page.
When I write "http://myYun.local/arduino/red/150" or "http://myYun.local/arduino/red/0" into my Chrome address bar it works perfectly, but not when i click on the "Lights ON" or "Lights OFF" buttons.

index.txt (1.05 KB)

webdim.ino (2.17 KB)

aryes:
::::SNIP::::

The webpage loads fine and I have total control of all things on the page.
When I write "http://myYun.local/arduino/red/150" or "http://myYun.local/arduino/red/0" into my Chrome address bar it works perfectly, but not when i click on the "Lights ON" or "Lights OFF" buttons.

@aryes, where are you loading the webpage from? is the webpage being loaded from the Yun server? or is the webpage loaded from your Hardisk?

Jesse

The SD card on the Yun with the Yun server

@aryes,
i tested your code, without the LEDS. it appears to work correctly.

You may want to add the following code to your setup()

 while (!Serial) {
   ; // wait for serial port to connect.
 }
 Serial.print("Started server.");

When you test with your browser, make sure the URL is

http:///arduino/<YOUR_REST_API>

If that fails, adding debug statements will help.

You may also want to check the location of your zepto.min.js file

Jesse

jessemonroy650:
You may want to add the following code to your setup()

 while (!Serial) {

; // wait for serial port to connect.
}
Serial.print("Started server.");

Be aware that this means that the sketch will not proceed past this point until a serial connection is established over the micro-USB port. If you want to be able to see all of the serial messages (especially the early setup messages) then this is a good thing. If you want to be able to run stand-alone without a PC connection, this would be a very bad thing to do.

Add the code to help your debugging, but remember to remove it (or comment it out) when you get things working and want to run stand-alone.