Skip to content

How to setup automatic arming and disarming cycles (API 6)

Attention

Please note that this is an advanced article that requires a deeper understanding of the firmware!

If you're new to API 6, read this We've encountered an interesting client use case - they need to monitor temperature, but only during the working hours of the day. We think it's a great use case and decided to have the settings written down, so you can use this article for your inspiration. This article is about creating device behavioral cycles. For that, we will be using:

  • Arming and disarming
  • Downlink
  • Heartbeats You can use IO Frog, Sigfox backend or your own platform to set these up. In IO Frog, you can find all of these features by their name and the value can be changed in a user-friendly way. Arming and disarming (changing device state from armed-active to disarmed-inactive and vice versa) can be achieved via several features of the API 6. The features that you can work with:
  • Arming

  • Manual (short press in default), will not be used as we want an automated cycle

  • Auto-arm timer (register 0x10), after downlink is received, the countdown starts and when it reaches 0, the device is armed, time value from 1 to 63 seconds, minutes, hours or days
  • Force-arm (bit 7 of register 0x40), after downlink is received, device is immediately armed

  • Disarming

  • Manual (long press in default), will not be used as we want an automated cycle

  • Disarm through alert 1, 2 or 3 (bit 5 of registers 0x23, 0x26 and 0x29), event-based disarm, for situations where you know the cycle ends with a specific uplink message (such as light detection when a package is opened)
  • Force-disarm (bit 6 of register 0x40), after downlink is received, device is immediately disarmed Now that we have defined the possible ways of arming and disarming the device, it is important to understand that downlinks play a major role in this as they work with most of the features above. Downlinks (and to a certain extent, heartbeats) can be thought of as cycle phase switches. This is crucial:

  • Downlink triggers

  • Manual(extra long press in default), will not be used as we want an automated cycle

  • _Start of arming phase,_will not be used as it's only applicable for manual arming
  • Heartbeats 1 and 2 (bit 5 of registers 0x08 and 0x0B), regular time-triggered messages that can request a downlink if set up so
  • Alerts 1, 2 and 3 (bit 6 of registers 0x23, 0x26 and 0x29), event-based downlink request, can be combined with a disarm (see above)
  • Downlink confirmation with a downlink request, can be used if more than 4 registers need to be setup, but generally will not be used as often Heartbeats are vital for creating cycles because they are triggered by time and therefore cyclic. You can set up two different heartbeats:

  • Heartbeat 1 and 2 settings (binary bit settings of registers 0x08 and 0x0B)

  • Bit 7 - Real time period/time from last message - used in case you want the downlink trigger to follow some time after a message (this message will most likely disarm the device and the heartbeart-triggered downlink will arm it again by force-arm)

  • Bit 6 - While armed only/anytime - this is very important for setting the cycles
  • Bit 5 - Uplink only/downlink request - again, crucial
  • Bits 4, 3, 2, 1, 0 are either not important or not defined in the firmware Now that the tools are explained, let's try an example: You want to monitor temperature, but only during working hours from 09:00 to 17:00. You want to receive temperature updates every 10 minutes plus get notified when temperatures go over or under a certain temperature threshold. It's possible to set up up to three of them. This is the ideal behavior: At around 09:00, the device will become active and start sending you regular temperature updates every 10 minutes through the first heartbeat with the possibility to also send you a temperature threshold alerts. Around 17:00, the device will request downlink by the second heartbeat and disarm. The downlink will set an auto-arm timer to arm the device at 09:00 again and the cycle will be repeated. Here are the settings for this example: Mode: Temperature threshold alert (0x10), feel free to set the three thresholds to anything you like, the default thresholds are 1,5°C, 40°C and 60°C. Additional settings:Downlink confirmation enabled. This is so you know that the downlink was received properly by the device when the second heartbeat requests downlink and will also help you with the setup. Turn this on like this: 0x0F = 0x0E. Heartbeats:

  • Heartbeat 1

  • Heartbeat 1 period set to 10 minutes (0x07 = 0x4A)

  • Heartbeat 1 settings left in default (real time period, while armed only, uplink only)
  • Heartbeat 1 appended payload mask set to temperature only (0x09 = 0x40)

  • Heartbeat 2

  • Heartbeat 2 period set to 24 hours (0x0A = 0x98)

  • Heartbeat 2 settings set to real time, anytime, downlink request (0x0B = 0x60)
  • Heartbeat 2 appended payload turned off (0x0C = 0x00) Downlink:The purpose of the downlink payload requested at the end of the cycle is to disarm/deactivate the device and set the auto-arm timer to arm/activate it again. So the downlink payload needs to contain this:

  • Regular downlink (after setup)

  • Force-disarm (0x40 = 0x40)

  • Auto-arm time set to 16 hours (0x10 = 0x90)

  • Setup downlink

  • First part of the settings above in one sequence: 0F0E0940074A0110

  • Second part of the settings above: 0C000B600A981090
  • Third downlink sequence: 0000000000004040 (regular downlink)

How to setup this example:

  1. During the day, trigger the first downlink and make sure it was received (you should receive a downlink confirmation message).
  2. Arm the device by pressing the button so it's active and check if the heartbeats are sending you temperature and if everything is ok.
  3. Then, around 17:00, request the second downlink sequence, which will set up the second heartbeat to be sent at five.
  4. Immediately afterwards, request the third downlink sequence, which will disarm the device and set the auto-arm timer to arm it at 09:00.
  5. DONE!