Close

Wireless Communications

A project log for OpenFence - Digital Livestock Fencing

OpenFence is an open source GPS based digital livestock fencing system and web interface, aiming to reduce barriers of using cell grazing.

alex-muirAlex Muir 06/27/2016 at 07:330 Comments

An important feature of the OpenFence system is the ability to update the fence position remotely and to be able to track the animals’ movements over the day. This requires some sort of wireless communication. As was mentioned in the component selection above, LoRa has been chosen for the physical layer of the system. The HopeRF RFM95W is a 915MHz module, which has the ability to transmit over long distances with low power consumption, and is available in relatively cheap modules.

The network will use a star topology with the collar nodes only looking to receive packets after they complete a transmission. This will reduce the power consumption significantly by not having the module always looking to receive data. The star topology was chosen over the option of a mesh network, as it would require the collar nodes to be always receiving and then sometimes retransmitting messages, consuming much more energy. Another flaw with using a mesh network for this application is that the position of the animals will be constantly changing, making it difficult for the network to find the most efficient path to a particular end node.

The “RadioHead” library (GNU GPLv2) is available for the RFM95W that is being used for this project. This library provides the ability to transmit and receive reliable (acknowledged) packets to up to 255 nodes as standard, with the possibility of altering this to allow more node IDs. It supports broadcasting to all nodes, and has the ability to classify messages into 16 different categories using 4 bits of flags in the header. The complete message format is shown below.

Currently there are two types of messages that are being sent between the base station and collar. The first is a position update from the collar to the base station and contains the location, time, date and number of alerts and shocks so far today. The second is a fence update from the base station to the collar and contains the fence version, number of corners, and the positions of these corners. Both of these two packets are 20bytes as can be seen in below.

Discussions