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.
To make it still easy we come up with a script to install the requires libraries automatically.
Download the Script from the following link:
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)
Once everything is done successfully,open a new .sh file with any file name(ex–iot.sh) and paste the below shell script.
echo -n “Who are you? ”
echo -n “Where are you at? ”
echo -n “What is your favorite animal? ”
curl –header “Phant-Private-Key: 7BW8wzzPwRiWMEAp15r0″ \
–data “who=$PHANT_WHO” \
–data “where=$PHANT_WHERE” \
–data “code=$PHANT_CODE” \
–data “favorite_animal=$PHANT_ANIMAL” \
You should replace your public key and private key as per the image below.
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.
The private key is required in order to post your data to the stream. Only you should know this key.
If you want to delete your URL you can use this delete key.
You can create field and set your data to the specific field according to your Application.
After replacing your public key and private key save the file and give the executable permission for the script.
Run the script: