{"id":28176,"date":"2021-04-28T09:57:48","date_gmt":"2021-04-28T16:57:48","guid":{"rendered":"https:\/\/blog.digilentinc.com\/?p=28176"},"modified":"2021-05-11T09:23:49","modified_gmt":"2021-05-11T16:23:49","slug":"using-linux-and-ethernet-to-upload-data-to-thingspeak","status":"publish","type":"post","link":"https:\/\/digilent.com\/blog\/using-linux-and-ethernet-to-upload-data-to-thingspeak\/","title":{"rendered":"Using Linux and Ethernet to Upload Data to ThingSpeak"},"content":{"rendered":"<p>Have you recently acquired a bunch of data and are trying to figure out what to do with it? Using the <a href=\"https:\/\/store.digilentinc.com\/analog-discovery-pro-3000-series-portable-high-resolution-mixed-signal-oscilloscopes\/\">Analog Discovery Pro 3450<\/a>&#8216;s (or ADP3250&#8217;s, for that matter) unique network connectivity and Linux Mode, you&#8217;ll be able to push the data through the interwebs and onto <a href=\"https:\/\/www.thingspeak.com\">ThingSpeak.com<\/a>! ThingSpeak, created by MathWorks, is an online platform for collecting, viewing, and analyzing data in the cloud. This guide runs through the steps required to send data captured by the ADP3450\/ADP3250 up to ThingSpeak and ends with an example, which uses the Pmod MIC3 to capture a sound wave, then, from the measurements, the Analog Discovery Pro calculates the noise level. The noise level measurements are visualized in four different ways on the ThingSpeak channel.<\/p>\n<p>The first thing(s) you&#8217;ll need are a working internet connection, an account at ThingSpeak, and an Analog Pro Device. For this, we&#8217;ll use the ADP3450.<\/p>\n<h5>Configuring a ThingSpeak Channel<\/h5>\n<div class=\"group plugin_wrap\">\n<div class=\"wrap_column wrap_half plugin_wrap\">\n<p>In the\u00a0<em>Channels<\/em>\u00a0menu select\u00a0<em>My Channels<\/em>\u00a0and create a\u00a0<strong>New Channel<\/strong>.<\/p>\n<\/div>\n<div class=\"wrap_column wrap_half plugin_wrap\">\n<p><a class=\"media\" title=\"reference:software:waveforms:waveforms-sdk:thinspeak_newchannel.png\" href=\"https:\/\/reference.digilentinc.com\/_detail\/reference\/software\/waveforms\/waveforms-sdk\/thinspeak_newchannel.png?id=reference%3Ainstrumentation%3Aanalog-discovery-pro-3x50%3Alinux-thingspeak-demo\"><img decoding=\"async\" class=\"mediacenter\" src=\"https:\/\/reference.digilentinc.com\/_media\/reference\/software\/waveforms\/waveforms-sdk\/thinspeak_newchannel.png?w=600&amp;tok=ef02d9\" alt=\"\" width=\"600\" \/><\/a><\/p>\n<\/div>\n<\/div>\n<div class=\"group plugin_wrap\">\n<div class=\"wrap_column wrap_half plugin_wrap\">\n<p>Configure the channel settings, name, and fields. The field will be the containers for your data. Configure a field for every data type that you want to store\/process.<\/p>\n<\/div>\n<div class=\"wrap_column wrap_half plugin_wrap\">\n<p><a class=\"media\" title=\"reference:software:waveforms:waveforms-sdk:thingspeak_channelset.png\" href=\"https:\/\/reference.digilentinc.com\/_detail\/reference\/software\/waveforms\/waveforms-sdk\/thingspeak_channelset.png?id=reference%3Ainstrumentation%3Aanalog-discovery-pro-3x50%3Alinux-thingspeak-demo\"><img decoding=\"async\" class=\"mediacenter\" src=\"https:\/\/reference.digilentinc.com\/_media\/reference\/software\/waveforms\/waveforms-sdk\/thingspeak_channelset.png?w=600&amp;tok=77be49\" alt=\"\" width=\"600\" \/><\/a><\/p>\n<\/div>\n<\/div>\n<div class=\"group plugin_wrap\">\n<div class=\"wrap_column wrap_half plugin_wrap\">\n<p>Under\u00a0<em><abbr title=\"\" data-original-title=\"Application Programming Interface\">API<\/abbr>\u00a0Keys<\/em>, note the\u00a0<strong>Write\u00a0<abbr title=\"\" data-original-title=\"Application Programming Interface\">API<\/abbr>\u00a0Key<\/strong>\u00a0that will be needed to push data to the server from the custom application or script. The\u00a0<strong>Read\u00a0<abbr title=\"\" data-original-title=\"Application Programming Interface\">API<\/abbr>\u00a0Key<\/strong>\u00a0can be used to access stored data.<\/p>\n<\/div>\n<\/div>\n<div class=\"group plugin_wrap\">\n<div class=\"wrap_column wrap_half plugin_wrap\">\n<p><a class=\"media\" title=\"reference:software:waveforms:waveforms-sdk:thingspeak_keys.png\" href=\"https:\/\/reference.digilentinc.com\/_detail\/reference\/software\/waveforms\/waveforms-sdk\/thingspeak_keys.png?id=reference%3Ainstrumentation%3Aanalog-discovery-pro-3x50%3Alinux-thingspeak-demo\"><img decoding=\"async\" class=\"mediacenter\" src=\"https:\/\/reference.digilentinc.com\/_media\/reference\/software\/waveforms\/waveforms-sdk\/thingspeak_keys.png?w=600&amp;tok=991167\" alt=\"\" width=\"600\" \/><\/a><\/p>\n<\/div>\n<\/div>\n<div class=\"group plugin_wrap\">\n<div class=\"wrap_column wrap_half plugin_wrap\">\n<p>When uploading data to a ThingSpeak channel, it will be displayed field-by-field on different plots. To modify these default plots, or add other data visualization methods to your channel, you can use the visualization or widget presets, you can modify the MATLAB code of the default plots, or you can write your own code to visualize the data.<\/p>\n<\/div>\n<div class=\"wrap_column wrap_half plugin_wrap\">\n<p><a class=\"media\" title=\"reference:software:waveforms:waveforms-sdk:thingspeak_visualization.png\" href=\"https:\/\/reference.digilentinc.com\/_detail\/reference\/software\/waveforms\/waveforms-sdk\/thingspeak_visualization.png?id=reference%3Ainstrumentation%3Aanalog-discovery-pro-3x50%3Alinux-thingspeak-demo\"><img decoding=\"async\" class=\"mediacenter\" src=\"https:\/\/reference.digilentinc.com\/_media\/reference\/software\/waveforms\/waveforms-sdk\/thingspeak_visualization.png?w=600&amp;tok=093565\" alt=\"\" width=\"600\" \/><\/a><\/p>\n<\/div>\n<\/div>\n<div class=\"group plugin_wrap\">\n<div class=\"wrap_column wrap_half plugin_wrap\">\n<p>To make your visualizations\/data publicly available, go to\u00a0<strong>Sharing<\/strong>\u00a0and select the option you want to set.\u00a0<em>\u201ciframe\u201d<\/em>\u00a0tags can be used to embed graphical elements from ThingSpeak into your webpages.<\/p>\n<\/div>\n<h5>Hardware Overview<\/h5>\n<div class=\"group plugin_wrap\">\n<p>The Pmod MIC3 communicates on a SPI interface which will be connected to the Analog Discovery Pro&#8217;s digital I\/O lines as follows: SS to DIO line 0,\u00a0<abbr title=\"\" data-original-title=\"Master In Slave Out\">MISO<\/abbr>\u00a0to DIO 1 and SCK to DIO 2. Power to the Pmod is also supplied by the Test and Measurement device used, so the\u00a0<abbr title=\"\" data-original-title=\"Positive Voltage Supply\">VCC<\/abbr>\u00a0pin of the Pmod should be connected to the VIO pin on Analog Discovery Pro, and the grounds of the two devices should be connected together, as shown in the image to the right.<\/p>\n<p>Prepare a FAT\/FAT32 USB drive (while this is the default format for many USB drives, you may need to format it). Copy the Python script (PmodMIC3_to_Thingspeak.py) to the USB drive&#8217;s root directory. You can also use your own Python script as well, just copy it to the root directory of the USB drive. Plug the USB drive into the back of the Analog Discovery Pro. As always, before using a Test and Measurement device, it needs to be connected to the host computer. To safely connect it, cases in which the device is used by other software, or is not available from some other reason, should be evited.<\/p>\n<\/div>\n<div class=\"wrap_column wrap_half plugin_wrap\">\n<h5>Preparing the Script, Running It, and Getting Results<\/h5>\n<p>For the entire rundown of getting this project running, read the rest on our ever-so-helpful Resource Center: <a href=\"https:\/\/reference.digilentinc.com\/reference\/instrumentation\/analog-discovery-pro-3x50\/linux-thingspeak-demo\">https:\/\/reference.digilentinc.com\/reference\/instrumentation\/analog-discovery-pro-3&#215;50\/linux-thingspeak-demo<\/a><\/p>\n<\/div>\n<\/div>\n<div class='watch-action'><div class='watch-position align-left'><div class='action-like'><a class='lbg-style6 like-28176 jlk' data-task='like' data-post_id='28176' data-nonce='5286a1c13f' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Like' \/><span class='lc-28176 lc'>0<\/span><\/a><\/div><div class='action-unlike'><a class='unlbg-style6 unlike-28176 jlk' data-task='unlike' data-post_id='28176' data-nonce='5286a1c13f' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Unlike' \/><span class='unlc-28176 unlc'>0<\/span><\/a><\/div><\/div> <div class='status-28176 status align-left'>Be the 1st to vote.<\/div><\/div><div class='wti-clear'><\/div>","protected":false},"excerpt":{"rendered":"<p>Have you recently acquired a bunch of data and are trying to figure out what to do with it? Using the Analog Discovery Pro 3450&#8216;s (or ADP3250&#8217;s, for that matter) &hellip; <\/p>\n","protected":false},"author":50,"featured_media":28077,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4325,4312,1563,1561],"tags":[104],"ppma_author":[4502],"class_list":["post-28176","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-debug-validation-test","category-usb-scopes-analyzers-generators","category-guide","category-applications","tag-project-2"],"jetpack_featured_media_url":"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2021\/01\/adp3450-obl2-1000sq.png","jetpack_sharing_enabled":true,"authors":[{"term_id":4502,"user_id":50,"is_guest":0,"slug":"davidh","display_name":"David Horn","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/917c337136844f075c76fcf4a0c3b94aa8c225366009ebf63c08fcb9ce6d0e52?s=96&d=mm&r=g","1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":"","9":"","10":""}],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/28176","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/users\/50"}],"replies":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/comments?post=28176"}],"version-history":[{"count":0,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/28176\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media\/28077"}],"wp:attachment":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media?parent=28176"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/categories?post=28176"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/tags?post=28176"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=28176"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}