# Beacons

> A beacon is a checkpoint a guard proves they visited, by scanning a QR code or NFC tag or by standing inside a GPS area. Beacons are the basis of patrols.

Source: https://vigilsecure.net/docs/concepts/beacons/

A beacon is a checkpoint: a point at a site that a guard proves they visited. The proof is
either something they read at the spot, such as a QR code, or their GPS position inside an
area around it. Every proven visit is a _scan_, recorded with the time, the place and the
person.

You find them under **Infrastructure → Beacons** in the console.

## Kinds of beacon

| Kind         | How a guard scans it                                           | Good for                                                                   |
| ------------ | -------------------------------------------------------------- | -------------------------------------------------------------------------- |
| **QR code**  | Points the device's camera at the printed code                 | Doors, gates, plant rooms, anywhere you can fix a label                    |
| **Geofence** | Stands inside a circle around the point and checks in with GPS | Perimeter corners, parking areas, open ground where a label would not last |
| **NFC tag**  | Holds the device against the tag                               | Places where a QR label would be photographed or damaged                   |

Passive QR codes and NFC tags need no power and no batteries.

Codes printed for the previous Vigil platform still identify the same beacon. Bluetooth and
Wi-Fi beacons cannot yet be registered in the console or scanned by the guard app.

> **Guard app support:** The guard app scans QR codes and geofences today. Reading NFC tags in the guard app is being
> rolled out, so use QR or geofence beacons for patrols.

## Register a beacon

1. Choose **Infrastructure → Beacons** and add a beacon, open a site's **Beacons** tab and
   choose **Add beacon**, or right-click the spot on the
   [Overview](https://vigilsecure.net/docs/concepts/overview.md) map and choose **Add beacon here**.
2. Fill in the form:

   | Field           | Notes                                                              |
   | --------------- | ------------------------------------------------------------------ |
   | **Name**        | What a guard will see, such as `North gate` or `Generator room`.   |
   | **Description** | Optional. Where exactly it is, or what to check there.             |
   | **Site**        | The site it is deployed to, or **Unassigned** to keep it in stock. |
   | **Kind**        | QR code, NFC tag or geofence. The kind cannot be changed later.    |
   | **Location**    | Required. Choose **Adjust location** to place it on the map.       |

3. Complete the part for its kind:
   - **QR code**: choose **Scan code** and scan the Vigil code on the label. Only Vigil
     beacon codes are accepted.
   - **NFC tag**: choose **Scan tag** and hold the tag against the back of an Android
     phone, in Chrome.
   - **Geofence**: enter the **Radius (metres)**, from 5 to 10,000. The default is 50.

Registering beacons needs the **Register beacons** permission, which the supervisor,
operator, manager, admin and owner roles have.

## Manage beacons

- **Move** a beacon to another site, or back to stock, by changing its **Site**. To move
  several together, select them in the list and choose **Move to site…**.
- **Disable** a beacon to leave it out of patrols without removing it, for example while a
  wing is closed. **Enable** it again later.
- **Archive** a beacon that is gone for good. Vigil keeps its record because patrol history
  refers to it.

The list filters by kind, state, site and placement, so you can find every unassigned
beacon or every disabled one.

## What a scan is

A scan is a message in a chat. It records:

- **Who** scanned, from the user signed in on the device.
- **Which beacon**, checked against proof. For a QR code the proof is the code itself. For a
  geofence it is a GPS fix accurate to 50 metres or better that lies within the radius, allowing for the fix's accuracy.
- **When**, by the device's clock at the moment of the scan. A scan made offline keeps its
  real time and is sent when the device is back online.

In the chat it reads **Scanned North gate**, with the method and, for GPS, the distance from
the centre.

### How a guard scans

In the guard app, a guard can scan in three ways:

- **From a patrol request.** The patrol card in the chat has a **Scan** button, and lists
  the beacons still to scan.
- **From a chat.** Choose **+**, then **Scan beacon**. Nearby geofences show **Check in**;
  **Scan QR code** opens the camera.
- **From the map.** Standing inside a geofence shows a card with **Scan**. The scan goes to
  the guard's default chat for beacon scans.

The device can vibrate and play a sound when the guard walks into a beacon's area.

## Beacons and patrols

A patrol is a list of beacons to scan within a time window. A patrol request can include up
to 100 enabled QR or geofence beacons. See [Guard patrols](https://vigilsecure.net/docs/examples/guard-patrols.md).

## Related

- [Sites](https://vigilsecure.net/docs/concepts/sites.md)
- [Guard patrols](https://vigilsecure.net/docs/examples/guard-patrols.md)
- [Frequently asked questions](https://vigilsecure.net/docs/faq.md#sites-and-beacons)
