LAN/Network Monitor

14,900

175

43

With the ever increasingly use of internet devices, or as it is know, IoT, more household devices are being connected to the network. With all the new IoT devices, our houses become more "smart", Everything can be automated. But there is a downside to all of this.

The first problem is that loosing internet connectivity, renders most of our IoT devices useless. For example, my house is fitted with several Sonoff devices, as well as IoT Smart Timers to control, to name only a few, the following:

  • Pool Pump
  • Pool Water Filler
  • Dog Water Filler
  • Pool Gate Alarm
  • Several lights

The above devices all rely on time to function correct, which is normally available via the internet. This is the first problem I experienced with loss of internet connectivity. To ensure that my IoT devices can still function without internet connectivity, I had to install a NTP Time Server on my local network.

The second problem having a lot of IoT devices, is that most of these devices connects to the local network via WiFi. Although a great option, WiFi has limited range in a normal house, and thus multiple WiFi routers or WiFi Range Extenders are installed to get good coverage. The end result is then multiple IoT devices connected to various WiFi access points throughout the house.

The third problem is that most of the IoT devices are installed out of sight. In the event of a fault on the IoT device, or loss of network connectivity to the device, we will only realize it once the function controlled by the IoT device fails. For instance, with my pool pump running during working hours when I am not at home, I will only notice the failure after several days, when the pool becomes dirty.

The solution is simple, we all monitor our IoT devices once in a while by connecting to them, or by looking at the IoT devices every day or two.

OR, build a new IoT device, that will monitor all the IoT devices . . . . . .

This is exactly what this WiFi connected LAN/Network Monitor does.

Using simple "high-bright" LEDs, and a LCD display, network faults can be easily seen and identified without the need to connect or inspecting each device.

Step 1: The Circuit Diagram

To connect to the local LAN/Network, network connectivity via WiFi is obtained using a Wemos D1 mini. The D1 Mini is then used to ping each of the IoT devices at regular intervals,

The circuit uses the minimum number of components.

  • Wemos D1 mini or equivalent
  • 16 x 2 LCD Display with back light.
  • I2C module for the LCD display
  • Three LEDs
  • Four resistors
  • Button

Building the circuit on strip board is quick and simple.

Apart from the LCD Display, three high-bright LEDs are used to indicate the system status.

  • Red LED to indicate loss of internet connectivity.
  • Red LED to indicate loss of connectivity of one of the IoT devices
  • Green LED to indicate that the LAN/Network Monitor is active (yes, this device must also be monitored).

Step 2: Programming the Wemos D1 Mini

Programming the D1 Mini is straight forward, as it has an on-board USB programming connector.

Simply upload the code into the Arduino IDE, and compile the sketch.

Once the sketch is compiled, upload the sketch to the D1 Mini.

N O T E

I removed ALL of my libraries, and determined that only the following libraries are required to compile:
#include //(might be part of the esp8266 board manager) #include #include #include #include #include //(included as part of IDE) #include //(included as part of IDE)

I have uploaded them under Step 2 again.

I use Arduino IDE Version 1.8.5

Under Additional Boards Manager URL (File/Preferences), I have the following entries: http://digistump.com/package_digistump_index.json https://raw.githubusercontent.com/damellis/attiny/... http://arduino.esp8266.com/stable/package_esp8266c...

Under Tools/Boards/Boards Manager, I have the following: esp8266 by ESP8266 Community Version 2.1.0

Hope this info will assist you.

Regards, Eric

Step 3: Connect the LAN/Network Monitor to Your WiFi

Power up the LAN/Network Monitor

  • The green LED will start to flash, and display will show "Connect to WiFi.
  • Within 10 seconds, press the config button.
  • The display will also show "Setup Network"
  • The LAN/Network Monitor is now set up as a WiFi Access Point.

Next, using a smartphone or PC, go to the WiFi connection option.

  • You should see a new open network called "Network Monitor".
  • Connect to the "Network Monitor" network.

Open up your web browser.

In the address bar, enter 192.168.4.1. This is the default IP address of the LAN/Network Monitor. The WiFiManager screen will appear.

  • Select "Configure WiFi".
  • A list with all the available WiFi access points will appear.
  • Select the access point you want to connect to.
  • Enter the WiFi password for the selected access point.
  • Enter the IP Address for the LAN/Network Monitor.
  • Enter your Gateway IP address.
  • Lastly, enter the Subnet Mask.
  • Press "save".
  • Your browser will indicate that the new settings were save.
  • Your smartphone/PC will automatically disconnect from the "Network Monitor" WiFi access point.
  • Power down, and restart the NetMonitor.
  • After connecting to your local network, the LCD Screen will indicate "Connected", and shortly afterwards give the LAN and Internet status.

The LAN/Network Monitor should now be connected to your local network.device

Step 4: Set Up the Local Devices to Be Monitored

It is now time to set up the local network devices that needs to be monitored. Using your browser, enter the IP address of the LAN/Network Monitor.

  • The LAN/Network Monitor web interface will open,
  • Click on "Local Network".tab.
  • Enter a short name, and the IP address for each device you want to monitor.
  • Device can be individually enabled/disabled with the tick-mark.
  • When done, click "Save".

When any of the devices being monitored, does not reply, the "LAN Fault" LED will come on.

The LCD screen will also scroll through the devices not found, displaying the name of each device for 2 seconds.

The current connection status can also be viewed using the web interface.

Step 5: Set Up Internet Connectivity Check

The LAN/Network Monitor can also be used to monitor your internet connectivity.

  • Click on the "Internet" tab.
  • Enter a description, and the website of up to 5 internet sites you want to use to monitor for connectivity.
  • Internet sites can be individually enabled/disabled with the tick-mark.
  • Once done, click "Save".

! NOTE !

The internet sites are not monitored independently. If any one of the internet sites reply when "pinged", internet connectivity will show healthy. When all of the internet sites fail to reply, the "WWW Fault" LED will come on.

Step 6: Configure the Monitor

Under the "Config" tab, the local network and internet settings can be changed independently.

  • Select the best number of scans (or pings) to give reliable feedback. Remember, some devices will not reply to ping commands each and every time.
  • You can also select the time interval between scans (or pings).
  • For my local IoT devices, I have found that 5 pings, every minute, works the best, and I do not get false warnings.
  • The internet sites works well with 5 sites being pinged once a minute. At least one of the sites always reply.

The LCD backlight can be also be set to indicate the status of your network. Apart from the "WWW Fault" and "LAN Fault" LEDs, the LCD backlight can be used to make connectivity problems more visible without the need to read the screen.

Once configured correctly, the LAN/Network Monitor should be placed in a visible location.

Step 7: 3D Printer to the Rescue.

I started building the project using one of my 60 x 110mm project boxes. After cutting out the holes for the LCD display, I noticed that after I added the I2C module to the display, the depth of the box no longer provide space for the circuit board. I needed about 10 mm more depth.

Using Fusion 360, I created a new cover, with the cut-out for the LCD display, and printed it on my Velleman 8200 3D Printer using 3mm filament.

I have included the STL as well as Fusion 360 files for reference.

