The short answer is the internal web server on the Yun is listening to requests on the internal WiFi and not your ESP8266 unless you reconfigure it. Please enter:
ifconfig
and send output here.
TY,
Clem
Sorry but what do you mean Internal Wifi? I have a Router to become an Access Point and both YUN and ESP8266 access this wifi. I sketch YUN become a Web server like Bridge Example and ESP8266 will send command to YUN instead of using web browser on PC.
By the way, What I need to config? ESP8266 or YUN? How can I config it? Please teach me.
The Yun has a built in wireless access radio and an ethernet port.
Please see http://www.arduino.cc/en/Guide/ArduinoYun where "Configuring the onboard WiFi" will explain how to setup the Yun to use properly.
Clem
Sorry, I still don't understand what you mean. I got a Router to be an Access Point. Did I need to config YUN to be an Access Point too? I thought that Router will be Access Point and both ESP8266 and YUN connect to that wifi to transfer and receiver data, am I right?
You configure the yun to connect to the router is your goal. But need a PC to configure the Yun at first. As an access point you can change the Yun to connect with your router.
I already done it. I can upload my data to google Spreadsheet already too. But I want my ESP8266 send command to YUN to control led like REST API control but it doesn't work
In a nutshell, the linux runs the TCP/IP stack on the linaro processor where the REST API runs too. The ESP8266 is on the Arduino side with no stack. Inside the ESP8266 is another TCP/IP stack internally. Unless you can program the internal ESP8266, I cannot see a way to connect through.
Clem
In the second part of setup()
, tell the instance of YunServer to listen for incoming connections only coming from localhost. Connections made to Linux will be passed to the 32U4 processor for parsing and controlling the pins. This happens on port 5555. Start the server with server.begin()
.
So when I use ESP8266 to connect the YUN server...I need to connect via port 5555, is that right? or I need change
server.listenOnLocalhost();
server.begin();
}
into
server.noListenOnLocalhost();
server.begin();
}
But when I tried to connect ESP8266 to YUN server via port 5555 but it linked for a short time and get unlinked. Just connected to YUN via port 80 is ok, unlink didn't happen.
So when I use ESP8266 to connect the YUN server...I need to connect via port 5555, is that right? or I need change
server.listenOnLocalhost();
server.begin();
}
into
server.noListenOnLocalhost();
server.begin();
}
But when I tried to connect ESP8266 to YUN server via port 5555 but it linked for a short time and get unlinked. Just connected to YUN via port 80 is ok, unlink didn't happen.