Access Point AND web client

6 years 9 months ago #3908 by scalesr1
Hello, I hope someone can point me in the right direction.
I am using nodeMCU and WeMos devices as my development environment and the Arduino IDE for programming.
I can make a device a client on an existing network and do stuff - that's all good.
I have just set a device to be an AP, I can connect my phone to it and I can turn an LED on and off - that's all good too.
What I would like to be able to do is as follows:
Have the device set up as an AP which displays a simple web page when I connect to it.
I would like to be able to scan for local wireless networks and select one OR just enter the SSID and key for a known network.
Then I would like the device to reset and for it to connect directly to that SSID with the password supplied and then just let it do stuff.
I am at a bit of a loss - mostly because of my lack of knowledge I am sure.
I read that the 8266 can be both AP and client at the same time - is that right? If so, is it actually a question of inputting the SSID and key from a web page and storing them in variables which are then used by the client side to access whatever WiFi network as specified and then let do whatever I wanted it to do at that point?

In the example I used that set up as an AP, the main loop looks like this:

void loop() {
server.handleClient();
}

Can I just insert my code for doing whatever I want the client to do withing this loop?
How do I get it to connect to the AP that I specify when filling out fields on the web page that specify the desired WiFi network?
I am struggling to grasp the basics I feel, could anyone point me in the right direction?
Am I the only person who has tried to achieve this (I suspect and hope not!)

Thank you for your help.
Kind regards
Richard

Please Log in or Create an account to join the conversation.

Time to create page: 0.546 seconds

Forum latest

  • No posts to display.