Calling HTTPS URL (google docs) from spark core... is it possible?

Hi all,

I want to use the spark core to post data into a google spreadsheet. In order to do so I have a https URL (google Forms) that writes data to my spreadsheet whenever it is called.

Everything works, only that I don’t know how to call a HTTPS url from my spark. Anybody know if this is possible? If yes, where can I find some more information on this?

Regard,

Nana

@nana,

Hi, I have used tinywebserver running on the core and code in a < html>< iframe>…< /iframe> where the source of the iframe would be your https: url.

The problem I ran in to is google’s android browser will not load an iframe unless the source page (core) and the frame page (google docs) are both https:.

Take a look at this page and you will see discussion of Tinywebserver & my examples. I owe credit to @BDub and @bko and @Dave for they helped me with the same question.

There are other examples. let me know if you need additional links.

3 Likes

Hi SpyDrop,

I think I understand what you did (looks really nice), but I am not sure if this works for me. I want to receive a “push notification” whenever a certain event takes place (sensor on spar) and basically log the event and the time in a spreadsheet. This is the first tiny step for a larger project, but given that I am new to all this I try to take it slow.

I see how this will work with a tiny webserver, but is it possible to trigger the https url call based on an external event? As far as I currently understand it, this might be difficult… or do I get it wrong?

Regards,

Nana

Hi @nana

The Spark core does not have the resources to do HTTPS on its own; it does HTTP transfers well. The certificate management for TLS/SSL would not fit in memory. So instead it has one secure connection to the Spark cloud but you can use that connection for all sorts of things: variables that you can read from the core, functions you can call on the core, events you can publish from a core and recently even subscribe to. Check the docs and the tutorial section here in the forum for more info.

There is a way for a Google spreadsheet to pull data from the core periodically described in this thread:

There are lots other ways to do this!

2 Likes

I am also looking for a way to publish data from the core to Google spreadsheet. Pulling data from the core just doesn’t work for me. My core is working in somewhere that doesn’t have a power outlet and it is being powered by two AA batteries. Therefore most of the time it is going to be in deep-sleep mode and wake up about once per hour to send out data. I used to do that with Arduino Yun and Google form with code like this.
Process p;
p.runShellCommandAsynchronously(“curl “https://docs.google.com/forms/d/NDWnjgQ9EVVGOQmSz1NW4sbHmoDXcaJ4cvoz0s/formResponse?entry.21328096=” + data + “&submit=Submit” -k”);

Hi @Iat

This thread is from before webhooks were available–now I would use a webhook with Spark.publish().

How would you implement a webhook with spark.publish so that it could fill a google form?

Hi @mwbrady

You should start by looking at this tutorial:

But instead of pushover.net you would use a URL for your google form.

Another way would be to use IFTTT which is really a meta-level webhook to connect to Google drive, using the “Add a row to a spreadsheet” action.

OK I just did this with IFTTT and Google drive and it was completely easy!

I now have an spreadsheet logging the temperature data that my core is publishing every minute. Gdrive says it will make a new spreadsheet every 2000 rows.

The only downside I can see is that it automatically formatted the time and date stamp in a way that I might want to change.

1 Like

Hi @bko , just wondering if you could give a little more detail on the “completely easy” IFTTT Google spreadsheet. I have an event published under Spark.publish called “static” that I’m broadcasting via a webhook to Ubidots. I’d prefer to send the data to a google sheet - but when creating a recipe, and adding what I think is correct - nothing happens. I know the data is being published (because I see it on the Particle Dashboard - and in Ubidots).

Hi @DRCO

Here is a screenshot of the IFTTT trigger and action sections. In my case the published event name is “Temperature”. The action is on your Google Drive (not the spreadsheet program in Google) which might have been hard to figure out.

4 Likes

Thanks @bko , got it working.

@bko I know it’s an older topic but the content I’m posting is relevant so please don’t flag it. The esp8266 now has ssl support. Even on the original ESP-01 with small amount of memory. See here: esp8266-ssl

I am using it to log data from my ESP-01 directly to google spreadsheets.

1 Like