GithubHelp home page GithubHelp logo

joeslice / nodemcu-internet-outage-monitor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from supermakesomething/nodemcu-internet-outage-monitor

0.0 0.0 0.0 19 KB

Code for the NodeMCU internet outage monitor

C++ 100.00%

nodemcu-internet-outage-monitor's Introduction

NodeMCU Internet Outage Detector

by: Alex - Super Make Something

date: July 29, 2020

NodeMCU code and setup instructions for the internet outage detector shown here.

If you need to pick up a NodeMCU for this build and want to support this project, you can purchase one through this Amazon Affiliate link: https://amzn.to/2X7RK5m

If you like projects like these, consider subscribing to the Super Make Something YouTube page here for more cool builds!

Introduction

With COVID-19 making telework the new norm, having access to the internet is extremely important. Unfortunately, some ISPs are better than others, which may eventually make you file a complaint with an organization like the FCC to try to resolve your connectivity issues and improve your internet service. Having data about outages helps you to make a better case that your ISP is not delivering the services you are paying for, which is why I created a tiny internet outage detector using a NodeMCU microcontroller.

The code simply pings Google approximately every 30 seconds (using the delay() function), and fetches the real-world time that it was able to last connect to the site from an NTP server. If internet connectivity is interrupted, the last time that the NodeMCU was able to sucessfully ping Google is logged, after which the NodeMCU will continue to try to reach Google until it is able to. Once the NodeMCU successfully pings Google again, it sends an e-mail with the last successful connection time and the time that internet connectivity was restored to the recipient specified in the code through the SMTP2GO service. (Instructions about how to set up a free SMTP2GO account and how to encode your username and password to the correct format to use with the code can be found here.) If no outage occurs within approximately 24 hours (2880 loops through the code, once every ~30 seconds), the NodeMCU will send an e-mail to the user letting them know that there were no outages within that timeframe.

Installation instructions and required libraries

To program the NodeMCU using the Arduino IDE, the following link must be added to the "Additional Boards Manager URLs" field under the "Preferences" Menu: http://arduino.esp8266.com/stable/package_esp8266com_index.json. After this, install esp8266 platform support using the "Boards Manager" in the Arduino IDE. (Installation instructions here.)

The code uses the following libraries:

  • ESP8266 Arduino Core: Installed via the "Library Manager" in the Arduino IDE. Installation instructions here.
  • ESP8266Ping: Place the unzipped folder into the Arduino -> libraries directory.
  • NTPClient: Unzip the file, rename the folder NTPClient-master to NTPClient and place it the Arduino -> libraries directory.

Configuration instructions

Replace the following items in the code to match your setup:

  • const char* ssid: the SSID of your WiFi network.
  • const char* password: your WiFi network password.
  • const String url: the website to ping.
  • const String ENCODED_USERNAME: encoded SMTP2GO username.
  • const String ENCODED_PASSWORD: encoded SMTP2GO password.
  • Recipient e-mail address in lines 216 and 228.
  • Sender e-mail address in lines 210 and 231.

Conclusion

Hopefully you found this quick project useful! If you enjoyed this tutorial, consider subscribing to Super Make Something on YouTube here for more cool builds! If you really liked this tutorial and want to support future projects, you can become a patron on Patreon or buy me a coffee.

If you have any questions or comments, I can most easily be reached on Twitter or Instagram.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.