-->
Page 1 of 2

ESP8266 multiple client network

PostPosted: Tue Feb 23, 2016 6:02 pm
by Mike Monk
Hi,

Is it possible to use an ESP8266 module as server and acess point at the same time to handle the communication between two or more clients?

I use Adafruit Huzzah modules and the arduino IDE. I want to send and recieve data from client to client without using an external router or webapplication.

Firstly I programmed a module as access point and another as client. This works fine.
What I am trying to do is to adapt this example:
[url]https://learn.adafruit.com/remote-control-with-the-huzzah-plus-adafruit-io/overview
[/url]
for two clients in the descirbed way.

I just startet to work with these ESP8266 modules yesterday. So I am still a noob.

Can anybody give me a hint or show me some code of how I can implent my project?

Is it possible in general?

Re: ESP8266 multiple client network

PostPosted: Tue Feb 23, 2016 8:21 pm
by martinayotte
The ESP8266 can, of course, run in STA+AP mode.
But that doesn't mean it can act as router, there is nothing yet in the SDK that allows packets at networking low level to be routed between clients.
But you can still do, depending of your project, having your Master AP ESP to act as a relay, receiving commands from one clients, and re-sending it to another clients.
For that, you first need to establish an application protocol, choose transport format, plain TCP format with plain text commands for example.

Re: ESP8266 multiple client network

PostPosted: Sat Aug 20, 2016 9:41 am
by paulfer
martinayotte wrote:The ESP8266 can, of course, run in STA+AP mode.
But that doesn't mean it can act as router, there is nothing yet in the SDK that allows packets at networking low level to be routed between clients.
But you can still do, depending of your project, having your Master AP ESP to act as a relay, receiving commands from one clients, and re-sending it to another clients.
For that, you first need to establish an application protocol, choose transport format, plain TCP format with plain text commands for example.


Hi Martin, do you have a link to an example of the sta+ap mode??

Regds

Paul

Re: ESP8266 multiple client network

PostPosted: Sat Aug 20, 2016 10:52 am
by martinayotte
If you mean basic STA+AP sketch, I've posted one more than a year ago, but it is probably obsolete, although the idea still the same. But for quicker way, simply take the example from https://github.com/esp8266/Arduino/tree ... ccessPoint, and add a call to WiFi.mode(WIFI_AP_STA); just after the WiFi.softAP(HostName, password); and then add the STA connection with WiFi.begin(router_ssid, router_password);.
This way, the ESP is both STA and AP.