Internet Monitor

Promptly detect internet outages without using external services

 Application   June 27, 2022

Internet Monitor

The unavailability of the connection to the public network can be a serious problem whether you have to manage a data center or more simply the home connection, especially when equipment and services depend on access to the public network.

If Avior is connected to your WiFi network, it can easily detect service interruptions and use its cellular connectivity to report the problem by making a phone call, sending an SMS message, a chat message, an email or an HTTP call to a server...

Avior configuration

We can use Avior.Suite software by connecting Avior to a Personal Computer with the appropriate USB cable or accessing the device's account cloud by entering the identification (WebId) and password.

Variable

We assign the name WiFi.Internet to variable 1 and to its expression the remainder of the division of parameter D26/2 (recalling its value with $D26). This parameter contains the current status of the internet connection:
0 = no connection
1 = connection available through WiFi network
2 = connection available through cellular network
3 = connection available through both WiFi and cellular networks

The WiFi connection is present in conditions 1 and 3 and absent in conditions 0 and 2.
The remainder of the division by 2 of an odd number always makes 1 while an even number always makes 0, so this operation allows us to have as a result 1 when WiFi connection is available (regardless of cellular connection status).

The variable is updated every 60 seconds.
More info on variables available HERE.

Rules

Let's add a simple rule to be triggered when the connection is restored.

  • Trigger event is the change of state of variable 1.
  • The condition is that the value of variable 1 is equal to 1
    it means a WiFi internet connection is available.
  • The first action contain the command to print WiFi Internet OK to COM port
  • The second action makes a call to phone number +39123456
  • The third action send the SMS WiFi.Internet OK to phone number +39123456
    $V10 is replaced by the value of V10 that is the name of Variable 1.
  • The fourth action contain the command to play a tone on local speaker.

Let's add a simple rule to be triggered when the connection is lost.

  • Trigger event is the change of state of variable 1.
  • The condition is that the value of variable 1 is equal to 0
    it means no WiFi internet connection is available.
  • The first action contain the command to print WiFi Internet KO to COM port
  • The second action makes a call to phone number +39123456
  • The third action send the SMS WiFi.Internet KO to phone number +39123456
    $V10 is replaced by the value of V10 that is the name of Variable 1.
  • The fourth action contain the command to play a tone on local speaker.

You can also add rules to send messages in the event of a power failure, or when a temperature threshold is exceeded, detected with a probe connected to an analog input or with a remote Bluetooth sensor.

In addition to sending messages, you can activate outputs, control other interconnected devices, publish an MQTT topic ...

You can check the connection status at any time by consulting the status of variable 1 (WiFi.Internet).

HERE you can find the complete Avior documentation.

Copyright © 2023 ContriveWireless. All Right Reserved.
Powered by Bludit - Theme By BlThemes