CURL fails to retrieve JSON from Firebase Reference - HTTPS related?

Hi,
I find Firebase really useful for holding simple configuration values for a number of things. I want to use it to hold a simple "ON" or "OFF" value for controlling a remote camera attached to an Arduino Yun.

If I run the CURL command from my MAC against the JSON URL, it works fine, e.g.

https://.firebaseio.com/camera/state.json
..returns..
ON

This area of my Firebase account is read/write to everyone - I know this is not an access issue in that respect. I have several node scripts running on Raspberry Pi's that can access this fine.

If, on my Yun, I use the Process library to run runShellCommand as follows;

p.runShellCommand("curl -X GET "https://.firebaseio.com/camera/state.json" ");

I just get a blank value back.

If I substitute a local URL for a simple page that just holds the value "ON" or "OFF", Curl (with those arguments) works fine. It also works fine if I test it with the URL for the Arduino ASCII Art logo (i.e. http://www.arduino.cc/asciilogo.txt).

Has anyone else managed to pull in Firebase values to a local variable in this way?

Thanks,

Steve

opkg update
opkg install openssl-util

wget -O ca-certificates_20140325_ar71xx.ipk https://www.dropbox.com/s/rmvkunea1ifa9zn/ca-certificates_20140325_ar71xx.ipk?dl=0 --no-check-certificate
opkg install ca-certificates_20140325_ar71xx.ipk

Install missing ca-certificates for support https.

momopi:
::::SNIP::::
Has anyone else managed to pull in Firebase values to a local variable in this way?

::::SNIP::::

You don't need the -X GET. This seems to cause a problem on some MBAAS. Notably, scriptr.io, parse.com, firebase.com

TRY

curl https://<yourname>.firebaseio.com/junkdata.json

You may need to update your SSL cert also.

Don't forget you can edit the Database by hand by opening your webbrowser to:

https://.firebaseio.com/

This means you can add, remove, inspect the data in your firebase.

Jesse

Thanks for the suggestions, but what I don't get is I have a different sketch that successfully puts and updates data to Firebase (output from a sensor). This works now - without installing any certs or ssl utils? The Curl command used in that script is;

Serial.println(distance);
 p.runShellCommand("curl -k -X PATCH -d '{ \"value\": " + String(distance) + " }' https://<myfirebase>.firebaseio.com/sensors/HC-SR04.json");
 digitalWrite(LEDPin, LOW);

?

So after much to'ing and fro'ing with OpenWRT upgrades, resets and reboots - it is now working. I'm sure I tried these options before without success (?!) but it's certainly working now. The following call to CURL works without any additional package installs;

p.runShellCommand("curl -k -X GET \"https://<myfirebase>.firebaseio.com/D3/State.json\" ");

I've a feeling it was the -k option that was missing (and that was present on the 'PATCH' REST calls that were working).

curl --help |grep insecure
 -k, --insecure      Allow connections to SSL sites without certs (H)

The insecure is kind of defeat https, but for childish unserious application is perfectly fine. :wink: