Tutela - Farm Health Monitoring System
Real-time health monitoring system for pig farms with hierarchical data tracking and historical lookup capabilities
The system uses a hierarchical three-level topic structure:
Field
Type
Description
farmTopicId
string
Hedera Topic ID for the farm
ethAddress
string
Farm owner's Ethereum address
farmerName
string
Name of the farmer
timestamp
ISO date
Registration timestamp
Field
Type
Description
pigTopicId
string
Hedera Topic ID for the pig
rfid
string
Pig's RFID identifier
timestamp
ISO date
Registration timestamp
Field
Type
Description
hasFever
boolean
Fever status flag
temperature
number
Temperature reading
timestamp
ISO date
Measurement timestamp
Hedera Consensus Service
Cloud Functions for API endpoints
Topic IDs as foreign keys
JSON formatted messages
CORS-enabled web access
OpenAI LLM and Langchain Integration
Endpoint
Method
Purpose
/createRegion
POST
Creates new region topic
/registerFarm
POST
Creates farm topic and links to region
/registerPig
POST
Creates pig topic and links to farm
Endpoint
Method
Purpose
/getFarmId
GET
Retrieves farm details from region
/getTopicMessages
GET
Gets all messages for any topic
/submitPigFeverStatus
GET
Records pig health status
Example IoT device call:
GET / submitPigFeverStatus ?rfid = 123 & hasFever = true
© December 18th, 2024