{"id":2599,"date":"2020-07-26T12:49:37","date_gmt":"2020-07-26T02:49:37","guid":{"rendered":"https:\/\/jandmf.com\/?p=2599"},"modified":"2020-08-04T14:13:35","modified_gmt":"2020-08-04T04:13:35","slug":"a-neat-little-display","status":"publish","type":"post","link":"https:\/\/jandmf.com\/index.php\/2020\/07\/26\/a-neat-little-display\/","title":{"rendered":"A neat little display"},"content":{"rendered":"<div id=\"pl-2599\"  class=\"panel-layout\" ><div id=\"pg-2599-0\"  class=\"panel-grid panel-no-style\" ><div id=\"pgc-2599-0-0\"  class=\"panel-grid-cell\" ><div id=\"panel-2599-0-0-0\" class=\"so-panel widget_text panel-first-child\" data-index=\"0\" ><h3 class=\"widget-title\">A four line system monitor<\/h3>\t\t\t<div class=\"textwidget\"><p>Whilst doing a bit of idle web surfing I stumbled across <a href=\"https:\/\/core-electronics.com.au\/adafruit-pioled-128x32-monochrome-oled-add-on-for-raspberry-pi.html\" target=\"_blank\" rel=\"noopener\">this little gizmo<\/a> and thought that it would provide me with a few hours of amusement so I went ahead and ordered one. After it arrived it sat on my desk for a few days while we shot off to Omeo for a bit of a break for a few days.<\/p>\n<p>When we got back I installed it and started playing. Fortunately Adafruit have a sample python script which I was able to massage to come up with this.<\/p>\n<figure id=\"attachment_2595\" aria-describedby=\"caption-attachment-2595\" style=\"width: 768px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-2595 size-large\" src=\"https:\/\/jandmf.com\/wp-content\/uploads\/2020\/07\/BIRU-WP-20200726T115332GMT1000-768x1024.jpg\" alt=\"\" width=\"768\" height=\"1024\" srcset=\"https:\/\/jandmf.com\/wp-content\/uploads\/2020\/07\/BIRU-WP-20200726T115332GMT1000-768x1024.jpg 768w, https:\/\/jandmf.com\/wp-content\/uploads\/2020\/07\/BIRU-WP-20200726T115332GMT1000-225x300.jpg 225w, https:\/\/jandmf.com\/wp-content\/uploads\/2020\/07\/BIRU-WP-20200726T115332GMT1000.jpg 960w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><figcaption id=\"caption-attachment-2595\" class=\"wp-caption-text\">Raspberry Pi 4 4GB with a heatsink case and four line display<\/figcaption><\/figure>\n<p>As you can see it displays the date, time, CPU temp and memory and CPU usage.<\/p>\n<p>I&#8217;ve already got USB booting happening so it boots from a 1TB Seagate USB 3.0 SSD which is just two partitions &#8211; &#8220;\/boot&#8221; and &#8220;\/&#8221;. That works well too.<\/p>\n<\/div>\n\t\t<\/div><div id=\"panel-2599-0-0-1\" class=\"so-panel widget_text\" data-index=\"1\" ><h3 class=\"widget-title\">The python script<\/h3>\t\t\t<div class=\"textwidget\"><p>This was, or is, my first ever python script. I&#8217;m adept at Perl, COBOL, Fortran, etc. so I was able to work out a simple script with only minimal messing around. It&#8217;s a good thing that Adafruit have some <a href=\"https:\/\/learn.adafruit.com\/adafruit-pioled-128x32-mini-oled-for-raspberry-pi\/usage\" target=\"_blank\" rel=\"noopener\">detailed instructions <\/a>which include a python script to get it working. A bit of modifying \/ rewriting the Adafruit script and I had it displaying what I wanted.<\/p>\n<p>So, without further ado here&#8217;s <a href=\"https:\/\/jandmf.com\/files\/moni.py\">here&#8217;s the Python3<\/a> script which I was going to embed here but WordPress is wilfully destroying the indentation.\u00a0 A quick look will reveal that there is no error handling whatsoever. I haven&#8217;t learnt how to do that yet so that&#8217;ll be introduced on another day. There&#8217;s also almost no commenting either.<\/p>\n<p>&nbsp;<\/p>\n<\/div>\n\t\t<\/div><div id=\"panel-2599-0-0-2\" class=\"so-panel widget_text panel-last-child\" data-index=\"2\" ><h3 class=\"widget-title\">What now<\/h3>\t\t\t<div class=\"textwidget\"><p>Well now that I&#8217;ve got this working and working well I thought that I&#8217;d get one of <a href=\"https:\/\/core-electronics.com.au\/adafruit-128x64-oled-bonnet-for-raspberry-pi.html\" target=\"_blank\" rel=\"noopener\">these<\/a> which has buttons and is a bigger. The little one that I have now will go onto my other P1 4 (1GB) which is used for storage and as a test bed for this site. It&#8217;s also booting from USB and is also running Pi OS 64bit which seems to me to be nice and stable.<\/p>\n<p>The bigger display will allow more lines of text but I don&#8217;t know what I&#8217;ll put there yet. It also has a couple of buttons and a joystick. I can use the buttons for things like &#8220;sudo reboot&#8221; or &#8220;sudo poweroff&#8221; or something.<\/p>\n<p>Stand by for future developments.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<\/div>\n\t\t<\/div><\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Whilst doing a bit of idle web surfing I stumbled across this little gizmo and thought that it would provide me with a few hours of amusement so I went ahead and ordered one. After it arrived it sat on my desk for a few days while we shot off to Omeo for a bit &hellip; <a href=\"https:\/\/jandmf.com\/index.php\/2020\/07\/26\/a-neat-little-display\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;A neat little display&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[53],"tags":[],"class_list":["post-2599","post","type-post","status-publish","format-standard","hentry","category-pi"],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/jandmf.com\/index.php\/wp-json\/wp\/v2\/posts\/2599","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jandmf.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jandmf.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jandmf.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jandmf.com\/index.php\/wp-json\/wp\/v2\/comments?post=2599"}],"version-history":[{"count":17,"href":"https:\/\/jandmf.com\/index.php\/wp-json\/wp\/v2\/posts\/2599\/revisions"}],"predecessor-version":[{"id":2653,"href":"https:\/\/jandmf.com\/index.php\/wp-json\/wp\/v2\/posts\/2599\/revisions\/2653"}],"wp:attachment":[{"href":"https:\/\/jandmf.com\/index.php\/wp-json\/wp\/v2\/media?parent=2599"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jandmf.com\/index.php\/wp-json\/wp\/v2\/categories?post=2599"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jandmf.com\/index.php\/wp-json\/wp\/v2\/tags?post=2599"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}