{"id":38,"date":"2023-04-05T20:43:04","date_gmt":"2023-04-05T20:43:04","guid":{"rendered":"https:\/\/csguy.org\/technotes\/?p=38"},"modified":"2023-04-05T20:43:06","modified_gmt":"2023-04-05T20:43:06","slug":"internet-monitor","status":"publish","type":"post","link":"https:\/\/csguy.org\/technotes\/internet-monitor\/","title":{"rendered":"Internet Monitor"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">This sketch monitors the web via wifi and resets the modem if the network is unavailable for an extended period of time<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/\n\/\/ESP8266 NodeMCU CP2102 ESP-12E Development Board with 1306 OLED display (128x32)\n\/\/\n#include \"setup.h\" \n\nvoid setup() {pinMode(16\/*D0 (LED1) *\/,OUTPUT);    pinMode(2\/*D4 (LED2) *\/,OUTPUT); \n              pinMode(15\/*D8 (speaker) *\/,OUTPUT); pinMode(0\/*D3 (relay)*\/,OUTPUT);\n              display.begin(SSD1306_SWITCHCAPVCC,0x3C); display.dim(true); \n              display.setTextSize(2); display.setTextColor(WHITE); show; dw(0,LOW); \n              delay(onemin*2); }\n              \nvoid loop()  {noTone(15); fails=0; dw(0,LOW); \n             if (WiFi.status() != WL_CONNECTED) {\n                clr; display.setCursor(11,10); display.print(\"WiFiScan!\"); show;\n                WiFi.begin(ssid,pswd); while(WiFi.status()!=WL_CONNECTED) {beep();}}\n\n             if (j++ > sites) {j=0;} dw(16,HIGH); dw(2,HIGH); \n             \n             if (client.connect(\"www.\"+String(site[j])+\".com\",80)) { fails=0; \n                display.invertDisplay(false);                                                                      \n                for ( int m=1; m&lt;50; m++ ) { \n                    clr; display.setCursor(6,15); display.print(String(site[j]));\n                    for ( int i=1; i&lt;100; i++ ) {\n                        display.fillCircle(i,4,4,SSD1306_WHITE);   show; delay(6);\n                        display.fillCircle(i,4,4,SSD1306_INVERSE); show; }}}\n             \n                else {clr; display.setCursor(11,10); display.print(\"INTERNET!\"); show;\n                      for ( int i=1; i&lt;10; i++ ) {beep();} \n                      clr; display.invertDisplay(false); show;  \n                      fails++; if (fails > 10) {fails=10;} delay(onemin*fails);     \n                      display.setCursor(11,10); display.print(\"ModemIPL!\"); show;\n                      dw(0,HIGH); delay(onemin\/5); dw(0,LOW); delay(onemin);}}\n                      \n\n\n...... this is setup.h .......\n\n\/\/#include &lt;Wire.h> \n#include &lt;ESP8266WiFi.h>\n#include &lt;Adafruit_SSD1306.h>\n#define onemin 60000\n#define sites 12\n#define show display.display()\n#define clr display.clearDisplay()\n#define dw digitalWrite\nWiFiClient client;\nAdafruit_SSD1306 display(128,32,&amp;Wire);\nconst char* ssid=\"net\"; const char* pswd=\"wireless\"; int j=0; int x=0; int z=0; long ipldelay=0; int fails;\nconst char* site[]={\"FACEBOOK\",\"MICROSOFT\",\"GOOGLE\",\"YAHOO\",\"AMAZON\",\"EBAY\",\"APPLE\",\"TWITTER\",\"DELL\",\"AOL\",\"HP\",\"IBM\",\"ORACLE\",\"CISCO\"};\n\nvoid beep() {tone(15,2000); display.invertDisplay(x=!x); \n            for ( int i=1; i&lt;10; i++ )  { dw(16,z); dw(2,z=!z); delay(50); } noTone(15);}<\/pre>\n\n\n\n<!--more-->\n","protected":false},"excerpt":{"rendered":"<p>This sketch monitors the web via wifi and resets the modem if the network is unavailable for an extended period of time \/\/ \/\/ESP8266 NodeMCU CP2102 ESP-12E Development Board with 1306 OLED display (128&#215;32) \/\/ #include &#8220;setup.h&#8221; void setup() {pinMode(16\/*D0 (LED1) *\/,OUTPUT); pinMode(2\/*D4 (LED2) *\/,OUTPUT); pinMode(15\/*D8 (speaker) *\/,OUTPUT); pinMode(0\/*D3 (relay)*\/,OUTPUT); display.begin(SSD1306_SWITCHCAPVCC,0x3C); display.dim(true); display.setTextSize(2); display.setTextColor(WHITE); show; [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[1],"tags":[],"class_list":["post-38","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Internet Monitor - Tech Notes<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/csguy.org\/technotes\/internet-monitor\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Internet Monitor - Tech Notes\" \/>\n<meta property=\"og:description\" content=\"This sketch monitors the web via wifi and resets the modem if the network is unavailable for an extended period of time \/\/ \/\/ESP8266 NodeMCU CP2102 ESP-12E Development Board with 1306 OLED display (128x32) \/\/ #include &quot;setup.h&quot; void setup() {pinMode(16\/*D0 (LED1) *\/,OUTPUT); pinMode(2\/*D4 (LED2) *\/,OUTPUT); pinMode(15\/*D8 (speaker) *\/,OUTPUT); pinMode(0\/*D3 (relay)*\/,OUTPUT); display.begin(SSD1306_SWITCHCAPVCC,0x3C); display.dim(true); display.setTextSize(2); display.setTextColor(WHITE); show; [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/csguy.org\/technotes\/internet-monitor\/\" \/>\n<meta property=\"og:site_name\" content=\"Tech Notes\" \/>\n<meta property=\"article:published_time\" content=\"2023-04-05T20:43:04+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-04-05T20:43:06+00:00\" \/>\n<meta name=\"author\" content=\"barry hills\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"barry hills\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/csguy.org\\\/technotes\\\/internet-monitor\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/csguy.org\\\/technotes\\\/internet-monitor\\\/\"},\"author\":{\"name\":\"barry hills\",\"@id\":\"https:\\\/\\\/csguy.org\\\/technotes\\\/#\\\/schema\\\/person\\\/89e2d600fe21bcb92d502289e27831a4\"},\"headline\":\"Internet Monitor\",\"datePublished\":\"2023-04-05T20:43:04+00:00\",\"dateModified\":\"2023-04-05T20:43:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/csguy.org\\\/technotes\\\/internet-monitor\\\/\"},\"wordCount\":24,\"commentCount\":0,\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/csguy.org\\\/technotes\\\/internet-monitor\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/csguy.org\\\/technotes\\\/internet-monitor\\\/\",\"url\":\"https:\\\/\\\/csguy.org\\\/technotes\\\/internet-monitor\\\/\",\"name\":\"Internet Monitor - Tech Notes\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/csguy.org\\\/technotes\\\/#website\"},\"datePublished\":\"2023-04-05T20:43:04+00:00\",\"dateModified\":\"2023-04-05T20:43:06+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/csguy.org\\\/technotes\\\/#\\\/schema\\\/person\\\/89e2d600fe21bcb92d502289e27831a4\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/csguy.org\\\/technotes\\\/internet-monitor\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/csguy.org\\\/technotes\\\/internet-monitor\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/csguy.org\\\/technotes\\\/internet-monitor\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/csguy.org\\\/technotes\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Internet Monitor\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/csguy.org\\\/technotes\\\/#website\",\"url\":\"https:\\\/\\\/csguy.org\\\/technotes\\\/\",\"name\":\"Tech Notes\",\"description\":\"Sharing the tech\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/csguy.org\\\/technotes\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/csguy.org\\\/technotes\\\/#\\\/schema\\\/person\\\/89e2d600fe21bcb92d502289e27831a4\",\"name\":\"barry hills\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e7df4c371d55904f1d858a9d27549d002b93713cd2f13d672c3c0898efcb70b4?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e7df4c371d55904f1d858a9d27549d002b93713cd2f13d672c3c0898efcb70b4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e7df4c371d55904f1d858a9d27549d002b93713cd2f13d672c3c0898efcb70b4?s=96&d=mm&r=g\",\"caption\":\"barry hills\"},\"url\":\"https:\\\/\\\/csguy.org\\\/technotes\\\/author\\\/barry\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Internet Monitor - Tech Notes","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/csguy.org\/technotes\/internet-monitor\/","og_locale":"en_US","og_type":"article","og_title":"Internet Monitor - Tech Notes","og_description":"This sketch monitors the web via wifi and resets the modem if the network is unavailable for an extended period of time \/\/ \/\/ESP8266 NodeMCU CP2102 ESP-12E Development Board with 1306 OLED display (128x32) \/\/ #include \"setup.h\" void setup() {pinMode(16\/*D0 (LED1) *\/,OUTPUT); pinMode(2\/*D4 (LED2) *\/,OUTPUT); pinMode(15\/*D8 (speaker) *\/,OUTPUT); pinMode(0\/*D3 (relay)*\/,OUTPUT); display.begin(SSD1306_SWITCHCAPVCC,0x3C); display.dim(true); display.setTextSize(2); display.setTextColor(WHITE); show; [&hellip;]","og_url":"https:\/\/csguy.org\/technotes\/internet-monitor\/","og_site_name":"Tech Notes","article_published_time":"2023-04-05T20:43:04+00:00","article_modified_time":"2023-04-05T20:43:06+00:00","author":"barry hills","twitter_card":"summary_large_image","twitter_misc":{"Written by":"barry hills","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/csguy.org\/technotes\/internet-monitor\/#article","isPartOf":{"@id":"https:\/\/csguy.org\/technotes\/internet-monitor\/"},"author":{"name":"barry hills","@id":"https:\/\/csguy.org\/technotes\/#\/schema\/person\/89e2d600fe21bcb92d502289e27831a4"},"headline":"Internet Monitor","datePublished":"2023-04-05T20:43:04+00:00","dateModified":"2023-04-05T20:43:06+00:00","mainEntityOfPage":{"@id":"https:\/\/csguy.org\/technotes\/internet-monitor\/"},"wordCount":24,"commentCount":0,"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/csguy.org\/technotes\/internet-monitor\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/csguy.org\/technotes\/internet-monitor\/","url":"https:\/\/csguy.org\/technotes\/internet-monitor\/","name":"Internet Monitor - Tech Notes","isPartOf":{"@id":"https:\/\/csguy.org\/technotes\/#website"},"datePublished":"2023-04-05T20:43:04+00:00","dateModified":"2023-04-05T20:43:06+00:00","author":{"@id":"https:\/\/csguy.org\/technotes\/#\/schema\/person\/89e2d600fe21bcb92d502289e27831a4"},"breadcrumb":{"@id":"https:\/\/csguy.org\/technotes\/internet-monitor\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/csguy.org\/technotes\/internet-monitor\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/csguy.org\/technotes\/internet-monitor\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/csguy.org\/technotes\/"},{"@type":"ListItem","position":2,"name":"Internet Monitor"}]},{"@type":"WebSite","@id":"https:\/\/csguy.org\/technotes\/#website","url":"https:\/\/csguy.org\/technotes\/","name":"Tech Notes","description":"Sharing the tech","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/csguy.org\/technotes\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/csguy.org\/technotes\/#\/schema\/person\/89e2d600fe21bcb92d502289e27831a4","name":"barry hills","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/e7df4c371d55904f1d858a9d27549d002b93713cd2f13d672c3c0898efcb70b4?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/e7df4c371d55904f1d858a9d27549d002b93713cd2f13d672c3c0898efcb70b4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e7df4c371d55904f1d858a9d27549d002b93713cd2f13d672c3c0898efcb70b4?s=96&d=mm&r=g","caption":"barry hills"},"url":"https:\/\/csguy.org\/technotes\/author\/barry\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/csguy.org\/technotes\/wp-json\/wp\/v2\/posts\/38","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/csguy.org\/technotes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/csguy.org\/technotes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/csguy.org\/technotes\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/csguy.org\/technotes\/wp-json\/wp\/v2\/comments?post=38"}],"version-history":[{"count":1,"href":"https:\/\/csguy.org\/technotes\/wp-json\/wp\/v2\/posts\/38\/revisions"}],"predecessor-version":[{"id":39,"href":"https:\/\/csguy.org\/technotes\/wp-json\/wp\/v2\/posts\/38\/revisions\/39"}],"wp:attachment":[{"href":"https:\/\/csguy.org\/technotes\/wp-json\/wp\/v2\/media?parent=38"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/csguy.org\/technotes\/wp-json\/wp\/v2\/categories?post=38"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/csguy.org\/technotes\/wp-json\/wp\/v2\/tags?post=38"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}