← Back to Harvestree
Harvestree v5 LoRaWAN documentation

Operation

How the device cycles through wake, energy, measure, uplink, and sleep — and how Alarm mode reacts to events.

Operation overview

Harvestree operation cycle: Wake, Energy check, Measure ports, uplink choice, Sleep, with thermal harvesting feeding energy check
Monitoring · periodic Alarm · checks + events Idle · standby Modbus · wired RTU

Alarm mode — pictured simply

Think of Alarm mode as a watchdog that sleeps, wakes on a schedule or on a shock, then either shouts (alarm uplink), whispers a normal status, or goes back to sleep quietly. A contact or motion edge can raise an alarm immediately; scheduled wakes still measure ports and system values when energy allows.

Sleep Waiting for the next check or a sudden event
Wake Timer (reactivity) or interrupt (motion / contact)
Look Consume edge latch · measure ports + system (if energy allows)
Decide Alarm uplink · normal uplink · or nothing

Two kinds of “things that can ring”

Scheduled look (synchronous)

On each powered measure pass, the device compares samples to configured limits:

  • M8 port values (thresholds / dry contact)
  • TEG / harvest voltage (HVT)
  • Baseplate temperature (HEAT)

Compared to limits: high / low / in range / out of range. No hysteresis — the latest sample decides. Storage voltage is an energy gate (whether the full measure / alarm path runs), not an HVT-style threshold.

Sudden poke (asynchronous)

A poke wakes the product and can raise an alarm from the edge itself (no need to wait for the next reactivity timer):

  • Motion — acceleration threshold (IIS2DLPC) → system alarm latch for that cycle
  • Async dry contact — contact edge → port alarm latch for that cycle

Pokes are only accepted in Calm (armed). While an alarm episode is active, EXTI stays locked (new pokes ignored). Async dry contact then re-samples the contact level on each Alarm TX to hold or clear. Motion does not re-measure acceleration for hold — the episode clears on a later cycle when there is no fresh motion latch and no other active alarm source.

Async poke — state machine

Armed Calm Sleep · poke or reactivity can wake
Disarmed Decide Edge latch = trigger · measure for payload / hold
Locked Alarm active Pokes ignored · Alarm TX re-check
2 s filter Re-arm Clear → normal uplink → debounce

Then back to Calm (armed). Reactivity still runs on schedule without a poke: sync thresholds are evaluated, and an async dry contact already in the active level can also start or continue an episode.

Async dry contact: a rising/falling edge in Calm is enough to start an alarm episode (short pulses are not lost even when other ports take longer to measure). While Locked, each Alarm TX re-samples the contact (about 20 ms settle on that port) — rising keeps the episode if still closed, falling if still open; otherwise it clears. After Clear, new pokes are ignored for 2 s (re-arm filter).

Three clocks

While watching, the product uses three timers (Toolbox / downlink):

ReactivityHow often to check when calm
Alarm TXHow often to shout while alarm is active
Normal TXMinimum spacing between normal uplinks when calm

Reactivity and Normal TX are different: reactivity decides when to wake and look; Normal TX decides whether a normal uplink is allowed yet. On a calm wake, if the Normal TX period has not elapsed, the product still checks alarms but sends no uplink. When an alarm clears, one normal uplink is sent immediately, then the Normal TX period applies again. Parameter IDs: Downlink commands.

Wake · reactivity or poke
Alarm condition?
Alarm uplink
Sleep · alarm TX period
Normal TX period elapsed?
Normal uplink
Check only
Sleep · next reactivity
next wake
Back to wake
Energy

If storage is below the minimum operating voltage (voltage_limit), the cycle skips full measure / alarm uplinks (keepalive rules can still apply). An async contact or motion edge that woke the device is remembered (latch kept) until a powered cycle can raise the alarm — it is not discarded across the low-energy gap. Further edges are ignored while that latch is already set.