{"id":21035,"date":"2021-06-25T20:37:02","date_gmt":"2021-06-25T11:37:02","guid":{"rendered":"https:\/\/www.souichi.club\/?p=21035"},"modified":"2022-03-19T17:25:02","modified_gmt":"2022-03-19T08:25:02","slug":"shutdown-button","status":"publish","type":"post","link":"https:\/\/www.souichi.club\/en\/raspberrypi\/shutdown-button\/","title":{"rendered":"I added a button to the Raspberry Pi to shut it down with a long press."},"content":{"rendered":"<ul class=\"bogo-language-switcher list-view\"><li class=\"en-US en current first\"><span class=\"bogoflags bogoflags-us\"><\/span> <span class=\"bogo-language-name\"><a rel=\"alternate\" hreflang=\"en-US\" href=\"https:\/\/www.souichi.club\/en\/wp-json\/wp\/v2\/posts\/21035\/\" title=\"English\" class=\"current\" aria-current=\"page\">English<\/a><\/span><\/li>\n<li class=\"ja last\"><span class=\"bogoflags bogoflags-jp\"><\/span> <span class=\"bogo-language-name\"><a rel=\"alternate\" hreflang=\"ja\" href=\"https:\/\/www.souichi.club\/wp-json\/wp\/v2\/posts\/21035\/\" title=\"Japanese\">\u65e5\u672c\u8a9e<\/a><\/span><\/li>\n<\/ul>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a67ddcd68e8c\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #454e5c;color:#454e5c\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #454e5c;color:#454e5c\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a67ddcd68e8c\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.souichi.club\/en\/raspberrypi\/shutdown-button\/#Shutdown_the_Raspberry_Pi\" >Shutdown the Raspberry Pi<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.souichi.club\/en\/raspberrypi\/shutdown-button\/#Button\" >Button<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.souichi.club\/en\/raspberrypi\/shutdown-button\/#Function\" >Function<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.souichi.club\/en\/raspberrypi\/shutdown-button\/#Model_Number\" >Model Number<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.souichi.club\/en\/raspberrypi\/shutdown-button\/#Wiring_Diagram\" >Wiring Diagram<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.souichi.club\/en\/raspberrypi\/shutdown-button\/#Tested_environment\" >Tested environment<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.souichi.club\/en\/raspberrypi\/shutdown-button\/#Program\" >Program<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.souichi.club\/en\/raspberrypi\/shutdown-button\/#Source_code\" >Source code<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.souichi.club\/en\/raspberrypi\/shutdown-button\/#supplementary_explanation\" >supplementary explanation<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.souichi.club\/en\/raspberrypi\/shutdown-button\/#Execution_result\" >Execution result<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.souichi.club\/en\/raspberrypi\/shutdown-button\/#At_the_end\" >At the end.<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Shutdown_the_Raspberry_Pi\"><\/span>Shutdown the Raspberry Pi<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Since the Raspberry Pi is a Linux OS, it cannot be turned off suddenly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It is necessary to connect via ssh or connect a keyboard and monitor and use the shutdown command to shutdown the OS.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">However, the Raspberry Pi installed at the manufacturing site for IoT is not always able to shut down properly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I added a button for shutdown to my Raspberry Pi, and I&#8217;ll write an article about it as a reminder.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/shutdown-button-06.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/shutdown-button-06.jpg?resize=512%2C384&#038;ssl=1\" alt=\"I added a shutdown button to the Raspberry Pi.\" class=\"wp-image-20633\" width=\"512\" height=\"384\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/shutdown-button-06.jpg?resize=1024%2C767&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/shutdown-button-06.jpg?resize=300%2C225&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/shutdown-button-06.jpg?resize=768%2C575&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/shutdown-button-06.jpg?resize=1536%2C1150&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/shutdown-button-06.jpg?w=1920&amp;ssl=1 1920w\" sizes=\"auto, (max-width: 512px) 100vw, 512px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Button\"><\/span>Button<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Function\"><\/span>Function<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>To avoid shutting down when a button is touched accidentally, shutdown is now done only when the button is &#8220;long pressed&#8221;.<\/li><li>Selected a button with LED light.<\/li><li>The LED light on the button turns on when the program is running and turns off when the program is shutdown by pressing and holding the button.<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Model_Number\"><\/span>Model Number<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">I bought an OMRON pushbutton switch (model number = A165L-JRM-5D-1).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The meaning of the model number is as follows.<\/p>\n\n\n<figure class=\"wp-block-table is-style-regular\">\n<table class=\"r_table01\">\n<tbody>\n<tr>\n<td class=\"r_td30\">\n<p>A16<\/p>\n<\/td>\n<td>\n<p>The type of the button.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>5<\/p>\n<\/td>\n<td>\n<p>IP standard grade of water resistance or protection.<\/p>\n<ul>\n<li>None: IP40 (protected from wires, etc., not protected against water ingress)<\/li>\n<li>5: IP66 (completely protected from dust ingress, not harmed by strong direct jets of water from any direction)<\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>L<\/p>\n<\/td>\n<td>\n<p>Whether it is illuminated or not<\/p>\n<ul>\n<li>None: Non-illuminated<\/li>\n<li>L: Illumination<\/li>\n<\/ul>\n<p>I wanted a button with an LED light, so I chose the illuminated type.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>J<\/p>\n<\/td>\n<td>\n<p>Button shape<\/p>\n<ul>\n<li>J: Rectangle<\/li>\n<li>A: Square<\/li>\n<li>T: Round<\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>R<\/p>\n<\/td>\n<td>\n<p>Button color<\/p>\n<ul>\n<li>R: Red<\/li>\n<li>Y\uff1aYellow<\/li>\n<li>PY: Pure yellow<\/li>\n<li>G\uff1aGreen<\/li>\n<li>W\uff1aWhite<\/li>\n<li>A: Blue<\/li>\n<li>PW: Pure white<\/li>\n<li>B\uff1aBlack (non-illuminated only)<\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>M<\/p>\n<\/td>\n<td>\n<p>Button behavior when pressed<\/p>\n<ul>\n<li>M: Momentary (turns on only when the button is pressed)<\/li>\n<li>A: Alternate (remains on after the button is pressed and released)<\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>5D<\/p>\n<\/td>\n<td>\n<p>LED voltage<\/p>\n<ul>\n<li>None: Non-illuminated<\/li>\n<li>5D: 5V DC<\/li>\n<li>12D: AC\/DC12V<\/li>\n<li>24D: AC\/DC24V<\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>1<\/p>\n<\/td>\n<td>\n<p>This shows the terminal arrangement.<\/p>\n<p>In terms of circuitry, I would have preferred to use an a-contact, but since the button I had available was a c-contact, I chose a type of button with only one contact.<\/p>\n<ul>\n<li>1: 1c (soldered terminal)<\/li>\n<li>2: 2c (soldered terminal)<\/li>\n<li>1P: 1c (printed circuit board terminal)<\/li>\n<li>2P: 2c (printed circuit board terminal)<\/li>\n<li>2S: 2C (quick connector)<\/li>\n<\/ul>\n<p>The terminal arrangement for 1c is as follows (<a href=\"https:\/\/www.fa.omron.co.jp\/data_pdf\/cat\/a16_ds_j_11_9.pdf?id=1101\" target=\"_blank\" rel=\"noopener\">from the OMRON manual<\/a>)<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/shutdown-button-01.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"r_image alignnone wp-image-20623 size-full\" title=\"Bottom View\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/shutdown-button-01.png?resize=308%2C280&#038;ssl=1\" alt=\"Bottom View\" width=\"308\" height=\"280\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/shutdown-button-01.png?w=308&amp;ssl=1 308w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/shutdown-button-01.png?resize=300%2C273&amp;ssl=1 300w\" sizes=\"auto, (max-width: 308px) 100vw, 308px\" \/><\/a><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Wiring_Diagram\"><\/span>Wiring Diagram<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">I don&#8217;t use NC connector.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It is used as a button with real a-contact.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/shutdown-button-en-01.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/shutdown-button-en-01.png?resize=768%2C610&#038;ssl=1\" alt=\"Add a shutdown button\" class=\"wp-image-21042\" width=\"768\" height=\"610\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/shutdown-button-en-01.png?resize=1024%2C813&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/shutdown-button-en-01.png?resize=300%2C238&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/shutdown-button-en-01.png?resize=768%2C610&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/shutdown-button-en-01.png?w=1360&amp;ssl=1 1360w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Tested_environment\"><\/span>Tested environment<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The following environment was tested.<\/p>\n\n\n<figure class=\"wp-block-table is-style-regular\">\n<table class=\"r_table01\">\n<tbody>\n<tr>\n<td class=\"r_td30\">\n<p>Raspberry Pi<\/p>\n<\/td>\n<td>\n<p>Raspberry Pi 4B<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>OS<\/p>\n<\/td>\n<td>\n<p>Raspberry Pi OS 32Bit<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Program\"><\/span>Program<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">I saved the following program in  &#8220;.local\/shutdown_test\/&#8221;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Source_code\"><\/span>Source code<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">shutdown_button.py<\/p>\n\n\n<pre class=\"line-numbers\"><code class=\"lang-python\"># -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Jun  5 08:24:26 2021\n\n\u30fbPress and hold button to shut down\n\u30fbLED on during program operation, off during shutdown\n\n@author: Souichirou Kikuchi\n\"\"\"\n\nimport os\nimport RPi.GPIO as GPIO\nfrom time import sleep\n\nPIN_BUTTON_LED = 4 # LED on the button\nPIN_BUTTON_SD = 22 # shutdown button\n\ndef shut_down(channel): # Long Press to shutdown\n    if channel == PIN_BUTTON_SD:\n        sw = 0\n        for _ in range(15):\n            sleep(0.2) # 0.2 seconds x 15 times = 3 seconds\n            sw = GPIO.input(channel)\n            if sw == 0: # If there is even one LOW out of 15 times, it will not shutdown.\n                break\n        if sw == 1:\n            GPIO.output(PIN_BUTTON_LED, GPIO.LOW) # Button LED off\n            os.system('sudo shutdown -h now') # shutdown\n\nGPIO.setmode(GPIO.BCM)\nGPIO.setup(PIN_BUTTON_LED, GPIO.OUT)\nGPIO.setup(PIN_BUTTON_SD, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)\nGPIO.add_event_detect(PIN_BUTTON_SD, GPIO.RISING, callback=shut_down, bouncetime=200)\n\nif __name__ == \"__main__\":\n    try:\n        print('ShutDown Test Program Start') # Program start\n        GPIO.output(PIN_BUTTON_LED, GPIO.HIGH) # LED lights on the button\n        while True:\n            sleep(0.001)\n    except:\n        pass\n    finally:\n        GPIO.cleanup()\n        print('ShutDown Test Program End') # Program ended<\/code><\/pre>\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"supplementary_explanation\"><\/span>supplementary explanation<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">I&#8217;ve included some comments in the program, but I&#8217;ll add a few more.<\/p>\n\n\n<pre><code class=\"lang-python\">GPIO.setup(PIN_BUTTON_SD, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)<\/code><\/pre>\n\n\n<p class=\"wp-block-paragraph\">is the GPIO22 connected from the button NO, but I have specified a pull_down resistor.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Also, the<\/p>\n\n\n<pre><code class=\"lang-python\">GPIO.add_event_detect(PIN_BUTTON_SD, GPIO.RISING, callback=shut_down, bouncetime=200)<\/code><\/pre>\n\n\n<p class=\"wp-block-paragraph\">In the same way, when the voltage of GPIO22 rises from LOW to HIGH (RISING), the shut_down function is called.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Since the voltage does not rise in a straight line, the interval of 200 milliseconds between the next call to the shut_down function is left with bouncetime=200 to prevent the function from being called repeatedly.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Execution_result\"><\/span>Execution result<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Run the program with the following command.<\/p>\n\n\n<pre><code class=\"lang-shell\">cd ~\/.local\/shutdown_test\npython shutdown_button.py<\/code><\/pre>\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/shutdown-button-04.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/shutdown-button-04.png?resize=512%2C319&#038;ssl=1\" alt=\"Run a shutdown test program.\" class=\"wp-image-20630\" width=\"512\" height=\"319\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/shutdown-button-04.png?resize=1024%2C638&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/shutdown-button-04.png?resize=300%2C187&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/shutdown-button-04.png?resize=768%2C478&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/shutdown-button-04.png?w=1026&amp;ssl=1 1026w\" sizes=\"auto, (max-width: 512px) 100vw, 512px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The LED lights up, and I was able to confirm that long press it (for about 3 seconds) will shut it down.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/shutdown-button-05.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/shutdown-button-05.jpg?resize=512%2C373&#038;ssl=1\" alt=\"Long press the button to shutdown the OS.\" class=\"wp-image-20631\" width=\"512\" height=\"373\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/shutdown-button-05.jpg?resize=1024%2C745&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/shutdown-button-05.jpg?resize=300%2C218&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/shutdown-button-05.jpg?resize=768%2C558&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/shutdown-button-05.jpg?resize=1536%2C1117&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/shutdown-button-05.jpg?w=1920&amp;ssl=1 1920w\" sizes=\"auto, (max-width: 512px) 100vw, 512px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"At_the_end\"><\/span>At the end.<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This is the end of the article on shutdown by button.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The reason why Raspberry Pi (Linux OS) can&#8217;t be shutdown suddenly is that various files used by the OS are written to the SD card while the OS is running.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you suddenly turn off the power while writing files, those files may be corrupted, which may affect the next time the OS boots and prevent it from booting.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">As a countermeasure for this, I&#8217;ve written an article on how to &#8220;add a shutdown button&#8221;.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Other methods.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Set the file system to Read Only(SD Card)<\/li><li>Relay circuit to give grace until OS shutdown<\/li><\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">I&#8217;ve heard that there is a way to do the above, and I&#8217;d like to try it soon.<\/p>\n\n\n<div class=\"postscript_balloon\">Finally.<\/div>\n\n\n<p class=\"wp-block-paragraph\">I hope this article will be useful to someone somewhere.<\/p>\n\n\n","protected":false},"excerpt":{"rendered":"<p>Since the Raspberry Pi is a Linux OS, it cannot be turned off suddenly.Need to shut down the OS with the shutdown command.<\/p>\n","protected":false},"author":5,"featured_media":20631,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_locale":"en_US","_original_post":"https:\/\/www.souichi.club\/?p=20609","_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[136],"tags":[138],"class_list":["post-21035","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-raspberrypi","tag-python","en-US"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"robots\" content=\"max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n\t<meta name=\"author\" content=\"souichirou kikuchi\"\/>\n\t<meta name=\"google-site-verification\" content=\"I8SUoF98Rb8nTRkWlwcAUglH3v2Z49ZUmVL8-hWcBds\" \/>\n\t<meta name=\"msvalidate.01\" content=\"621A4EE09A712013B79161DEF6085174\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.souichi.club\/en\/raspberrypi\/shutdown-button\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"\u305d\u3046\u5099\u5fd8\u9332 note to self\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"I added a button to the Raspberry Pi to shut it down with a long press. | \u305d\u3046\u5099\u5fd8\u9332\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.souichi.club\/en\/raspberrypi\/shutdown-button\/\" \/>\n\t\t<meta property=\"fb:admins\" content=\"222762298621510\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/www.souichi.club\/wp-content\/uploads\/shutdown-button-05.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/www.souichi.club\/wp-content\/uploads\/shutdown-button-05.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t\t<meta property=\"og:image:height\" content=\"1396\" \/>\n\t\t<meta property=\"article:tag\" content=\"raspberrypi\" \/>\n\t\t<meta property=\"article:tag\" content=\"python\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2021-06-25T11:37:02+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2022-03-19T08:25:02+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/sou.bibouroku\/\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/kikuchi.souichiro\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@soukikuchi175\" \/>\n\t\t<meta name=\"twitter:title\" content=\"I added a button to the Raspberry Pi to shut it down with a long press. | \u305d\u3046\u5099\u5fd8\u9332\" \/>\n\t\t<meta name=\"twitter:creator\" content=\"@soukikuchi175\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/www.souichi.club\/wp-content\/uploads\/shutdown-button-05.jpg\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.souichi.club\\\/en\\\/raspberrypi\\\/shutdown-button\\\/#article\",\"name\":\"I added a button to the Raspberry Pi to shut it down with a long press. | \\u305d\\u3046\\u5099\\u5fd8\\u9332\",\"headline\":\"I added a button to the Raspberry Pi to shut it down with a long press.\",\"author\":{\"@id\":\"https:\\\/\\\/www.souichi.club\\\/author\\\/souwpuser023en\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.souichi.club\\\/#person\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/www.souichi.club\\\/wp-content\\\/uploads\\\/shutdown-button-05.jpg?fit=1920%2C1396&ssl=1\",\"width\":1920,\"height\":1396},\"datePublished\":\"2021-06-25T20:37:02+09:00\",\"dateModified\":\"2022-03-19T17:25:02+09:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.souichi.club\\\/en\\\/raspberrypi\\\/shutdown-button\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.souichi.club\\\/en\\\/raspberrypi\\\/shutdown-button\\\/#webpage\"},\"articleSection\":\"RaspberryPi, Python\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.souichi.club\\\/en\\\/raspberrypi\\\/shutdown-button\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.souichi.club#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.souichi.club\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.souichi.club\\\/en\\\/category\\\/raspberrypi\\\/#listItem\",\"name\":\"RaspberryPi\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.souichi.club\\\/en\\\/category\\\/raspberrypi\\\/#listItem\",\"position\":2,\"name\":\"RaspberryPi\",\"item\":\"https:\\\/\\\/www.souichi.club\\\/en\\\/category\\\/raspberrypi\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.souichi.club\\\/en\\\/raspberrypi\\\/shutdown-button\\\/#listItem\",\"name\":\"I added a button to the Raspberry Pi to shut it down with a long press.\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.souichi.club#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.souichi.club\\\/en\\\/raspberrypi\\\/shutdown-button\\\/#listItem\",\"position\":3,\"name\":\"I added a button to the Raspberry Pi to shut it down with a long press.\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.souichi.club\\\/en\\\/category\\\/raspberrypi\\\/#listItem\",\"name\":\"RaspberryPi\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.souichi.club\\\/#person\",\"name\":\"souichirou\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.souichi.club\\\/en\\\/raspberrypi\\\/shutdown-button\\\/#personImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/13f7f455b0e5efb64918fd4bc46f81ae8232f37679b7b638f53ac198086d1422?s=96&r=g\",\"width\":96,\"height\":96,\"caption\":\"souichirou\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/kikuchi.souichirou\",\"@soukikuchi175\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.souichi.club\\\/author\\\/souwpuser023en\\\/#author\",\"url\":\"https:\\\/\\\/www.souichi.club\\\/author\\\/souwpuser023en\\\/\",\"name\":\"souichirou kikuchi\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.souichi.club\\\/en\\\/raspberrypi\\\/shutdown-button\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ae74b378502f0f972ee51f5bed6a401be64ea02df531d9a86cf4cbdd7d68861e?s=96&r=g\",\"width\":96,\"height\":96,\"caption\":\"souichirou kikuchi\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/kikuchi.souichiro\",\"@soukikuchi175\"]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.souichi.club\\\/en\\\/raspberrypi\\\/shutdown-button\\\/#webpage\",\"url\":\"https:\\\/\\\/www.souichi.club\\\/en\\\/raspberrypi\\\/shutdown-button\\\/\",\"name\":\"I added a button to the Raspberry Pi to shut it down with a long press. | \\u305d\\u3046\\u5099\\u5fd8\\u9332\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.souichi.club\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.souichi.club\\\/en\\\/raspberrypi\\\/shutdown-button\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.souichi.club\\\/author\\\/souwpuser023en\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.souichi.club\\\/author\\\/souwpuser023en\\\/#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/www.souichi.club\\\/wp-content\\\/uploads\\\/shutdown-button-05.jpg?fit=1920%2C1396&ssl=1\",\"@id\":\"https:\\\/\\\/www.souichi.club\\\/en\\\/raspberrypi\\\/shutdown-button\\\/#mainImage\",\"width\":1920,\"height\":1396},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.souichi.club\\\/en\\\/raspberrypi\\\/shutdown-button\\\/#mainImage\"},\"datePublished\":\"2021-06-25T20:37:02+09:00\",\"dateModified\":\"2022-03-19T17:25:02+09:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.souichi.club\\\/#website\",\"url\":\"https:\\\/\\\/www.souichi.club\\\/\",\"name\":\"\\u305d\\u3046\\u5099\\u5fd8\\u9332\",\"description\":\"note to self\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.souichi.club\\\/#person\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"I added a button to the Raspberry Pi to shut it down with a long press. | \u305d\u3046\u5099\u5fd8\u9332","description":"","canonical_url":"https:\/\/www.souichi.club\/en\/raspberrypi\/shutdown-button\/","robots":"max-snippet:-1, max-image-preview:large, max-video-preview:-1","keywords":"","webmasterTools":{"google-site-verification":"I8SUoF98Rb8nTRkWlwcAUglH3v2Z49ZUmVL8-hWcBds","msvalidate.01":"621A4EE09A712013B79161DEF6085174","miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.souichi.club\/en\/raspberrypi\/shutdown-button\/#article","name":"I added a button to the Raspberry Pi to shut it down with a long press. | \u305d\u3046\u5099\u5fd8\u9332","headline":"I added a button to the Raspberry Pi to shut it down with a long press.","author":{"@id":"https:\/\/www.souichi.club\/author\/souwpuser023en\/#author"},"publisher":{"@id":"https:\/\/www.souichi.club\/#person"},"image":{"@type":"ImageObject","url":"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/shutdown-button-05.jpg?fit=1920%2C1396&ssl=1","width":1920,"height":1396},"datePublished":"2021-06-25T20:37:02+09:00","dateModified":"2022-03-19T17:25:02+09:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.souichi.club\/en\/raspberrypi\/shutdown-button\/#webpage"},"isPartOf":{"@id":"https:\/\/www.souichi.club\/en\/raspberrypi\/shutdown-button\/#webpage"},"articleSection":"RaspberryPi, Python"},{"@type":"BreadcrumbList","@id":"https:\/\/www.souichi.club\/en\/raspberrypi\/shutdown-button\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.souichi.club#listItem","position":1,"name":"Home","item":"https:\/\/www.souichi.club","nextItem":{"@type":"ListItem","@id":"https:\/\/www.souichi.club\/en\/category\/raspberrypi\/#listItem","name":"RaspberryPi"}},{"@type":"ListItem","@id":"https:\/\/www.souichi.club\/en\/category\/raspberrypi\/#listItem","position":2,"name":"RaspberryPi","item":"https:\/\/www.souichi.club\/en\/category\/raspberrypi\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.souichi.club\/en\/raspberrypi\/shutdown-button\/#listItem","name":"I added a button to the Raspberry Pi to shut it down with a long press."},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.souichi.club#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.souichi.club\/en\/raspberrypi\/shutdown-button\/#listItem","position":3,"name":"I added a button to the Raspberry Pi to shut it down with a long press.","previousItem":{"@type":"ListItem","@id":"https:\/\/www.souichi.club\/en\/category\/raspberrypi\/#listItem","name":"RaspberryPi"}}]},{"@type":"Person","@id":"https:\/\/www.souichi.club\/#person","name":"souichirou","image":{"@type":"ImageObject","@id":"https:\/\/www.souichi.club\/en\/raspberrypi\/shutdown-button\/#personImage","url":"https:\/\/secure.gravatar.com\/avatar\/13f7f455b0e5efb64918fd4bc46f81ae8232f37679b7b638f53ac198086d1422?s=96&r=g","width":96,"height":96,"caption":"souichirou"},"sameAs":["https:\/\/www.facebook.com\/kikuchi.souichirou","@soukikuchi175"]},{"@type":"Person","@id":"https:\/\/www.souichi.club\/author\/souwpuser023en\/#author","url":"https:\/\/www.souichi.club\/author\/souwpuser023en\/","name":"souichirou kikuchi","image":{"@type":"ImageObject","@id":"https:\/\/www.souichi.club\/en\/raspberrypi\/shutdown-button\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/ae74b378502f0f972ee51f5bed6a401be64ea02df531d9a86cf4cbdd7d68861e?s=96&r=g","width":96,"height":96,"caption":"souichirou kikuchi"},"sameAs":["https:\/\/www.facebook.com\/kikuchi.souichiro","@soukikuchi175"]},{"@type":"WebPage","@id":"https:\/\/www.souichi.club\/en\/raspberrypi\/shutdown-button\/#webpage","url":"https:\/\/www.souichi.club\/en\/raspberrypi\/shutdown-button\/","name":"I added a button to the Raspberry Pi to shut it down with a long press. | \u305d\u3046\u5099\u5fd8\u9332","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.souichi.club\/#website"},"breadcrumb":{"@id":"https:\/\/www.souichi.club\/en\/raspberrypi\/shutdown-button\/#breadcrumblist"},"author":{"@id":"https:\/\/www.souichi.club\/author\/souwpuser023en\/#author"},"creator":{"@id":"https:\/\/www.souichi.club\/author\/souwpuser023en\/#author"},"image":{"@type":"ImageObject","url":"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/shutdown-button-05.jpg?fit=1920%2C1396&ssl=1","@id":"https:\/\/www.souichi.club\/en\/raspberrypi\/shutdown-button\/#mainImage","width":1920,"height":1396},"primaryImageOfPage":{"@id":"https:\/\/www.souichi.club\/en\/raspberrypi\/shutdown-button\/#mainImage"},"datePublished":"2021-06-25T20:37:02+09:00","dateModified":"2022-03-19T17:25:02+09:00"},{"@type":"WebSite","@id":"https:\/\/www.souichi.club\/#website","url":"https:\/\/www.souichi.club\/","name":"\u305d\u3046\u5099\u5fd8\u9332","description":"note to self","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.souichi.club\/#person"}}]},"og:locale":"en_US","og:site_name":"\u305d\u3046\u5099\u5fd8\u9332 note to self","og:type":"article","og:title":"I added a button to the Raspberry Pi to shut it down with a long press. | \u305d\u3046\u5099\u5fd8\u9332","og:url":"https:\/\/www.souichi.club\/en\/raspberrypi\/shutdown-button\/","fb:admins":"222762298621510","og:image":"https:\/\/www.souichi.club\/wp-content\/uploads\/shutdown-button-05.jpg","og:image:secure_url":"https:\/\/www.souichi.club\/wp-content\/uploads\/shutdown-button-05.jpg","og:image:width":1920,"og:image:height":1396,"article:tag":["raspberrypi","python"],"article:published_time":"2021-06-25T11:37:02+00:00","article:modified_time":"2022-03-19T08:25:02+00:00","article:publisher":"https:\/\/www.facebook.com\/sou.bibouroku\/","article:author":"https:\/\/www.facebook.com\/kikuchi.souichiro","twitter:card":"summary_large_image","twitter:site":"@soukikuchi175","twitter:title":"I added a button to the Raspberry Pi to shut it down with a long press. | \u305d\u3046\u5099\u5fd8\u9332","twitter:creator":"@soukikuchi175","twitter:image":"https:\/\/www.souichi.club\/wp-content\/uploads\/shutdown-button-05.jpg"},"aioseo_meta_data":{"post_id":"21035","title":null,"description":null,"keywords":null,"keyphrases":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_custom_url":null,"og_image_custom_fields":null,"og_custom_image_width":null,"og_custom_image_height":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"none","tabs":null,"priority":null,"frequency":null,"local_seo":null,"breadcrumb_settings":null,"created":"2023-08-22 23:08:24","updated":"2026-05-21 03:44:53","primary_term":null,"og_image_url":null,"og_image_width":null,"og_image_height":null,"twitter_image_url":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"limit_modified_date":false,"ai":null,"seo_analyzer_scan_date":null},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/shutdown-button-05.jpg?fit=1920%2C1396&ssl=1","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.souichi.club\/wp-json\/wp\/v2\/posts\/21035","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.souichi.club\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.souichi.club\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.souichi.club\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.souichi.club\/wp-json\/wp\/v2\/comments?post=21035"}],"version-history":[{"count":1,"href":"https:\/\/www.souichi.club\/wp-json\/wp\/v2\/posts\/21035\/revisions"}],"predecessor-version":[{"id":24537,"href":"https:\/\/www.souichi.club\/wp-json\/wp\/v2\/posts\/21035\/revisions\/24537"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.souichi.club\/wp-json\/wp\/v2\/media\/20631"}],"wp:attachment":[{"href":"https:\/\/www.souichi.club\/wp-json\/wp\/v2\/media?parent=21035"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.souichi.club\/wp-json\/wp\/v2\/categories?post=21035"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.souichi.club\/wp-json\/wp\/v2\/tags?post=21035"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}