mirror of
https://github.com/timmbogner/Farm-Data-Relay-System
synced 2024-11-08 13:10:29 +00:00
added delay(0)
This commit is contained in:
parent
754fb9ce56
commit
ccf24f50f9
@ -20,7 +20,12 @@ void loop() {
|
|||||||
loadFDRS(data1, HUMIDITY_T);
|
loadFDRS(data1, HUMIDITY_T);
|
||||||
data2 = readTemp();
|
data2 = readTemp();
|
||||||
loadFDRS(data2, TEMP_T);
|
loadFDRS(data2, TEMP_T);
|
||||||
sendFDRS();
|
// DBG(sendFDRS());
|
||||||
|
if(sendFDRS()){
|
||||||
|
DBG("Big Success!");
|
||||||
|
} else {
|
||||||
|
DBG("Nope, not so much.");
|
||||||
|
}
|
||||||
sleepFDRS(10); //Sleep time in seconds
|
sleepFDRS(10); //Sleep time in seconds
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -29,5 +34,5 @@ float readTemp() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
float readHum() {
|
float readHum() {
|
||||||
return random(0,100);
|
return random(0, 100);
|
||||||
}
|
}
|
||||||
|
@ -121,8 +121,7 @@ void OnDataSent(const uint8_t *mac_addr, esp_now_send_status_t status) {
|
|||||||
esp_now_ack_flag = CRC_OK;
|
esp_now_ack_flag = CRC_OK;
|
||||||
} else {
|
} else {
|
||||||
esp_now_ack_flag = CRC_BAD;
|
esp_now_ack_flag = CRC_BAD;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
void OnDataRecv(const uint8_t * mac, const uint8_t *incomingData, int len) {
|
void OnDataRecv(const uint8_t * mac, const uint8_t *incomingData, int len) {
|
||||||
#endif
|
#endif
|
||||||
@ -408,12 +407,15 @@ bool sendFDRS() {
|
|||||||
#ifdef USE_ESPNOW
|
#ifdef USE_ESPNOW
|
||||||
esp_now_send(gatewayAddress, (uint8_t *) &fdrsData, data_count * sizeof(DataReading));
|
esp_now_send(gatewayAddress, (uint8_t *) &fdrsData, data_count * sizeof(DataReading));
|
||||||
esp_now_ack_flag = CRC_NULL;
|
esp_now_ack_flag = CRC_NULL;
|
||||||
while(esp_now_ack_flag == CRC_NULL){}
|
while(esp_now_ack_flag == CRC_NULL){
|
||||||
if (esp_now_ack_flag = CRC_OK){
|
delay(0);
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
if (esp_now_ack_flag == CRC_OK){
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef USE_LORA
|
#ifdef USE_LORA
|
||||||
if(transmitLoRa(>wyAddress, fdrsData, data_count)){
|
if(transmitLoRa(>wyAddress, fdrsData, data_count)){
|
||||||
|
Loading…
Reference in New Issue
Block a user