LakeNet Stateless LoRa Mesh Network
|University of Idaho Coeur d'Alene
|Fall 2020 - Spring 2021
The goal of the project is.................................
Problem Definition[edit | edit source]
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[edit | edit source]
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[edit | edit source]
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[edit | edit source]
- Heltec LoRa Wifi ESP-32 v.2 boards (915 mhz)
- GPS Sensor
- ASAIR DHT22 Temp/Humidity Sensor
- MySQL Database
Value Proposition Statement[edit | edit source]
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[edit | edit source]
- 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[edit | edit source]
- 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[edit | edit source]
The final design of our project contained 2 tasks.
- 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
|[Packet Type] [Packet ID] [Src Mac] [Dest Mac] [Payload] [Mac addr of any node*]
|0 300 BC70 A27C Temp 24.80 BC70
| [Packet ID] [Dest Mac]
|1 300 BC70
| [Packet ID] [Packet ID to remove]
|2 401 201
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[edit | edit source]
|Initial Transmit LoRa test
|Demonstrate Sending and Receiving Packet
|Success. Packets sent and received
|Create a packet in FreeRTOS on ESP32
|Success. Created unique packets with identifiers (nodes)
|Implement temp/humidity sensor into network nodes
|Success. Other sensors can be added later.
|GPS Setup and Sync
|Setup GPS modules and sync them.
|ESP32, Neo6m GPS
|Success. Timing works between nodes and gateway node.
|RTOS LoRa Send/Receive Packets
|Send and receive packets through RTOS.
|Success. Each node is given distinct name in code.
|Send data to database
|Move data from network node packet to DB.
|ESP32, Apache Web Server, MySQL database
|Success. DB can be accessed publically.
Team Members[edit | edit source]
Major: Computer Science
Major: Computer Science
Major: Computer Science
Additional Documentation[edit | edit source]