http.get to Google Spreadsheet #604
Replies: 19 comments
-
Posted at 2015-06-15 by @gfwilliams Espruino won't redirect itself, but it's dead easy to add code for this. Try:
Only thing I'd say is Espruino doesn't do HTTPS at the moment - the resources needed to handle SSL are really high for a microcontroller, and I haven't had time to try and shoehorn it in yet. It might be that the Google app redirects to an HTTPS URL, and won't accept non-secure connections. Not sure about that though. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-06-15 by Cale Thats probably what is going on. The headers.location returns the same url, not the one we are supposed to be redirected to. It also tries to set a cookie. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-06-16 by Cale Well I did find a work around. Its not perfect but it works well enough.
I used the "Hello World" server example from the CC3000 page. I then set port forwarding on my router for the espruino server address through port 80. When called the Logger reports "Hello World"!! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-06-17 by @gfwilliams Wow, great! So you can get the Google spreadsheet to request arbitrary URLs - it's just going the other way that's a problem? You might be able to use some service like pastebin to allow the Espruino to HTTP POST data, and Google spreadsheets to GET that same data - without having to have a server. There was a great-looking Twitter-ish kind of website that would have been perfect, but I'm afraid I can't find the link now. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-07-21 by Cale I found a great way to get data from Espruino into Google Spreadsheets using PushingBox! And here is a great video to boot (Although its with Arduino) about 2 minutes in. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-01-12 by electronicsguy @Cale I am using pushingbox as well. do you know of a way to get the response of a "GET" request made to Google sheets through pushingbox, back to the client? I don't have any text response from pushingbox at all, even though the actual pushing of data works. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-01-13 by @gfwilliams Just to add - since the Espruino Pico can now do HTTPS, it might be that you can communicate directly with the spreadsheet? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-02-06 by Cale @electronicsguy sounds like your wanting a confirmation returned back to the espruino? HTTPS is your best bet. I'm working to get that up and running right now. I haven't done anything with this for a while as I've been waiting for the HTTPS. Its here, YAY! @gordon what do you make of this?
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-02-06 by Cale Scratch that..... Im getting closer. Now im getting
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-02-06 by @gfwilliams First one was (I think) a certificate in the wrong format? The error code 0x7200 is Does it happen every time? Are you using a Pico + ESP8266 for this, and you're using basically the same code? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-04-25 by electronicsguy @Cale @gordon I wrote a library to handle to redirects automatically, as long as you can use TLS to connect (which you now can, on the esp8266). More info here: HTTPSRedirect |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-04-26 by @gfwilliams Does your code work with Espruino? It looks a lot like it's C - so Arduino-only |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-04-26 by electronicsguy @gordon Well the TLS 1.1 (HTTPS) support is required. If Espruino can do those requests, then it'll work. I don't have a Pico board to test. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-04-26 by @gfwilliams Espruino does do HTTPS - as I guess this thread is a bit old, there's actually now example code for writing to Google Sheets here: http://www.espruino.com/Logging+to+Google+Sheets I think if you ask for https in the first place, you don't get the redirect. But Espruino runs JavaScript, not C++ - it looks to me like your code is C++ for an Arduino, so I'm not really sure how it can work with Espruino? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-04-26 by electronicsguy @gordon Ok let me correct my previous comment. I didn't realize the espruino is only JS. So the answer is no, it won't work as-is. The logic is pretty simple though, so it's not hard to adapt it for JS. I'll work on it when I have the time. Is there a espruino simulator I could test it on? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-04-27 by @gfwilliams Thanks! There's no simulator, but you can build it for something like a Raspberry Pi very easily. I'd posted some code above that handles redirects - would your code do anything different to that? It might be worth using as a base - the HTTP and callbacks in Espruino make doing stuff like parsing the header a lot easier than in an Arduino. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-04-27 by electronicsguy @gordon Looks the same. The C++ has some extra stuff to do the parsing and passing variables, and checking X.509 certificate fingerprints. Your code is very seamless. Kudos. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-08-03 by electronicsguy @gordon Error code "302" also refers to redirection (moved temporarily, like with google apps script). i think you should add this to the logic above. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-08-03 by @gfwilliams Thanks! I just updated that code snippet... |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2015-06-13 by Cale
I have a project where I am trying to send data directly into google spreadsheets through google script. I have a get function in google script:
As of now this script will return the same data it was sent in JSON format. The problem I have at this moment is that google redirects the get call to another page. See bottom of this page. How do I get espruino to redirect?? Thank you in advance for your help on the subject.
Beta Was this translation helpful? Give feedback.
All reactions