Embedded, REST

REST-ing with Raspberry Pi

In the world of IoT being restful reduces the pain of interactions with cloud.Since, most of the IoT platforms supports REST APIs. This not only gives us portability of our prototype/projects but also gives us the reason to share the method to do the job.

Lets juggle around with basic.

REST or Representational State Transfer  wiki says,  REST-ful web services provide inter-operability between computer systems on the Internet. REST-compliant web services allow the requesting systems to access and manipulate textual representations of web resources by using a uniform and predefined set of stateless operations. Read more

Raspberry Pi most probably you are aware of Pi if you are visiting us in case if you do not It is a mini computer running Linux on to its having couple of GPIOs and interfaces like HDMI, Bluetooth, Wi-Fi, USBs etc etc…

How do we connect to cloud?

We are taking ubidots for our reference it supports C-URLs or curls and interesting part is Linux supports curl if not install the library by below command.

sudo apt-get install curl

ahaa.. hope by this time you have curl to your command line if not already, Test one of the connect APIs give over here. If any of that does not works up write us.

Moving further how to do it automatically..

We can write a c program or a python script any thing would work just fine.I wont mention how to write such programs that you follow Aditya’s  post.

For curls, well indeed curl provides lib APIs for the same to do feel free to explore that if need from us(soon I ll try to write more on curls) for now we will use popen which means process open.Put your curl API and run the executable.

Some more ease is always good there you go Python has a pip install for ubidots by below command its installed as easy as microwaving popcorn :

pip install ubidots==1.6.6

and lil less easy is again curl libraries for python i.e. PycURL.

With all that I guess you guys the good for that.

P.S. This is my first writing and has lots of link Why ? because its always fun exploring, think other wise please let me know I would love to hear from you guys.

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s