This shows you the differences between two versions of the page.
iothings:proiecte:2023sric:loratrackingsystem [2024/05/30 01:32] sebastian.matusa [Results] |
iothings:proiecte:2023sric:loratrackingsystem [2024/05/30 01:56] (current) sebastian.matusa [Google Sheets Data] |
||
---|---|---|---|
Line 6: | Line 6: | ||
===== Introduction ===== | ===== Introduction ===== | ||
+ | |||
+ | The rapid growth of the Internet of Things (IoT) has led to the development of innovative solutions to enhance device performance, making them more user-friendly and cost-effective. IoT devices like sensors, actuators, and gateways form ecosystems that address various problems, with Low-Power Wide-Area Network (LPWAN) technologies playing a crucial role. | ||
+ | |||
+ | Traditional wireless technologies are often inefficient for specific embedded tasks. The need for extensive coverage, low energy consumption, and affordable equipment has driven the adoption of LPWAN technologies such as LoRaWAN, SigFox, and NB-IoT. Among these, LoRaWAN has become particularly popular due to its low energy consumption, high communication capacity, and robustness in urban environments. | ||
+ | |||
+ | Geolocation of IoT devices poses a significant challenge, especially with the high energy demands of GPS modules. This project aims to develop a geolocation system using the Heltec WiFi LoRa32(V2)-F board, combining WiFi scanning and LoRaWAN communication to accurately locate IoT devices in urban settings. This approach offers a practical and energy-efficient solution for IoT geolocation. | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
===== Objective ===== | ===== Objective ===== | ||
+ | The objective of this project is to develop an integrated geolocation system using the Heltec WiFi LoRa32(V2)-F board that combines WiFi scanning and LoRaWAN communication to accurately determine the position of IoT devices in urban environments. This system aims to: | ||
+ | |||
+ | - Utilize the ESP32 module's WiFi capabilities to scan and identify surrounding WiFi networks, capturing SSID data to enrich the geolocation dataset. | ||
+ | - Transmit the collected WiFi SSID data over a low-power, wide-area LoRaWAN network to a central server for processing. | ||
+ | - Implement a custom payload decoder on The Things Network (TTN) to interpret the transmitted data and store it in Google Sheets for organized and accessible data management. | ||
+ | - Employ a MATLAB script to calculate the geoid coordinates of the ESP32 board by estimating distances from multiple gateways based on RSSI values, addressing the challenges posed by urban density and signal disruptions. | ||
+ | - Achieve a practical level of geolocation accuracy, while identifying areas for future improvements in gateway density, spatial distribution, and RSSI model calibration. | ||
+ | Through this project, I aim to demonstrate the feasibility and practical application of combining WiFi and LoRaWAN technologies for geolocation purposes in IoT deployments within urban settings. | ||
===== Hardware ===== | ===== Hardware ===== | ||
Line 197: | Line 216: | ||
{{:iothings:proiecte:2023sric:ttn_overview.png?750|}} | {{:iothings:proiecte:2023sric:ttn_overview.png?750|}} | ||
+ | A TTN (The Things Network) application was created, and the device was registered using Over-The-Air Activation (OTAA). The device is configured to operate on the European frequency plan (863-870 MHz) and adheres to LoRaWAN Specification 1.0.2 with Regional Parameters version RP001 1.0.2 revision B. The live data section shows successful uplink and downlink communication events, indicating that the device is correctly sending and receiving data through the TTN gateway. | ||
=== Payload Decoder === | === Payload Decoder === | ||
Line 255: | Line 275: | ||
{{:iothings:proiecte:2023sric:webhook.png?800|}} | {{:iothings:proiecte:2023sric:webhook.png?800|}} | ||
+ | The webhook configuration is designed to bridge The Things Network (TTN) application with Google Sheets. The webhook, identified as "iot-sric-project-webhook," is set to format data in JSON and directs uplink messages to a specified Google Script URL. This setup ensures that uplink messages received by the TTN application are forwarded to Google Sheets for logging and further analysis. This integration facilitates seamless data transfer from IoT devices to a user-friendly and accessible data management platform. | ||
- | ==== Google Sheets Script ==== | + | |
+ | |||
+ | ==== Google Sheets ==== | ||
+ | The data received in Google Sheets includes the following fields: Device ID, Application ID, Device EUI, Device Address, Received At, Port, Undecoded Payload, SSIDs, Gateway ID, EUI, RSSI, SNR, Latitude, Longitude, and Altitude of the gateway. | ||
+ | |||
+ | === Google Sheets Script === | ||
<code> | <code> | ||
Line 385: | Line 411: | ||
The primary purpose of this script is to collect and organize data from LoRaWAN devices into a structured format within a Google Sheets spreadsheet. It handles both the data from the devices themselves (including SSIDs detected by the devices) and metadata from the gateways that received the uplink messages, ensuring all relevant information is logged efficiently. | The primary purpose of this script is to collect and organize data from LoRaWAN devices into a structured format within a Google Sheets spreadsheet. It handles both the data from the devices themselves (including SSIDs detected by the devices) and metadata from the gateways that received the uplink messages, ensuring all relevant information is logged efficiently. | ||
- | === Google Sheets Data === | + | |
Line 499: | Line 525: | ||
===== Conclusions ===== | ===== Conclusions ===== | ||
+ | Hardware and Software Integration: | ||
+ | * The Heltec WiFi LoRa32(V2)-F board effectively integrates WiFi and LoRa capabilities, making it suitable for IoT applications requiring low-power, wide-area communication. The provided code successfully prepares and transmits WiFi SSID data over the LoRa network using the ESP32 and SX1276/SX1278 chipsets. | ||
+ | |||
+ | Data Collection and Decoding: | ||
+ | * The board's code accurately collects and transmits WiFi SSID data, which is then decoded by The Things Network (TTN) using a custom payload decoder. The decoded data is logged into Google Sheets via a custom webhook, ensuring the information is well-organized and easily accessible for further analysis. | ||
+ | |||
+ | WiFi Scanning: | ||
+ | * The ESP32 module performs WiFi scans to detect nearby SSIDs, which are included in the LoRa packets sent to the network. These SSIDs are stored in Google Sheets, providing a record of WiFi networks detected during the geolocation process. However, due to privacy concerns, they are not displayed in the accompanying figure. | ||
+ | |||
+ | Geolocation Using RSSI: | ||
+ | * The MATLAB script estimates the geoid coordinates of the ESP32 board by calculating the distances between the board and multiple gateways based on RSSI values. Despite the need for four gateways for optimal triangulation, only three gateways were available due to the urban density in Bucharest. An estimated fourth point was used to complete the calculation. | ||
+ | |||
+ | Accuracy and Challenges: | ||
+ | * The results indicate a satisfactory level of accuracy given the significant signal disruptions in an urban environment, with an estimated error margin of 200-300 meters. Manually entered gateway coordinates, particularly altitude values, may not be realistic, affecting the vertical accuracy of the geolocation results. | ||
+ | |||
+ | Practical Implications: | ||
+ | * The method demonstrates a practical approach to geolocation using LoRaWAN in urban environments where gateway density may be low. The combination of WiFi scanning and LoRa transmission provides a robust data collection mechanism, although improvements in gateway density and positioning accuracy could enhance results. | ||
+ | |||
+ | Future Improvements: | ||
+ | * Increasing the number of detectable gateways and improving their spatial distribution could significantly reduce the geolocation error margin. Automating the entry of gateway coordinates, especially altitude, would enhance the reliability of the geolocation results. Further calibration of the RSSI model parameters (n and A) specific to the local environment can improve distance estimation accuracy. | ||
+ | Overall, the integration of hardware, software, and geolocation techniques proves to be a viable approach for IoT applications, with room for enhancements in gateway density, data accuracy, and the use of WiFi scans to provide additional context and data points for the geolocation process. | ||
===== References ===== | ===== References ===== | ||
- https://docs.heltec.org/en/node/esp32/wifi_lora_32/index.html | - https://docs.heltec.org/en/node/esp32/wifi_lora_32/index.html | ||
- https://www.thethingsnetwork.org/docs/lorawan/end-device-activation/ | - https://www.thethingsnetwork.org/docs/lorawan/end-device-activation/ | ||
- https://github.com/HelTecAutomation/Heltec_ESP32 | - https://github.com/HelTecAutomation/Heltec_ESP32 | ||
+ | - Ertürk, M.A., Aydın, M.A., Büyükakkaşlar, M.T. and Evirgen, H., 2019. A survey on LoRaWAN architecture, protocol and technologies. Future internet, 11(10), p.216. | ||
- Kwasme, H. and Ekin, S., 2019. RSSI-based localization using LoRaWAN technology. IEEE Access, 7, pp.99856-99866. | - Kwasme, H. and Ekin, S., 2019. RSSI-based localization using LoRaWAN technology. IEEE Access, 7, pp.99856-99866. |