Chat here is you are connecting ESP-xx type modules to existing AVR based Arduino

Moderator: igrr

User avatar
By Mike Monk
#41760 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?
User avatar
By martinayotte
#41767 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.
User avatar
By paulfer
#53376
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
User avatar
By martinayotte
#53387 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.