Close
0%
0%

Range Testing with FDRS and Node-RED

Test the range of ESP-NOW and LoRa radios

Similar projects worth following
In this project I will show how to use Farm Data Relay System (FDRS) with a GPS module to test the limits of ESP-NOW and LoRa radios.

https://github.com/timmbogner/Farm-Data-Relay-System

In this project I will demonstrate how to implement an FDRS system that provides connectivity from a GPS device to a Node-RED server.

GPS coordinates are obtained using a GNSS module connected to a TTGO LoRa 32 v1 board. The device will send these coordinates using either ESP-NOW or LoRa to another module located in a clear, elevated area. The elevated device next sends the data via ESP-NOW to a ThingPulse ESPGateway Ethernet located nearby.  This final gateway posts the coordinates to an MQTT server, where they can be accessed by Node-RED.

Once they've arrived in Node-RED, the coordinates will be plotted using the WorldMap node.  You can then log them into a file or database.


gps_flow.json

Node-RED flows

JavaScript Object Notation (JSON) - 4.60 kB - 03/27/2023 at 06:03

Download

range-test.zip

Arduino files

x-zip-compressed - 2.22 MB - 03/27/2023 at 06:03

Download

  • 1
    Install FDRS and Flash Your Devices

    In this tutorial I will assume that you have already installed Arduino IDE and the latest ESP32/8266 board definitions.

    Install FDRS

    Download and extract 'range_testing.zip'. Copy the folder titled 'Farm-Data-Relay-System' into your Arduino 'libraries' folder.

    Flash your devices

    Gateway #1

    The first gateway sends all received data to Node-RED, either by a USB-UART connection or ethernet.  It can be any ESP module, but I recommend using a standard ESP8266 WeMos D1 Mini, an ESP32 Dev Kit, or the ThingPulse ESPGateway Ethernet.

    If using ethernet, go to the attached 'fdrs_gateway_config.h', and uncomment the line that says:

    #define USE_ETHERNET
    

    Select the board you are using ('ESP32 Dev Module' for ThingPulse Gateway), choose the the COM port that your board is connected to, and press "Upload". 

    Gateway #2

    The second gateway acts as an ESP-NOW/LoRa access point for sensors and controllers. It forwards any data that it receives directly to the first gateway.

    Select the board "TTGO LoRa32-OLED", choose the the COM port that your board is connected to, and press "Upload".

    GPS Node

    The GPS node obtains its GPS coordinates and sends them via LoRa to the second gateway at ten second intervals.
    To test your ESP-NOW coverage instead, switch the following two options in 'fdrs_node_config.h' to look like this:

    #define USE_ESPNOW
    //#define USE_LORA

    Select the board "TTGO LoRa32-OLED", choose the the COM port that your board is connected to, and press "Upload".

  • 2
    Prepare Node-RED

    In this tutorial I will assume that you already have a Node-RED server up and running, as well as an MQTT broker if taking that option.

    Add Contributed Nodes

    Click the menu in the top right corner, then choose "Manage palette" (alt-shift-p). Click the install tab and find/install 'node-red-contrib-web-worldmap' and 'node-red-node-serialport' (if using UART).

    Import Flow

    Download 'gps_flow.json' and import it into Node-RED using the "Import" option from the menu (ctrl-i).

    If you are using USB/UART: 

    • Double-click on the serial node, edit the configuration and choose the COM port that Gateway #1 is connected to. 

    If you are using ethernet/MQTT: 

    • Double-click on the MQTT node and enter the address of your MQTT broker. 
  • 3
    Prepare and Position Your Devices

    Gateway #1

    If you are using USB/UART:

    • Gateway #1 will be plugged directly into the server that is running Node-RED via USB.

    If you are using ethernet/MQTT:

    • Gateway #1's ethernet will be connected to your network, and its USB to a wall outlet.

    Gateway #2 

    This gateway will be listening for the GPS node, so it's important for it to be positioned in a spot where it will get good reception. A roof or attic window would be perfect. Keep in mind that while it can run off batteries for a few hours, this device will need to remain plugged into a power source for normal use. 

    GPS Node

    There are three wires that should be connected between the GPS module and the LoRa module:

    TTGO  ---  GPS Module

    3V3       ---   VCC
    GND      ---   GND
    GPIO13  ---   TXD

    To power the GPS node you can use your own battery with the TTGO's onboard battery circuit, or run it off of USB.

View all 5 instructions

Enjoy this project?

Share

Discussions

JP Gleyzes wrote 03/16/2023 at 12:12 point

Thanks sooooo much Timm to share this excellent library!

  Are you sure? yes | no

Timm Bogner wrote 03/27/2023 at 06:06 point

It's finally ready to go! Thanks for your support, JP!

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates