Can I use Arduino+Cellular Network or Arduino+Ethernet with Parse SDK to save data to Parse Server

#1

Hello everyone,

Summary: I would like to build an Android app for asset tracking with Arduino sending GPS coordinate to Parse Server. I think it may be possible.
Application field: asset tracking/pet tracking

On one side I have used Parse Server by Bitnami on Amazon Web Services and I have already developed my app with Android Studio that make the user to Log in to the server with username and password and to collect the latitude and longitude data from Parse Server and send it to the the user’s smartphone. Everything is working fine and I think you have made an amazing job with Parse Server because really makes life simpler.

But I am not sure if on the other side it will work: on the Arduino side for my final prototype I would like Arduino MKR GSM 1400 or Adafruit FONA 8080 (or any similar configuration made with GPS shield) to send the latitude and longitude to parse server every 15min.

Here I have a couple of question, I have seen that you have made the SDK to work for Yùn and Zero, could it work with every Arduino as long as only
#include <Parse.h>
is the code?
I would like to try to test it with Arduino Uno/Genuino + Ethernet shield just to try if it is working and then in case I will pass to Arduino MKR GSM 1400 so I will have cellular connectivity. Will the Parse library work in both cases?

In order to save new data to parse is it enough to include the following code and it should work fine?


My last question would regard the set up for Arduino:

In the Arduino set up I noticed that there is not specified the Parse Server address, only
APPLICATION_ID and CLIENT_KEY

How and where should I write the server address, shouldn’t it be in the set up together with APPLICATION_ID and CLIENT_KEY similarly the way it is for Android Studio:

.applicationId(“ergfeavarfvarfvasgfsvaesva454a5rf4v56a4c5a4”)
.clientKey(“aecra42ca4ec84aec4a4c5ae4c54a5”)
.server(“http://56.69.328.175:80/parse/”)
(all these keys are obviously made up)

I would have asked all these questions on Github but unfortunately I have seen that you have closed the thread regarding Arduino SDK for lack of activity.

Thank you very much for the time for reading my questions.

Good bye

Pietro

#2

I have no answer to your question, just wanted to mention the following: if all you need is to send data to the server, you should have a look at the HTTP API of Parse. This way you could avoid the overhead of integrating the SDK.

1 Like
#3

Hi, Pietro.

If you want to try the Arduino SDK, you should do something like this:

void setup() {
	Parse.begin("your application id", "your client key");
	Parse.setServerURL("your server url");
}

You should then be fine by saving the objects according to the Parse Arduino SDK Guide (https://docs.parseplatform.org/arduino/guide/).

But this SDK is archived and hasn’t been maintained for a while. Therefore Parse Server may have changed in the meanwhile and made the SDK stop working for some functionalities. So I think it could be better you to use the REST API directly (with no SDK):

1 Like
#4

Thank you very much dr_barto & davimarcedo

Using the REST API to send HTTP PUT REQUESTS from Arduino is exactly what I will need.

I was playing around with the API console in the Parse dashboard and everything is working fine there.
This video helped me: https://www.youtube.com/watch?v=pCn3R8VnkSU&t=63s

I also tested the GET REQUEST from curl.exe from Windows terminal and after a few trails I made it.

I have copy-pasted into the terminal the following long line and everything is working: (server, ID and key are made-up)

curl -X GET -H “X-Parse-Application-Id: ergfeavarfvarfvasgfsvaesva454a5rf4v56a4c5a4” -H “X-Parse-REST-API-Key: aecra42ca4ec84aec4a4c5ae4c54a5e” \http://56.69.328.175:80/parse/classes/ExampleObject

Got a nice reply from server
Cattura

Next step I will try to do some GET/PUT REQUESTS over Ethernet and then I’ll pass to the Cellular Network. For HTTP PUT REQUESTS from Arduino with GPRS everything is reported in the following sketch.
https://www.arduino.cc/en/Tutorial/MKRGSMExamplesSSLWebClient

It seems that Parse is extremely cool to scale up IoT applications as well.

A sincere thank you!

Pietro

1 Like