{"id":592,"date":"2018-12-01T20:58:40","date_gmt":"2018-12-02T04:58:40","guid":{"rendered":"http:\/\/dragonwarz.net\/?p=592"},"modified":"2019-12-06T15:34:21","modified_gmt":"2019-12-06T23:34:21","slug":"minor-changes-stuff","status":"publish","type":"post","link":"https:\/\/dragonwarz.net\/?p=592","title":{"rendered":"Minor changes &#038; stuff"},"content":{"rendered":"\n<p>I have been working to update the smaller stuff after those overhauls before.&nbsp; Editing comments, updating help files and fixing bugs.&nbsp;&nbsp;<\/p>\n\n\n\n<p>Now that I have Flask in use, it allows me to show reports off the sensor itself, by going to a URL with the sensors IP (or hostname if DNS is setup right).\u00a0 I&#8217;m working on http:\/\/sensor_ip:port\/TestSensor.\u00a0 I created a combo of all 3 Control Center reports in one.\u00a0 Going to that URL with an actual IP and the right port would give a nice combo HTML report of the sensor, complete with name, version, current sensor readings, configuration setups, etc!\u00a0\u00a0<br>The big thing I like about this is you can take your cell phone, make it a wifi hotspot the sensors connect to and goto the URL in a web browser on said phone to see its status.\u00a0 If I make an actual phone app, I may be able to automate the process with a push of a button.\u00a0 Cool possibilities for the future!\u00a0<\/p>\n\n\n\n<p>I have been pondering some other back-end changes.\u00a0 Since I know a lot more about python now, I might move a bunch of my install code from the bash script into the program&#8217;s first launch.\u00a0 I should probably keep the bash script to a bare min, just enough to get the program needs installed, then let the program start and take over from there.\u00a0\u00a0<\/p>\n\n\n\n<p>I should probably set a time to do a purely refactoring session too.\u00a0 There are a lot of places where the code could use improvement where I was trying to get it working at all.\u00a0 I also really want to get the Live Graph working with threading for the data gathering.\u00a0 Since right now, if the connection is not so great, the program will freeze until it times out.\u00a0 So what I&#8217;m thinking of doing, is simply threading the data gathering and putting results in a queue or pool of sorts.\u00a0 So long as this pool allows the program to continue while waiting for data, it should work very well.\u00a0 Otherwise, I&#8217;ll set aside some time to really think about how to make it shine &#8230; or maybe replace it&#8230; Since Matplotlib is not thread safe to begin with, maybe I should look for something that is more like a multi-camera\u00a0dashboard.\u00a0 I&#8217;m pretty sure most people are going to want to put a dashboard of live sensors up in front of them, to monitor things like crops and such.\u00a0\u00a0<\/p>\n\n\n\n<p>I will most likely release a new version soon, as there are a lot of nice touches on this one, such as most areas are threaded to prevent program freezes now (minus the live graph), the program is no longer dependant on a 3rd party HTTP server, the Control Center sensor re-configuration section has been re-done to allow config and installed sensor changes. It also allows grabbing a sensor configuration to compare or re-distribute to other sensors.\u00a0 Graphing now allows a default temperature offset from the sensor itself, which has an\u00a0automatic offset based on the hardware chosen, as well as allows a custom entry.\u00a0 Notes can now be entered into the Sensor Database with a date and time stamp so it will (eventually) show up in graphs beside relevant sensor data. I have created an update and program checks that will make needed adjustments to settings and files after an upgrade.\u00a0 Hmm, what else&#8230; O yeah, I was able to remove the rebuild of numpy\u00a0with the new Raspbian version that&#8217;s out, but I had to add &#8216;atlas&#8217; i think&#8230; but just for install, not rebuild it, so that&#8217;s\u00a0good.\u00a0\u00a0<\/p>\n\n\n\n<p>Lots of good improvements and it seems to be running fairly smoothly with the transition from sockets to Flask&#8230; although I must admit, I do notice a slight more delay using Flask, which makes sense due to the overhead.\u00a0 The delay is also measured in ms not seconds, so its not bad. It is especially hard to notice now that I have added threading to pretty much every sensor reading grab, so it shows up as a delay in showing, not a frozen program.\u00a0 \u00a0<\/p>\n\n\n\n<p>That&#8217;s it for now.\u00a0\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have been working to update the smaller stuff after those overhauls before.&nbsp; Editing comments, updating help files and fixing bugs.&nbsp;&nbsp; Now that I have Flask in use, it allows me to show reports off the sensor itself, by going &hellip;<\/p>\n<p class=\"read-more\"><a href=\"https:\/\/dragonwarz.net\/?p=592\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25,27,26,3],"tags":[33],"class_list":["post-592","post","type-post","status-publish","format-standard","hentry","category-programming","category-project","category-python","category-random","tag-kootnet-sensors"],"_links":{"self":[{"href":"https:\/\/dragonwarz.net\/index.php?rest_route=\/wp\/v2\/posts\/592","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dragonwarz.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dragonwarz.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dragonwarz.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/dragonwarz.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=592"}],"version-history":[{"count":1,"href":"https:\/\/dragonwarz.net\/index.php?rest_route=\/wp\/v2\/posts\/592\/revisions"}],"predecessor-version":[{"id":596,"href":"https:\/\/dragonwarz.net\/index.php?rest_route=\/wp\/v2\/posts\/592\/revisions\/596"}],"wp:attachment":[{"href":"https:\/\/dragonwarz.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=592"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dragonwarz.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=592"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dragonwarz.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=592"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}