> ## Documentation Index
> Fetch the complete documentation index at: https://docs.intuitibits.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect to a sensor

> Connect WiFi Explorer Pro 3 to a Linux- or Android-based sensor to scan for wireless networks remotely.

A sensor is a remote device that scans for wireless networks on *WiFi Explorer Pro 3*'s behalf and sends the results back for analysis. Sensors are useful when you can't be physically present at a location, such as a remote site or a different floor of a building, or when you need scanning capabilities your Mac's built-in Wi-Fi adapter doesn't have, such as 6 GHz support. *WiFi Explorer Pro 3* can connect to Linux- or Android-based sensors.

## Linux-based sensors

A sensor can be any Linux device with one or more compatible Wi-Fi adapters configured to allow *WiFi Explorer Pro 3* SSH access to scan for wireless networks using the desired Wi-Fi interface. A sensor can use active or passive scan mode.

In active scan mode, the sensor uses a helper utility that scans for Wi-Fi networks using the 802.11 netlink API. In passive scan mode, the sensor puts the Wi-Fi interface in *monitor mode* and listens for beacons. Most modern Wi-Fi adapters support the 802.11 netlink API, so if an adapter doesn't support *monitor mode*, you may still be able to use it to scan for Wi-Fi networks in active scan mode.

<Note>
  By default, a sensor is configured to use **Auto** in *WiFi Explorer Pro 3*. In auto mode, active scan mode is preferred when available; otherwise, passive scan mode is used.
</Note>

