Page 3 of 3
Re: ESP8266 + Database
Posted:
Sat Jul 30, 2016 9:27 am
by martinayotte
As I said earlier, it doesn't make sense to put "localhost" or "127.0.0.1" in the "Host" header field.
Re: ESP8266 + Database
Posted:
Sat Jul 30, 2016 11:34 am
by RichardS
Yep not looking good, you need to try and add the actual IP of the local server..... not local: and not loopback
RichardS
Re: ESP8266 + Database
Posted:
Sat Jul 30, 2016 8:02 pm
by barti5001
Thank you very much guys, your answers were very helpful!
I have one more question. How can i receive a request from server on the clientmode esp?
For example i want to change the state of any output pin, how to send it to this esp from server?
Re: ESP8266 + Database
Posted:
Sun Jul 31, 2016 9:52 am
by martinayotte
In the previous case, your ESP was used as a client to the server, in such mode, server can only send commands by making ESP doing polling on the server, asking the server "do you wish I do something ?".
This method isn't efficient and will be slow.
The real way to do that, is that ESP should become a server by it own, waiting for remote request from the other computer with PHP code doing acting as a client. For exemple, an HTTP request could be something like "http://<esp_ip_addr>/gpio/<gpio_number>/ON" and "http://<esp_ip_addr>/gpio/<gpio_number>/OFF".