Hola soy nuevo en ARDUINO hace como una par de meses que lo uso, he intentado mandar datos de ARDUINO a PHP pero no lo consigo he probando usando un servidor local y un también con un servidor hosteado si alguien tendrá un guía me ayudaría mucho me estoy guiando con este código. de antemano gracias.
#include <EtherCard.h>
#define PATH "temp.php"
byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 };
char website[] PROGMEM = "127.0.0.1";
byte Ethernet::buffer[700];
uint32_t timer;
Stash stash;
void setup () {
Serial.begin(57600);
Serial.println("\n[webClient]");
if (ether.begin(sizeof Ethernet::buffer, mymac) == 0)
Serial.println( "Failed to access Ethernet controller");
if (!ether.dhcpSetup())
Serial.println("DHCP failed");
if (!ether.dnsLookup(website))
Serial.println("DNS failed");
ether.printIp("SRV: ", ether.hisip);
}
void loop () {
ether.packetLoop(ether.packetReceive());
if (millis() > timer) {
timer = millis() + 10000;
byte sd = stash.create();
stash.print("t0=22");
stash.save();
Stash::prepare(PSTR("POST http://127.0.0.1/temp.php HTTP/1.0" "\r\n"
"Host: 127.0.0.1 \r\n"
"Content-Length: $D" "\r\n"
"\r\n"
"$H"),
stash.size(), sd);
ether.tcpSend();
}
}