Remote devices operating behind a router are usually given 'Virtual IP' addresses. Only the router will have an IP address which is contactable on the WWW. ISP providers will offer their clients a choice of a fixed IP address (at extra cost) or a dynamic IP address (standard package). This makes sending a control message to a device with a virtual ip address behind a router allocated with a dynamic ip address very problematic. Use of third party Dynamic DNS providers are available as a partial solution e.g. remote WEB cams, but for the ESP8266 devices, Dynamic dns is very difficult to implement due to the Dynamic dns service providers not publicising their connection methodology.

Router IP Address Log (7113 records)
Source Date Time IP Address
PIR#2 20 Oct 2018 2:33 AM 82.46.191.91
PIR#1 20 Oct 2018 1:54 AM 82.46.191.91
PIR/uwave#1 20 Oct 2018 1:34 AM 82.46.191.91
Microwave 20 Oct 2018 1:31 AM 82.46.191.91
PIR#2 20 Oct 2018 12:33 AM 82.46.191.91
PIR#1 19 Oct 2018 11:53 PM 82.46.191.91
PIR/uwave#1 19 Oct 2018 11:34 PM 82.46.191.91
Microwave 19 Oct 2018 11:31 PM 82.46.191.91
PIR#2 19 Oct 2018 10:33 PM 82.46.191.91
PIR#1 19 Oct 2018 9:53 PM 82.46.191.91
PIR/uwave#1 19 Oct 2018 9:34 PM 82.46.191.91
Microwave 19 Oct 2018 9:31 PM 82.46.191.91
PIR#2 19 Oct 2018 8:33 PM 82.46.191.91
PIR#1 19 Oct 2018 7:53 PM 82.46.191.91
PIR/uwave#1 19 Oct 2018 7:34 PM 82.46.191.91
Microwave 19 Oct 2018 7:31 PM 82.46.191.91
PIR#2 19 Oct 2018 6:33 PM 82.46.191.91
PIR#1 19 Oct 2018 5:52 PM 82.46.191.91
PIR/uwave#1 19 Oct 2018 5:34 PM 82.46.191.91
Microwave 19 Oct 2018 5:30 PM 82.46.191.91

 

The solution is briefly explained below:

  • Program the ESP8266 to send a GET request to a 'find your ip address' site.
  • Parse the returned html text and filter out the returned ip address of your router.
  • Program the ESP8266 to POST the ip address to a page on a host WEB server.
  • Create a database structure on the the host web server.
  • On the host WEB server create a WEB page to interactively insert a posted string into the database.
  • Create a WEB page on the server which will allow the results in the database to be shown.