-->
Page 1 of 1

ESP8266-12 AP (station) & multiple ESP8266-12 STA (client)

PostPosted: Sat Jul 09, 2016 3:55 pm
by dominator99
Hi All

I'm running the above combination of AP (station) & STA (client) & receive the following:


Received from client0 (IP/Size/Data): 192.168.4.2 / 33 / Sending to AP from client1 25'C

Connected to WiFi.localIP 0.0.0.0 WiFi.softAPIP 192.168.4.1

Received from client0 (IP/Size/Data): 192.168.4.3 / 37 / Send millis from client2: 10314294

Connected to WiFi.localIP 0.0.0.0 WiFi.softAPIP 192.168.4.1

Received from client0 (IP/Size/Data): 192.168.4.2 / 33 / Sending to AP from client1 25'C

Connected to WiFi.localIP 0.0.0.0 WiFi.softAPIP 192.168.4.1

Received from client0 (IP/Size/Data): 192.168.4.3 / 37 / Send millis from client2: 10316295

Connected to WiFi.localIP 0.0.0.0 WiFi.softAPIP 192.168.4.1

I need to be able to identify & store the incoming data from each STA for processing by a mega2560 which has the ESP8266-12 AP attached but all my attempts have failed.

Is there a way to use the STA IP addresses as a pointer to the data so as to get:

Received from client1 (IP/Size/Data): 192.168.4.2 / 33 / Sending to AP from client1 25'C

Received from client2 (IP/Size/Data): 192.168.4.3 / 37 / Send millis from client2: 10314294

thereby identifying the source of the data as client1 or client2 not both as client0

I've tried strcmp(port.remoteIP(), "192.168.4.2") but that doesn't compile, with the error:

invalid user-defined conversion from 'IPAddress' to 'const char*' [-fpermissive]

I've attched the 3 sketches (1 AP & 2 STA) in the hope someone can help

MyAdafruitHuzzahSTA_9-7-16_3.ino
MyAdafruitFeatherAP_9-7-16_3.ino
MyAdafruitFeatherSTA_9-7-16_3.ino

Re: ESP8266-12 AP (station) & multiple ESP8266-12 STA (clien

PostPosted: Sat Jul 09, 2016 8:33 pm
by bbx10node
This compiles but I do not know if it works.

Code: Select all    if (port.remoteIP() == IPAddress(192,168,4,2)) {
      Serial.println("recv from client A");
    }
    else if (port.remoteIP() == IPAddress(192,168,4,3)) {
      Serial.println("recv from client B");
    }