{"id":2780,"date":"2021-02-20T13:00:00","date_gmt":"2021-02-20T13:00:00","guid":{"rendered":"https:\/\/chewett.co.uk\/blog\/?p=2780"},"modified":"2021-02-15T19:53:33","modified_gmt":"2021-02-15T19:53:33","slug":"raspberry-pi-cluster-node-18-raspberry-pi-temperature-monitoring","status":"publish","type":"post","link":"https:\/\/chewett.co.uk\/blog\/2780\/raspberry-pi-cluster-node-18-raspberry-pi-temperature-monitoring\/","title":{"rendered":"Raspberry Pi Cluster Node \u2013 18 Raspberry Pi Temperature Monitoring"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"678\" height=\"254\" data-attachment-id=\"2812\" data-permalink=\"https:\/\/chewett.co.uk\/blog\/2780\/raspberry-pi-cluster-node-18-raspberry-pi-temperature-monitoring\/raspi_cluster_18_cpu_temp_header\/\" data-orig-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2021\/02\/raspi_cluster_18_cpu_temp_header.jpg?fit=800%2C300&amp;ssl=1\" data-orig-size=\"800,300\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"raspi_cluster_18_cpu_temp_header\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2021\/02\/raspi_cluster_18_cpu_temp_header.jpg?fit=300%2C113&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2021\/02\/raspi_cluster_18_cpu_temp_header.jpg?fit=678%2C254&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2021\/02\/raspi_cluster_18_cpu_temp_header.jpg?resize=678%2C254&#038;ssl=1\" alt=\"\" class=\"wp-image-2812\" srcset=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2021\/02\/raspi_cluster_18_cpu_temp_header.jpg?w=800&amp;ssl=1 800w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2021\/02\/raspi_cluster_18_cpu_temp_header.jpg?resize=300%2C113&amp;ssl=1 300w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2021\/02\/raspi_cluster_18_cpu_temp_header.jpg?resize=768%2C288&amp;ssl=1 768w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2021\/02\/raspi_cluster_18_cpu_temp_header.jpg?resize=50%2C19&amp;ssl=1 50w\" sizes=\"auto, (max-width: 678px) 100vw, 678px\" \/><\/figure>\n\n\n\n<p>This post builds on\u00a0<a href=\"https:\/\/chewett.co.uk\/blog\/2744\/raspberry-pi-cluster-node-17-influxdb-machine-stats-monitoring\/\" data-type=\"URL\" data-id=\"https:\/\/chewett.co.uk\/blog\/2744\/raspberry-pi-cluster-node-17-influxdb-machine-stats-monitoring\/\">my previous posts in the Raspberry Pi Cluster series<\/a>\u00a0by starting to log temperature with the RaspberryPiVcgencmd Python module.<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">Installing RaspberryPiVcgencmd<\/h2>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/pypi.org\/project\/RaspberryPiVcgencmd\/\" data-type=\"URL\" data-id=\"https:\/\/pypi.org\/project\/RaspberryPiVcgencmd\/\" target=\"_blank\">RaspberryPiVcgencmd is a small python module<\/a> aimed to control <code>vcgencmd<\/code> and allow programmatic access to it. This can be installed with the following command.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\npython3 -m pip install RaspberryPiVcgencmd\n<\/pre><\/div>\n\n\n<p>Once installed it can be included in a file using the following import.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nfrom RaspberryPiVcgencmd import Vcgencmd\n<\/pre><\/div>\n\n\n<p>Once this is installed on all the Raspberry Pi nodes that you wish to record the temperature we are ready to continue.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Added NodeConfig static class to hold general data<\/h2>\n\n\n\n<p>To ease accessing global configuration information I have moved the node config to a new class. This static <code>NodeConfig<\/code> class will be used to load and access the node data from various places.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nclass NodeConfig:\n    &#039;&#039;&#039; Static class used to hold generic information about the node&#039;s Config&#039;&#039;&#039;\n\n    node_type = None\n\n    @staticmethod\n    def load(config_data):\n        NodeConfig.node_type = config_data.get(&quot;node_config&quot;, &quot;node_type&quot;)\n<\/pre><\/div>\n\n\n<p>Here the data is loaded from the config parser object and stored in the static variables. For now we are only loading the node_type data which will tell the RaspberryPi cluster code what type of node it is.<\/p>\n\n\n\n<p>This can then be used to perform different operations based on the node type.<\/p>\n\n\n\n<p>Now in each basic script there are simple config loading lines.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nfrom RpiCluster.NodeConfig import NodeConfig\n\nconfig = configparser.ConfigParser()\nconfig.read(os.path.join(os.path.dirname(os.path.realpath(__file__)), &#039;rpicluster.cfg&#039;))\n\nNodeConfig.load(config)\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">Added cpu_temperature to vitals payload<\/h2>\n\n\n\n<p>Since we want to start transmitting the CPU temperature to the primary node we need to add that to the vitals Payload. By default this will be null so it isn&#8217;t required to be supplied.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nclass VitalsPayload:\n\n    def __init__(self, cpu_percentage, cpu_frequency, ram_free, swap_free, cpu_temperature=None):\n        self.cpu_percentage = cpu_percentage\n        self.cpu_frequency = cpu_frequency\n        self.ram_free = ram_free\n        self.swap_free = swap_free\n        self.cpu_temperature = cpu_temperature\n<\/pre><\/div>\n\n\n<p>In addition we need to tweak how the flat payload are created to optionally include the cpu_temperature.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\ndef get_flat_payload(self):\n\t&quot;&quot;&quot; This will be called to get the data in a flat format to be used to send as a payload &quot;&quot;&quot;\n\tbase_object = {\n\t\t&#039;cpu_percentage&#039;: self.cpu_percentage,\n\t\t&#039;cpu_frequency&#039;: self.cpu_frequency,\n\t\t&#039;ram_free&#039;: self.ram_free,\n\t\t&#039;swap_free&#039;: self.swap_free,\n\t}\n\n\t# If there are more &quot;optional&quot; parts, these will be added if they exist\n\tif self.cpu_temperature:\n\t\tbase_object&#x5B;&#039;cpu_temperature&#039;] = self.cpu_temperature\n\n\treturn base_object\n<\/pre><\/div>\n\n\n<p>Here if cpu_temperature is set to a non-false value it will be included in the object. By default this will not be set as basic nodes will not send this data.<\/p>\n\n\n\n<p>Finally the static load_payload method is also changed to handle the fact cpu_temperature might be set.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n@staticmethod\ndef load_payload(payload):\n\tcpu_temperature = None\n\tif payload&#x5B;&#039;cpu_temperature&#039;]:\n\t\tcpu_temperature = payload&#x5B;&#039;cpu_temperature&#039;]\n\n\treturn VitalsPayload(payload&#x5B;&#039;cpu_percentage&#039;], payload&#x5B;&#039;cpu_frequency&#039;], payload&#x5B;&#039;ram_free&#039;], payload&#x5B;&#039;swap_free&#039;], cpu_temperature=cpu_temperature)\n<\/pre><\/div>\n\n\n<p>If it is set it will include this data in the newly created VitalsPayload object.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Reading CPU Temperature on Raspberry Pi&#8217;s<\/h2>\n\n\n\n<p>Now we have the Vcgencmd library to read the CPU temperature we can use it in the NodeVitals script.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\ndef get_current_node_vitals():\n    &quot;&quot;&quot;When called various statistics about the node in its current state are returned\n        These are things that are expected to change minute to minute.\n        Currently this includes cpu percentage, cpu frequency, ram available and swap available.\n    &quot;&quot;&quot;\n\n    # None unless we have a node that supports exporting this\n    cpu_temperature = None\n    if NodeConfig.node_type == &quot;raspberrypi&quot;:\n        #Only import this if we are a RaspberryPi node, other nodes might not have this\n        from RaspberryPiVcgencmd import Vcgencmd\n        vc = Vcgencmd()\n        cpu_temperature = vc.get_cpu_temp()\n\n\n    return VitalsPayload(\n        # TODO: Store fans, and battery details if available?\n        psutil.cpu_percent(1),\n        psutil.cpu_freq().current,\n        psutil.virtual_memory().free,\n        psutil.swap_memory().free,\n        cpu_temperature=cpu_temperature\n    )\n<\/pre><\/div>\n\n\n<p>Here the NodeConfig class is used to check what type of node it is. If it is a <code>raspberrypi<\/code> node then it will import the Vcgencmd module and read the temperature.<\/p>\n\n\n\n<p>Having the import enclosed in the if statement means that it will only be imported for Raspberry Pi&#8217;s which will have the module installed.<\/p>\n\n\n\n<p>In the future further types of node will be supported and able to have their CPU temperature reported.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Storing temperature data to influx<\/h2>\n\n\n\n<p>The final step of keeping track of node temperatures is to log this to InfluxDB.<\/p>\n\n\n\n<p>Here the start of log_vitals is changed a little to also log temperature if provided.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\ndef log_vitals(self, vitals):\n\t# TODO: Write these in one write_points API call rather than lots of smaller ones\n\tcpu_data = {\n\t\t&quot;frequency&quot;: vitals.cpu_frequency,\n\t\t&quot;percentage&quot;: vitals.cpu_percentage,\n\t}\n\n\tif vitals.cpu_temperature:\n\t\tcpu_data&#x5B;&#039;temperature&#039;] = vitals.cpu_temperature\n\n\tself._write_datapoint(&quot;cpu&quot;, cpu_data)\n<\/pre><\/div>\n\n\n<p>Here it is written into the CPU field alongside frequency and percentage.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Summary of logging the CPU temperature<\/h2>\n\n\n\n<p>Now with some refactoring is it easy to keep track of what type of node the secondary is. This is shared across the codebase and is used to log the temperature of a raspberrypi node.<\/p>\n\n\n\n<p>This is then transmitted to the primary and logged in InfluxDB. This will help keep an eye on the temperature to see if a node is overloaded.<\/p>\n\n\n\n<p>The full code is&nbsp;<a href=\"https:\/\/github.com\/chewett\/RaspberryPiCluster\/\" target=\"_blank\" rel=\"noreferrer noopener\">available on Github<\/a>, any comments or questions can be raised there as issues or posted below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post builds on\u00a0my previous posts in the Raspberry Pi Cluster series\u00a0by starting to log temperature with the RaspberryPiVcgencmd Python module.<\/p>\n","protected":false},"author":1,"featured_media":2811,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"Today I am talking about the #RaspberryPi Cluster project - Monitoring the temperature of Raspberry Pi nodes","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[122],"tags":[102,184,198,37,101,393],"class_list":["post-2780","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-raspberry-pi-cluster","tag-distributed-computing","tag-python","tag-python-3","tag-raspberry-pi","tag-raspberry-pi-cluster","tag-raspberry-pi-os"],"wppr_data":{"cwp_meta_box_check":"No"},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2021\/02\/raspi_cluster_18_cputemperature_posticon_OUTPUT.png?fit=1200%2C628&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p2toWX-IQ","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":343,"url":"https:\/\/chewett.co.uk\/blog\/343\/raspberrypivcgencmd-python-library-access-raspberry-pi-vcgencmd-command\/","url_meta":{"origin":2780,"position":0},"title":"RaspberryPiVcgencmd A python library to access Raspberry Pi vcgencmd command","author":"Chewett","date":"May 31, 2017","format":false,"excerpt":"To access some of the lower level aspects of the Raspberry Pi's config you can use the built in command vcgencmd. This is a useful on the command line but to easily access it in a program you need to parse the output. I am planning to use this command\u2026","rel":"","context":"In &quot;Raspberry Pi Cluster&quot;","block_context":{"text":"Raspberry Pi Cluster","link":"https:\/\/chewett.co.uk\/blog\/category\/raspberry-pi-cluster\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/05\/vcgencmd.png?fit=628%2C288&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/05\/vcgencmd.png?fit=628%2C288&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/05\/vcgencmd.png?fit=628%2C288&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":2766,"url":"https:\/\/chewett.co.uk\/blog\/2766\/updating-the-raspberrypivcgencmd-library-to-python-3\/","url_meta":{"origin":2780,"position":1},"title":"Updating the RaspberryPiVcgencmd library to Python 3","author":"Chewett","date":"January 16, 2021","format":false,"excerpt":"This post talks quickly about the updates performed to the RaspberryPiVcgencmd library for porting to Python 3. Porting RaspberryPiVcgencmd to Python 3 Originally this library was written for Python 2 but now that has been retired it was time to update it. The main work that needed to be done\u2026","rel":"","context":"In &quot;Raspberry Pi Cluster&quot;","block_context":{"text":"Raspberry Pi Cluster","link":"https:\/\/chewett.co.uk\/blog\/category\/raspberry-pi-cluster\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2021\/01\/rpi_vcgencmd_lib_OUTPUT.png?fit=1200%2C628&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2021\/01\/rpi_vcgencmd_lib_OUTPUT.png?fit=1200%2C628&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2021\/01\/rpi_vcgencmd_lib_OUTPUT.png?fit=1200%2C628&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2021\/01\/rpi_vcgencmd_lib_OUTPUT.png?fit=1200%2C628&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2021\/01\/rpi_vcgencmd_lib_OUTPUT.png?fit=1200%2C628&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":1001,"url":"https:\/\/chewett.co.uk\/blog\/1001\/raspberry-pi-cluster-node-04-configuration-files-configparser\/","url_meta":{"origin":2780,"position":2},"title":"Raspberry Pi Cluster Node \u2013 04 Configuration Files with ConfigParser","author":"Chewett","date":"February 10, 2018","format":false,"excerpt":"This post builds on the\u00a0third step to create a Raspberry Pi Cluster Node\u00a0to store our configuration settings in a config file. Here we move all the configuration settings in our script into a useful .cfg file using the python ConfigParser. Why use Configuration Files? When developing a system there will\u2026","rel":"","context":"In &quot;Raspberry Pi Cluster&quot;","block_context":{"text":"Raspberry Pi Cluster","link":"https:\/\/chewett.co.uk\/blog\/category\/raspberry-pi-cluster\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/02\/rpi_cluster_04_config_parser.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/02\/rpi_cluster_04_config_parser.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/02\/rpi_cluster_04_config_parser.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/02\/rpi_cluster_04_config_parser.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":1054,"url":"https:\/\/chewett.co.uk\/blog\/1054\/raspberry-pi-tutorial-website-online-now\/","url_meta":{"origin":2780,"position":3},"title":"Raspberry Pi Tutorial Website online now!","author":"Chewett","date":"March 10, 2018","format":false,"excerpt":"This post talks about the new page on my website with linking to all my Raspberry Pi Cluster tutorials. Raspberry Pi Cluster Tutorial Webpage Now I have a couple Raspberry Pi Cluster tutorials I decided to link to all of them on my website. This will form the basis of\u2026","rel":"","context":"In &quot;Raspberry Pi Cluster&quot;","block_context":{"text":"Raspberry Pi Cluster","link":"https:\/\/chewett.co.uk\/blog\/category\/raspberry-pi-cluster\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/03\/rpi_tutorial_website_online.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/03\/rpi_tutorial_website_online.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/03\/rpi_tutorial_website_online.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/03\/rpi_tutorial_website_online.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":2952,"url":"https:\/\/chewett.co.uk\/blog\/2952\/running-a-python-script-on-boot-with-systemd\/","url_meta":{"origin":2780,"position":4},"title":"Running a Python Script on Boot with Systemd","author":"Chewett","date":"August 7, 2021","format":false,"excerpt":"This short blog post details how you can run a python script on boot using systemd. Using Systemd to manage the python script Systemd is a daemon that is used to control various aspects of services and initialization scripts that run on and after boot. It is used by a\u2026","rel":"","context":"In &quot;Informational&quot;","block_context":{"text":"Informational","link":"https:\/\/chewett.co.uk\/blog\/category\/informational\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2021\/07\/systemd_bootup_posticon_OUTPUT.png?fit=1200%2C628&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2021\/07\/systemd_bootup_posticon_OUTPUT.png?fit=1200%2C628&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2021\/07\/systemd_bootup_posticon_OUTPUT.png?fit=1200%2C628&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2021\/07\/systemd_bootup_posticon_OUTPUT.png?fit=1200%2C628&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2021\/07\/systemd_bootup_posticon_OUTPUT.png?fit=1200%2C628&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":2127,"url":"https:\/\/chewett.co.uk\/blog\/2127\/raspberry-pi-cluster-node-14-a-simple-webserver\/","url_meta":{"origin":2780,"position":5},"title":"Raspberry Pi Cluster Node \u2013 14 A simple webserver","author":"Chewett","date":"April 17, 2019","format":false,"excerpt":"This tutorial focuses on creating a simple webserver that displays the status of the master using python Bottle. What will the webserver be used for? To interact with the cluster I am planning on making a small set of webpages. Initially these will just display information about the cluster but\u2026","rel":"","context":"In &quot;Raspberry Pi Cluster&quot;","block_context":{"text":"Raspberry Pi Cluster","link":"https:\/\/chewett.co.uk\/blog\/category\/raspberry-pi-cluster\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/04\/rpi_cluster_14_a_simple_webserver.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/04\/rpi_cluster_14_a_simple_webserver.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/04\/rpi_cluster_14_a_simple_webserver.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/04\/rpi_cluster_14_a_simple_webserver.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/2780","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=2780"}],"version-history":[{"count":7,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/2780\/revisions"}],"predecessor-version":[{"id":2815,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/2780\/revisions\/2815"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/media\/2811"}],"wp:attachment":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=2780"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=2780"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=2780"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}