Reputation: 27
I need to program an esp8266 to do the following:
I am thinking on doing these actions on the setup() function:
The idea is to "interrupt" the server with the timer and using the same port used on the server to send a udp packet to a remote location. Example: server is started to listen on port 2000. Then when the interrupt is triggered, the server should "pause", then we should send a packet from port 2000 to our remote IP, then the server should "resume"
I am waiting for my board to arrive to test this setup but wanted to know if that is possible. I am assuming that the mqtt client should work similarly (it can subscribe and publish). Aside from an interrupt I can't think on another way to "stop" the server temporarily and act as a client
Has anybody tried this before?
Upvotes: 1
Views: 1303
Reputation: 1
You should use the AT
command
AT+CIPMUX=1
and
AT+CIPSTART=<link ID>,<type>,<remote IP>,<remote port>[,<TCP keep alive>]<link ID>
Upvotes: 0