mirror of
https://github.com/timmbogner/Farm-Data-Relay-System
synced 2024-11-08 13:10:29 +00:00
fix GPS
This commit is contained in:
parent
c26491451d
commit
5e226cbea8
@ -9,7 +9,7 @@
|
||||
#include "fdrs_node_config.h"
|
||||
#include <fdrs_node.h>
|
||||
|
||||
#define SERIAL1_RX 34 // TX pin of GPS sensor
|
||||
#define SERIAL1_RX 13 // TX pin of GPS sensor
|
||||
#define SERIAL1_TX 12 // RX pin of GPS sensor
|
||||
#define MAX_NMEA_LENGTH 82 //maximum allowed length of a NMEA 0183 sentences.
|
||||
|
||||
@ -47,6 +47,7 @@ void loop() {
|
||||
// negative values mean "S" or "W", positive values mean "N" and "E"
|
||||
float latitude = convertGpsCoordinates(atof(gpsLatitude), gpsLatitudeOrientation);
|
||||
float longitude = convertGpsCoordinates(atof(gpsLongitude), gpsLongitudeOrientation);
|
||||
|
||||
float altitude = atof(gpsAltitude);
|
||||
|
||||
/*
|
||||
@ -59,9 +60,11 @@ void loop() {
|
||||
loadFDRS(latitude, LATITUDE_T);
|
||||
loadFDRS(longitude, LONGITUDE_T);
|
||||
loadFDRS(altitude, ALTITUDE_T);
|
||||
|
||||
|
||||
sendFDRS();
|
||||
if(sendFDRS()){
|
||||
DBG("Big Success!");
|
||||
} else {
|
||||
DBG("Nope, not so much.");
|
||||
}
|
||||
sleepFDRS(10); //Sleep time in seconds
|
||||
}
|
||||
|
||||
@ -162,7 +165,7 @@ float convertGpsCoordinates(float degreesMinutes, char* orientation) {
|
||||
double gpsMinutes = fmod((double)degreesMinutes, 100.0);
|
||||
uint8_t gpsDegrees = degreesMinutes / 100;
|
||||
double decimalDegrees = gpsDegrees + ( gpsMinutes / 60 );
|
||||
if (orientation == "W" || orientation == "S") {
|
||||
if (strcmp(orientation, "W") == 0 || strcmp(orientation, "S") == 0) {
|
||||
decimalDegrees = 0 - decimalDegrees;
|
||||
}
|
||||
return decimalDegrees;
|
||||
|
@ -4,18 +4,25 @@
|
||||
|
||||
|
||||
#define READING_ID 1 //Unique ID for this sensor
|
||||
#define GTWY_MAC 0x01 //Address of the nearest gateway
|
||||
#define GTWY_MAC 0x03 //Address of the nearest gateway
|
||||
|
||||
#define USE_ESPNOW
|
||||
//#define USE_LORA
|
||||
#define DEEP_SLEEP
|
||||
//#define USE_ESPNOW
|
||||
#define USE_LORA
|
||||
//#define DEEP_SLEEP
|
||||
//#define POWER_CTRL 14
|
||||
#define FDRS_DEBUG
|
||||
// LoRa Configuration
|
||||
#define RADIOLIB_MODULE SX1276 //Tested on SX1276
|
||||
#define LORA_SS 18
|
||||
#define LORA_RST 14
|
||||
#define LORA_DIO 26
|
||||
#define RADIOLIB_MODULE SX1276 // ESP32 SX1276 (TTGO)
|
||||
#define LORA_SS 18
|
||||
#define LORA_RST 14
|
||||
#define LORA_DIO 26
|
||||
#define LORA_BUSY 33
|
||||
|
||||
#define LORA_TXPWR 17 // LoRa TX power in dBm (: +2dBm - +17dBm (for SX1276-7) +20dBm (for SX1278))
|
||||
#define LORA_ACK // Request LoRa acknowledgment.
|
||||
|
||||
#define USE_OLED
|
||||
#define OLED_HEADER "FDRS"
|
||||
#define OLED_SDA 4
|
||||
#define OLED_SCL 15
|
||||
#define OLED_RST 16
|
Loading…
Reference in New Issue
Block a user