SyukriY:
I'm sorry because I cannot post the code properly in here.
See this for help: posting code in the forum
It looks like your code may be based on an ESP8266 example - the Yun operates completely differently, and I would be very surprised if any concepts used on the ESP8266 will carry over to a Yun example.
What you have in your sketch doesn't make sense. You are starting a Linux process to run /usr/bin/pretty-wifi_info.lua. This is an example script to collect information about your current WiFi connection. It generates output that looks like this:
Current WiFi configuration
SSID: Wireless Network Name
Mode: Client
Signal: 67%
Encryption method: WPA PSK (TKIP)
Interface name: wlan0
Active for: 44025 minutes
IP address: 192.168.42.132/255.255.255.0
MAC address: 90:A2:DA:F0:32:D2
RX/TX: 3146097/177599 KBs
While some of these values will change over time (like the active time and signal strength) they will in no way reflect any information about incoming web requests. You will never find the "pin=" keyword in that response, nor will you find any of the following information.
It looks like you are trying to set the output PWM value of several pins in response to commands from a web page. You need to use a different approach. There is an example that come with the IDE that should give you some guidance.
The Bridge Tutorial will get you very close to what you want. You can use that sketch as an example and modify it as required, but as it is now it will do what you want. You can adjust the PWM output of a pin by making a web request with the format:
http://<address>/arduino/analog/<pin>/<value>
Where:
- is the node name or IP address of your Yun
- is the pin number to be updated
- is the output PWM value
For example: http:10.8.209.210/arduino/analog/6/128
to set pin to a PWM value of 128.
Then, your javascript will need to change to send requests in that format. I'm not a javascript expert, but the simplest way to do it usually involves using jquery or zepto. A minified copy of zepto is in the www folder under the Bridge library's TemperatureWebPanel example. That same folder includes a very simple example of making a web request using zepto.
This is the quick and easy way to accomplish what you want. But it's not particularly efficient - while the response time is sufficiently fast for many applications, it may be too slow for some uses. There are faster ways of accomplishing this, but that is a much more advance topic and involves a lot of Linux programming. It's better to start with small steps and learn the basics first.