What is Link Mode?
Link Mode refers to Monnit ALTA and Gen1 Sensors’ operation when connecting to an ALTA or Gen1 Gateway. Sensors enter Link Mode when they first attempt to connect or if, on rare occasions after they lose connection with a gateway and attempt to reconnect. This article outlines the details of this operation in Monnit Sensors.
What triggers a sensor to enter Link Mode?
There are two scenarios:
- When a sensor is powered up
- When a sensor loses connection to a gateway
Sensors will only link to a gateway after they’re authorized to communicate. This authorization comes from a sensor being on a gateway’s Sensor List. Only sensor IDs on the gateway’s Sensor List can communicate with that gateway. This generally means a sensor is added to the same gateway in iMonnit. If a sensor is not on the gateway’s Sensor List, the gateway will not allow the link. For more information about a gateway’s Sensor List, see this article.
The configuration in iMonnit relating to Link Mode is “Failed transmissions before link mode.” It can be found in iMonnit under the Sensor Overview > Settings tab toward the bottom of the page. The configuration determines how many failed attempts a sensor will make before entering Link Mode and seeking a link to another gateway. The default setting for this is 3.
What does a sensor do when it isn’t linked?
Once a sensor links to a gateway, it will transmit data to the gateway on the sensor’s Heartbeat (for information on Heartbeats, see the following article: “Understanding Sensor Heartbeat, Aware State, Assessments, and Rearm”). On the sensor’s Heartbeat, the sensor will activate its radio and transmit data to the gateway. Once the gateway receives a sensor transmission, the gateway responds by sending an acknowledgment to the sensor. Once the sensor receives the acknowledgment, the Heartbeat is completed successfully.
If the sensor doesn’t hear the acknowledgment from the gateway, the sensor considers the transmission unsuccessful. The sensor will then attempt to retransmit the reading to the preferred gateway. This is considered a “Retry.” Gen1 and ALTA Sensors have different Retry configurations, but both generations will attempt to Retry the transmission to the preferred gateway within seconds of the failed attempt.
After multiple Retry attempts are unsuccessful, the sensor will enter Link Mode and attempt “Recovery.” The Recovery attempts occur when the sensor tries to transmit only to the preferred gateway. During Recovery, the sensor will not seek out a new gateway. The sensor will attempt to transmit to the existing gateway on its configured Heartbeat to the previously connected gateway the number of times in its Recovery configuration (the default value for this differs between Gen1 and ALTA Sensors). If the sensor wasn’t successful during Recovery, it will connect to any gateway with that sensor’s ID in its allowed device list.
Link Mode with ALTA Sensors
Default Link Mode configurations for ALTA sensors are listed below:
• Failed transmissions before link mode: 3
• Retry Count: 6 (not configurable in iMonnit)
• Recovery Count: 10 (not configurable in iMonnit)
• Default scan interval: 1 hour (not configurable in iMonnit)
As described above, sensors transmit data to their gateways on Heartbeats. If the sensor does not hear the acknowledgement response from the gateway after transmitting on its Heartbeat, an ALTA sensor will attempt 6 Retries (by default) .2 to 3 seconds apart. If it is unsuccessful during one of the Retries, the sensor will enter Link Mode and increment the Recovery count. During the Recovery time, the sensor can only reconnect to the existing gateway. After an ALTA sensor has incremented the Recovery count (10 by default), the sensor will enter Link Mode in which it can seek out a different gateway.
After a sensor enters Link Mode, it will scan for gateways at 0 seconds, 5 seconds, 15 seconds, 30 seconds, 1 minute, 2 minutes, 3 minutes, 5 minutes, 15 minutes, and then 1 hour (default). If the sensor doesn’t find a gateway with which it is authorized to communicate during the previous scans, it will scan at the default interval (60 minutes) repeatedly until it relinks with a gateway or runs out of battery life.
Note: With the default Recovery Count set to 10, it would be at least one hour before the sensor could link to another gateway. This is because Recovery Counts 1-10 would occur at the 0 seconds (first Recovery attempt), 5 seconds (second Recovery attempt), 15 seconds (third Recovery attempt), 30 seconds (fourth Recovery attempt), 1 minute (fifth Recovery attempt), 2 minutes (sixth Recovery attempt), 3 minutes (seventh Recovery attempt), 5 minutes (eighth Recovery attempt), 15 minutes (ninth Recovery attempt), and 1 hour (tenth Recovery attempt). After these attempts, the sensor would scan for other gateways every hour after the tenth Recovery attempt and every 60 minutes after that.
Link Mode with Commercial Generation 1 (Gen1) Sensors
Default Link Mode configurations for Gen1 Sensors are listed below:
- Failed transmissions before link mode: 2
- Retry Count: 2 (not configurable in iMonnit)
- Recovery Count: 2 (not configurable in iMonnit)
- Default scan interval: 2 hours
Gen1 Sensors also offer Link Mode operation, but the execution of Link Mode differs compared to ALTA. Gen1 Sensors do not offer a “cascading” scan wherein they scan for a gateway more frequently immediately after losing connection. Additionally, the default Retry and Recovery settings with Gen1 Sensors differ from ALTA.
When the batteries are inserted into a Gen1 Sensor, the sensor tries all available channels to find a gateway. Gen1 Sensors start on the first channel and send a message, “I’m number 12345. Can I talk to you?" If it doesn’t hear anything back, it assumes there is no gateway on that channel and tries the next channel. After it has tried all of the channels and determines there is no available gateway, it stops sending messages for two hours.
Each scan cycle takes about 30 seconds but uses over a day’s worth of battery power. In other words, if it just continued to scan continually when the gateway wasn’t powered on, the battery would deplete very quickly. After two hours, the sensor starts the scanning process again, beginning with the first channel.
Like power-up, a Gen1 Sensor enters Link Mode when it loses connection to its gateway. If the sensor was talking to a gateway on a specific channel but has multiple failed transmissions (two Heartbeats, plus two additional Retries for each missed Heartbeat for a total of six missed communications in a row), the sensor assumes the gateway it was communicating with is no longer available and enters the same Link Mode.
Inserting Batteries Before a Gateway is Powered Up
As a result of the differences in Link Mode behavior between Gen1 and ALTA Sensors, the order of operations can affect setup differently. Two specific behaviors differ between the sensors that might affect the setup.
Join Message Transmission
As noted in the article, “Differences between ALTA (Gen2) and Commercial (Gen1) Devices,” when ALTA Sensors first join gateways, they trigger a gateway Heartbeat immediately, whereas Gen1 Sensors do not. This means before you see the first sensor check-in on power-up, you will generally need to wait for a scheduled gateway Heartbeat with Gen1 Sensors.
Powering Up the Sensor Before the Gateway on Initial Setup
If an ALTA Sensor is powered on before the gateway is powered on, you will see different behavior compared to Gen1 Sensors. Since ALTA Sensors function with a Link Mode in which they “cascade” more frequently, Link Mode attempts after power-up, and you will generally see ALTA Sensors active in iMonnit earlier than you would see Gen1 Sensors.
This is important because if the battery is put in the Gen1 Sensor before the gateway is active and ready to listen for the sensor, the sensor will miss the gateway and not scan again for another two hours. If you powered up a Gen1 Sensor before powering up the gateway during setup, it might be two hours or more before the sensor shows as active in iMonnit.
Link Mode is a critical operation of the Monnit platform. Because of the intricacies of Link Mode, this article can be very useful in explaining behavior you see or diagnosing issues. If you have related inquiries, feel free to contact Monnit Support.