Go Down

Topic: Fails invoking a simple php file and html file from arduino yun (Read 591 times) previous topic - next topic

Xanderxer

Hello Friends

I am using the httpclient example from arduino yun for executing a php file that i have on a hosting and it should returns me the datetime. However i get the following error from the arduino monitor:


<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>406 Not Acceptable</title>
</head><body>
<h1>Not Acceptable</h1>
<p>An appropriate representation of the requested resource /WebTekDomo/Clases/clsOpFecha.php could not be found on this server.</p>
<p>Additionally, a 406 Not Acceptable
error was encountered while trying to use an ErrorDocument to handle the request.</p>
</body></html>


i get the same result from a simple html file where i put <b>hola</b>

Please tell me what i need to do for this could working fine

PD:  Actually when i invoke this php from my pc it returns the date.

PD2: the code that i am using is the following:



#include <Bridge.h>
#include <HttpClient.h>

void setup() {
  // Bridge takes about two seconds to start up
  // it can be helpful to use the on-board LED
  // as an indicator for when it has initialized
  pinMode(13, OUTPUT);
  digitalWrite(13, LOW);
  Bridge.begin();
  digitalWrite(13, HIGH);

  SerialUSB.begin(9600);

  while (!SerialUSB); // wait for a serial connection
}

void loop() {
  // Initialize the client library
  HttpClient client;

  // Make a HTTP request:
  client.get("http://www.mydomain.com.ec/Clases/clsOpFecha.php");

  // if there are incoming bytes available
  // from the server, read them and print them:
  while (client.available()) {
    char c = client.read();
    SerialUSB.print(c);
  }
  SerialUSB.flush();


 

  delay(5000);
}




Please help me

Kind regards





Go Up