I have an Arduino Uno WiFi and I'm trying to launch this PHP script with the RestClient example from UnoWifiDevEd library but I'm just able to connect the board to the server.
Can somebody help me please?
Here is the code:
#include <Wire.h>
#include <UnoWiFiDevEd.h>
void setup() {
const char* connector = "rest";
const char* server = "https://________.com";
const char* method = "POST";
const char* resource = "/send.php";
Serial.begin(9600);
Ciao.begin();
pinMode(2, INPUT);
delay(10000);
doRequest(connector, server, resource, method);
}
void loop() {
}
void doRequest(const char* conn, const char* server, const char* command, const char* method){
CiaoData data = Ciao.write(conn, server, command, method);
if (!data.isEmpty()){
Ciao.println( "State: " + String (data.get(1)) );
Ciao.println( "Response: " + String (data.get(2)) );
Serial.println( "State: " + String (data.get(1)) );
Serial.println( "Response: " + String (data.get(2)) );
}
else{
Ciao.println ("Write Error");
}
}
If it is the Arduino.org Arduino UNO WiFi Developer Edition, then use WiFi Link with UNO WiFi Serial1 library