For my school project i need to insert sensor data from my FEZ Panda in a MySQL database.
I think the best way is to make a script which reads GET data so in my Panda application i have to request a certain URL.
For example: thisistheurl.com/addSensordata.php?height=12&tilt=24
For some reason i can’t get this to work and i’m desperate since i have to demonstrate this tomorrow.
As Ian points out, telling us more about what you want to do will help here. Telling us how your code doesn’t work today and what you want to do with it, including who is doing the pull/push of data and to what is critical.
If you have Fez Panda and Connect shield, then there’s good examples of returning values from Fez sensors or data (look at several of the code submissions by Jasdev or Nicolas3 of a server instance that works great) and there’s examples of pushing data to Pachube (or whatever they call themselves these days), again that might help you frame your problem statement.
@ MarcoV
It sounds like you want to transfer sensor data from your Panda II to a web server using a Get request. If you are using a Panda and the Connect shield, you need to use the GHIElectronics.NETMF.Net library. You will also need to use the HttpWebRequest class to do the Get request to the web server.
Each post gives more and more info … So I figured, just give him the fish
var req = System.Net.HttpWebRequest.Create("http://www.myUrl.com/GetVar1=Value&GetVar2=Value&GetVar3=Value");
var response = req.GetResponse();
// this reads the response from the webserver -- optional
var reader = new System.IO.StreamReader(response.GetResponseStream());
var responseText = reader.ReadToEnd();
@ ianlee74 - sometimes when you want to do something quick and easy as proof of concept, GET works just fine.
var request = System.Net.HttpWebRequest.Create("http://www.myUrl.com");
string postData = "Var1=value&Var2=value&Var3=value";
byte[] data = System.Text.Encoding.UTF8.GetBytes(postData);
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = data.Length;
var requestStream = request.GetRequestStream();
requestStream.Write(data, 0, data.Length);
var response = request.GetResponse();
// this reads the response from the webserver -- optional
var reader = new System.IO.StreamReader(response.GetResponseStream());
var responseText = reader.ReadToEnd();