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&cmd=10 HTTP/1.1
Connection: keep-alive
Cache-Control: max-age=0
Accept: */*
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
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!


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


AT version: 11 2016 18:09:56)
SDK version:1.5.4(baaeaebb)
Ai-Thinker Technology Co. Ltd.
Jun 13 2016 11:29:20
  • Which firmware do you have running on your ESP8266? Sep 15 '16 at 16:42
  • Hi @RobertoLoGiacco, I edited my question to include firmware info. Sep 15 '16 at 17:00

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


Not sure though this actually might solve your problem.

  • This actually solves it! Thx!! It relies on both networks being on separate addresses though, so you can't have both on, for example (if you are one to do such things, and I've seen production environments with such network configuration... a complete IP nightmare). Sep 16 '16 at 13:44
  • Glad to hear my long shot turned out to be on the spot :-) Sep 16 '16 at 15:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.