Labs
Services Labs
Lab: Dweet
root@edison:~# nano maindweet.py
#!/usr/bin/python
import dweepy
import time
def functionServicesDweet():
while True:
time.sleep(5)
dweepy.dweet_for('InternetOfThings101Dweet', {'Status':'1'})
print dweepy.get_latest_dweet_for('InternetOfThings101Dweet')
time.sleep(5)
dweepy.dweet_for('InternetOfThings101Dweet', {'Status':'0'})
print dweepy.get_latest_dweet_for('InternetOfThings101Dweet')
if __name__ == '__main__':
functionServicesDweet()
# End of File
root@edison:~# python maindweet.py
[{u'content': {u'Status': 0}, u'thing': u'InternetOfThings101Dweet', u'created': u'2016-05-01T16:03:10]
[{u'content': {u'Status': 1}, u'thing': u'InternetOfThings101Dweet', u'created': u'2016-05-01T16:04:06]
[{u'content': {u'Status': 0}, u'thing': u'InternetOfThings101Dweet', u'created': u'2016-05-01T16:04:12]
[{u'content': {u'Status': 1}, u'thing': u'InternetOfThings101Dweet', u'created': u'2016-05-01T16:04:19]
^Z
[8]+ Stopped(SIGTSTP) python maindweet.py
Lab: Freeboard.Io
Dashboard Creation
Go to freeboard.io and sign up
Go to freeboard.io account, under "My Freeboards"
"Enter a Name" and "Create New", let's call it IoT101
You should see "IoT101" board created being a "Public" dashboard
Click on "IoT101" to open the dashboard
DataSource Selection
Once you are in "IoT101" Dashboard click on "Add" from "DataSources"
Select "Dweet.io" as "Type"
Choose a "Name" for the DataSource, e.g. "MyIoT101Source"
Type the "Thing Name" based on what you are sending to dweet.io e.g. "InternetOfThings101Dweet"
Pane/Widget Creation and DataSource Linkage
Select "Add Pane"
Select a type of Widget "Sparkline"
Click on "DataSource" and select ["Internet of Things 101"]["Status"]
Last updated