-->
Page 1 of 1

Connecting phone Directly to ESP8266 running a webpage

PostPosted: Thu May 21, 2015 5:29 am
by pumzele
Hello Everybody,
I want to connect my phone directly to the ESP8266 with out having another Router.
Up until now all the examples I have see require the ESP8266 to connect to a Router and you connect your phone to the router to have access to it.

Is it possible to connect my phone to the ESP8266 direclty via WiFi and then have the ESP8266 host a small webpage?
The idea is to have a simple web interface running on the ESP8266 so that you can control things using the ESP8266 with out the need of writing an app. If you running a webpage you automatically made it compatible with every mobile device running a browser.

If anyone has an example of the ESP8266 hosting a webpage with out an additional router please let me know.

Re: Connecting phone Directly to ESP8266 running a webpage

PostPosted: Thu May 21, 2015 3:32 pm
by j0hncc
Hi,

Most of the examples you see of "connecting to router" will work directly from phone to ESP by simply changing the initialization (2-3 lines of code) from "Station" mode to "Access Point" mode.

For example in Sming several examples (e.g. HttpServer_AJAX) have
Code: Select all   WifiStation.config(WIFI_SSID, WIFI_PWD);
   WifiStation.enable(true);
   WifiAccessPoint.enable(false);

Basically just change to this, and you've got what you want:
Code: Select all   WifiStation.enable(false);
   WifiAccessPoint.enable(true);

Then on your phone connect to ESP access point and go to the ESP ip address (default 192.168.4.1).

Espressif SDK, Arduino, nodemcu, even some AT versions have basically the same thing using different syntax.

Cheers,
John