Writing farm.bot data to google sheets and drive

Hi,

At our school we just got our farm.bot working. We, a team of 10 students and two teachers, have big plans and are very excited :slight_smile:

We would like to use Google Looker Studio to make our bot’s data more accessible to students outside our team - to provide research opportunities and to build a bit of a social media presence. To this end, we would like to learn how to write sensor and other data to google sheets and how to copy photos to our own Google Drive.

We are new to the farm.bot, willing to get our hand dirty doing some coding and figuring out, but could use a pointer as to where to start with figuring this out. Does what we are trying to do make sense? Has it been done before?

Thank you!
Farm.Bot@unishanoi.org

1 Like

Hello @farmbotatunishanoi!!! Welcome!
I love to see that they are moving forward with this project in a school!

I wanted to welcome you and accompany you with good energy as you continue forward.
Regarding your question, I cannot answer you because I do not have the necessary knowledge. I hope that someone else in the forum can give you some guidance on where to move forward in the development that allows you to export the data from the sensors.

I can only think of giving them the idea of ​​setting up a self-hosted instance (on their own server) to be able to have the data available, directly access the database and have more flexibility. But I understand that this path is a little more complicated (a little…) I personally was able to replicate the services environment (servers) locally to do my preliminary tests. I achieved it with little technical knowledge (researching and reading).

I would take these bases:

This is my process: Sharing progress on the FarmBot prototype in Santa Fe, Argentina

Good luck and I hope to continue seeing the progress of your project! A hug
Never lose enthusiasm, desire to learn and transform this world into a more harmonious and beautiful place!

1 Like

@farmbotatunishanoi Welcome :wave: Sounds like a neat project!

I would recommend starting with our Lua developer documentation if you want to take the approach of uploading data to a 3rd party server directly from the FarmBot (assuming the other server uses API keys to authenticate as opposed to some other authentication method such as OAuth).

The other approach would be to grab data from the FarmBot REST API (documentation) and then move it to Google’s servers, process it locally, etc.

And, while a bit more involved, @luciano.dlf’s solution of running your own FarmBot server is also totally valid, though doesn’t necessarily improve your access to your own data compared with just using the my.farm.bot server.

Keep us informed of your progress. I’m sure others would be interested in methods you develop such as storing images in Google Drive.

2 Likes

Thanks all for your help. Just the push we needed. We decided to go the API route first. With some success. In a Google Apps script, we used hacked this importJson script a bit: GitHub - bradjasper/ImportJSON: Import JSON into Google Sheets, this library adds various ImportJSON functions to your spreadsheet

And then used this to figure out how to pass the authentication token: Passing API Key to importJSON Function Script for Google Sheets - Stack Overflow

And this to keep calling the API to get updated data in our sandbox Google Sheet: https://www.youtube.com/watch?v=ylH_7i4hLwc

We can show the photos taken by our bot through Google’s Looker Studio now: Data Scientists

On to more serious data processing now :slight_smile:

Let us know if anyone is interested in our code snippets.

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.