Rest.begin problem - cannot get contact with webpage

I have a problem with the following code. (Only the important code is shown)

The code works when I’m on localhost (using the IP address) but when going to an external web page I get the text “No answer”

I do not have a fixed IP only the URL of the webpage and my web supplier cannot give me a fixed IP on the homepage.

Any good advice would be appreciated, as I’m stuck with 20 rev 2 Cactus micros if there is no solution!

The code is build on your example.

void wificonnect(MyObject customVar) {


  debugTekst("ARDUINO: setup rest client");

  while (!esp.ready());

  Serial.println("ARDUINO: setup rest client");
  //if (!rest.begin("")) {

  if (!rest.begin("")) {
    debugTekst("ARDUINO: failed to setup rest client");
    while (1);

  /*setup wifi*/
  debugTekst("ARDUINO: setup wifi");
  esp.wifiConnect(customVar.ssid, customVar.pass);
  debugTekst("ARDUINO: system started");
void wifi() {
  char response[266];


  if (digitalRead(pirPort)) {
    debugTekst("PIR alarm wifi?");
    if (wifiConnected) {
      debugTekst("PIR alarm");
      if (rest.getResponse(response, 266) == HTTP_STATUS_OK) {

        debugTekst("ARDUINO: GET successful");


      } else {
        debugTekst("No answer");

The output looks like this
add 0
aid 2
pm open phy2,type:2 0 0

connected with jip:,mask:,gw:
PIR alarm wifi?
PIR alarm
No answer

What result is the command line?


I can’t get any response.

Pinging [] with 32 bytes of data:
Reply from bytes=32 time=21ms TTL=57
Reply from bytes=32 time=12ms TTL=57
Reply from bytes=32 time=11ms TTL=57
Reply from bytes=32 time=16ms TTL=57

Ping statistics for
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 11ms, Maximum = 21ms, Average = 15ms

try to edit this line

  if (!rest.begin("")) {


  if (!rest.begin("")) {

Thanks for your fast response.

I have tried without luck as well as

I have even tried to use URL’s which are not mine and the result are always the same.

Will it work?

  if (!rest.begin("")) {

No it will not work.

If I enter in a browser I’ll not get

The result is:

If you are the owner of this website, please contact your hosting provider: webmaster@
It is possible you have reached this page because:

is test.php same with the file when you are on localhost?

Yes _ I have just changed the code on localhost and on the webpage so they are alike.

The code is very simple:

	  echo "Hello world";

The solution was:


Thank you for your support

I’m glad you resolved the problem yourself. I learned more.