-->
Page 1 of 3

AP, Station, Server, Client, adhoc and friends

PostPosted: Sat Mar 07, 2015 7:12 am
by wally
Hello,
i already tried wikipedia and some google searches to get a sufficient simple and clear
definition and explanation of AccessPoint, Station, configured as server / as client and ad-hoc
modes. Now i'm not much smarter as before. I see the several possibilities of configuration but
can not decide which i need for which task.
May anybody be so kind and define and explain this fundamental vocabulary in ESP8266 context.
If possible with appropriate AT command and/or nodemcu lua commands.

Thank a lot in advance
wally

Re: AP, Station, Server, Client, adhoc and friends

PostPosted: Sun Mar 08, 2015 5:40 pm
by ProfePaco
yes, same needs here

Re: AP, Station, Server, Client, adhoc and friends

PostPosted: Mon Mar 09, 2015 4:53 am
by wally
ProfePaco,
I'm sure we are not alone :)
As more i read, as more i'm confused. Too much different expressions for the same thing.
A graphical net totpology, limited to abilities of the ESP8266 would be great and/or examples
of solutions for several possible tasks.

If the student is ready the teacher appears! ... i hope

wally

Re: AP, Station, Server, Client, adhoc and friends

PostPosted: Fri May 08, 2015 8:05 am
by Alex P
I am in the process of learning how to use the ESP8266. For my particular task I need this module to operate in a mesh network topology. I don't know how much you know about networking and wireless communication, so I'm going to describe as much as I can remember, as simply as I can, and hopefully I will answer at least some of your questions. What I know so far:

The ESP8266 does not support ad hoc mode with all its perks (self healing, self organizing, etc) so making it a part of a mesh network requires one to write firmware that uses the AP and STA modes.

Access Point (AP) mode allows the ESP8266 to function as a router, broadcasting its SSID across the wireless 2.4GHz spectrum. ESP8266 has inbuilt TCP/IP and all of the neat features (like DHCP and DNS) one would need to get things started. So as soon as a device connects to your ESP in AP mode it will be assigned a local IP address. This mode is useful if you want to create a closed network for communication between devices, without access to the internet (or with, but then you'll have a router and will need more hardware).

Station mode (STA) basically makes the ESP8266 into a client, making it able to connect to other wireless networks (APs). This is the mode that allows one to use the ESP in IoT projects. So you basically connect to a network, get assigned a local IP by the router, create a server and listen on some port. After that you can send messages (HTTP requests) to the ESP from any device in the same network, or with further tweaking - from the internet.

As mentioned, to do all this one needs to have a TCP/UDP server running on the ESP8266. Luckily to create a server and make it listen to a port only takes 2 lines of code - courtesy of Arduino WiFi Shield and good people who tweaked it for ESP8266. Or you can do it the old fashioned way by writing AT commands (also really easy tbh).

If you want your ESP to be able to connect to other devices on the network/internet, you will need to establish a connection to the devices IP address, in effect making your ESP module a TCP/UDP client.

ESP8266 can be in AT and STA modes at the same time, while also running a server and being a client. If using AT commands, I believe one is limited to 5 TCP/UDP connections, however I know some people managed to change that to 256 by doing some wodoo magic.

Hope this helps in your ESP endeavors :)

PS: I am a little bit of a noob, so take what I've written with a grain of salt