{"id":5815,"date":"2017-12-16T10:47:04","date_gmt":"2017-12-16T18:47:04","guid":{"rendered":"https:\/\/www.bigtreestech.com\/wp2013\/?p=5815"},"modified":"2017-12-18T15:36:21","modified_gmt":"2017-12-18T23:36:21","slug":"new-approach-to-data-transfer","status":"publish","type":"post","link":"https:\/\/www.bigtreestech.com\/wp2013\/new-approach-to-data-transfer\/","title":{"rendered":"New Approach to Data Transfer"},"content":{"rendered":"<p>After giving it a great deal of thought and looking into various options, I&#8217;ve settled on a method to transfer data from the snow measurement system to the weather system. I am going to simply use SFTP within the python script that processes snow depth measurements to create a file with the measurement data and transfer that file to a known location on the weather system.<\/p>\n<p>The weather system (another Raspberry Pi) will have the responsibility for storing the snow data in it&#8217;s database and doing all of the processing needed to develop statistics and graphs.\u00a0 I will have to modify the database schema to use the new parameter.\u00a0 I will also have to write a new service that is executed by the weather software every 5 minutes.\u00a0 This service will go grab the data from the file that was uploaded by the snow depth system, check for errors, and provide a database entry for the measurement data.<\/p>\n<p>One nice thing about this approach is that I can completely test the measurement system without touching the weather system (other than perhaps some file permissions).\u00a0 Once the measurement system is working as expected I can use some fairly &#8220;standard&#8221; procedures to modify the database and add the new service.<\/p>\n<p>Come to think of it, I could also work on the weather system side independently just by creating a file with bogus measurement data in an alternate &#8220;known location&#8221; on the weather system.<\/p>\n<p>Next tasks to do:<\/p>\n<ul>\n<li>Uninstall mysql from the measurement system<\/li>\n<li>Install the SFTP client python module pysftp<\/li>\n<li>Install and modify the sensor interface code<\/li>\n<li>Create a place-holder python script that uploads bogus sensor data to the weather system via sftp<\/li>\n<li>Create a cron-job on the measurement system that executes the place-holder script every 5 minutes.<\/li>\n<\/ul>\n<p>Once all that is done, I&#8217;ll have a look at changes to the weather system that need to be made.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>After giving it a great deal of thought and looking into various options, I&#8217;ve settled on a method to transfer data from the snow measurement system to the weather system. I am going to simply use SFTP within the python &hellip; <a class=\"more-link\" href=\"https:\/\/www.bigtreestech.com\/wp2013\/new-approach-to-data-transfer\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"categories":[259],"tags":[],"class_list":["post-5815","post","type-post","status-publish","format-standard","hentry","category-snow-depth-project"],"_links":{"self":[{"href":"https:\/\/www.bigtreestech.com\/wp2013\/wp-json\/wp\/v2\/posts\/5815","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bigtreestech.com\/wp2013\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bigtreestech.com\/wp2013\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bigtreestech.com\/wp2013\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bigtreestech.com\/wp2013\/wp-json\/wp\/v2\/comments?post=5815"}],"version-history":[{"count":2,"href":"https:\/\/www.bigtreestech.com\/wp2013\/wp-json\/wp\/v2\/posts\/5815\/revisions"}],"predecessor-version":[{"id":5824,"href":"https:\/\/www.bigtreestech.com\/wp2013\/wp-json\/wp\/v2\/posts\/5815\/revisions\/5824"}],"wp:attachment":[{"href":"https:\/\/www.bigtreestech.com\/wp2013\/wp-json\/wp\/v2\/media?parent=5815"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bigtreestech.com\/wp2013\/wp-json\/wp\/v2\/categories?post=5815"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bigtreestech.com\/wp2013\/wp-json\/wp\/v2\/tags?post=5815"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}