Hello, I have a problem that I hope someone can help me with.
I'm using the Arduino Uno Wifi with the UnoWiFiDevEd libary to send data to a php script which interfaces with my database. All this is working fine, but when I tell my arduino to send data to my php script, the entire program freezes for about 6 seconds.
I haven't been able to find anything that would explain this behavior, so I hope someone can tell me if this is normal behavior by the library.
#include <Wire.h>
#include <UnoWiFiDevEd.h>
int goalpin = 1;
int goalSensor = 0;
const char* connector = "rest";
const char* server = "*******";
const char* method = "POST";
const char* resource = "*****";
void setup() {
Serial.begin(9600);
Ciao.begin();
pinMode(btnPin, INPUT);
}
void loop() {
goalSensor = analogRead(goalpin);
if(goalSensor < 15){
//GOAL
doRequest(connector, server, resource, method);
Serial.println("GOAAAAL!");
} else {
Serial.println("Waiting");
}
}
void doRequest(const char* conn, const char* server, const char* command, const char* method){
CiaoData data = Ciao.write(conn, server, command, method);
Serial.println("DONE SENDING");
Ciao.println("DONE SENDING");
}