Farm-Data-Relay-System/README.md

35 lines
3.3 KiB
Markdown
Raw Normal View History

2022-02-07 03:55:04 +00:00
# <p align="center">Farm Data Relay System
##### <p align="center">[***In loving memory of Gay Holman, an extraordinary woman.***](https://www.facebook.com/CFECI/posts/2967989419953119) #####
2020-12-18 13:56:29 +00:00
2022-02-07 03:53:29 +00:00
The Farm Data Relay System is an easy way to link remote sensors to the internet without the need for WiFi. It uses the ESP-NOW protocol on widely available ESP32 and ESP8266 microcontroller boards, and can be used to collect and transmit sensor data in situations where it would be too difficult or energy-consuming to provide full WiFi coverage.
2021-10-09 02:05:53 +00:00
2022-02-07 03:53:29 +00:00
Using an assigned MAC address scheme allows for the whole system to be configured by setting just a handful of values in code. Every ESP-NOW gateway is assigned a single-byte identifier, known as the UNIT_MAC. This, along with a set 5-byte preamble, is assigned to the MAC address of the ESP at boot.
2021-10-25 22:17:32 +00:00
2022-02-07 03:53:29 +00:00
Gateways can be configured to send an ESP-NOW transmission either to the serial port using JSON, another ESP-NOW gateway, or broadcast it via LoRa PHY. An incoming transmission from the serial port can also be routed to the same interfaces, with the addition of MQTT.
2020-12-18 13:56:29 +00:00
2021-11-26 18:22:49 +00:00
## Getting Started
2022-02-07 03:53:29 +00:00
To use FDRS with Node-Red and MQTT you'll need two ESP devices (gateways) that are connected via UART, plus additional ESP devices with sensors connected.
The two **gateways** are programmed using the instructions [found with the Gateway2000 sketch](https://github.com/timmbogner/Farm-Data-Relay-System/tree/main/FDRS_Gateway2000).
The **sensors** can either use the [example sketches](https://github.com/timmbogner/Farm-Data-Relay-System/tree/main/Sensors) included, or you can use the “fdrs_sensor.h” file to [use FDRS with a sketch youve already written.](https://github.com/timmbogner/Farm-Data-Relay-System/tree/main/FDRS_Sensor2000)
2022-02-07 18:04:14 +00:00
![Basic](/FDRS_Gateway2000/Basic_Setup.png)
2022-02-07 03:53:29 +00:00
### Sensors
2021-10-09 02:40:53 +00:00
```
typedef struct DataReading {
float d;
uint16_t id;
uint8_t t;
} DataReading;
```
2022-02-07 04:02:28 +00:00
Each sensor in the system sends its data over ESP-NOW as a float 'd' inside of a structure called a DataReading. Its global sensor address is represented by an integer 'id', and each type is represented by a single byte 't'. If sensors need to send multiple types of readings (ex: temp and humidity), then they are sent in an array of DataReadings. A single DataReading.id may have multiple readings of different types associated with it.
2021-10-09 02:05:53 +00:00
## Thank you
2022-02-07 04:02:28 +00:00
...very much for checking out my project! I truly appreciate everyone across the net who has reached out with assistance and encouragement. If you have any questions, comments, or issues please feel free to contact me at bogner1@gmail.com.
2021-11-26 23:14:45 +00:00
2021-11-26 23:27:31 +00:00
If you have any extra money laying around, you could [send it to me via this Paypal link](https://www.paypal.com/donate/?business=F2MYGWWTGG5PN&no_recurring=0&item_name=Anything+helps%21&currency_code=USD). I'm a farmer by occupation, and donations would help me to spend more time developing farm gadgets over the winter months.
2021-11-26 23:10:42 +00:00
A big thank you to both [***Sola Gratia Farm***](https://www.solagratiacsa.com/) and ***The IDEA Store*** of *Urbana, IL, USA*, without whom this project would not exist.
2022-02-07 03:57:05 +00:00
A huge thanks to the ever-instructional [**Andreas Spiess**](https://www.youtube.com/channel/UCu7_D0o48KbfhpEohoP7YSQ).
2022-02-07 03:53:29 +00:00
2022-02-07 03:57:05 +00:00
[**Random Nerd Tutorials**](https://randomnerdtutorials.com/) is also an indispensable source of ESP knowledge.