Coder Social home page Coder Social logo

parse-community / parse-embedded-sdks Goto Github PK

View Code? Open in Web Editor NEW
246.0 70.0 118.0 717 KB

The Embedded SDKs for the Parse Platform

Home Page: http://parseplatform.org

License: Other

C 90.55% Shell 0.36% HTML 2.14% Makefile 3.15% C++ 1.84% Batchfile 1.03% M4 0.41% NASL 0.29% Assembly 0.24%
c arduino iot sdk embedded raspberry-pi parse-platform embedded-sdks

parse-embedded-sdks's Introduction

WARNING ⚠️ - this project has been retired due to lack of use & contribution, if you wish to continue to use it please fork or if you wish to maintain this project make yourself known ⚠️

Parse Embedded C SDKs

Parse Embedded C SDKs provide support for Arduino Yún, Unix, and RTOS C platforms.

These SDKs let you use Parse for building Internet of Things (IoT) applications with connected devices. Parse is a developer-friendly cloud platform that lets you get an IoT project running in minutes. With Parse, you can:

  • Build cross-platform integrations between your connected device and mobile/web/desktop apps.

  • Allow your users to personalize and monitor their connected devices.

    • Parse is the easiest way to build user login on mobile apps. Parse also has user session APIs in all mobile SDKs, which let you provision restricted sessions from the phone after the user logs into your app. You can then transfer this restricted session token to your device so that your device can access user-specific data.
    • With Parse APIs, you can build a device manager screen in your mobile app what shows the user's provisioned connected devices (sample app below). At any time, the user can revoke a device from accessing his or her data on Parse.
  • Send push notifications to your connected devices.

  • Securely access your app's data from connected devices.

    • All communication between your connected device's Embedded SDK and the Parse Cloud, including push notifications, is protected by SSL encryption.
    • You can protect user data with Access Control Lists (ACLs) so it can only be accessed with that user's session token.
  • Perform complex application logic in Parse Cloud Code, so you can minimize the memory footprint of your app on your connected device.

  • Send analytics events from your connected devices, and see realtime graphs in your Parse web dashboard.

  • Intuitively visualize your cloud data with the Data Browser on the Parse website.

Getting Started

Arduino Yún

Please follow our Parse Arduino Quickstart. We highly recommend using Arduino Software (IDE). See the yun directory for more details.

Raspberry Pi / Ubuntu / Debian / other Unix-based systems

Please follow our Parse Raspberry Pi Quickstart. See the include, unix, and debian directories for more details.

TI CC3200 / other Real-time operatings systems (RTOS)

Please follow our Parse CC3200 Quickstart. See the cc3200 directory for more details.

Documentation

Please see the Parse website for detailed developer guides:

Sample App

We prepared a sample app that demonstrates how to provision connected devices using a companion phone app such that connected devices can securely access user-specific data on the Parse Cloud. This sample app also demonstrates how to send push notifications between the phone app and connected devices.

Porting

If you want to port this SDK to run on your own IoT platform, please see /partners/partner_platform_instructions.md.

Contributing

See the CONTRIBUTING file for how to help out.

parse-embedded-sdks's People

Contributors

evileye2000 avatar flovilmart avatar francip avatar georgeyakovlev avatar jaemyoun avatar lacker avatar ronaldyang avatar stanleyw avatar tomwfox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

parse-embedded-sdks's Issues

Memory leak

Is there a worked example for periodically sending data from the yun up to parse? I tried the code below, but the board froze after a while. I used FreeMemory to look at the available memory and this seems to be the problem. I suspect I'm just not clearing the ParseCreate object correctly. Any tips?

include <Bridge.h>

include <Parse.h>

include <MemoryFree.h>

define INTERVAL 60000 // one minute in ms

ParseClient client;
static unsigned long lTimer;
void setup() {
// put your setup code here, to run once:

// Initialize digital pin 13 as an output.
pinMode(13, OUTPUT);

// Initialize Bridge
Bridge.begin();

// Initialize Parse
client.begin("MY_KEY1", "MY_KEY2");

// initialise minute timer
lTimer = millis();

// Initialize Serial
Serial.begin(9600);
Serial.println("Initialised");
}

void loop() {
// timer
if ( (long)( millis() - lTimer ) >= 0)
{
lTimer += INTERVAL; // do it again 1 interval later
//periodic actions

// print memory state
Serial.print("freeMemory()=");
Serial.println(freeMemory());

// create and fill parse object
ParseObjectCreate create;
create.setClassName("TestData");
create.add("tStk", 550);
create.add("iPwrFc", 9.1);

// send data and get response
ParseResponse response = create.send();

// display response status
Serial.println("\nResponse for saving LogData:");
Serial.print(response.getJSONBody());
if (!response.getErrorCode()) {
  String objectId = response.getString("objectId");
  Serial.print("Test object id:");
  Serial.println(objectId);
} else {
  Serial.println("Failed to save the log data");
}
response.close();

}
}

