diff --git a/README.md b/README.md index 5751784..40e65bb 100644 --- a/README.md +++ b/README.md @@ -1,89 +1,4 @@ -# Documentation: Wireless Decentralized Network Prototype +# ApfelNetzwerk -## Table of Contents -1. [Introduction](#introduction) -2. [Requirements](#requirements) -3. [Approaches](#approaches) - - [LoRa/WAN Approach](#lora-wan-approach) - - [BLE Approach](#ble-approach) - - [WLAN Approach](#wlan-approach) -4. [Devices Used and Tested](#devices-used-and-tested) -5. [Development Environments](#development-environments) -6. [Challenges and Issues](#challenges-and-issues) - - [BLE Issues](#ble-issues) - - [LoRa/WAN Issues](#lora-wan-issues) - - [WLAN Issues](#wlan-issues) - - [ESP-MESH](#esp-mesh) -7. [Conclusion](#conclusion) - ---- - -## Introduction - -The wireless decentralized network prototype aims to explore the feasibility of creating a low-power communication network for agricultural purposes. This network is designed to facilitate communication between devices over long distances without the need for traditional centralized infrastructure. Several communication protocols and hardware devices were tested, and their performance and feasibility were analyzed to determine the most suitable approach. - -## Requirements - -- Low-power communication between devices. -- Decentralized structure (no need for a central hub or server). -- Support for long-range communication across large fields (e.g., agricultural applications). -- Flexible communication protocol to support a variety of devices. - -## Approaches - -The following communication protocols were explored in our prototype development: - -### LoRa/WAN Approach -LoRa (Long Range) is a wireless technology that allows for long-distance communication with low power consumption. LoRaWAN adds a network layer to LoRa, enabling devices to connect over large distances with minimal power usage. This protocol is often favored for IoT projects requiring long-range communication. - -### BLE Approach -Bluetooth Low Energy (BLE) is a short-range wireless communication protocol designed for low-power devices. It is suitable for small data packets over shorter distances but faces limitations in range compared to other technologies like LoRa. - -### WLAN Approach -WLAN (Wireless Local Area Network) communication via ESP-NOW is a low-power communication technology that allows devices to communicate directly without a router. It provides low-latency data transmission but is limited in range. - -## Devices Used and Tested - -| Device | Communication Type | Notes | -|----------------------|---------------------|----------------------------------------| -| Raspberry Pi Pico | BLE | Stack issues during compilation | -| Rak Wireless | LoRa/WAN | Limited due to single module availability | -| ESP8266 (ESP-NOW) | WLAN | Successful testing with low power usage | - -## Development Environments - -- **Arduino IDE**: Used to develop and test with **Rak Wireless** and **ESP8266** for both LoRa/WAN and WLAN. -- **VSCode**: Used for developing on **Raspberry Pi Pico** with BLE, though the BLE stack compilation issues halted progress. - -## Challenges and Issues - -### BLE Issues - -- The Bluetooth stack for the **Raspberry Pi Pico** did not compile, resulting in the inability to transmit or receive data. -- No usable data could be exchanged via the BLE approach, which halted further development and testing with BLE for this project. - -### LoRa/WAN Issues - -- We only had **one LoRa/WAN module**, meaning we could only transmit or receive data, but not establish a complete network. -- Due to the absence of multiple modules, we couldn’t properly test the decentralized network capabilities. - -### WLAN Issues - -- The **ESP-NOW** protocol using **ESP8266** was successful in terms of data transmission and reception with low power consumption. -- However, the **range limitations** are a concern. ESP-NOW can reach about **480 meters in good conditions**, which is significantly less than the **16 km** range achievable with LoRa under ideal conditions. -- For small-scale or prototype testing, WLAN (ESP-NOW) is sufficient, but in large agricultural fields, the shorter range may become a critical issue. - -### ESP-MESH -- The continuation of the **ESP-NOW** protocol is done in the **ESP-MESH** protocol however that is only usable the ESP32 variations which we dont have enough of to build a decentralized network, we also had problems talking to the ESP32 which in turn ment that we could not work with it. - -## Conclusion - -In this project, we explored three different approaches—LoRa/WAN, BLE, and WLAN (ESP-NOW)—for building a decentralized, wireless communication network. Each technology has its own advantages and limitations: - -- **LoRa/WAN** offers the best long-range communication but was hindered by the availability of only one module, preventing a full test. -- **BLE** is not viable due to the compilation issues and range limitations. -- **WLAN (ESP-NOW)**, though limited in range compared to LoRa, showed promise for short-distance, low-power communication in prototype testing. ---- -- **Hardware** we hat a lot of problems finding the right hardware to do the job because either we experienced unusual errors that we could not solve or the device was incapable of the protocol we are trying to develop with - -For future developments, expanding the availability of **LoRa/WAN modules** would be ideal, as it would allow for thorough testing and deployment of a long-range communication network suitable for large-scale agricultural fields. For small areas, **ESP-NOW** may suffice, but further testing is required to determine if it meets all the field requirements. +[Considerations](docs/considerations.md) \ +[Setup](docs/SETUP.md) \ No newline at end of file diff --git a/SETUP.md b/docs/SETUP.md similarity index 100% rename from SETUP.md rename to docs/SETUP.md diff --git a/docs/considerations.md b/docs/considerations.md new file mode 100644 index 0000000..5751784 --- /dev/null +++ b/docs/considerations.md @@ -0,0 +1,89 @@ +# Documentation: Wireless Decentralized Network Prototype + +## Table of Contents +1. [Introduction](#introduction) +2. [Requirements](#requirements) +3. [Approaches](#approaches) + - [LoRa/WAN Approach](#lora-wan-approach) + - [BLE Approach](#ble-approach) + - [WLAN Approach](#wlan-approach) +4. [Devices Used and Tested](#devices-used-and-tested) +5. [Development Environments](#development-environments) +6. [Challenges and Issues](#challenges-and-issues) + - [BLE Issues](#ble-issues) + - [LoRa/WAN Issues](#lora-wan-issues) + - [WLAN Issues](#wlan-issues) + - [ESP-MESH](#esp-mesh) +7. [Conclusion](#conclusion) + +--- + +## Introduction + +The wireless decentralized network prototype aims to explore the feasibility of creating a low-power communication network for agricultural purposes. This network is designed to facilitate communication between devices over long distances without the need for traditional centralized infrastructure. Several communication protocols and hardware devices were tested, and their performance and feasibility were analyzed to determine the most suitable approach. + +## Requirements + +- Low-power communication between devices. +- Decentralized structure (no need for a central hub or server). +- Support for long-range communication across large fields (e.g., agricultural applications). +- Flexible communication protocol to support a variety of devices. + +## Approaches + +The following communication protocols were explored in our prototype development: + +### LoRa/WAN Approach +LoRa (Long Range) is a wireless technology that allows for long-distance communication with low power consumption. LoRaWAN adds a network layer to LoRa, enabling devices to connect over large distances with minimal power usage. This protocol is often favored for IoT projects requiring long-range communication. + +### BLE Approach +Bluetooth Low Energy (BLE) is a short-range wireless communication protocol designed for low-power devices. It is suitable for small data packets over shorter distances but faces limitations in range compared to other technologies like LoRa. + +### WLAN Approach +WLAN (Wireless Local Area Network) communication via ESP-NOW is a low-power communication technology that allows devices to communicate directly without a router. It provides low-latency data transmission but is limited in range. + +## Devices Used and Tested + +| Device | Communication Type | Notes | +|----------------------|---------------------|----------------------------------------| +| Raspberry Pi Pico | BLE | Stack issues during compilation | +| Rak Wireless | LoRa/WAN | Limited due to single module availability | +| ESP8266 (ESP-NOW) | WLAN | Successful testing with low power usage | + +## Development Environments + +- **Arduino IDE**: Used to develop and test with **Rak Wireless** and **ESP8266** for both LoRa/WAN and WLAN. +- **VSCode**: Used for developing on **Raspberry Pi Pico** with BLE, though the BLE stack compilation issues halted progress. + +## Challenges and Issues + +### BLE Issues + +- The Bluetooth stack for the **Raspberry Pi Pico** did not compile, resulting in the inability to transmit or receive data. +- No usable data could be exchanged via the BLE approach, which halted further development and testing with BLE for this project. + +### LoRa/WAN Issues + +- We only had **one LoRa/WAN module**, meaning we could only transmit or receive data, but not establish a complete network. +- Due to the absence of multiple modules, we couldn’t properly test the decentralized network capabilities. + +### WLAN Issues + +- The **ESP-NOW** protocol using **ESP8266** was successful in terms of data transmission and reception with low power consumption. +- However, the **range limitations** are a concern. ESP-NOW can reach about **480 meters in good conditions**, which is significantly less than the **16 km** range achievable with LoRa under ideal conditions. +- For small-scale or prototype testing, WLAN (ESP-NOW) is sufficient, but in large agricultural fields, the shorter range may become a critical issue. + +### ESP-MESH +- The continuation of the **ESP-NOW** protocol is done in the **ESP-MESH** protocol however that is only usable the ESP32 variations which we dont have enough of to build a decentralized network, we also had problems talking to the ESP32 which in turn ment that we could not work with it. + +## Conclusion + +In this project, we explored three different approaches—LoRa/WAN, BLE, and WLAN (ESP-NOW)—for building a decentralized, wireless communication network. Each technology has its own advantages and limitations: + +- **LoRa/WAN** offers the best long-range communication but was hindered by the availability of only one module, preventing a full test. +- **BLE** is not viable due to the compilation issues and range limitations. +- **WLAN (ESP-NOW)**, though limited in range compared to LoRa, showed promise for short-distance, low-power communication in prototype testing. +--- +- **Hardware** we hat a lot of problems finding the right hardware to do the job because either we experienced unusual errors that we could not solve or the device was incapable of the protocol we are trying to develop with + +For future developments, expanding the availability of **LoRa/WAN modules** would be ideal, as it would allow for thorough testing and deployment of a long-range communication network suitable for large-scale agricultural fields. For small areas, **ESP-NOW** may suffice, but further testing is required to determine if it meets all the field requirements. diff --git a/docs/use_case_diagram b/docs/use_case_diagram new file mode 100644 index 0000000..b78efc7 --- /dev/null +++ b/docs/use_case_diagram @@ -0,0 +1,34 @@ +digraph { + node [color=lightgrey fontname=Arial shape=ellipse style=filled] + edge [fontname=Arial] + subgraph cluster_sensor_nodes { + color=blue label="Ad-hoc Network" style=dashed + "Sensor Nodes 1" [label="ESP8266 Nodes +(Temperature Sensors)"] + "Sensor Nodes 2" [label="ESP8266 Nodes +(Temperature Sensors)"] + "Sensor Nodes 3" [label="ESP8266 Nodes +(Temperature Sensors)"] + "Sensor Nodes 4" [label="ESP8266 Nodes +(Temperature Sensors)"] + } + "Exit Node" [label="ESP8266 +(Exit Node)"] + "Backend Server" [label="Rust Backend +(on PC)"] + "Postgres DB" [label="PostgreSQL +Database"] + Frontend [label="Frontend +(Web Browser/App)"] + API [label=API] + User [label=User] + "Sensor Nodes 1" -> "Exit Node" [label="Sends Data"] + "Sensor Nodes 2" -> "Exit Node" [label="Sends Data"] + "Sensor Nodes 3" -> "Exit Node" [label="Sends Data"] + "Sensor Nodes 4" -> "Sensor Nodes 3" [label="Sends Data"] + "Exit Node" -> "Backend Server" [label="Sends Data over WLAN"] + "Backend Server" -> "Postgres DB" [label="Persists Data in DB"] + "Backend Server" -> API [label="Provides API Endpoints"] + Frontend -> API [label="API Calls to Backend"] + User -> Frontend [label="Interacts with Frontend"] +} diff --git a/docs/use_case_diagram.py b/docs/use_case_diagram.py new file mode 100644 index 0000000..53f6132 --- /dev/null +++ b/docs/use_case_diagram.py @@ -0,0 +1,45 @@ +import graphviz + +# Create a new Digraph for the use case diagram +use_case = graphviz.Digraph(format='svg') + +# Define the style for nodes and edges +use_case.attr('node', shape='ellipse', style='filled', color='lightgrey', fontname='Arial') +use_case.attr('edge', fontname='Arial') + +# Define the nodes (Actors and Systems) +with use_case.subgraph(name='cluster_sensor_nodes') as c: + c.attr(style='dashed', color='blue', label='Ad-hoc Network') + c.node('Sensor Nodes 1', 'ESP8266 Nodes\n(Temperature Sensors)') + c.node('Sensor Nodes 2', 'ESP8266 Nodes\n(Temperature Sensors)') + c.node('Sensor Nodes 3', 'ESP8266 Nodes\n(Temperature Sensors)') + c.node('Sensor Nodes 4', 'ESP8266 Nodes\n(Temperature Sensors)') + +use_case.node('Exit Node', 'ESP8266\n(Exit Node)') +use_case.node('Backend Server', 'Rust Backend\n(on PC)') +use_case.node('Postgres DB', 'PostgreSQL\nDatabase') +use_case.node('Frontend', 'Frontend\n(Web Browser/App)') +use_case.node('API', 'API') +use_case.node('User', 'User') + +# Add edges between nodes to show interactions + +use_case.edge('Sensor Nodes 1', 'Exit Node', label='Sends Data') +use_case.edge('Sensor Nodes 2', 'Exit Node', label='Sends Data') +use_case.edge('Sensor Nodes 3', 'Exit Node', label='Sends Data') +use_case.edge('Sensor Nodes 4', 'Sensor Nodes 3', label='Sends Data') +use_case.edge('Exit Node', 'Backend Server', label='Sends Data over WLAN') +use_case.edge('Backend Server', 'Postgres DB', label='Persists Data in DB') +use_case.edge('Backend Server', 'API', label='Provides API Endpoints') +use_case.edge('Frontend', 'API', label='API Calls to Backend') +use_case.edge('User', 'Frontend', label='Interacts with Frontend') + +# Render the use case diagram as an SVG + +use_case.render('docs/use_case_diagram') +#use_case.render('/mnt/data/use_case_diagram') + +# Output the file path for user to download + +"docs/use_case_diagram.svg" +#"/mnt/data/use_case_diagram.svg" \ No newline at end of file diff --git a/docs/use_case_diagram.svg b/docs/use_case_diagram.svg new file mode 100644 index 0000000..dba4e77 --- /dev/null +++ b/docs/use_case_diagram.svg @@ -0,0 +1,148 @@ + + + + + + + + +cluster_sensor_nodes + +Ad-hoc Network + + + +Sensor Nodes 1 + +ESP8266 Nodes +(Temperature Sensors) + + + +Exit Node + +ESP8266 +(Exit Node) + + + +Sensor Nodes 1->Exit Node + + +Sends Data + + + +Sensor Nodes 2 + +ESP8266 Nodes +(Temperature Sensors) + + + +Sensor Nodes 2->Exit Node + + +Sends Data + + + +Sensor Nodes 3 + +ESP8266 Nodes +(Temperature Sensors) + + + +Sensor Nodes 3->Exit Node + + +Sends Data + + + +Sensor Nodes 4 + +ESP8266 Nodes +(Temperature Sensors) + + + +Sensor Nodes 4->Sensor Nodes 3 + + +Sends Data + + + +Backend Server + +Rust Backend +(on PC) + + + +Exit Node->Backend Server + + +Sends Data over WLAN + + + +Postgres DB + +PostgreSQL +Database + + + +Backend Server->Postgres DB + + +Persists Data in DB + + + +API + +API + + + +Backend Server->API + + +Provides API Endpoints + + + +Frontend + +Frontend +(Web Browser/App) + + + +Frontend->API + + +API Calls to Backend + + + +User + +User + + + +User->Frontend + + +Interacts with Frontend + + +