How bytecod3/ear-tag works
This repository is an in-progress LoRa cattle ear-tag system: an onboard device is intended to collect motion and GPS data, send it through a base station, and present locations to a farmer. The sampled tag firmware contains MPU6050 processing, GPS sampling, Wi-Fi provisioning, and an HTTP upload routine; the README also describes LoRa transmission. The base station currently receives and prints packets, while the web server stores location posts and provides a live-update mechanism. Firmware control flow and browser-side wiring are only partly visible, so those links are not assumed.
Main entry points: server.js HTTP and WebSocket server · src/main.cpp Onboard firmware · mpu.cpp MPU6050 processing · src/main.cpp LoRa receiver
Components 12
Ear-tag firmware
- Onboard firmware
firmware/onboard-device/src/main.cpp - MPU6050 processing
firmware/onboard-device/src/mpu.cpp - GPS sampling
firmware/onboard-device/src/main.cpp
Radio station
- LoRa receiver
firmware/base-station/src/main.cpp
Web platform
- HTTP and WebSocket server
web-app/server.js - MongoDB locations
- Map page
web-app/views/index.ejs - Map client
web-app/public/js/map.js
Tag sensors
- MPU6050
- GPS module
Other components
- Farmer
- Farmer device
Connections 12
- Onboard firmware → MPU6050 processing: uses
firmware/onboard-device/src/main.cpp - MPU6050 processing → MPU6050: reads I2C
firmware/onboard-device/src/mpu.cpp - Onboard firmware → GPS sampling: samples
firmware/onboard-device/src/main.cpp - GPS sampling → GPS module: reads coordinates
firmware/onboard-device/src/main.cpp - Onboard firmware → LoRa receiver: sends LoRa
README.md - Onboard firmware → HTTP and WebSocket server: POSTs location
- HTTP and WebSocket server → MongoDB locations: saves locations
web-app/server.js - HTTP and WebSocket server → MongoDB locations: queries locations
web-app/server.js - HTTP and WebSocket server → Map page: renders
web-app/server.js - HTTP and WebSocket server → Farmer device: broadcasts updates
web-app/server.js - Farmer → Farmer device: views map
README.md - Farmer device → Map client: uses