ESP8266 - How to know if incoming connection is from AP or station network? I have an ESP8266 module connected with my Arduino configured as a server, with both AP and station modes (AT+CWMODE=3) activated, and I want to know if an incoming connection comes from the AP's network or the station's network. This is the package I'm receiving, and it's exactly the same whether it comes from one or another network:

+IPD,0,437:GET /?uuid=7be547af980d13c5&amp;cmd=10 HTTP/1.1
Host: 192.168.0.222:51813
Connection: keep-alive
Cache-Control: max-age=0
Accept: */*
Origin: http://127.0.0.1:8020
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36
DNT: 1
Referer: http://127.0.0.1:8020/domo_ctrl/www/index.html
Accept-Encoding: gzip, deflate, sdch
Accept-Language: es-419,es;q=0.8,en;q=0.6


At first I thought that it would reject packages addressed towards another IP (AP's IP is different from station's IP), but since this IS the gateway, it receives ALL incoming traffic. Please help!

EDIT:

This is the firmware and other stuff shown by AT+GMR:

AT+GMR

AT version:1.1.0.0(May 11 2016 18:09:56)
SDK version:1.5.4(baaeaebb)
Ai-Thinker Technology Co. Ltd.
Jun 13 2016 11:29:20
OK
I don't think the default AT firmware allows to automatically reject packets because that would probably require a higher degree of control, but looking at the Expressif documentation about the AT command set I've discovered you can actually retrieve the remote address rather than the local one, just by using the same command you were using but with a different parameter

AT+CIPDINFO=1


Not sure though this actually might solve your problem.