Wifi (LAN) Scanner

Version History...


Download

Installation

The plugin can be installed as zip file into Loxberry. Similar to all other plugins.

Functionality of the plugin

The plugin is based on this script from the wiki.
Most of the times, the plugin is used for presence detection of certain users in your Wifi network. For that users can be setup with one or more mac addresses. The plugin will scan periodically for the setup mac addresses by fetching this information from the FritzBox. For all other Routers or also as a Fallback an active scan can be used.
The result will be send to the miniserver using UDP or MQTT.

Configuration options

You can activate the scanner using the „Activate Scanner“ button.
The scanner will scan for new users in a periodic manner, which can be setup in the next step.

The ComboBox after the „Activate Scanner“ button defines the scanning interval.

A new user can be added by using the „New User“ button. The now appearing fields can be used to configure this user.

Every user needs to be identified by it's name. The plugin doesn't check that the names are unique, but the name will be used for sending the data to the miniserver, which can lead to problems if the users are not unique.
For every user you can setup one or more MAC addresses. Multiple addresses can be added separated by ;
Instead of MAC addresses, it is also possible to add an IP address or mix both.

The MAC addresses can be found in the network overview of your FritzBox or by using a scanning software like LANScan.

Fritzbox-Connection

You can setup the FritzBox address and port in the „FritzBox connection“ section. Most of the times nothing need to be changed here.

To ask the FritzBox a MAC address in the following format is needed 00:80:41:ae:fd:7e and the online state of the user is determined.
If the device is offline, an additional active scan can be scheduled.

All other Routers

For all other Routers the „Active Scan“ will be used. In that mode ping or arping Packages are sent and need to be answered by the device to mark a user online.

That mode can also be used as a fallback for the Fritzbox-Connection. The Fritzbox will be asked first and only if the device is offline and additional active scan is used to determine the state.

The active scan uses IP addresses. If an IP address is set for a user, this will be used. Is only a MAC address set, the MAC address will be converted to an IP address.

That conversion is done using ARP. In case the local ARP table isn't filled yet or the IP address is not part of the table, an active attempt to fetch it is made.

By unchecking the „Use ARP-Cache“ checkbox, the ARP table lookup is skipped and the IP address is always fetched by actively.

iPhones

iPhones don't answer normal „ping“ packages in a timely manner, because they use a „deep sleep“ state. To determine an iPhone in the network, the arping command can be used instead.

Those special pings are better suited for iPhones.

Wifi Repeater

In most cases a Wifi repeater connects all devices to the network without an additional border in between. In some situations the MAC addresses of the devices are changed to the one of the repeater or a different schema.

In such situations the detection by MAC address doesn't work correctly. Instead the „Active Scan“ mode should be used and the „ARP-Cache“ needs to be disabled.

Miniserver-Connection

The connection to the Miniserver is done by UDP-Port or using MQTT

UDP

For that connection the UDP-Port need to be set in the „Miniserver-Connection“ section.

Setup in the Loxone Config Software

First a new Virtueller UDP Input needs to be added. The UDP Port needs to be the same port that was setup in the plugin configuration.
Following an example setting up the default port:

For every user a new Virtual UDP Input Command needs to be added.

Use the following command recognition: \i<USER>:\i\v

<USER> needs to be replaced by the user setup in your plugin configuration. Following an example for the user „Dominik“

MQTT

This option is only available when the MQTT Gateway plugin is installed.

The correct topic is automatically added as subscription for the gateway. All other settings need to be done in the MQTT Gateway.

Scan on Demand

In most cases the scan interval is set pretty conservative. For time critical things e.g. to deactive the alarm, this can be a problem. To fix this an request to scan for users can also be done from the miniserver by using the following URL:

http://<Loxberry-IP>/wifiscanner/scan.cgi

Roadmap

  • English Translation (1.1)
  • Scan for IP addresses (2.0
  • independence from the FritzBox (2.0
  • Start a scan from the Miniserver (2.0)
  • Update to the new plugin API (2.0)
  • Start using the Loxberry Update Mechanism (2.0)

Asking questions and reporting problems

Question about the plugin will be answered in the forum. Please report your errors here.