{"id":6934,"date":"2019-11-14T16:17:45","date_gmt":"2019-11-14T07:17:45","guid":{"rendered":"https:\/\/techclass.wfjydl.com\/?p=6934"},"modified":"2022-09-20T14:55:27","modified_gmt":"2022-09-20T06:55:27","slug":"%e5%88%a9%e7%94%a8%e7%9c%8b%e9%97%a8%e7%8b%97%e6%9d%bf%e8%87%aa%e5%8a%a8%e9%87%8d%e5%90%afraspberry-pi","status":"publish","type":"post","link":"https:\/\/techclass.wfjydl.com\/knowledge\/deviceplus\/how-tos\/raspberry\/raspberry-pi-auto-reboot-using-watchdog-board","title":{"rendered":"\u5229\u7528\u770b\u95e8\u72d7\u677f\u81ea\u52a8\u91cd\u542fRaspberry Pi"},"content":{"rendered":"<p><script type=\"text\/javascript\" src=\"https:\/\/ssl-cache.stream.ne.jp\/www50\/eqa194obdo\/jmc_pub\/jmc_swf\/player\/t3\/if.js\" charset=\"UTF-8\"><\/script><\/p>\n<div class=\"\u201cthe_content_wrapper\u201d\">\n\u8fd9\u7bc7\u6587\u7ae0\u6765\u6e90\u4e8e<a href=\"https:\/\/www.deviceplus.com\/\">DevicePlus.com<\/a>\u82f1\u8bed\u7f51\u7ad9\u7684\u7ffb\u8bd1\u7a3f\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6346\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2017\/09\/image001.jpg\" alt=\"raspberry pi watchdog\" width=\"700\" height=\"525\" srcset=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2017\/09\/image001.jpg 700w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2017\/09\/image001-300x225.jpg 300w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2017\/09\/image001-195x146.jpg 195w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2017\/09\/image001-50x38.jpg 50w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2017\/09\/image001-100x75.jpg 100w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\"><\/p>\n<p><span style=\"font-weight: 400;\">\u5728\u672c\u6559\u7a0b\u4e2d\uff0c\u6211\u4eec\u5c06\u4f7f\u7528\u4e00\u5757<\/span><a href=\"https:\/\/international.switch-science.com\/catalog\/2254\/\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"font-weight: 400;\">\u9002\u7528\u4e8eRaspberry Pi Model B+\u7684\u770b\u95e8\u72d7\u677f<\/span><\/a><span style=\"font-weight: 400;\">\u3002\u6ca1\u9519\uff0c\u8fd9\u662f\u4e00\u4e2a\u53ef\u4ee5\u5b89\u88c5\u5728Raspberry Pi\u4e0a\u7684\u770b\u95e8\u72d7\u677f\uff01<\/span><\/p>\n<p><a href=\"https:\/\/www.webopedia.com\/TERM\/W\/watchdog.html\" target=\"_blank\" rel=\"noopener noreferrer\"><i><span style=\"font-weight: 400;\">\u770b\u95e8\u72d7 \u2013 \u7ef4\u57fa\u767e\u79d1<\/span><\/i><\/a><\/p>\n<p><i><span style=\"font-weight: 400;\">\u770b\u95e8\u72d7\u662f\u4e00\u79cd\u4fdd\u62a4\u7cfb\u7edf\u514d\u53d7\u53ef\u80fd\u5bfc\u81f4\u7cfb\u7edf\u505c\u6b62\u54cd\u5e94\u7684\u8f6f\u4ef6\u6216\u786c\u4ef6\u6545\u969c\u5f71\u54cd\u7684\u8bbe\u5907\u3002\u9996\u5148\uff0c\u6211\u4eec\u5c06\u5e94\u7528\u7a0b\u5e8f\u5728\u770b\u95e8\u72d7\u8bbe\u5907\u4e0a\u767b\u8bb0\u3002\u770b\u95e8\u72d7\u5728\u7cfb\u7edf\u4e0a\u8fd0\u884c\u540e\uff0c\u8be5\u5e94\u7528\u7a0b\u5e8f\u5fc5\u987b\u5b9a\u671f\u5411\u770b\u95e8\u72d7\u8bbe\u5907\u53d1\u9001\u4fe1\u606f\u3002\u5982\u679c\u770b\u95e8\u72d7\u8bbe\u5907\u5728\u6307\u5b9a\u7684\u65f6\u95f4\u5185\u6ca1\u6709\u6536\u5230\u6b64\u4fe1\u53f7\uff0c\u5c31\u4f1a\u6267\u884c\u9002\u5f53\u7684\u884c\u52a8\u4ee5\u91cd\u542f\u673a\u5668\u6216\u91cd\u65b0\u542f\u52a8\u5e94\u7528\u7a0b\u5e8f\u3002<\/span><\/i><\/p>\n<p><span style=\"font-weight: 400;\">\u770b\u95e8\u72d7\u662f\u4e00\u79cd\u76d1\u89c6\u7cfb\u7edf\u662f\u5426\u6b63\u5e38\u8fd0\u884c\u7684\u529f\u80fd\u3002<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u8fd9\u6b21\u6240\u7528\u7684Raspberry Pi Model B+\u770b\u95e8\u72d7\u677f\u6709\u4e00\u4e2a\u5185\u7f6e\u7a0b\u5e8f\uff0c\u80fd\u591f\u63d0\u524d\u76d1\u63a7GPIO\uff0c\u56e0\u6b64\u5b89\u88c5\u975e\u5e38\u5bb9\u6613\u3002<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2><b>\u7528\u4e8eRaspberry Pi Model B+\u7684\u770b\u95e8\u72d7\u677f<\/b><\/h2>\n<div id=\"attachment_6347\" style=\"width: 710px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-6347\" class=\"size-full wp-image-6347\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2017\/09\/image003.jpg\" alt=\"raspberry pi watchdog\" width=\"700\" height=\"525\" srcset=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2017\/09\/image003.jpg 700w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2017\/09\/image003-300x225.jpg 300w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2017\/09\/image003-195x146.jpg 195w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2017\/09\/image003-50x38.jpg 50w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2017\/09\/image003-100x75.jpg 100w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\"><\/p>\n<p id=\"caption-attachment-6347\" class=\"wp-caption-text\">\u56fe 1<\/p>\n<\/div>\n<p><a href=\"https:\/\/international.switch-science.com\/catalog\/2254\/\" target=\"_blank\" rel=\"noopener noreferrer\"><i><span style=\"font-weight: 400;\">\u7528\u4e8eRaspberry Pi Model B+\u7684\u770b\u95e8\u72d7\u5b9a\u65f6\u5668\u677f<\/span><\/i><\/a><\/p>\n<p><i><span style=\"font-weight: 400;\">\u8be5IC\u5177\u6709\u5185\u7f6e\u5012\u8ba1\u65f6\u5668\u8d1f\u8d23\u76d1\u89c6Raspberry Pi\u7684GPIO\u3002Raspberry Pi\u4e0a\u7684\u8f6f\u4ef6\u4ee5\u56fa\u5b9a\u95f4\u9694\u5411GPIO\u53d1\u9001\u8109\u51b2\u4fe1\u53f7\uff0c\u4ee5\u91cd\u7f6eIC\u4e2d\u7684\u5b9a\u65f6\u5668\u3002<\/span><\/i><\/p>\n<p><i><span style=\"font-weight: 400;\">\u5982\u679cRaspberry Pi\u53d1\u751f\u9519\u8bef\uff0c\u6ca1\u6709\u53d1\u9001\u8109\u51b2\u4fe1\u53f7\uff0c\u770b\u95e8\u72d7\u4e0a\u7684\u5012\u8ba1\u65f6\u5668\u4e0d\u4f1a\u590d\u4f4d\u3002\u7136\u540e\uff0c\u7535\u8def\u677f\u4e0a\u7684IC\u5c06\u505c\u6b62\u4e3aRaspberry Pi\u4f9b\u7535\u5e76\u91cd\u542f\u4f9b\u7535\uff0c\u4ee5\u91cd\u65b0\u542f\u52a8Raspberry Pi\u3002<\/span><\/i><\/p>\n<p><span style=\"font-weight: 400;\">\u6211\u4eec\u5c31\u662f\u4f7f\u7528\u8be5\u770b\u95e8\u72d7\u677f\u3002\u867d\u7136\u6211\u5199\u7684\u662f\u201cRaspberry Pi Model B +\u201d\uff0c\u4f46\u662f\u8be5\u677f\u4e5f\u9002\u7528\u4e8eRaspberry Pi Model A+\u4ee5\u53caRaspberry Pi 2 Model B\u3002\u5728\u672c\u6559\u7a0b\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528\u7684\u662fRaspberry Pi 2 Model B\u3002<\/span><\/p>\n<p><a href=\"https:\/\/trac.switch-science.com\/wiki\/Watch_dog_for_RPi#no1\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"font-weight: 400;\">\u5982\u4f55\u4f7f\u7528Raspberry\u770b\u95e8\u72d7\u5b9a\u65f6\u5668<\/span><\/a><span style=\"font-weight: 400;\">\u8fd9\u7bc7\u6587\u7ae0\uff08\u65e5\u8bed\uff09\u63cf\u8ff0\u4e86\u4eca\u5929\u6240\u7528\u7684\u770b\u95e8\u72d7\u677f\u7684\u8be6\u7ec6\u4fe1\u606f\u3002\u4e0b\u6587\u4e2d\u7684\u5f88\u591a\u5185\u5bb9\u90fd\u4f1a\u53c2\u8003\u6b64\u6587\u7ae0\u3002<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2><b>\u8bbe\u7f6e\u770b\u95e8\u72d7\u677f<\/b><\/h2>\n<div id=\"attachment_6348\" style=\"width: 710px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-6348\" class=\"size-full wp-image-6348\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2017\/09\/image005.jpg\" alt=\"raspberry pi watchdog\" width=\"700\" height=\"525\" srcset=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2017\/09\/image005.jpg 700w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2017\/09\/image005-300x225.jpg 300w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2017\/09\/image005-195x146.jpg 195w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2017\/09\/image005-50x38.jpg 50w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2017\/09\/image005-100x75.jpg 100w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\"><\/p>\n<p id=\"caption-attachment-6348\" class=\"wp-caption-text\">\u56fe 2<\/p>\n<\/div>\n<p><span style=\"font-weight: 400;\">\u4e0e<\/span><a href=\"https:\/\/www.deviceplus.com\/how-tos\/raspberrypi-guide\/raspberry-pi-sense-hat-led\/\"><span style=\"font-weight: 400;\">Sense HAT<\/span><\/a><span style=\"font-weight: 400;\">\u4e00\u6837\uff0c\u5c06\u770b\u95e8\u72d7\u63d2\u5165Raspberry Pi\u7684GPIO\u5f15\u811a\u5373\u53ef\u3002\u5982\u679c\u60a8\u60f3\u8981\u56fa\u5b9a\u7535\u8def\u677f\uff0c\u8ba9\u8fde\u63a5\u66f4\u7262\u56fa\uff0c\u8bf7\u4f7f\u7528Raspberry Pi\u87ba\u4e1d\u548c\u57ab\u7247\uff0c\u6ca1\u6709\u95ee\u9898\u3002<\/span><\/p>\n<div id=\"attachment_6349\" style=\"width: 710px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-6349\" class=\"size-full wp-image-6349\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2017\/09\/image007.jpg\" alt=\"raspberry pi watchdog\" width=\"700\" height=\"525\" srcset=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2017\/09\/image007.jpg 700w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2017\/09\/image007-300x225.jpg 300w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2017\/09\/image007-195x146.jpg 195w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2017\/09\/image007-50x38.jpg 50w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2017\/09\/image007-100x75.jpg 100w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\"><\/p>\n<p id=\"caption-attachment-6349\" class=\"wp-caption-text\">\u56fe 3<\/p>\n<\/div>\n<p><span style=\"font-weight: 400;\">\u5982\u56fe3\u6240\u793a\uff0c\u8bf7\u7528DC\u63d2\u5934\u5c06\u7535\u6e90\u8fde\u81f3\u770b\u95e8\u72d7\u677f\u3002\u8be5DC\u8fde\u63a5\u5668\u5c06\u4e3a\u770b\u95e8\u72d7\u548cRaspberry Pi\u4e3b\u4f53\u4f9b\u7535\u3002<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">\u4ee5\u4e0b\u4e24\u70b9\u53ef\u80fd\u4f1a\u4ee4\u4eba\u56f0\u60d1\uff0c\u6240\u4ee5\u6211\u4eec\u4e8b\u5148\u6f84\u6e05\u4e00\u4e0b \u2026\u2026<\/span><\/p>\n<p><b>1. \u8bf7\u7528\u770b\u95e8\u72d7\u677f\u4e0a\u7684DC\u63d2\u5934\u63d0\u4f9b5V\u7535\u6e90\u3002<\/b><\/p>\n<p><span style=\"font-weight: 400;\">\u5c31\u50cf<\/span><a href=\"https:\/\/trac.switch-science.com\/wiki\/Watch_dog_for_RPi#no1\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"font-weight: 400;\">\u5982\u4f55\u4f7f\u7528Raspberry\u770b\u95e8\u72d7\u5b9a\u65f6\u5668<\/span><\/a><span style=\"font-weight: 400;\">\u4e2d\u63cf\u8ff0\u7684\u90a3\u6837\uff0c\u5e94\u4f7f\u7528\u770b\u95e8\u72d7\u677f\u4e0a\u7684DC\u63d2\u5934\u8fdb\u884c\u4f9b\u7535\u3002\u8fd9\u4e0e\u7528GPIO\u5f15\u811a\u4e3aSense HAT\u4f9b\u7535\u4e0d\u540c\u3002<\/span><\/p>\n<p><b>2. \u5207\u52ff\u4f7f\u7528Raspberry Pi\u81ea\u8eab\u7684\u7535\u6e90<\/b><\/p>\n<p><span style=\"font-weight: 400;\">\u7535\u6e90\u7531\u770b\u95e8\u72d7\u7684\u7684DC\u63d2\u5934\u63d0\u4f9b\uff0c\u4e0d\u80fd\u7528Raspberry Pi\u4e3b\u673a\u7684\u7535\u6e90\uff08microUSB\uff09\u4f9b\u7535\u3002\u4f7f\u7528\u5176\u4ed6\u7535\u6e90\u65e0\u6cd5\u91cd\u542fRaspberry Pi\uff0c\u5373\u4f7f\u770b\u95e8\u72d7\u8fd0\u884c\u6b63\u5e38\u3002<\/span><\/p>\n<p><em><span style=\"font-weight: 400;\">\u6211\u8d39\u4e86\u4e00\u756a\u82e6\u529f\u2014\u2014\u591a\u6b21\u53d8\u6362\u7535\u6e90\u2014\u2014\u624d\u641e\u6e05\u695a\u8fd9\u4e2a\u72b6\u51b5\uff01<\/span><\/em><\/p>\n<p>&nbsp;<\/p>\n<div id=\"attachment_6350\" style=\"width: 710px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-6350\" class=\"size-full wp-image-6350\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2017\/09\/image009.jpg\" alt=\"raspberry pi watchdog\" width=\"700\" height=\"525\" srcset=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2017\/09\/image009.jpg 700w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2017\/09\/image009-300x225.jpg 300w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2017\/09\/image009-195x146.jpg 195w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2017\/09\/image009-50x38.jpg 50w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2017\/09\/image009-100x75.jpg 100w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\"><\/p>\n<p id=\"caption-attachment-6350\" class=\"wp-caption-text\">\u56fe 4<\/p>\n<\/div>\n<p><span style=\"font-weight: 400;\">\u68c0\u67e5\u8fd0\u884c\u60c5\u51b5\u65f6\uff0cLED\u72b6\u6001\u6307\u793a\u706f\u5e94\u4eae\u8d77\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u4e3a\u4e86\u8282\u80fd\uff0cLED\u662f\u7184\u706d\u7684\uff0c\u4f46\u662f\u77ed\u63a5LED\u5f00\/\u5173\u8df3\u7ebf\u540eLED\u4f1a\u70b9\u4eae\u3002\u6211\u7528\u7684\u77ed\u63a5\u8df3\u9488\uff0c\u56fe\u7247\u7528\u7684\u662f\u77ed\u63a5\u8df3\u7ebf\u3002<\/span><\/p>\n<p><span style=\"font-weight: 400;\">LED\u7684\u70b9\u4eae\u9075\u5faa\u4ee5\u4e0b\u4e09\u79cd\u72b6\u6001\u3002\u5982\u679c\u53ea\u662f\u770b\u5230\u6570\u503c\uff08\u79d2\uff09\u63cf\u8ff0\uff0c\u6211\u4eec\u53ef\u80fd\u5f88\u96be\u60f3\u8c61\u76f8\u5e94\u7684\u6548\u679c\uff0c\u4f46\u662f\u5f53LED\u95ea\u70c1\u65f6\u60a8\u4f1a\u6ce8\u610f\u5230\u660e\u663e\u7684\u5dee\u5f02\u3002<\/span><\/p>\n<p><b><i>\u6bcf\u79cd\u72b6\u6001\u4e0b\u7684LED\u70b9\u4eae\u60c5\u51b5\uff1a<\/i><\/b><\/p>\n<ul>\n<li><i><span style=\"font-weight: 400;\">\u72b6\u6001\u4e3a WD_DEFAULT \u65f6\uff0c\u72b6\u6001 LED \u6bcf 2.56 \u79d2\u95ea\u70c1\u4e00\u6b21<\/span><\/i><\/li>\n<li><i><span style=\"font-weight: 400;\">\u72b6\u6001\u4e3a WD_Active \u65f6\uff0c\u72b6\u6001 LED \u6bcf 0.32 \u79d2\u95ea\u70c1\u4e00\u6b21<\/span><\/i><\/li>\n<li><i><span style=\"font-weight: 400;\">\u72b6\u6001\u4e3a WD_ReBoot \u65f6\uff0c\u72b6\u6001 LED \u6bcf 0.08 \u79d2\u95ea\u70c1\u4e00\u6b21<\/span><\/i><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2><b>\u770b\u95e8\u72d7\u7b80\u4ecb<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">\u5bf9\u4e8e\u672c\u6559\u7a0b\uff0c\u6211\u4eec\u5c06\u4f7f\u7528Raspberry Pi 2 Model B\u548c\u5e26\u6709PIXEL\u7684Raspbian Jessie\uff082016.11.25\u53d1\u5e03\uff09\u3002<\/span><\/p>\n<p><span style=\"color: white; font-weight: 400; background-color: black;\">sudo apt-get update<\/span><\/p>\n<p><span style=\"color: white; font-weight: 400; background-color: black;\">sudo apt-get upgrade<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u5c06Raspbian\u5199\u5165SD\u5361\u540e\uff0c\u50cf\u5f80\u5e38\u4e00\u6837\u8fd0\u884c\u4e0a\u8ff0\u547d\u4ee4\u3002<\/span><\/p>\n<div id=\"attachment_6351\" style=\"width: 710px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-6351\" class=\"size-full wp-image-6351\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2017\/09\/image011.jpg\" alt=\"raspberry pi watchdog\" width=\"700\" height=\"493\" srcset=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2017\/09\/image011.jpg 700w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2017\/09\/image011-300x211.jpg 300w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2017\/09\/image011-207x146.jpg 207w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2017\/09\/image011-50x35.jpg 50w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2017\/09\/image011-106x75.jpg 106w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\"><\/p>\n<p id=\"caption-attachment-6351\" class=\"wp-caption-text\">\u56fe5.\u770b\u95e8\u72d7\u7a0b\u5e8f\u72b6\u6001\u8f6c\u6362 \/\u00a9SwitchScience<\/p>\n<\/div>\n<p><span style=\"font-weight: 400;\">\u770b\u95e8\u72d7\u7684\u8fd0\u884c\u60c5\u51b5\u5982\u56fe5\u6240\u793a\u3002\u53ea\u662f\u5f00\u542f\u7535\u6e90\u5e76\u4e0d\u4f1a\u542f\u52a8\u770b\u95e8\u72d7\u3002\u9ed8\u8ba4\u72b6\u6001\u201c\u72b6\u6001LED\u6bcf2.56\u79d2\u95ea\u70c1\u4e00\u6b21\u201d\u7ee7\u7eed\u3002\u6709\u5173\u5982\u4f55\u6fc0\u6d3b\u770b\u95e8\u72d7\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u8bf7\u53c2\u8003<\/span><a href=\"https:\/\/trac.switch-science.com\/wiki\/Watch_dog_for_RPi#no1\"><span style=\"font-weight: 400;\">\u5982\u4f55\u4f7f\u7528Raspberry\u770b\u95e8\u72d7\u5b9a\u65f6\u5668<\/span><\/a><span style=\"font-weight: 400;\">\uff08\u65e5\u8bed\uff09\u3002\u76f8\u5173\u5185\u5bb9\u4f4d\u4e8e\u9875\u9762\u5e95\u90e8\u3002<\/span><\/p>\n<p><b><i>\u8981\u914d\u7f6eRaspberry Pi\uff0c\u6211\u4eec\u9700\u8981\u8fd0\u884c\u8fd9\u6837\u4e00\u4e2a\u7a0b\u5e8f\uff1a\u51c6\u5907\u597d\u542f\u52a8\u540e\uff0c\u4e3a\u76d1\u63a7\u7aef\u53e3\uff08\u9ed8\u8ba4\u4e3aGPIO 17\uff09\u81ea\u52a8\u751f\u6210\u4e00\u4e2a\u8109\u51b2\u4fe1\u53f7\u3002<\/i><\/b><\/p>\n<p><span style=\"font-weight: 400;\">\u8fd9\u975e\u5e38\u91cd\u8981\u3002\u6267\u884c\u6b64\u529f\u80fd\u7684\u6e90\u7a0b\u5e8f\u5982\u4e0b\u6240\u793a\uff1a<\/span><\/p>\n<p><a href=\"https:\/\/trac.switch-science.com\/wiki\/Watch_dog_for_RPi_Python_RPi\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"font-weight: 400;\">Raspberry Pi\u793a\u4f8b\u7a0b\u5e8f(Python)<\/span><\/a><span style=\"font-weight: 400;\"> \u2013 \u65e5\u8bed<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u8be5\u7a0b\u5e8f\u201c\u6bcf\u79d2\u5411GPIO 17\u8f93\u51fa\u4e00\u6b21\u8109\u51b2\u201d\u3002<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u4e3a\u4e86\u4e0e\u770b\u95e8\u72d7\u677f\u5bf9\u63a5\uff0c\u6211\u4eec\u5e94\u81ea\u52a8\u542f\u52a8\u4e00\u4e2a\u5411\u8be5GPIO\u63d0\u4f9b\u8109\u51b2\u7684\u7a0b\u5e8f\u3002\u8fd9\u6837\u505a\uff0c\u5373\u4f7fRaspberry Pi\u91cd\u65b0\u542f\u52a8\uff0c\u60a8\u4e5f\u53ef\u4ee5\u81ea\u52a8\u7ee7\u7eed\u4f7f\u7528\u770b\u95e8\u72d7\u529f\u80fd\u3002<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u8ba9\u6211\u4eec\u7528\u8fd9\u4e2a\u7a0b\u5e8f\u542f\u52a8\u770b\u95e8\u72d7\uff01<\/span><\/p>\n<p><span style=\"color: white; font-weight: 400; background-color: black;\">sudo nano blink17.py<\/span><\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-c\" data-lang=\"C\"><code>#!\/usr\/bin\/env python\n \nimport RPi.GPIO as GPIO\nimport time\n \nLEDPIN = 17\n \nGPIO.setwarnings(False)\n \nGPIO.setmode(GPIO.BCM)\nGPIO.setup(LEDPIN, GPIO.OUT)\n \nwhile True:\n    LEDon = GPIO.output(LEDPIN, 0)\n    time.sleep(0.5)\n    LEDoff = GPIO.output(LEDPIN, 1)\n    time.sleep(0.5)\n<\/code><\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>\u9996\u5148\uff0c\u5c06\u7a0b\u5e8f\u4fdd\u5b58\u5728\u4e00\u4e2a\u6587\u4ef6\u5939\u4e2d\uff0c\u7136\u540e\u7528\u4ee5\u4e0b\u547d\u4ee4\u6267\u884c\u3002<\/p>\n<p><span style=\"color: white; font-weight: 400; background-color: black;\">python blink17.py<\/span><\/p>\n<p><script type=\"text\/javascript\"><br \/>\n\tjstream_t3.PlayerFactoryIF.create({<br \/>\n\tb:\"eqa194obdo.eq.webcdn.stream.ne.jp\/www50\/eqa194obdo\/jmc_pub\/jmc_swf\/player\/\",<br \/>\n\tc:\"NDc3\",<br \/>\n\tm:\"NDE0\",<br \/>\n\ts:{<br \/>\n\t\thp:360,<br \/>\n\t\til:\"off\",<br \/>\n\t\trb:\"off\",<br \/>\n\t\tsn:\"f,t,g\",<br \/>\n\t\twp:640<br \/>\n\t}});<br \/>\n<\/script><\/p>\n<p><span style=\"font-weight: 400;\">\u7531\u4e8e\u770b\u95e8\u72d7\u5728\u68c0\u6d4b\u52305\u4e2a\u8109\u51b2\u65f6\u542f\u52a8\uff0c\u56e0\u6b64\u5728\u6b64\u7a0b\u5e8f\u4e2d\uff0c\u6267\u884c5\u79d2\u540e\uff0c<\/span><b>\u72b6\u6001LED\u6bcf0.32\u79d2\u95ea\u70c1\u4e00\u6b21<\/b><span style=\"font-weight: 400;\">\u3002\u4e4b\u540e\uff0c\u5982\u679c\u8d85\u8fc75\u79d2\u6ca1\u6709\u8109\u51b2\uff0c\u72b6\u6001LED\u4f1a\u53d8\u4e3a<\/span><b>\u6bcf0.08\u79d2\u95ea\u70c1\u4e00\u6b21<\/b><span style=\"font-weight: 400;\">\uff0c\u4e14\u91cd\u542f\u81ea\u52a8\u6267\u884c\u3002\uff08\u5728\u89c6\u9891\u4e2d\uff0c\u8be5\u8fc7\u7a0b\u901a\u8fc7[Ctrl]+[C]\u5f3a\u884c\u7ec8\u6b62\uff09\u3002<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2><b>\u81ea\u52a8\u91cd\u542f\u6d4b\u8bd5<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">\u5c06\u770b\u95e8\u72d7\u7a0b\u5e8f\u8bbe\u7f6e\u4e3a\u5f00\u673a\u8fd0\u884c\u975e\u5e38\u65b9\u4fbf\uff0c\u56e0\u4e3a\u7a0b\u5e8f\u5373\u4f7f\u5728\u81ea\u52a8\u91cd\u542f\u540e\u4e5f\u80fd\u8fd0\u884c\uff01<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u6211\u4eec\u8c03\u6574\u7a0b\u5e8f\u8fdb\u884c\u6d4b\u8bd5\uff0c\u5904\u7406\u65f6\u95f4\u4ec5\u8bbe\u4e3a30\u79d2\uff08\u56e0\u4e3a\u5982\u679c\u8fd9\u4e2a\u65f6\u95f4\u592a\u77ed\uff0c\u5f88\u96be\u91ca\u653ecron\uff0c\u5efa\u8bae\u81f3\u5c1130\uff09\u3002<\/span><\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-c\" data-lang=\"C\"><code>sudo nano blink17_30sec.py\n\n\n#!\/usr\/bin\/env python\n \nimport RPi.GPIO as GPIO\nimport time\n \nLEDPIN = 17\nSEC\t= 0\n \nGPIO.setwarnings(False)\n \nGPIO.setmode(GPIO.BCM)\nGPIO.setup(LEDPIN, GPIO.OUT)\n \nwhile SEC &lt; 30:\n    LEDon = GPIO.output(LEDPIN, 0)\n    time.sleep(0.5)\n    LEDoff = GPIO.output(LEDPIN, 1)\n    time.sleep(0.5)\n    SEC = SEC + 1\n    print SEC\n<\/code><\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">\u63a5\u4e0b\u6765\uff0c\u5728\u6388\u4e88\u6267\u884c\u6743\u9650\u540e\u5c06\u5176\u767b\u8bb0\u5230cron\u3002<\/span><\/p>\n<p><span style=\"color: white; font-weight: 400; background-color: black;\">sudo chmod 755 blink17_30sec.py<\/span><\/p>\n<p><span style=\"color: white; font-weight: 400; background-color: black;\">crontab -e<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u56e0\u4e3a\u6211\u4eec\u60f3\u5728\u201c\u542f\u52a8\u201d\u65f6\u6267\u884c\u5b83\uff0c\u6240\u4ee5\u6211\u4eec\u5e94\u6307\u5b9a\u201c@reboot\u201d\u3002\u6211\u5728\u6700\u540e\u4e00\u884c\u6dfb\u52a0\u4e86\u4ee5\u4e0b\u5185\u5bb9\u3002<\/span><\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-c\" data-lang=\"C\"><code>@reboot python \/home\/pi\/blink17_30sec.py\n<\/code><\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>\u91cd\u65b0\u52a0\u8f7dcron\u5e76\u91cd\u65b0\u542f\u52a8Raspberry Pi\u3002<\/p>\n<p><span style=\"color: white; font-weight: 400; background-color: black;\">sudo \/etc\/init.d\/cron restart<\/span><\/p>\n<p><span style=\"color: white; font-weight: 400; background-color: black;\">sudo reboot<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><script type=\"text\/javascript\"><br \/>\n\tjstream_t3.PlayerFactoryIF.create({<br \/>\n\tb:\"eqa194obdo.eq.webcdn.stream.ne.jp\/www50\/eqa194obdo\/jmc_pub\/jmc_swf\/player\/\",<br \/>\n\tc:\"NDc3\",<br \/>\n\tm:\"NDE1\",<br \/>\n\ts:{<br \/>\n\t\thp:360,<br \/>\n\t\til:\"off\",<br \/>\n\t\trb:\"off\",<br \/>\n\t\tsn:\"f,t,g\",<br \/>\n\t\twp:640<br \/>\n\t}});<br \/>\n<\/script><\/p>\n<p><span style=\"font-weight: 400;\">LED\u7684\u95ea\u70c1\u9891\u7387\u4f1a\u975e\u5e38\u76f4\u89c2\u5730\u544a\u8bc9\u6211\u4eec\u662f\u4f55\u79cd\u72b6\u6001\u3002<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u68c0\u67e5\u5b8c\u6bd5\u540e\uff0c\u6211\u4eec\u64a4\u6d88cron\u8bbe\u7f6e\u3002\u4ecb\u7ecd\u6b64\u529f\u80fd\u65f6\uff0c\u53ef\u4ee5\u901a\u8fc7cron\u66f4\u6539\u8981\u8c03\u7528\u7684\u7a0b\u5e8f\uff0c\u4ee5\u7ee7\u7eed\u65e0\u9650\u5236\u5730\u53d1\u9001\u8109\u51b2\uff08\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u4e3a\u95ea\u70c117.py\uff09\u3002<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2><b>\u603b\u7ed3<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">\u770b\u95e8\u72d7\u975e\u5e38\u6709\u5229\u4e8e\u8fdc\u7a0b\u8bbf\u95ee\u548c\u63a7\u5236\u3002Raspberry Pi\u7531\u4e8e\u67d0\u79cd\u539f\u56e0\u6b7b\u673a\u540e\uff0c\u60a8\u4e0d\u518d\u9700\u8981\u91cd\u65b0\u63d2\u62d4\u6765\u624b\u52a8\u91cd\u542fPi\u3002<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u7136\u800c\uff0c\u6211\u4eec\u6709\u5fc5\u8981\u6d4b\u8bd5\u51fa\u73b0\u9519\u8bef\u5904\u7406\u65f6\u8109\u51b2\u662f\u5426\u80fd\u591f\u6b63\u786e\u505c\u6b62\uff0c\u6216\u8005\u662f\u5426\u5b58\u5728\u4efb\u4f55\u51b2\u7a81\u3002\u5207\u52ff\u8fc7\u5206\u4f9d\u8d56\u770b\u95e8\u72d7\u3002\u8be5\u529f\u80fd\u5e94\u8be5\u4f5c\u4e3a\u4e00\u79cd\u201c\u4fdd\u9669\u201d\u4f7f\u7528\u3002<\/span><\/p>\n<div class=\"author-box-wrapper\">\n<div class=\"avatar-wrapper\">\n\t\t<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/micro.wfjydl.com\/deviceplus\/wp-content\/uploads\/2018\/08\/Device-Plus-logo-for-author-info-75x75.png\" width=\"64\" height=\"64\" alt=\"DevicePlus \u7f16\u8f91\u56e2\u961f\"><\/div>\n<div class=\"desc-wrapper\">\n<h5>DevicePlus \u7f16\u8f91\u56e2\u961f<\/h5>\n<div class=\"desc\">\n<p>\u8bbe\u5907\u5347\u7ea7\u7248\u9002\u7528\u4e8e\u6240\u6709\u70ed\u7231\u7535\u5b50\u548c\u673a\u7535\u4e00\u4f53\u5316\u7684\u4eba\u3002<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"\u8fd9\u7bc7\u6587\u7ae0\u6765\u6e90\u4e8eDevicePlus.com\u82f1\u8bed\u7f51\u7ad9\u7684\u7ffb\u8bd1\u7a3f\u3002 \u5728\u672c\u6559\u7a0b\u4e2d\uff0c\u6211\u4eec\u5c06\u4f7f\u7528\u4e00\u5757\u9002\u7528\u4e8eRaspberry Pi Model B+\u7684\u770b\u95e8\u72d7\u677f\u3002\u6ca1\u9519\uff0c\u8fd9\u662f\u4e00\u4e2a\u53ef\u4ee5\u5b89\u88c5\u5728Raspberry Pi\u4e0a\u7684\u770b\u95e8\u72d7\u677f\uff01 \u770b\u95e8\u72d7  [&hellip;]","protected":false},"author":3,"featured_media":21043,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1132],"tags":[],"class_list":["post-6934","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-raspberry"],"acf":[],"wps_subtitle":"","_links":{"self":[{"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/posts\/6934","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/comments?post=6934"}],"version-history":[{"count":3,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/posts\/6934\/revisions"}],"predecessor-version":[{"id":21044,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/posts\/6934\/revisions\/21044"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/media\/21043"}],"wp:attachment":[{"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/media?parent=6934"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/categories?post=6934"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/tags?post=6934"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}