Parse SDK not working on YUN mini

Hello,

I'm trying to run the Parse SDK on Arduino YUN mini. I don't have ay error but I can't saved object on server, the installation ID is not saved...

I try to update the firmware with the latest one but it doesn't fix the issue.

Any idea?

Cloud function not getting executed in loop

I have created cloud function using Parse.com Javascript SDK and i am calling those functions from Arduino.Following is code for function hello

Parse.Cloud.define("hello", function(request, response) {
response.success("This is hello function");
}); //hello function Block

I am calling this function from Arduino side using following code.

void setup() {

 Bridge.begin();
 Serial.begin(9600);

 while(!Serial);

 Parse.begin("***zE0uUjQkMa7nj5D5BALvzegzfyVNSG22BD***", "***Ssggp5JgMFmSHfloewW5oixlM5ibt9LBSE***"); 
      //commented my keys with * here only

 // In this example, we associate this device with a pre-generated installation
 Parse.getInstallationId();
 Parse.startPushService();

}

void loop() {

      Serial.println("Start loop");
      demoBasic("meeting",0);

}

void demoBasic(String functionname,int light){

  char fnname[11];
  functionname.toCharArray(fnname,11);

 Serial.print("In ");
 Serial.print(functionname);
 Serial.println(" Function");


 ParseCloudFunction cloudFunction;
 cloudFunction.setFunctionName(fnname);
 cloudFunction.add("light_sensor", light);
 cloudFunction.add("value", "Arduino Hello");//parameters

 ParseResponse response = cloudFunction.send();
 Serial.println(response.getJSONBody());

}//function block for demoBasic

Problem is that i am getting response 8 times only after that whole program flow gets blocked.What is the problem,can somebody help please?

embedded library seems to run infinite loop inside parseProcessNextPushNotification function.

Testing / evaluating parse using an Ubuntu Linux computer.
Parse UNIX library seems to be in a continuous loop eating 100% of CPU.
The problematic code seems to be in parse.c, function: int parseProcessNextPushNotification(ParseClient client), the following lines:

        while (length == -1 && parse_push_message_size < sizeof(parse_push_message_buffer)) {
            CURLcode result = curl_easy_recv(clientInternal->pushCurlHandle,
                                             parse_push_message_buffer + parse_push_message_size,
                                             sizeof(parse_push_message_buffer) - parse_push_message_size,
                                             &read);
            if (result == CURLE_OK) {
                parseLog(PARSE_LOG_INFO, "got ok!\n");
                parse_push_message_size += read;
                message = (char *)getPushJson(parse_push_message_buffer,
                                              parse_push_message_size,
                                              &start,
                                              &length);
            } else if (result == CURLE_AGAIN) {
                break;
            } else {
                parseLog(PARSE_LOG_ERROR, "curl_easy_recv read %i an error %s\n", length, curl_easy_strerror(result));
                if (clientInternal->pushCallback != NULL) {
                    clientInternal->pushCallback(client, ECONNRESET, NULL);
                }
                return 0;
            }
        }

The while loop continues to run as the CURLcode result = curl_easy_recv returns CURLE_OK.
However the 'read' parameter passed to curl_easy_recv has a value of 0 after call that indicates a closed connection according to http://curl.haxx.se/libcurl/c/curl_easy_recv.html.
The result is 100% cpu utilization and inability to process subsequent push messages.
I think the correct form would be to use if ((result == CURLE_OK) && (read > 0))

Fetching backlogged push notification (Debian)

My program only receive last push message when coming back online (e.g. after reboot or disconnected from network). Is this an expected behavior? since the iOS and Android Parse SDK can receive backlogged message: link

error: 'Parse' was not declared in this scope

Hello i am getting error: 'Parse' was not declared in this scope

following is my code :

include <ArduinoJson.h> //Libray for JSON parsing

include <Parse.h> //Parse Library

include <Bridge.h>

include <Process.h>

char mac_id[] = "B4:21:8A:F0:00:AE"; //MAC ID of Arduino Device
char char_installationId[] = ""; //MAC ID of Arduino Device

static int counter =0; //Counter to call setup function after sometime.
int push_button = 3; //Push Button is used to book room
int button_counter = 0; //this is used to toggle room book/cancel
boolean isButtonPressed = false;

