Parse and the Intel Edison board

By Promotion Published Date
05 - Oct - 2015
| Last Updated
05 - Oct - 2015
Parse and the Intel Edison board

Looking to run your Internet of Things (IoT) devices remotely? Parse is a cloud mobile backend service that allows you to interconnect and manage a myriad of devices from an intuitive and simple to use web interface. It offers just about any feature you would expect from a cloud provider including analytics and stats, a database, push notification services, and server side programming, among others. The Parse Embedded SDK is available for multiple platforms from desktop and mobile to IoT devices.

In this tutorial, we will cover the steps required to install the Parse Embedded SDK on an Intel® Edison board and show an example of how to run a sample application and receive push notifications.

First and foremost, if you haven’t done so already, you’ll need to get the Intel® Edison board up and running with the latest OS image and connect it to the Internet. There’s a comprehensive guide on how to do so on the Intel® Developer Zone - IoT page.

Unlike the Intel® Galileo board, the Intel® Edison board does not have an Ethernet port, thus the preferred connection method is the integrated Wi-Fi*. In case you missed it, once you connect to the board either via serial or Ethernet over USB, the configure_edison tool will let you set up wireless access.  If you don’t have wireless access, it should be possible to route an existing Internet connection via software to the RNDIS (Ethernet over USB) network on the Intel® Edison board. From here on, I will assume that you have successfully connected the Intel® Edison board to the Internet.
Once you have your Intel® Edison board configured, it’s time to install the Parse SDK. Head to website and sign up for an account. Then go to your apps section and create a new application. After you pick a name, you will be asked if you want to check out the quick start guide, which I encourage you to do. You can also get to the guide from your dashboard, like so:

From the quick start link that opens, select the embedded option and then pick Linux*. This guide was written with the Raspberry Pi in mind, but the getting started steps are very similar to what you need to do on the Intel® Edison board. In fact, it’s actually easier to get the SDK running on the Intel® Edison board. Most of the required libraries are already installed, and only uuid-dev is required. Instead of following Step 1 in the “Install the SDK” section, open a ssh session to the Intel® Edison board with the client of your choice (for example, Putty) and type in the following commands:

1 root@edison:~# echo "src/gz i586" >> /etc/opkg/base-feeds.conf

2 root@edison:~# opkg update

3 root@edison:~# opkg install util-linux-dev

The first line will add the Intel® IoT developer kit repository to the opkg configuration file. This tool is used to manage installed packages on our Linux distribution. The second and third lines of code will update and then install the required uuid-dev library along with any needed dependencies.
Now follow steps 2 and 3 from the guide and install the Parse SDK in the directory of choice. The home folder for instance will do just fine. Here’s an example:

1 root@edison:~# cd ~

2 root@edison:~/parse-sdk# wget --no-check-certificate

3 root@edison:~/parse-sdk# unzip

4 root@edison:~# cd parse-embedded-sdks-1.0.0/

5 root@edison:~/parse-embedded-sdks-1.0.0# autoreconf -fi

6 root@edison:~/parse-embedded-sdks-1.0.0# ./configure --prefix=/usr

7 root@edison:~/parse-embedded-sdks-1.0.0# make

8 root@edison:~/parse-embedded-sdks-1.0.0# make install

If everything went well, you should now have the Parse SDK installed and are ready to use it on your Intel® Edison board. Before we move on, to enable and test push notifications, let’s configure the new application we just created through the web site. Go to your application page and into the Settings tab. From here, select Push and enable Push Notifications as shown:

Let’s go back to the quick start guide and follow the remaining steps to download and compile the sample project:
1 root@edison:~/parse-embedded-sdks-1.0.0# cd ..

2 root@edison:~# wget --no-check-certificate

3 root@edison:~# unzip

This code unpacks a main.c code file along with a makefile that is configured to compile the code and link against the newly installed Parse library. To make changes to the code file you can either use the vi editor that’s installed on the Intel® Edison board or another editor of your choice that allows you to write files over a network connection. Personally, I prefer Notepad++ with the NppFTP plugin that allows modifying files via FTP easily, but there are other tools available that you can use to the same effect, like WinSCP for instance.

The rest of the quick start guide provides sample code for setting up an application, registering it with Parse, and sending push notifications. Paste this code into your main.c file and add the keys provided. Usually, these values are filled in automatically for you in the guide, but in case they aren’t, here’s how to grab your Application and Client keys:

After adding all the sample code to your main.c file, it should look something like this:

Compile the code using the provided makefile and run it using the following commands:

1 root@edison:~# cd raspberry-pi-starter-project

2 root@edison:~/raspberry-pi-starter-project# make

3 root@edison:~/raspberry-pi-starter-project# ./quickstart

Now, leave the application running on your Intel® Edison board, and if you head back to the quick guide on the Parse web site, you should be able to click the “Test” button at the bottom of the page and send a push notification to your Intel® Edison board. The following result should pop-up in your console:

1 received push: '{"data":{"alert":"A test push from Parse!"},"time":"2015-05-18T04:21:13.946Z"}'
That’s it! We hope this tutorial was helpful for installing the Parse SDK and running sample apps on the Intel® Edison board.
The steps needed to install Parse SDK are also summarized in our github repository.

For more such intel IoT resources and tools from Intel, please visit the Intel® Developer Zone