I am successfully posting from my Arduino to a Google Spreadsheet via Google Form using GSM/GPRS shield.
I am able to manipulate the data on the Spreadsheet.
Now I need to send some of the manipulated data in the cells on the Spreadsheet back to the Arduino.
I need to send the values of specific cells in my Spreadsheet back to the Arduino.
Is there any way for me to do this?
I am able to publish the spreadsheet to html (automatically as it changes), which then allows me to inspect its elements (i.e the value in a particular cell). I don't know if this will be of any use.
Now I need to send some of the manipulated data in the cells on the Spreadsheet back to the Arduino.
I need to send the values of specific cells in my Spreadsheet back to the Arduino.
Is there any way for me to do this?
No. The client that send the input has gone away. There is NO way for the server to contact the client.
The client (the Arduino) could ask the server what has changed, and then ask for the changed data.
If I run a GET on the html published spreadsheet, is there not some clever way that I can parse the recieved text and pull out a tag value? For example if I were to recieve this text from the Arduino, will I somehow be able to run through this and pull out a variable (which would be either "Arduino" or NotArduino")? In the code below, "Arduino" is the data sitting in one of the cells on the Spreadsheet.
Let me give a brief description of what I am doing and trying to achieve:
Using RFID card reader to obtain unique card number.
Using keypad to input a user chosen pin number.
Populating Google Spreadsheet (server) with both of these entries.
Using spreadsheet to verify if the pin code matches the unique card number
If there is a match, a single cell in the spreadsheet will be either "accept" or "denied"
The server does not need to initiate contact, the client will know to check the accept/deny state a second or so after the data has been sent to the spreadsheet
For example if I were to recieve this text from the Arduino, will I somehow be able to run through this and pull out a variable (which would be either "Arduino" or NotArduino")? In the code below, "Arduino" is the data sitting in one of the cells on the Spreadsheet.
Where would you receive that text FROM the Arduino? Or, did you mean "if I were to receive this text ON the Arduino"?
If that is text received ON the Arduino, that could be parsed (not easily), since the data is between td and /td tags, and the data between the and contains "s0" AND more than one and .
Frankly, what you are trying to do would be far easier with PHP and MySQL than using gagme (I mean google) spreadsheets, but that might just be me.
I am trying to do it via Google Spreadsheets because I'm noob and also want it to be free!
PHP and MySQL fit that budget, without all the grief of using google. Well, OK, there may not be all that much grief, and there is a learning curve (well worth tackling) to PHP and MySQL.
Using GET on the published spreadsheet html:
That gets the data ON the Arduino. You need to save data in an array until you detect stuff of interest in the stream, like '<'. When that happens, store stuff in the array, until '>' arrives. Then the array could contain something like "tr". When that happens, set a flag that indicates that interesting data may be coming.
When that flag is set, save to another array.
When the input stream contains '<', save to the first array. When the stream contains '>', look at the value in the first array. If it contains "/tr", then the second array may contain Arduino or NotArduino (although I confess I'm confused about the "accept" or "denied" comments).
If you used a PHP script, you'd have complete control over the server response, which could be simply 0 or 1. Far simpler to parse that, isn't it?
I agree fully with all you are saying. It is a possible (but bad) solution to the problem. I will investigate setting up a server, which might take a lot of time since I essentially have zero experience. Do you know off had any reference links for something like "creating servers for dummies" to get me started? Including domain name registration etc.
Am dualbooting Win7 and Linux
Slight experience with Wamp and Xamp (I think, can't remember) hosting local server and playing with SQL db's. Also minor PuTTy blah blah blah...
I need to jog my memory a bit
Thanks again PaulS, I will seek any further help in different topic threads!
It's pretty simple and open incredible possibilities! ....like store some historical data on spreadsheet and make some calculation and then publish (send) results to control equipment. Or "remote settings" by simple editing the spreadsheet with clear comments and strong value checking.
Important task - minimize garbage traffic from server to client.
So, to import some cell from Google Spreadsheet:
Create spreadsheet
File/Publish to the web. Start Publishing.
Get a link to the published data. Change "Web Page" to ATOM
Selectesd sell.... and give the range of sell that you need to send to Arduino. In my example it's one cell D10