dear all,
I know I am not using Arduino, and I am using waspmote, but I hope that you can help me with this:
I am uploading the following code to my waspmote to send the word (HI to web server)
void setup(){
USB.begin();
WIFI.begin();
WIFI.ON(socket0);
WIFI.resetValues();
WIFI.setDebugMode(1);
WIFI.setESSID("linksysss");
WIFI.setConnectionOptions(HTTP);
WIFI.setDHCPoptions(DHCP_ON);
WIFI.setAutojoinAuth(OPEN);
WIFI.join("linksysss");
USB.println("Inicializado!");
}
void loop(){
USB.println("Conectado!");
WIFI.getWLANsettings();
WIFI.getUARTsettings();
WIFI.getAdhocSettings();
WIFI.getURL(DNS, "www.farah.comyr.com", "GET$/add.php?data=HI");
USB.println(WIFI.answer);
WIFI.leave();
USB.println("TERMINO");
}
and I am having the following files in my webserver:
File1:
function Conection(){
if (!($link=mysql_connect("server","userName","Password"))) {
exit();
}
if (!mysql_select_db("DataBase",$link)){
exit();
}
return $link;
}
?>
File2:
<?php include("conec.php"); $link=Conection(); $Sql="insert into table(fieldName) values ('".$_GET["data"]."')"; mysql_query($Sql,$link); header("Location: insertareg.php"); ?>File3:
DataData from the waspmote
| Temp |
<?php include("conec.php"); $link=Conection(); $result=mysql_query("select * from table order by id desc",$link); ?> <?php while($row = mysql_fetch_array($result)) { printf("", $row["fieldName"]); } mysql_free_result($result); ?>
| Data 1 |
| %s |
and I got nothing saved in my database, an nothing displayed.
So can you help me with this ??
Regards,
Farah