LoRaWAN Virtual Fence Updates for GPS Cattle Collars
LoRaWAN Virtual Fence Updates: How to Confirm Every Cattle Collar Is Ready
A ranch manager changes a grazing boundary on a map. The new polygon appears immediately, and the next pasture looks ready.
But have the cattle collars received the change?
For a connected livestock system, saving a boundary on the platform and activating it on a device are separate operations. Reliable LoRaWAN virtual fence updates require a clear way to track delivery, validate the configuration and confirm which boundary each collar is using.
This article explains an engineering approach for livestock collar projects, including customized deployments based on the Jinshengchang JSC-805 series. The workflow described below is a design recommendation; availability must be confirmed for the selected firmware and platform configuration.
1. Identify Where the Fence Is Evaluated
Before designing the update process, establish where boundary decisions happen.
Server-side geofencing: The collar reports its position, and the platform evaluates whether the animal has entered or left an area. Updating the server’s boundary changes subsequent platform evaluations without necessarily transferring a polygon to the collar.
Collar-side boundary evaluation: The device stores boundary information and evaluates its own position locally. A platform change must reach the collar before that device can use the new boundary.
Combined operation: The platform handles monitoring and records while the collar performs supported local functions. Both sides need a way to identify the configuration currently in use.
This distinction determines whether a pasture edit is a database update, a device configuration operation, or both.
2. Understand When a LoRaWAN Downlink Can Arrive
For a Class A device, downlink reception takes place in receive windows following an uplink. A command queued while the collar is sleeping cannot simply be delivered at any arbitrary moment.
A confirmed downlink requests a reception acknowledgement, normally carried in a subsequent uplink. The Things Stack documentation describes these timing and acknowledgement behaviors for the different LoRaWAN device classes.
This creates an operational relationship between the collar’s uplink schedule and the expected update time.
A collar configured for infrequent reporting may conserve energy, but its next opportunity to receive a new boundary may also be delayed. A project should therefore define an acceptable update window alongside its battery-life target.
3. Separate Message Reception from Boundary Activation
A network acknowledgement answers a limited question: did the device acknowledge receiving the downlink?
It does not, by itself, establish that the application successfully parsed, stored and activated the new boundary.
As an engineering recommendation, use an application-level response to distinguish these stages:
| Update state | Meaning |
|---|---|
| Queued | The platform has prepared the command |
| Transmitted | The network reports a transmission attempt |
| Received | Reception has been acknowledged |
| Validated | The collar has accepted the configuration format and contents |
| Active | The collar reports that it is using the requested boundary |
| Failed or expired | The update needs investigation or a new attempt |
The farmer-facing interface can keep this simple: Updating, Active, or Needs attention. Detailed states remain available for technical support.
4. Give Each Boundary a Version
A boundary name such as “North Pasture” is useful to people, but it does not identify which revision is installed.
A recommended configuration record includes:
- Boundary identifier.
- Configuration version.
- Target device or herd group.
- Payload format version.
- Validation checksum.
- Activation policy.
The collar should report its active boundary identifier and version, either in a dedicated response or in a supported status message.
For example, if the platform expects version 18 and a collar reports version 17, the mismatch remains visible even when ordinary GPS reports continue arriving.
A checksum helps detect incomplete or corrupted application data. It does not replace authentication or access control.
5. Handle Large Polygons Without Partial Activation
A detailed pasture polygon may exceed the application payload available in one LoRaWAN message. Payload capacity depends on the regional configuration, data rate and other protocol overhead.
Possible engineering approaches include simplifying the polygon within an agreed geometric tolerance or transferring the configuration in multiple parts.
For a multipart design, the device should verify that all required parts are present before accepting the configuration. It should avoid combining part of an old boundary with part of a new one.
A useful design pattern is to store a pending configuration separately, validate it, and then switch to it as a complete unit. The restart behavior and handling of an interrupted transfer should be explicitly tested.
6. Treat Herd Updates as Individual Device Operations
A group command does not prove that every collar has changed state.
Consider an illustrative herd of 100 collars:
| Reported result | Collar count |
|---|---|
| New boundary active | 92 |
| Update pending | 5 |
| No recent communication | 3 |
The platform should show the eight exceptions and their last known status. It should not present the herd as fully updated.
This is especially useful before moving animals between grazing areas. Staff need to know which devices are ready and which animals require attention.
If coordinated activation is required, the project must also define clock synchronization, readiness checks and what happens when some collars fail to receive the update.
7. Make Retries Bounded and Repeatable
Wireless delivery can fail. However, repeatedly sending the same command without limits consumes network capacity and can delay other traffic.
A robust application design should define:
- A maximum number of attempts.
- An expiry time for outdated commands.
- A retry interval appropriate to the reporting schedule.
- A rule for replacing superseded boundary versions.
- A way to recognize duplicate commands.
Receiving the same configuration twice should not restart guidance, corrupt stored data or create conflicting boundaries. A transaction identifier and version check can help make repeated delivery predictable.
8. Define What Happens During a Connection Loss
Communication loss affects remote monitoring and configuration delivery. It does not automatically establish whether local boundary operation continues.
Continued local operation requires verified onboard boundary storage, positioning and application logic. The product specification should state what happens when:
- The gateway or its internet connection fails.
- The collar misses a boundary update.
- Satellite positioning becomes unreliable.
- The collar restarts.
- Its battery reaches a critical level.
For locally evaluated boundaries, one possible policy is to retain the last validated configuration until a replacement is accepted. Whether that policy is appropriate depends on the grazing operation and the device’s control design.
9. Validate the Workflow in a JSC-805 Pilot
Jinshengchang’s published 805 solution describes livestock positioning, pasture boundaries, platform alerts and gateway-based communication. Local storage, application acknowledgements and version-controlled activation should be confirmed separately for the proposed configuration.
A pilot should test more than successful delivery under ideal coverage. Include interrupted transfers, duplicate commands, older versions arriving late and device restarts.
Record the time from submitting an update to receiving an active-version report. Measure how many collars complete the process within the required operational window.
These results provide a practical basis for selecting reporting intervals, planning gateway coverage and defining the rollout procedure.
Plan Your LoRaWAN Livestock Collar Integration
For a new deployment, specify both the tracking requirement and the boundary-update requirement. Herd size, pasture layout, device sleep behavior and acceptable update delay all affect the final design.
Explore the Jinshengchang 805 cattle tracking solution and discuss firmware, platform and integration requirements before scaling beyond the pilot.
Shenzhen Jinshengchang Technology Co., Ltd.
Contact: Wang Tao
WhatsApp: +86 13480881974
Email: 397017470@qq.com
Website: www.lora8.net