Difference between revisions of "EBC Exercise 38 Logging to ThingSpeak"

From eLinux.org
Jump to: navigation, search
(I)
 
m (Set up the Bone)
 
(3 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
[https://www.mathworks.com/ MathWorks], the maker of [https://www.mathworks.com/products/matlab.html MATLAB]
 
[https://www.mathworks.com/ MathWorks], the maker of [https://www.mathworks.com/products/matlab.html MATLAB]
  
== Create a new Sheet ==
+
Here's we'll set up ThinkSpeak to log data from two TMP101 sensors.
  
 +
== Set up ThingSpeak ==
 +
 +
* Go to https://thingspeak.com/ and create an account
 +
* Go to [https://thingspeak.com/channels My Channels]
 +
* Click on '''New Channel'''
 +
* Fill in fields as shown
 +
[[File:NewChannel.png|frameless|New Channel Fields]]
 +
* Scroll down and click '''Save channel'''. You will now see the default plots for the channel
 +
[[File:OfficeTemps.png|frameless|Office Temps plots]]
 +
* Click on the '''API Keys''' tab
 +
* Note the '''Channel ID''', '''Write API Key''' and '''Read API Key'''
 +
 +
== Set up the Bone ==
 +
 +
* Go to the ThingSpeak directory on the Bone.
 +
bone$ '''cd exercises/iot/thingspeak'''
 +
* Install
 +
bone$ '''sudo pip3 install requests'''
 +
* Edit '''setup.sh''' to include your API write key from above.
 +
# https://thingspeak.com/channels/538706/api_keys
 +
export THING_KEY=VKBLZME68539A9H
 +
* Save and run.
 +
bone$ '''./temp.py'''
 +
Every 15 minutes it will log the current temperature to ThinkSpeak.
 +
* Click on the '''Private View''' tab and you'll see your data plotted.
 +
[[File:ThingSpeakPlots.png|ThingSpeak temperature plots]]
  
 
{{YoderFoot}}
 
{{YoderFoot}}

Latest revision as of 10:24, 26 October 2020

thumb‎ Embedded Linux Class by Mark A. Yoder


Here are instructions on how to log data to a ThinkSpeak, a site from MathWorks, the maker of MATLAB

Here's we'll set up ThinkSpeak to log data from two TMP101 sensors.

Set up ThingSpeak

New Channel Fields

  • Scroll down and click Save channel. You will now see the default plots for the channel

Office Temps plots

  • Click on the API Keys tab
  • Note the Channel ID, Write API Key and Read API Key

Set up the Bone

  • Go to the ThingSpeak directory on the Bone.
bone$ cd exercises/iot/thingspeak
  • Install
bone$ sudo pip3 install requests
  • Edit setup.sh to include your API write key from above.
# https://thingspeak.com/channels/538706/api_keys
export THING_KEY=VKBLZME68539A9H
  • Save and run.
bone$ ./temp.py

Every 15 minutes it will log the current temperature to ThinkSpeak.

  • Click on the Private View tab and you'll see your data plotted.

ThingSpeak temperature plots




thumb‎ Embedded Linux Class by Mark A. Yoder