LakeNet Stateless LoRa Mesh Network

The goal of the project is................................. =Problem Definition= Project Goal: Develop a mesh network of nodes to be placed in buoys around lake Coeur d'Alene. These buoys will contain ESP-32 microcontrollers to monitor and record data such as O2 content, water temperature, and air temperature around the lake, and send that data back to a database in Coeur d'Alene to help with future lake reclamation projects.

Background
North Idaho has an extensive mining history that has created environmental problems that threaten Lake Coeur d'Alene. Currently, 75 million metric tons of contaminated sediment on the lake bed are the focus of ongoing cleanup by the EPA. The computer science department at the University of Idaho is involved in Our Gem Coeur d'Alene Lake Collaborative to "preserve lake health and protect water quality." Our team is tasked with creating a low-cost, low maintenance mesh network of nodes to collect data about the lakes of Coeur d'Alene to aid in the environmental monitoring of the lake.​

Deliverables
The network devices must:
 * Integrate nodes into a stateless LoRa mesh network.
 * Collect useful data such as Temp, Humidity, GPS location, and time.
 * Send data from the network nodes about the lake to a database.
 * Be robust and fixable. If a node in the network goes down for any reason, the rest of the nodes in the network should continue to send important information to the database.

Specifications
Node Specifications:
 * Heltec LoRa Wifi ESP-32 v.2 boards (915 mhz)
 * GPS Sensor
 * ASAIR DHT22 Temp/Humidity Sensor
 * MySQL Database

Value Proposition Statement
The lakes and waters of North Idaho and the surrounding areas are in need of environmental monitoring and data gathering in order to maintain the health of the bodies of water. There is a need to create some sort of system that can be implemented into the lakes to collect data in an efficient and low-cost manner. The goal of this project is to implement ESP32s, low-powered microcontrollers, into these bodies of water to create a stateless mesh network of nodes using LoRa, or Long Range communication. This solution will be inexpensive and will also require little maintenance, while also providing frequent information gathering.

=Design Considerations=
 * Each LoRa node should be robust and independent so that if a node goes down, the system will remain operational.
 * The timing on the GPS sensors will sync nodes so they can communicate at the appropriate times to prevent data flooding.
 * Sensors can be added to the system to collect other kinds of data for lake reclamation work.
 * Packets sent by the LoRa nodes should maintain data integrity from the time of collection to storage in the database.
 * Packets will be preserved (as long as possible) until the payload is integrated into the database.

=Project Learning=
 * Create an RTOS (Real Time Operating System) using freeRTOS
 * Doug Park's Masters Thesis and project on A Stateless LoRa Mesh Network
 * How to gather data from microcontroller sensors

=Final Design=

Gateway node: Network nodes:
 * Task Create (priority 1) creates a packet. Depending on the packet type, it might pull data from the DHT22 temp sensor.
 * Task Scheduler (priority 24) decides what to do based on packet type. Sometimes it sends, listens, or blocks.
 * Future Task Suggestions:
 * Task for sensors to gather data
 * Task for sleep function
 * WiFi to connect to server. LoRa to connect to SBNPL network nodes
 * Not an RTOS. Implemented with loops
 * 3 Queues: Transfer Queue, Backup Queue, Visitor List
 * Sync time, broadcast time, listen time
 * Data packet, Node receipt, end receipt

Simple explanation:

When a data packet (call it packet A) is created by a node, a copy is made and put in the backup queue, and is sent to the next node. If the node is not the gateway node, it is added to the VL, and BQ, then transmitted by the next node. When the original packet (packet A) makes it to the gateway node, the payload is added to the database, then an ER (end receipt) is created and sent back to the network nodes. When the network nodes receive the ER, they check the ER against what is in the backup queue, and if the ER matches the packet in the backup queue, the data packet in the backup queue is dropped, and the ER is passed to the nodes that need the ER for packet A. If for some reason, packet A does not reach the gateway node, the node in the backup queue will be pulled into the TQ to be sent to the gateway node.

=Validation=

=Team Members=

=Additional Documentation=

Project Schedule

Gantt Chart

Presentations

Concept Design Review Snapshot 1 Snapshot 2 Snapshot 3 Expo Presentation

Project Budget

Budget