0

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
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
  • Which firmware do you have running on your ESP8266? – Roberto Lo Giacco Sep 15 '16 at 16:42
  • Hi @RobertoLoGiacco, I edited my question to include firmware info. – Christian Rodriguez Sep 15 '16 at 17:00
1

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.

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