Making a GET request to a PHP script using Ciao.write

Hey everyone,

I’m using an Arduino Uno Wifi and I want to send sensor data from my Uno to a PHP-Script, which saves the data into a MySQL Database. When I execute my code, nothing happens and the database stays empty, even though everything compiles correctly and I did pretty much the exactly same thing as in this tutorial.

This is my Arduino Code

#include <UnoWiFiDevEd.h>
 
void setup() {
  char* connector = "rest";
  char* server = "myserver/src/add_data.php?";
  char* method = "GET";
  String resource = "humidity=11&&temperature=22";
 
  Serial.begin(9600);
  Ciao.begin();
 
  doRequest(connector, server, resource, method);
}
 
void loop() {
 
}
 
void doRequest(char* conn, char* server, String command, char* method) {
  CiaoData data = Ciao.write(conn, server, command, method);
  if(!data.isEmpty()){
    Serial.println("Success");
  } else {
    Serial.println("FAILED");
  }  
}

and this is how my add_data.php script looks like

<?php
    // Connect to MySQL
    include("dbconnect.php");
 
    // Prepare the SQL statement
    $SQL = "INSERT INTO arduino_data (Humidity, Temperature) VALUES ('".$_GET["humidity"]."', '".$_GET["temperature"]."')";
 
    // Execute SQL statement
    mysql_query($SQL);
?>

If I’m using a browser and write “myserver/src/add_data.php?humidity=60&&temperature=22” into the url bar, everything works just fine.
I think I misunderstand how this Ciao.write works, even though I looked in the code (in the CiaoData PassThroughRead function) and thought I specified everything correct. The documentation (http://www.arduino.org/learning/reference/ciao-write) is no help at all.

I’m pretty new to this whole topic, so please bear with me if I’m just making a really, really dumb mistake.

Anyway, any help is highly appreciated!

Seems to me that you need to start here:

http://www.arduino.org/learning/reference/ciao-library

Arduino Ciao is a easy-to-use and powerful technology that enables Arduino sketches to communicate intuitively with the “outside World”. It aims to simplify interaction between microcontroller and Linino OS allowing a variety of connections with most common protocols, social networks, third-party services and applications.

What is running the Linino OS, that you are trying to communicate with?

Felix - did you ever figure this problem out? I'm trying to get my Uno Wifi board to do the same thing and no luck. The Arduino Ciao reference material is completely AWFUL. Basically doesn't exist.

wheels:
Felix - did you ever figure this problem out? I'm trying to get my Uno Wifi board to do the same thing and no luck. The Arduino Ciao reference material is completely AWFUL. Basically doesn't exist.

Can you answer the question that PaulS asked of the previous poster?