<Tip>
  The [WLAN Pi](http://www.wlanpi.com) comes pre-configured as a *WiFi Explorer Pro 3* sensor.
</Tip>

<Note>
  A WLAN Pi connected directly to your Mac over USB (OTG) doesn't need to be added under *Settings* > *Sensors*. *WiFi Explorer Pro 3* automatically lists it as its own entry in the *Scan Mode* menu.
</Note>

### Install the required utilities

For a Linux device to work as a sensor, the following utilities must be installed:

| Utility                                               | Required for                  |
| ----------------------------------------------------- | ----------------------------- |
| `ip` (iproute2)                                       | Active and passive scan modes |
| `iw`                                                  | Active and passive scan modes |
| `tcpdump`                                             | Passive scan mode             |
| [`scandump`](https://github.com/intuitibits/scandump) | Active scan mode              |

### Configure passwordless sudo

*WiFi Explorer Pro 3* runs the utilities listed above over SSH with `sudo`, so the SSH user you use to connect to the sensor must be able to run them **without being prompted for a password**. You can grant that permission to only those utilities by adding a file to the `/etc/sudoers.d/` directory on the sensor:

1. Find the absolute path of each utility you need. Paths vary between Linux distributions, so check them on the sensor itself rather than assuming the ones used in the examples below:

   ```bash theme={null}
   command -v ip iw tcpdump scandump
   ```

2. Create the sudoers file, called `wlandump` in this example, using `visudo`, which checks the syntax before saving:

   ```bash theme={null}
   sudo visudo -f /etc/sudoers.d/wlandump
   ```

3. Add a single line listing the utilities required by the scan mode you plan to use, using the paths you found in step 1. For active scan mode:

   ```text theme={null}
   %sudo ALL=(ALL) NOPASSWD: /sbin/iw, /bin/ip, /usr/bin/scandump
   ```

   For passive scan mode:

   ```text theme={null}
   %sudo ALL=(ALL) NOPASSWD: /sbin/iw, /bin/ip, /usr/bin/tcpdump
   ```

   To allow either scan mode, list all of the utilities:

   ```text theme={null}
   %sudo ALL=(ALL) NOPASSWD: /sbin/iw, /bin/ip, /usr/bin/tcpdump, /usr/bin/scandump
   ```

   The paths above are examples. `sudo` matches each rule against the exact path of the command it runs, so if a utility is installed elsewhere on your sensor, replace the example path with the one you found in step 1.

4. Save the file and exit the editor, then make the file read-only:

   ```bash theme={null}
   sudo chmod -w /etc/sudoers.d/wlandump
   ```

5. Verify the configuration by logging in to the sensor as the SSH user and running a utility with `sudo -n`, which fails instead of prompting for a password:

   ```bash theme={null}
   sudo -n iw dev
   ```

   If the command lists the wireless interfaces, the SSH user can run the utilities without entering a password. If it returns "sudo: a password is required", check the paths you entered in step 3 and the group membership described below.

<Note>
  The example lines grant passwordless `sudo` to every member of the `sudo` group (`%sudo`). If the SSH user doesn't belong to that group, replace `%sudo` with the username, as in `wlanpi ALL=(ALL) NOPASSWD: /sbin/iw, /bin/ip, /usr/bin/scandump`.
</Note>

<Warning>
  A syntax error in a file under `/etc/sudoers.d/` can prevent `sudo` from working on the sensor. Edit these files with `visudo`, which refuses to save a file that contains invalid syntax.
</Warning>

## Android-based sensors

You can also use an Android device as an active-scan sensor when using [WiFi Sensor](https://www.intuitibits.com/products/wifisensor/) for Android or [analiti](https://www.analiti.com)'s real-time stream function. Android-based sensors support active scanning only. To use [WiFi Sensor](https://www.intuitibits.com/products/wifisensor/) or [analiti](https://www.analiti.com) with a compatible Android device as a sensor, follow the instructions below to add your Android device as a sensor and use port 19000.

***

## Add a sensor

1. Go to *WiFi Explorer Pro 3* > *Settings* > *Sensors* and click the **+** button.
2. Enter the hostname or IP address of the sensor.
3. Double-click the **Name** field to give the sensor a custom name.
4. To specify a wireless interface for scanning, double-click the **Interface Name** field and enter its name. Otherwise, *WiFi Explorer Pro 3* automatically chooses the first remote wireless interface. This field is ignored for Android-based sensors.
5. If the Linux-based sensor uses a port other than TCP port 22 for SSH access, double-click the **Port** field and enter the correct port number. For Android-based sensors, enter port 19000.

<Note>
  *WiFi Explorer Pro 3* discovers [WLAN Pi](http://www.wlanpi.com)-based sensors deployed in your local area network automatically.
</Note>

<Note>
  Because *WiFi Explorer Pro 3* uses a Linux-based sensor's Wi-Fi adapter to perform the scan, *WiFi Explorer Pro 3* must connect to the sensor via Ethernet or a secondary Wi-Fi adapter.
</Note>

***

## Connect to a sensor

1. Click on the *Scan Mode* menu in the *WiFi Explorer Pro 3*'s toolbar.
2. Select the sensor.
3. Enter a valid username and password to connect to the sensor if prompted.

For Linux-based sensors, the connection between *WiFi Explorer Pro 3* and the sensor is made securely via SSH. The first time you use the sensor, you will be prompted to authenticate with a valid username and password. You can choose to have *WiFi Explorer Pro 3* remember the credentials, so you don't have to enter them every time you do a scan using the sensor. *WiFi Explorer Pro 3* will store the credentials securely in your Mac's keychain.

<Tip>
  Press the Option key when selecting the sensor or starting a new remote scan if you previously chose to save the credentials and need to enter a new username and password.
</Tip>

<Note>
  If the sensor is behind a firewall, you must open TCP port 22 (SSH), or the port the sensor is using for SSH access, to allow for *WiFi Explorer Pro 3* to communicate with the sensor.
</Note>

***

## Manage sensors

To manage the sensors, go to *WiFi Explorer Pro 3* > *Settings* > *Sensors*. You can add, edit or delete existing sensors, and change the order of the sensors by dragging the entries in the list.

You can also import or export sensors by clicking the **More** button and choosing **Import** or **Export**.

***

## Troubleshoot sensors

If you're experiencing issues connecting to or using a sensor, *WiFi Explorer Pro 3* includes a built-in diagnostics tool to help identify potential problems.

To run diagnostics, open *WiFi Explorer Pro 3*, go to *Settings* > *Sensors*, select the sensor from the list, click the **More** button, and choose **Run Diagnostics**.

<Note>
  Sensor diagnostics are available exclusively for Linux-based sensors.
</Note>

## See also

* [Find networks using the built-in Wi-Fi adapter](/wifiexplorerpro3/find-networks-using-built-in-adapter)
* [Sensors](/wifiexplorerpro3/sensors-settings)
