first_beta6_cleaning
This commit is contained in:
parent
559f027667
commit
d74d20074f
|
|
@ -21,9 +21,9 @@ https://github.com/sh123/esp32_loraprs
|
||||||
|
|
||||||
#define VERSION "2023.01.24" // BETA!!!
|
#define VERSION "2023.01.24" // BETA!!!
|
||||||
|
|
||||||
SX1268 radio = new Module(NSS, DIO1, NRST, BUSY);
|
SX1268 radio = new Module(NSS, DIO1, NRST, BUSY);
|
||||||
HardwareSerial neo6m_gps(1);
|
HardwareSerial neo6m_gps(1);
|
||||||
TinyGPSPlus gps;
|
TinyGPSPlus gps;
|
||||||
OneButton UserButton1 = OneButton(BUTTON1_PIN, true, true);
|
OneButton UserButton1 = OneButton(BUTTON1_PIN, true, true);
|
||||||
|
|
||||||
static bool send_update = true;
|
static bool send_update = true;
|
||||||
|
|
@ -33,11 +33,11 @@ void setup_lora_module() {
|
||||||
radio.setOutputPower(Lora_Power);
|
radio.setOutputPower(Lora_Power);
|
||||||
radio.setRfSwitchPins(RXEN, TXEN);
|
radio.setRfSwitchPins(RXEN, TXEN);
|
||||||
if (state == RADIOLIB_ERR_NONE) {
|
if (state == RADIOLIB_ERR_NONE) {
|
||||||
Serial.println(F("LORA (1 Watt) MODULE Ready (Radiolib success!)"));
|
Serial.println(F("LORA (1 Watt) MODULE Ready (Radiolib success!)"));
|
||||||
} else {
|
} else {
|
||||||
Serial.println(F("Lora Module Setup failed, code "));
|
Serial.println(F("Lora Module Setup failed, code "));
|
||||||
Serial.println(state);
|
Serial.println(state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup_gps_module() {
|
void setup_gps_module() {
|
||||||
|
|
@ -46,7 +46,7 @@ void setup_gps_module() {
|
||||||
|
|
||||||
static void ForcedBeaconTx() {
|
static void ForcedBeaconTx() {
|
||||||
Serial.println("Forced Beacon Tx");
|
Serial.println("Forced Beacon Tx");
|
||||||
send_update = true;
|
send_update = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
|
|
@ -58,7 +58,7 @@ void setup() {
|
||||||
setup_gps_module();
|
setup_gps_module();
|
||||||
UserButton1.attachClick(ForcedBeaconTx);
|
UserButton1.attachClick(ForcedBeaconTx);
|
||||||
WiFi.mode(WIFI_OFF);
|
WiFi.mode(WIFI_OFF);
|
||||||
btStop();
|
btStop();
|
||||||
Serial.print("Version = ");
|
Serial.print("Version = ");
|
||||||
Serial.println(VERSION);
|
Serial.println(VERSION);
|
||||||
Serial.println("Transmission Start ---->");
|
Serial.println("Transmission Start ---->");
|
||||||
|
|
@ -99,11 +99,11 @@ void loop() {
|
||||||
if (!send_update && gps_loc_update) {
|
if (!send_update && gps_loc_update) {
|
||||||
uint32_t lastTx = millis() - lastTxTime;
|
uint32_t lastTx = millis() - lastTxTime;
|
||||||
currentHeading = gps.course.deg();
|
currentHeading = gps.course.deg();
|
||||||
lastTxDistance = TinyGPSPlus::distanceBetween(gps.location.lat(), gps.location.lng(), lastTxLatitude, lastTxLongitude);
|
lastTxDistance = TinyGPSPlus::distanceBetween(gps.location.lat(), gps.location.lng(), lastTxLatitude, lastTxLongitude);
|
||||||
if (lastTx >= txInterval) {
|
if (lastTx >= txInterval) {
|
||||||
if (lastTxDistance > MinimumDistanceTx) {
|
if (lastTxDistance > MinimumDistanceTx) {
|
||||||
send_update = true;
|
send_update = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!send_update) {
|
if (!send_update) {
|
||||||
double headingDelta = abs(previousHeading - currentHeading);
|
double headingDelta = abs(previousHeading - currentHeading);
|
||||||
|
|
@ -207,12 +207,12 @@ void loop() {
|
||||||
|
|
||||||
if (gps_time_update) { // updating txInterval between Slow and FastRate or in between
|
if (gps_time_update) { // updating txInterval between Slow and FastRate or in between
|
||||||
int curr_speed = (int)gps.speed.kmph();
|
int curr_speed = (int)gps.speed.kmph();
|
||||||
if (curr_speed < SlowSpeed) {
|
if (curr_speed < SlowSpeed) {
|
||||||
txInterval = SlowRate * 1000;
|
txInterval = SlowRate * 1000;
|
||||||
} else if (curr_speed > FastSpeed) {
|
} else if (curr_speed > FastSpeed) {
|
||||||
txInterval = FastRate * 1000;
|
txInterval = FastRate * 1000;
|
||||||
} else {
|
} else {
|
||||||
txInterval = min(SlowRate, (FastSpeed * FastRate / curr_speed)) * 1000;
|
txInterval = min(SlowRate, (FastSpeed * FastRate / curr_speed)) * 1000;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -34,7 +34,7 @@ RXD 17
|
||||||
21 ANTENA
|
21 ANTENA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define LED_BUILTIN 2 // Blue Led ESP32 Pin
|
#define LED_BUILTIN 2 // Blue Led ESP32 Pin
|
||||||
|
|
||||||
#define BUTTON1_PIN 15 // Forced Beacon Tx (Switch pin1 to pin 15 , Swith pin2 to 220 ohms resistor to GND)
|
#define BUTTON1_PIN 15 // Forced Beacon Tx (Switch pin1 to pin 15 , Swith pin2 to 220 ohms resistor to GND)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
#define USER_CONFIG_H_
|
#define USER_CONFIG_H_
|
||||||
|
|
||||||
#define SRC_CALLSIGN "CD2RXU-7" // Change "CD2RXU-7" to your CALLSIGN-SSID you would use in APRS
|
#define SRC_CALLSIGN "CD2RXU-7" // Change "CD2RXU-7" to your CALLSIGN-SSID you would use in APRS
|
||||||
#define DST_CALLSIGN "AP" // APRS Destination (could be also "WIDE1-1")
|
#define DST_CALLSIGN "AP" // APRS Destination (could be also "WIDE1-1")
|
||||||
#define SYMBOL "[" // APRS Symbol: "[" Runner, "b" Bike, ">" Auto/Car
|
#define SYMBOL "[" // APRS Symbol: "[" Runner, "b" Bike, ">" Auto/Car
|
||||||
#define APRS_COMMENT "Lora Tracker 1W" // if you want to send any comment change the APRS_COMMENT
|
#define APRS_COMMENT "Lora Tracker 1W" // if you want to send any comment change the APRS_COMMENT
|
||||||
// and also beacon_config.h > SendComment = true
|
// and also beacon_config.h > SendComment = true
|
||||||
#endif
|
#endif
|
||||||
Loading…
Reference in New Issue