Share

    Recommendations

    • Tape Contest

      Tape Contest
    • Trash to Treasure

      Trash to Treasure
    • Arduino Contest 2019

      Arduino Contest 2019

    43 Discussions

    0
    None
    dsutherland

    24 days ago

    Greetings fellow South African !
    Thanks for this brilliant project as well as your IOT timer.
    I built something similar to monitor my home brew beer fermentation chamber.
    Will be building your LAN monitor soon.
    Regards Dave

    0
    None
    WahyuW22

    5 weeks ago

    Why does my LCD not display text

    0
    None
    WahyuW22

    2 months ago

    If the ip from wifi LAN is dhcp, what can it do? And if the target device that is monitored has dhcp ip, how is that?

    0
    None
    Eric BrouwerWahyuW22

    Reply 3 months ago

    Hi
    You can download the ino file as well as the libraries under Step 2.

    Regards, Eric

    0
    None
    WahyuW22Eric Brouwer

    Reply 2 months ago

    If the ip from wifi LAN is dhcp, what can it do? And if the target device that is monitored has dhcp ip, how is that?

    0
    None
    iflyj3

    3 months ago

    I can't get a WiFi connection without a password. The cpp module WiFiManager.cpp has code to detect a NULL password. However it does not seem to work.
    I am not WiFi knowledgeable enough to trouble shoot the problem.
    Any suggestions?

    2 replies
    0
    None
    Eric Brouweriflyj3

    Reply 3 months ago

    Yes, you need to connect to your local WiFi network using your network password. Follow the instructions under Step 3 to connect to your WiFi.

    Remember, once you connect to your local WiFi, you need to specify your own IP address for the LAN Monitor, and the IP must be in the same range as your local network.

    Regards, Eric

    0
    None
    vyelland

    Question 2 months ago on Introduction

    Could you increase the number of entries on the Local LAN Config Page to 50 as I find 20 not enough.

    Thanks

    0
    None
    tfx0404

    Question 3 months ago

    Thanks for the project. I an having problem. I have gotten to the Network Monitor then Select "Configure WiFi". I do not know what addresses for the following:
    • Enter the IP Address for the LAN/Network Monitor.
    • Enter your Gateway IP address.
    • Lastly, enter the Subnet Mask.
    0
    None
    Jens1968

    4 months ago

    I got the monitor up and running. I only come to the Wifi Configurations page. There I give the IP from
    Network Monitor 192.168.1.20, IP from the router 192.168.1.1,
    Sub 255.255.255.0 on. After input of the password, I then save. Then the display shows Connected and jumps to LAN: Healthy. The Wifi connection is disconnected and the network monitor is no longer visible in the wifi list. Unfortunately not accessible via the IP address. Only after a restart, I can reach the network monitor again via Wifi, but then come back only on the Config page. unfortunately I do not come to Step 4. Help, what am I doing wrong?

    *WM: Already connected. Bailing out.
    {
    "ip": "192.168.1.20",
    "gateway": "192.168.1.1",
    "subnet": "255.255.255.0"
    }Should now be connected to the network
    *WM: freeing allocated params!


    1 reply
    0
    None
    Eric BrouwerJens1968

    Reply 3 months ago

    Hi
    I was unable to replicate your problem with my Wemos D1 minis. However, I have made some changes to the way the default settings are saved.

    I have uploaded a new version under Step 2, please see if this solves your problem.

    Regards, Eric

    1
    None
    lionelrees

    4 months ago

    Thank you for a very useful project. I still have one small issue. When I turn the circuit off and on it does not seem to be re- connecting to the network. If I got back and do a setup and save all is OK. Any help you can give will be most appreciated.
    Thanks,
    LR

    1 reply
    0
    None
    Eric Brouwerlionelrees

    Reply 3 months ago

    Hi
    I was unable to replicate your problem with my Wemos D1 minis. However, I have made some changes to the way the default settings are saved.

    I have uploaded a new version under Step 2, please see if this solves your problem.

    Regards, Eric

    0
    None
    supermartuk

    Question 4 months ago

    Hiya, I can't get this to compile, I get 'class IPAddress' has no member named 'from string'. Can I just put my own hard values for the wifiManager.setSTAStaticIPconfig call? Ps until I expanded the wiring diagram I did not notice that I also needed a diode (didn't have one in stock) so had to wait for the parts again as you don't list it this.

    1 answer
    0
    None
    Eric Brouwersupermartuk

    Answer 4 months ago

    Hi

    I removed ALL of my libraries, and determined that only the following libraries are required to compile:
    #include <FS.h> //(might be part of the esp8266 board manager)
    #include <ArduinoJson.h>
    #include <ESP8266Ping.h>
    #include <LiquidCrystal_I2C.h>
    #include <WiFiManager.h>
    #include <EEPROM.h> //(included as part of IDE)
    #include <Wire.h> //(included as part of IDE)

    I have uploaded these libraries under Step 2.

    I use Arduino IDE Version 1.8.5

    Under Additional Boards Manager URL (File/Preferences), I have the following entries:
    http://digistump.com/package_digistump_index.json
    https://raw.githubusercontent.com/damellis/attiny/...
    http://arduino.esp8266.com/stable/package_esp8266c...

    Under Tools/Boards/Boards Manager, I have the following:
    esp8266 by ESP8266 Community Version 2.1.0

    Hope this info will assist you.

    The diode is not required. I just add it to my projects to protect against reverse polarity..

    Regards, Eric

    0
    None
    Jens1968

    4 months ago

    I solved the problem. It lag at the IP address 192.168.4.1. You can change these with

    WiFi server server (80);
    IPAddress apIP (192, 168, 1, 1);
    and
    WiFi.mode (WIFI_AP);
    WiFi.softAPConfig (apIP, apIP, IPAddress (255, 255, 255, 0));
    1 reply
    0
    None
    Eric BrouwerJens1968

    Reply 4 months ago

    Glad you got it right.
    Hope you enjoy the project.

    Regards, Eric

    0
    None
    Jens1968

    4 months ago

    "ip": "192.168.1.20",
    "gateway": "192.168.1.1",
    "subnet": "255.255.255.0"
    }Should now be connected to the network
    *WM: freeing allocated params!
    ⸮P⸮4@H⸮l⸮@zIx⸮⸮
    Connect to WiFi
    Waiting for Setup Button to be pressed
    Trying to connect
    {"ip":"192.168.1.20","gateway":"192.168.1.1","subnet":"255.255.255.0"}*WM:
    *WM: AutoConnect
    *WM: Connecting as wifi client...
    *WM: Custom STA IP/GW/Subnet
    *WM: 192.168.1.20
    *WM: Using last saved values, should be faster
    *WM: Connection result:
    *WM: 0
    *WM:
    *WM: Configuring access point...
    *WM: Network Monitor
    *WM: AP IP address:
    *WM: 192.168.4.1
    *WM: HTTP server started
    *WM: Request redirected to captive portal
    *WM: Handle root
    *WM: Request redirected to captive portal
    *WM: Request redirected to captive portal
    *WM: Handle root
    *WM: Request redirected to captive portal
    *WM: Request redirected to captive portal
    *WM: Request redirected to captive portal