/***************************************************************************************************************************
setup function

  • This function is used to make authentication with Parse cloud.It gets the installation id for
    push notification.The entry of MAC id is also stored in Parse Cloud if it is not registered before.
    ****************************************************************************************************************************/
    void setup() {

    Bridge.begin();
    Serial.begin(9600);
    // attachInterrupt(digitalRead(2),checkButtonStatus,HIGH);

    pinMode(push_button,INPUT); // push button analog sensor pin => 1
    pinMode(0,INPUT); //light sensor pin analog pin => 0

    Serial.println("In Setup ");

    while (!Serial);

     connect_to_Parse();
     insertMacDetails_parse();
    

}//setup function block

/***************************************************************************************************************************
checkButtonStatus function

-This function will detect whether button is pressed or not
**************************************************************************************************************************/
void checkButtonStatus()
{
Serial.print("Pressed button");
isButtonPressed = true;
}

/***************************************************************************************************************************
connect_to_Parse function

  • This function will connect to Parse application using Application ID and Client key
    **************************************************************************************************************************/

void connect_to_Parse()
{
Serial.println("Connect to parse");
//CONNECT TO PARSE CLOUD
// Initialize Parse
Parse.begin("NR9dHycpjgUn0Bcem3lH1q0jniHSiynGh5yKe4Ws", "lC066NvhZDCfucTVB5yfaJCOyE2LhClq3T1OcxF6");

// In this example, we associate this device with a pre-generated installation
 Parse.getInstallationId();
 Parse.startPushService();

 String installationId = Parse.getInstallationId();     
 installationId.toCharArray(char_installationId,40);

}

void insertMacDetails_parse()
{
Serial.println("Insert mac details ");

if(counter == 0)
{
ParseCloudFunction cloudFunction;
cloudFunction.setFunctionName("InsertArduinoMacID");
cloudFunction.add("mac_id", mac_id);
ParseResponse response = cloudFunction.send();

    ParseCloudFunction cloudfn;
    cloudfn.setFunctionName("insertMacinInstallation");
    cloudfn.add("mac_id", mac_id);
    cloudfn.add("char_installationId",char_installationId);
    ParseResponse response1 = cloudfn.send();

}//if counter==0 block

}//insertMacDetails_parse function block

/***************************************************************************************************************************
loop function

  • This function continuosly gets executed.In this we send continuos sensor data to cloud and we
    also check for Push notifications from Parse.
    ****************************************************************************************************************************/

void loop() {

//attachInterrupt(digitalRead(2),checkButtonStatus,HIGH);
counter++;
Serial.println("In loop ");
// Serial.println(counter);
checkPush_parse(); //check whether there is any Push notification or not
// push_button_book_parse(); //Book or cancel room reservation
send_sensorData_parse(); //send Sensor data to parse

if(counter % 10 == 0){
setup();
}//CALL SETUP AFTER SOME TIME.THIS SOLVED PUSH AND CONTINUOS CLOUD CODE CALL ISSUE.

if(isButtonPressed == true)
{
push_button_book_parse();
}

} //loop function block

/***************************************************************************************************************************
checkPush_parse function

  • This function will check whether Arduino has any push notification or not
    If message is ON LED will be turned ON
    If message is OFF LED will be turned OFF.
    ****************************************************************************************************************************/
    void checkPush_parse()
    {

    if (Parse.pushAvailable()) {

    Serial.println("Got push"); 
    
    ParsePush push = Parse.nextPush();
    String message = push.getJSONBody();
    Serial.println(message);    //Print Push message
    Serial.println("After Message"); 
    
    // IMPORTANT, close your push message
    push.close();
    

    checkStatus(message); //CHECK THE PUSH MESSAGE CONTENT
    // setup(); // CALL SETUP FUNCTION

    }//if push notification block

}//checkPush_parse function block

can someone help for this? Thanks

Arduino Yún: Error 107 "invalid JSON" when repeatedly saving an object

I have a very basic Arduino Yún sketch which only saves a new object with a hardcoded key-value pair every minute.

void loop() {
  ParseObjectCreate create;
  create.setClassName("TestObject");
  create.add("testKey", 27.6);

  ParseResponse response = create.send();
  Serial.print(response.getJSONBody());
  response.close();

  delay(60000);
}

This will successfully save the object initially.

However if I keep the sketch running for a while (~30 minutes), I will start getting the error {"code":107,"error":"invalid JSON"} on every save.

Restarting the sketch will make saves work again, until I wait ~30 minutes and it stops working again.

[Parse Server] Embedded SDKs don't support Parse Server

Parse server needs api to change server. But, embedded sdk did not support yet.
And, parse server did not support push too.

I want to know the schedule about update sdk and push support.
Please answer me although there is no plan or drop the embedded project.

Thanks

Push Notifications - Yun

The sample project works great, and I'm able to execute "Test". This push is received and it looks like everything is working just fine. However, when I go to send my own push notification from the web panel it says I don't have any registered devices... what gives?

