sonnyyu,
Thanks for the code, it saved me a lot of time.
I was able to write to the database from the Yun via Putty by invoking "php-cli /mnt/sda1/db.php 856"
root@Arduino:~# php-cli /mnt/sda1/db.php 856
but wasn't able to get the Yun script to do it itself without a few code changes:
added
#include <Bridge.h>
and changed the p.begin and p.addParameter strings to mimic what worked at the command prompt.
#include <Process.h>
#include <Bridge.h>
int temperature;
void setup() {
Bridge.begin(); // Initialize Bridge
}
void loop() {
int temperature = random(0, 100);
Process p;
p.begin("php-cli");
p.addParameter("/mnt/sda1/db.php");
p.addParameter(String(temperature));
p.run();
delay(5000);
}
I don't know if all the changes were needed, but it works for me.
Other than that, I followed your directions verbatim.
Thanks again!