Reverse connection without port forwarding?
Posted:
Mon Jan 22, 2018 11:49 am
by lucasromeiro
hello, I'm using esp-12 with arduino ... I have a site that I get esp data by post html, but when my site needs to talk to esp, I have to set up a reverse connection on my client's router using port forwarding but this is very laborious and I often have trouble getting access to the client router ...
My system connects to the website every 15 minutes for sending data, I keep the wifi connection on, but I disconnect from my site after doing the html push. It's not cool to receive commands only when connecting to the site (15 minutes). I need a quick way.
Is there any way to simplify receiving commands from my site, which does not have to open the client router to configure port forwarding?
i need a help!!
Re: Reverse connection without port forwarding?
Posted:
Mon Jan 22, 2018 5:50 pm
by btidey
If the transaction starts from outside then port forwarding is the mechanism used to allow the router to know where to direct that traffic.
So no it is not possible to address a device on the internal side of a conventional NAT router from the WAN side.
If this has to work with arbitrary routers and you want a faster response time then you should consider a higher poll rate from the device. Some systems poll for remote commands every few seconds to give decent response times.
Re: Reverse connection without port forwarding?
Posted:
Mon Jan 22, 2018 7:15 pm
by destroyedlolo
2 solutions coming to my mind :
- you may reverse the connection : I mean, let the ESP to query your web site. To do that, store the command somewhere on your website and create a simple webservice to retrieve the command
- more sophisticated : use a public MQTT broker and persistent messages (QoS 1 or 2) : the web server publish commands and the ESP subscribes to the commands topics
I'm using the second one and it's working very well, but with a private MQTT broker.
Re: Reverse connection without port forwarding?
Posted:
Mon Jan 22, 2018 8:36 pm
by lucasromeiro
lucasromeiro wrote:hello, I'm using esp-12 with arduino ... I have a site that I get esp data by post html, but when my site needs to talk to esp, I have to set up a reverse connection on my client's router using port forwarding but this is very laborious and I often have trouble getting access to the client router ...
My system connects to the website every 15 minutes for sending data, I keep the wifi connection on, but I disconnect from my site after doing the html push. It's not cool to receive commands only when connecting to the site (15 minutes). I need a quick way.
Is there any way to simplify receiving commands from my site, which does not have to open the client router to configure port forwarding?
i need a help!!
HTTP POST !!!!
Sorry for my mistake
I wrote wrong
the command has to come from my site. without needing to order.
port forwarding does this ... but it is very laborious to always have to configure the reverse path on the clients router ...