A prototype IoT system that can be utilzied by cattlemen/ranchers/farmers for monitoring their animals' and farms' live data.
This system tackles some big concerns for ranchers/livestock breeders/farmers that maintain their business in huge areas by providing crucial information at the user’s web browser. Keeping track of the herds’ whereabouts, informing on the individual animal’s medical/vaccination history and security as long as the barn safety (environmental monitoring) and providing automation on gates and milking infrastructure with specific actuators. The Google Maps API is used for the map visualizations. Microsoft SQL Server is used for the database, Java for the HTTP server and the world simulator and HTML/CSS/Javascript for the front-end.
• Wearing collar sensor
- GPS
- Temperature
- Heart rate
- Normal rumination
- Secure
- Attention
- Timestamp
• History is saved
- Birth date
- Parents
- Vaccinations
- Is sick
- Sex
- Has given birth
- Milk production
• Milk Pumps
- Available
- Cow using it
- Milk on tank
• Gates (open-close)
A simulated farm starts when executing the initFarm module. Three milk pumps are created and a number of animals (belonging in various herds) with random history, random sensor data and a random location inside the farm. The Simulator module gives life to the farm. Animals move around, have their colar sensor data changed and go for milking at the three pumps. The AccessSensor servlet handles requests for the client to get a sensor with specific id, add a new sensor to the system and delete a sensor using the http://{{ip}}:8080/CattleMonitoring/accessSensor/ endpoint. The API of the app is:
Paths | Methods |
---|---|
/CattleMonitoring/accessSensor/ | GET, POST, DELETE |
/CattleMonitoring/accessSensors/ | GET |
/CattleMonitoring/accessAnimal/ | GET, POST, DELETE |
/CattleMonitoring/accessAnimals/ | GET |
/CattleMonitoring/accessMilkPump/ | GET |
/CattleMonitoring/accessMilkPump/ | GET |
Microsoft SQL Server and Java Runtime Environment are prerequisites for the machine that hosts the back-end. The database should first be enabled as a windows service (MSSQLSERVER → Start). Then, open the project in eclipse and put the 4 jars in the classpath of the project files located in the C:...\CattleMonitoring\WebContent\WEB INF\lib folder. JDBC is the driver enabling the communication with the database, while the Jackson libraries are used for converting objects to JSON and vice versa. Next, we create a Tomcat v9.0 Server at localhost from eclipse and add the CattleMonitoring project to the server. We start the server (Start) and the see the message INFO: Server startup in [xxxx] milliseconds in the eclipse console. To create a new farm with x number of animals we run InitFarm and change numOfAnimals = x. To start the emulator and begin life on the farm we run the Simulator. The server is now ready to serve requests.