Git Product home page Git Product logo

boazf / iwg Goto Github PK

View Code? Open in Web Editor NEW
18.0 4.0 4.0 42.8 MB

Arduino Internet Watchdog Device. It will check for Internet connectivity and if it is lost, it will restart your router and/or modem. Includes HTML interface for controlling, monitoring and getting recovery reports.

License: Apache License 2.0

C++ 82.30% C 1.18% CSS 1.74% HTML 14.77%
arduino internet recovery-service recovery recovery-tools sd-card internet-connectivity modem ping esp32

iwg's Introduction

Arduino Internet Watchdog Device

How many times have you lost internet connectivity, then you had to go to your router and/or modem, disconnect it/them from power, wait a while, reconnect and wait for internet connectivity to resume? Or worth, how many times were you not at home/office and you wanted to remotely connect to your computer at home/office, but there is no internet connectivity at the remote end and there is no one there to recover it? If the answer is too many times, this project is for you! This project will do it all by it self on the spot whenever internet connectivity is lost and practically you'll have continuous internet connectivity whether you're at home or not.

Main Features

  • Automatically recovers internet connectivity.
  • Supports recovering of router and modem as two separate devices or a single combined device.
  • Supports recovering of an access point.
  • Highly configurable.
  • Supports HTML interface for controlling, configuring and monitoring the device.
  • Supports either WiFi or Wired (w5500) Ethernet connection.
  • Supports manual control using LED indicators and pushbuttons.
  • Includes EasyEDA elecrical diagram, PCB design and packaging design.
This project is intended to run on ESP32 with SD card reader and optionally a wired ethernet adapter. The code is developed using platformio in visual studio code.

What it does is basically periodcally ping a server on the internet and optionally a local address on the LAN. If ping fails, it switches the router power to off and then on after several seconds. Then it waits for internet connectivity to resume. If internet connectivity is not resumed after some time, it switches the modem power to off and then on after several seconds. Then it waits for internet connectivity to resume. If internet connectivity is not resume, it goes again through the recovery attempt cycles until internet connectivity resumes, or maximum recovery cycles exceeded.

It is also possible to configure the device to periodically restart the router and/or the modem at a certain time, once in every 24 hours. This should usually be done during the night when there is low or no Internet usage. This usually prevent the need to recover the devices during the day which might interrupt connectivity for some time.

There are quite a few configurable parameters to this software, like name of server on the internet to ping, an optional alternative internet server to ping if the ping to the first server failed. Also the time for power disconnect and waiting time for connection to resume are configurable and more.

There is also an implementation of a web (HTML) site that is used as a human interface for monitoring, controlling and configuring the software. The web site also has a page for reporting recoveries history. For example, read about the Control Page in the wiki.

The files in the SD directory should be (tree) copied to an SD card and be placed in the SD card reader.

Edit the content of file config.txt on the SD card. The content is pretty much self-explanatory. The TimeServer parameter is used for setting the server name used for getting the current GMT time using NTP protocol. The TimeZone parameter is used to set the local time. The value is in minutes and can also be negative. DST is number of minutes to add to the time during daylight saving time. Then there are parameters for setting Ethernet. The code uses static IP address so the site address is always the same. Then you can also set the pin numbers for switching the router and modem power using relays. For more elaborated information see CONFIG.TXT wiki page.

The project is designed so that it is possible to connect to the LAN using the ESP32's WiFi, or using a wired Ethernet adapter. In case WiFi is used, then the configuration file should also contain the SSID and password to connect to the LAN.

There are also four pushbuttons with a LED in each of them. the pushbuttons are used to initiate connectivity checks and recovery cycles manually. The LEDs are used to report the status of the device, such as normal status when imternet is available, or whether a recovery cycle is on-going. For more information see Controlling the Device Manually wiki page.

The HTML pages are using bootsrap 3 libraries in order to produce nice looking responsive pages. The bootstrap libraries were renamed to names that conform to 8.3 file names (e.g., bstrap.js). This was done because the project started on a mega2560 board and the only SD library that I had there supported only 8.3 file names. After transferring to ESP32, I could use longer file names, but I left it as it was. Also jquery libraries are used by the JavaScript code. All required jquery libraries were merged to one single library (jqcombo.js) in order to reduce page load time and sockets consumption.

For much more information read the Wiki.

iwg's People

Contributors

boazf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

iwg's Issues

Bad history record

After power outage at the entire home. The router initiates communication with the box, but GMT time still cannot be obtained. This happens because the modem did not establish connection yet. So the NTP server is still not reachable. The recovery control realize that there is no internet connectivity and starts recovery cycles. Since GMT time is not available, the history record contains bad time: 1/1/1970...

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.