mirror of
https://github.com/timmbogner/Farm-Data-Relay-System
synced 2024-11-08 13:10:29 +00:00
Removed relay feedback
This commit is contained in:
parent
930a9abf03
commit
f624aafcf3
@ -3,14 +3,14 @@
|
||||
// GATEWAY MODULE
|
||||
//
|
||||
// Developed by Timm Bogner (bogner1@gmail.com) for Sola Gratia Farm in Urbana, Illinois, USA.
|
||||
// Setup instructions available in the "topography.h" file.
|
||||
// Setup instructions available in the "fdrs_config" file.
|
||||
|
||||
#include <ESP8266WiFi.h>
|
||||
#include <espnow.h>
|
||||
#include <BlynkSimpleEsp8266.h>
|
||||
#include <NTPClient.h>
|
||||
#include <WiFiUdp.h>
|
||||
#include "topography.h"
|
||||
#include "fdrs_config.h"
|
||||
|
||||
#define STASSID "user"
|
||||
#define STAPSK "pass"
|
||||
|
@ -4,7 +4,6 @@
|
||||
// then uncomment the code corresponding to the unit you would like
|
||||
// to be previous and next in the line of communication.
|
||||
// Be sure that all unused lines are commented out.
|
||||
// The terminal does not need a previous nor the gateway a next device.
|
||||
|
||||
// THIS UNIT
|
||||
//#define UNIT_MAC 0x00 // Terminal
|
||||
@ -19,10 +18,3 @@
|
||||
#define PREV_MAC 0x02 // Relay 1
|
||||
//#define PREV_MAC 0x03 // Gateway
|
||||
//#define PREV_MAC 0x04 //
|
||||
|
||||
// NEXT UNIT
|
||||
//#define NEXT_MAC 0x00 // Terminal
|
||||
//#define NEXT_MAC 0x01 // Relay 0
|
||||
//#define NEXT_MAC 0x02 // Relay 1
|
||||
//#define NEXT_MAC 0x03 // Gateway
|
||||
//#define NEXT_MAC 0x04 //
|
@ -2,12 +2,12 @@
|
||||
//
|
||||
// RELAY MODULE
|
||||
//
|
||||
// Developed by Timm Bogner (bogner1@gmail.com) for Sola Gratia Farm in Urbana, IL.
|
||||
// Setup instructions available in the "topography.h" file.
|
||||
// Developed by Timm Bogner (bogner1@gmail.com) for Sola Gratia Farm in Urbana, Illinois, USA.
|
||||
// Setup instructions available in the "fdrs_config.h" file.
|
||||
|
||||
#include <ESP8266WiFi.h>
|
||||
#include <espnow.h>
|
||||
#include "topography.h"
|
||||
#include "fdrs_config.h"
|
||||
|
||||
uint8_t prevAddress[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, PREV_MAC};
|
||||
uint8_t selfAddress[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, UNIT_MAC};
|
||||
@ -22,7 +22,6 @@ typedef struct DataReading {
|
||||
} DataReading;
|
||||
|
||||
DataReading theData[6];
|
||||
bool clickStatus = false;
|
||||
bool newData = false;
|
||||
uint8_t senderMAC[12];
|
||||
|
||||
@ -38,11 +37,9 @@ void OnDataSent(uint8_t *mac_addr, uint8_t sendStatus) {
|
||||
Serial.print("Last Packet Send Status: ");
|
||||
if (sendStatus == 0) {
|
||||
Serial.println("Delivery success");
|
||||
clickStatus = true;
|
||||
}
|
||||
else {
|
||||
Serial.println("Delivery fail");
|
||||
clickStatus = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -57,9 +54,6 @@ void OnDataRecv(uint8_t* mac, uint8_t *incomingData, uint8_t len) {
|
||||
void setup() {
|
||||
// Init Serial Monitor
|
||||
Serial.begin(115200);
|
||||
//Set an output pin for feedback (clicks)
|
||||
pinMode(LED_BUILTIN, OUTPUT);
|
||||
digitalWrite(LED_BUILTIN, true);
|
||||
// Init WiFi and set MAC address
|
||||
WiFi.mode(WIFI_STA);
|
||||
WiFi.disconnect();
|
||||
@ -90,16 +84,6 @@ void setup() {
|
||||
void loop() {
|
||||
if (newData) {
|
||||
newData = false;
|
||||
digitalWrite(LED_BUILTIN, false);
|
||||
delay(50);
|
||||
digitalWrite(LED_BUILTIN, true);
|
||||
passOn();
|
||||
}
|
||||
if (clickStatus) {
|
||||
delay(250);
|
||||
clickStatus = false;
|
||||
digitalWrite(LED_BUILTIN, false);
|
||||
delay(250);
|
||||
digitalWrite(LED_BUILTIN, true);
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,6 @@
|
||||
// then uncomment the code corresponding to the unit you would like
|
||||
// to be previous and next in the line of communication.
|
||||
// Be sure that all unused lines are commented out.
|
||||
// The terminal does not need a previous nor the gateway a next device.
|
||||
|
||||
// THIS UNIT
|
||||
//#define UNIT_MAC 0x00 // Terminal
|
@ -3,11 +3,11 @@
|
||||
// TERMINAL MODULE
|
||||
//
|
||||
// Developed by Timm Bogner (bogner1@gmail.com) for Sola Gratia Farm in Urbana, Illinois, USA.
|
||||
// Setup instructions available in the "topography.h" file.
|
||||
// Setup instructions available in the "fdrs_config.h" file.
|
||||
|
||||
#include <ESP8266WiFi.h>
|
||||
#include <espnow.h>
|
||||
#include "topography.h"
|
||||
#include "fdrs_config.h"
|
||||
|
||||
#define DELAY 60000
|
||||
|
||||
|
@ -4,7 +4,6 @@
|
||||
// then uncomment the code corresponding to the unit you would like
|
||||
// to be previous and next in the line of communication.
|
||||
// Be sure that all unused lines are commented out.
|
||||
// The terminal does not need a previous nor the gateway a next device.
|
||||
|
||||
// THIS UNIT
|
||||
#define UNIT_MAC 0x00 // Terminal
|
||||
@ -13,13 +12,6 @@
|
||||
//#define UNIT_MAC 0x03 // Gateway
|
||||
//#define UNIT_MAC 0x04 //
|
||||
|
||||
// PREVIOUS UNIT
|
||||
//#define PREV_MAC 0x00 // Terminal
|
||||
//#define PREV_MAC 0x01 // Relay 0
|
||||
//#define PREV_MAC 0x02 // Relay 1
|
||||
//#define PREV_MAC 0x03 // Gateway
|
||||
//#define PREV_MAC 0x04 //
|
||||
|
||||
// NEXT UNIT
|
||||
//#define NEXT_MAC 0x00 // Terminal
|
||||
#define NEXT_MAC 0x01 // Relay 0
|
Loading…
Reference in New Issue
Block a user