yun sdk issues

Is there a known issue with the yun SDK at the moment? I've just followed the quick start guide withv 1.6.3 of the IDE for Windows and 1.0.0-1_ar71xx of the sdk. No response from the calls to Parse. The serial output looks like this:

Parse Starter Project

Response for saving a TestObject:
Test object id:
Push Installation ID:6868e0c2-c506-4dc7-9e3f-dd34075302d9

I can ping out from the board and some Temboo scripts worked fine, so it's definitely connected to the internet. I've triple-checked the keys and they also look fine.
Any clues?

ParseTest - can't run multiple times w/o Linino/OpenWRT reboot

Good news: I've got some nice code, based on the ParseTest sample sketch running.

Bad news: It only works just after a Linux reboot. However, if I reboot the Arduino side (either manually or by uploading a new sketch) it fails in Bridge.begin().

If I take out the Parse.startPushService() (which I, of course don't want to do if I want to get push notifications!) I have to reboot the Linux side every time.

Is there a graceful way to reset this somehow? Can I turn the push service on/off somehow?

OTA using SDK

Can I do Over The Air update to the firmware using this SDK?

Porting parse-embeeded-sdk on wiced platform

I using parse-embedded-sdk on wiced platform which has freertos + lwip stack.
paseInitialize is successful and able to get the installation id.
But after starting push service, I am not able to receive anything from push server.
And after few seconds, connection with the push server gets closed.
Please advise on this.

CC3200 loses connection with Parse cloud

Using this SDK, the CC3200 device initially connects to the Parse cloud and receives push notifications, But when the device is kept idle for a few minutes, it loses connection with Parse and does not respond to any notification sent to it. I tried updating the SDK and also kept the functions 'parseRunPushLoop' and 'parseProcessNextPushNotification' on continuous call, but that did not solve the issue. Can anyone help me with this. Thanks in advance

Duplicate push on embedded API during startup

I have the parse SDK on a RaspberryPI and I have setup my callback. All is working perfectly but when I restart the code on the Raspberry I get the last push I sent which was already processed.

This happens every restart of the app on the Raspberry. Is this intended and do I need to write code to ignore it or do something else?

Push notifications do not work well in yun sdk 1.0.3-1

I followed the Quick Start guide to set up receiving Parse Push notifications on my Arduino Yún.
It only works once, on reboot or whenever .setup() is called.
Afterwards, sending pushes do not work from either the dashboard or a javascript client.

Please how do I solve/workaround this as fast as possible?

Push notification not working on Yun

I am trying to get push notification on Arduino Yun with Parse SDk version 1.0.3 and Arduino IDE 1.6.5.
The if (Parse.pushAvailable()) {} is not getting executed. I tried sending push from Dashboard as well as from cloud code,none of them worked.

Please help to solve this.

Request: ESP8266 Version Please

There is a new phenomenon currently getting good hype and worked on, ESP8266 which is full-fledged 32bit SoC with WiFi built-in. It's more powerful (speed + flash storage) than regular Arduino Mini Pro or even Mega 2560, and the size of it makes it really ideal for standalone IoT devices.

There are many modified firmwares for it with added functionality, and some like NodeMCU (LUA runtime with a file system). I've been playing around with it, and pretty impressed.

I believe a Parse SDK for ESP8266 would be really useful for many IoT developers like myself.

// chall3ng3r //

Push Notification does not work well in Yun sdk 1.0.1-rc2

Yun SDK QuickStart guide's Push Notification source:

if (Parse.pushAvailable()) {
    ParsePush push = Parse.nextPush();
    String message = push.getJSONBody();
    . . . .
    . . . .
    // NOTE: ensure to close current push message
    // otherwise next push won't be available
    push.close();
}

1.0.0 work well.
But 1.0.1-rc2 get the first notification but does not the second.
Parse.nextPush() work wrong?
Or the coding method has been changed in 1.0.1?

Error declaring a global Parse client instance

I get a "'ParseClient' does not name a type" while trying to compile the quickstart example. I'm using the latest Arduino 1.6.3 IDE, and I've unpacked the parse.h and internal folder within the Arduino library. Any ideas?

#include <Bridge.h>
#include <Parse.h>
/***** Quickstart of Parse Arduino Yún SDK *****/
// https://www.parse.com/apps/quickstart#embedded/arduinoyun

ParseClient client;

void setup() {

}

void loop() {

}

Build instructions for latest version

Hello,

I'm looking to build the embedded SDK, but the quickstart links in the README all point to parse.com URLs. Are there current instructions?

Also, is there a reason the Latest release label is on the 1.0.2 tag instead of the 1.0.4 tag?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.