Hola! Estoy intentando que se haga una inserción en mi servidor y no lo consigo, a ver si me podéis echar una mano.
Gracias
#include <Ethernet.h>
#include <SPI.h>byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; //physical mac address
byte ip[] = {192, 168, 1, 20 }; // ip in lan
byte gateway[] = {192, 168, 1, 254 }; // internet access via router
byte subnet[] = {255, 255, 255, 0 }; //subnet mask
EthernetServer server(5675); //server port
byte sampledata=50; //some sample data - outputs 2 (ascii = 50 DEC)//variables
String readString = String(30); //string for fetching data from address
char url[100];
char meta[200];
byte servidor[] = { 46,30,211,55 }; // servidor IP
EthernetClient client;
float value;
char location[100];void setup()
{Serial.begin(9600) ;
//INTERNET
Ethernet.begin(mac, ip, gateway, subnet);}
void regRiego(){
Serial.println("connecting...");if (client.connect(servidor, 80)) {
Serial.println("connected");
sprintf(url, "tiempo=%d&litros=%d&zona=%d");
sprintf(location, "http://gestion.ardumotica.es?regando&%s'>", url);client.print("GET ");
client.println(location);
client.println();}
else{
Serial.println ("connection failed");
}}
void loop(){
regRiego();
}