Shantanu24:
Is there a way to connect to the WiFi without its password?
You need to get the password first and then use that password to connect to the router. The question is how do you get the password from the Android app without being connected to the network? That depends on your application. I am working on a project where the user must connect to the ESP8266's AP for the initial network configuration(or if it has been changed). They will enter the SSID and password during that configuration and it is written to flash memory. After that the ESP8266 will connect to the network using the SSID and password that was provided.
The problem is,
The end device Will Not connect to the WiFi without the password.
So, even if my android app sends the password...HOW will the end device even receive the password? It is not connected to WiFi. Because it has no password.
Shantanu24:
The problem is,
The end device Will Not connect to the WiFi without the password.
As Pert has explained, to feed the ESP8266 with the configuration details of the main wireless lan, first the ESP8266 must be put in AP mode (by button press etc.). It creates its own private Wireless network with the SSID of your choice, say ESP1APP with, if you require, a standard userid and password. During this configuration mode, your device (android app, web browser etc.) connects and hands over the credentials of the main wireless lan. Once the ESP8266 has got those credentials, it can then authenticate and join the main wireless lan (in 'station' or wireless client mode).
Interestingly, you said in the OP that you want to eliminate the access point. Do you mean that you have already implemented such a scheme as described above or are you talking about a separate access point.
Everything is working fine, but now, my project lead wants me to eliminate the Access Point.
IF the WiFi main router will not have its password changed, you can write a short sketch and give the ESP8266 that information as a client. Once it connects, the SSID/passcode are stored in flash. Your published routine does not then need to set the SSID/password, just do a connect. Of course, this is a real P.I.T.A. if some fool changes the WiFi router password or SSID.
The way it really should be done for an ESP8266 is via a Captive Portal. This mimics the type of access often found in hotels where the user opens a browser and clicks HOME but any URL is trapped and the user is sent to the captive portal where credentials (room number, lastname, credit card number) are typed and verified. The captive portal then provides a redirect/hand-off connection to the real router/AP.
I have created and published my version of an ESP8266 captive portal, but I have not researched/experimented with the hand-off or redirect programming.
IMO the ESP8266 is simply not the proper device to manage a captive portal with pass-thru (proxy) services because it is limited in connections and the resources are minimal as are the number of simultaneous connections. My thoughts are that a redirect would be the logical transfer mechanism. But I have not empirically proven this to myself.
All the above being said, you can research WPS implementation and attempt to incorporate that with the ESP8266. A Google search does provide hits.
I hope the OP comes back and says what he is doing.
My guess is that he is developing a product that has to be provisioned in one of many different WLANS , that is sold to say home users ( NTP clock, remote controlled power socket, monitoring system etc. etc. ) which would rule out loading the access credentials by information embedded in the sketch.
For commercial use, there are also other solutions for mass provisioning of WLAN access in a specific organisation based on 802.1X certificates (CISCO / LEAP etc. ) but I guess that even if that is what the OP is doing, he is not going to find a ready made library for the ESP8266 to support all that.
but I guess that even if that is what the OP is doing, he is not going to find a ready made library for the ESP8266 to support all that.
Ha! Well, certainly not an Arduino library that I could find today. But, someone may write one... stranger things have happened in Arduino ESP8266 land.
My guess is that you would need to drop to the native API and use the SDK to concoct some type of captive portal, gather credentials, store, reboot into user mode.
I am a newbie to ESP8266. I have successfully created WiFi LED toggle application from Android.
But I am having a problem on how to go around giving SSID and password in the program. I need to understand how we can provide SSID and password to ESP8266 module after it has been powered up.
.
Is that called AccessPoint (AP) mode ?? .......
.
Appreciate some example sketches.
Using an access point is one option and I think it was already described well in this thread. I agree that a captive portal will make the system very user friendly.
The access point is not necessarily your only option. You just need some way for the user to communicate with the ESP8266. If you want to do that over WiFi, an AP is the way to go but if you have another communication channel like serial or bluetooth that would work too. Of course you can just hardcode the credentials in the sketch before you upload it to the ESP8266 but that doesn't meet your requirement of setting them while it's running.