Raspberry Pi Pushing Data to the Sparkfun Server

This week there is an interesting tutorial ,where  we can push our data to the sparkfun server from Raspberry Pi.This article helps you to build Internet Of Things(IOT) with Sparkfun data server.For more details about IOT click here.

Internet_of_Things

Installation:

To make it still easy we come up with a script to install the requires libraries automatically.

Download the Script from the following link:

https://www.dropbox.com/s/z256c04925ek5pd/sparkfun_data_helper.sh

Execution:

Give the Executable permission for the Script file.Type the following command in the Raspberry Pi Terminal.

sudo chmod a+x sparkfun_data_helper.sh

Run the Script using the following command: (Raspberry Pi Should be Connected to the Internet)

sudo ./sparkfun_data_helper.sh

Once everything is done successfully,open a new .sh file with any file name(ex–iot.sh) and paste the below shell script.

#!/bin/sh

echo -n “Who are you? ”

read PHANT_WHO

echo -n “Where are you at? ”

read PHANT_WHERE

PHANT_CODE=sh

echo -n “What is your favorite animal? ”

read PHANT_ANIMAL

curl –header “Phant-Private-Key: 7BW8wzzPwRiWMEAp15r0″ \

–data “who=$PHANT_WHO” \

–data “where=$PHANT_WHERE” \

–data “code=$PHANT_CODE” \

–data “favorite_animal=$PHANT_ANIMAL” \

‘http://data.sparkfun.com/input/5Jlo299W26tGoqWnZ3O0‘ \

 

You should replace your public key and private key as per the image below.

 

Public Key:

This key is used to identify your stream and provide a unique URL. This key is publicly visible – anyone can visits your stream’s URL will be able to see the data.

Private Key:

The private key is required in order to post your data to the stream. Only you should know this key.

Delete Key:

If you want to delete your URL you can use this delete key.

Fields:

You can create field and set your data to the specific field according to your Application.

latestlatest_iot

After replacing your public key and private key save the file and give the executable permission for the script.

Run the script:

sudo ./filename.sh

YouTube Link:

Training

Daily and weekly Deals

Youtube channel

For queries:info@tenettech.com

Contact:080-26722726

 

 

Print Friendly

Leave a Reply