From 91aeb11402a7408d2122181b6410d934c91d3d31 Mon Sep 17 00:00:00 2001 From: Timm Bogner <64260873+timmbogner@users.noreply.github.com> Date: Thu, 6 Oct 2022 05:33:35 -0500 Subject: [PATCH] remove .gitignore --- .gitignore | 2 -- .../Sensor_Examples/SHT20_fdrs/SHT20_fdrs.ino | 24 +++++++++++++ .../SHT20_fdrs/fdrs_sensor_config.h | 34 +++++++++++++++++++ src/fdrs_globals.h | 27 +++++++++++++++ 4 files changed, 85 insertions(+), 2 deletions(-) delete mode 100644 .gitignore create mode 100644 examples/Sensor_Examples/SHT20_fdrs/SHT20_fdrs.ino create mode 100644 examples/Sensor_Examples/SHT20_fdrs/fdrs_sensor_config.h create mode 100644 src/fdrs_globals.h diff --git a/.gitignore b/.gitignore deleted file mode 100644 index fe837f1..0000000 --- a/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ - -fdrs_globals.h diff --git a/examples/Sensor_Examples/SHT20_fdrs/SHT20_fdrs.ino b/examples/Sensor_Examples/SHT20_fdrs/SHT20_fdrs.ino new file mode 100644 index 0000000..6ec9850 --- /dev/null +++ b/examples/Sensor_Examples/SHT20_fdrs/SHT20_fdrs.ino @@ -0,0 +1,24 @@ +// FARM DATA RELAY SYSTEM +// +// SENSIRION SHT20 SENSOR MODULE +// +// Developed by Timm Bogner (timmbogner@gmail.com) in Urbana, Illinois, USA. +// If you are using the sensor for air monitoring, change SOIL_T to HUMIDITY_T. +// +#include "DFRobot_SHT20.h" +#include "fdrs_sensor_config.h" +#include + +DFRobot_SHT20 sht20(&Wire, SHT20_I2C_ADDR); + + +void setup() { + beginFDRS(); + sht20.initSHT20(); +} +void loop() { + loadFDRS(sht20.readHumidity(), SOIL_T); + loadFDRS(sht20.readTemperature(), TEMP_T); + sendFDRS(); + sleepFDRS(300); //Sleep time in seconds +} diff --git a/examples/Sensor_Examples/SHT20_fdrs/fdrs_sensor_config.h b/examples/Sensor_Examples/SHT20_fdrs/fdrs_sensor_config.h new file mode 100644 index 0000000..cd1419a --- /dev/null +++ b/examples/Sensor_Examples/SHT20_fdrs/fdrs_sensor_config.h @@ -0,0 +1,34 @@ +// FARM DATA RELAY SYSTEM +// +// Sensor Configuration + +#include + +#define READING_ID 11 //Unique ID for this sensor +#define GTWY_MAC 0x01 //Address of the nearest gateway + +#define USE_ESPNOW +//#define USE_LORA +#define DEEP_SLEEP +//#define POWER_CTRL 14 +#define FDRS_DEBUG +#define DEBUG_CONFIG // Displays full config info on startup + +//SPI Configuration -- Needed only on chipsets with multiple SPI interfaces (ESP32) +#define SPI_SCK 5 +#define SPI_MISO 19 +#define SPI_MOSI 27 + +//LoRa Configuration +#define LORA_SS 18 +#define LORA_RST 14 +#define LORA_DIO0 26 +//433E6 for Asia +//866E6 for Europe +//915E6 for North America +//#define LORA_BAND 915E6 // LoRa Frequency Band +//#define LORA_SF 7 // LoRa Spreading Factor +//#define LORA_TXPWR 17 // LoRa TX power in dBm (+2dBm - +20dBm), default is +17dBm +//#define LORA_ACK // Request LoRa acknowledgment. Increases battery usage. +//#define LORA_ACK_TIMEOUT 400 // LoRa ACK timeout in ms. (Minimum = 200) +//#define LORA_RETRIES 2 // LoRa ACK retries [0 - 3] diff --git a/src/fdrs_globals.h b/src/fdrs_globals.h new file mode 100644 index 0000000..80cbc4d --- /dev/null +++ b/src/fdrs_globals.h @@ -0,0 +1,27 @@ +/* FARM DATA RELAY SYSTEM +* +* "fdrs_globals.h" +* +* Developed by Timm Bogner (timmbogner@gmail.com) for Sola Gratia Farm in Urbana, Illinois, USA. +*/ + +#ifndef FDRS_GLOBALS +#define FDRS_GLOBALS + +#define GLOBAL_SSID "Your SSID" +#define GLOBAL_PASS "Password" + +#define GLOBAL_MQTT_ADDR "192.168.0.8" +#define GLOBAL_MQTT_PORT 1883 + +//#define GLOBAL_MQTT_AUTH //uncomment to enable MQTT authentication +#define GLOBAL_MQTT_USER "Your MQTT Username" +#define GLOBAL_MQTT_PASS "Your MQTT Password" + +#define GLOBAL_LORA_BAND 915E6 // LoRa Frequency Band +#define GLOBAL_LORA_SF 7 // LoRa Spreading Factor +#define GLOBAL_LORA_TXPWR 17 // LoRa TX power in dBm (+2dBm - +20dBm), default is +17dBm. Lower power = less battery use +#define GLOBAL_LORA_ACK_TIMEOUT 400 // ms timeout waiting for LoRa ACKs (if enabled). Wouldn't go less than 200ms +#define GLOBAL_LORA_RETRIES 2 + +#endif //FDRS_GLOBALS