Skip to Content
Raspberry Pi 3 Cookbook for Python Programmers - Third Edition
book

Raspberry Pi 3 Cookbook for Python Programmers - Third Edition

by Steven Lawrence Fernandes, Tim Cox
April 2018
Beginner content levelBeginner
552 pages
13h 58m
English
Packt Publishing
Content preview from Raspberry Pi 3 Cookbook for Python Programmers - Third Edition

How it works...

First, we initialize the Xively API client, to which we supply the API_KEY (this authorizes us to send data to the Xively device we created previously). Next, we use FEED_ID to link us to the specific feed we want to send the data to. Finally, we request the data stream to connect to (if it doesn't already exist in the feed, the get_datastream() function will create one for us).

For each data stream in the feed, we supply a name function and tags (these are keywords that help us identify the data; we can use our data names for this).

Once we have defined our data streams, we enter the main loop. Here, we gather our data values from dataDevice. We then set the current_value function and also the timestamp of the data for each ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Raspberry Pi for Python Programmers Cookbook - Second Edition

Raspberry Pi for Python Programmers Cookbook - Second Edition

Tim Cox

Publisher Resources

ISBN: 9781788629874Supplemental Content