kopia lustrzana https://github.com/sh123/esp32_loraprs
Moved frequency correction minimum delta value to config
rodzic
963c46ee0f
commit
96a6547710
3
config.h
3
config.h
|
@ -39,7 +39,8 @@
|
|||
#define CFG_WIFI_KEY "<key>"
|
||||
|
||||
#define CFG_FREQ_CORR false // NB! incoming interrupts may stop working on frequent corrections when enabled
|
||||
// test with your module before heavy usage
|
||||
#define CFG_FREQ_CORR_DELTA 1000 // test with your module before heavy usage
|
||||
|
||||
#define CFG_PERSISTENT_APRS true
|
||||
#define CFG_DIGIREPEAT false
|
||||
#define CFG_RF_TO_IS true
|
||||
|
|
|
@ -52,8 +52,11 @@ void initializeConfig(LoraPrs::Config &cfg) {
|
|||
cfg.WifiSsid = CFG_WIFI_SSID;
|
||||
cfg.WifiKey = CFG_WIFI_KEY;
|
||||
|
||||
// configuration flags and features
|
||||
// frequency correction
|
||||
cfg.EnableAutoFreqCorrection = CFG_FREQ_CORR; // automatic tune to any incoming packet frequency
|
||||
cfg.AutoFreqCorrectionDeltaHz = CFG_FREQ_CORR_DELTA;
|
||||
|
||||
// configuration flags and features
|
||||
cfg.EnableSignalReport = true; // signal report will be added to the comment sent to aprsis
|
||||
cfg.EnablePersistentAprsConnection = CFG_PERSISTENT_APRS; // keep aprsis connection open, otherwise connect on new data only
|
||||
cfg.EnableRfToIs = CFG_RF_TO_IS; // send data from rf to aprsis
|
||||
|
|
|
@ -43,9 +43,12 @@ struct Config
|
|||
String AprsRawBeacon; // aprs string for server beacon, e.g. NOCALL-1>APZMDM,WIDE1-1:!0000.00N/00000.00E#LoRA 433.775MHz/BW125/SF12/CR7/0xf3
|
||||
int AprsRawBeaconPeriodMinutes; // aprs beacon period
|
||||
|
||||
// frequency correction
|
||||
bool EnableAutoFreqCorrection; // true - correct own frequency based on received packet frequency deviation
|
||||
int AutoFreqCorrectionDeltaHz; // correct when difference is larger than this value
|
||||
|
||||
// aprs logic
|
||||
bool EnableSignalReport; // true - append signal report on server side for the client to be sent to APRS-IS
|
||||
bool EnableAutoFreqCorrection; // true - correct own frequency based on received packet frequency deviation
|
||||
bool EnablePersistentAprsConnection; // true - keep aprs-is connection active all the time
|
||||
bool EnableRfToIs; // true - enable RF to APRS-IS submission
|
||||
bool EnableIsToRf; // true - enable APRS-IS to RF submission
|
||||
|
|
|
@ -287,7 +287,7 @@ void Service::onRigPacket(void *packet, int packetLength)
|
|||
{
|
||||
long frequencyError = LoRa.packetFrequencyError();
|
||||
|
||||
if (config_.EnableAutoFreqCorrection && abs(frequencyError) > CfgFreqCorrMinHz) {
|
||||
if (config_.EnableAutoFreqCorrection && abs(frequencyError) > config_.AutoFreqCorrectionDeltaHz) {
|
||||
config_.LoraFreq -= frequencyError;
|
||||
Serial.print("Correcting frequency: "); Serial.println(frequencyError);
|
||||
LoRa.setFrequency(config_.LoraFreq);
|
||||
|
|
|
@ -85,8 +85,6 @@ private:
|
|||
const int CfgPollDelayMs = 5; // main loop delay
|
||||
const int CfgWiFiConnRetryMaxTimes = 10; // wifi number of connection retries
|
||||
const int CfgMaxAX25PayloadSize = 512; // maximum ax25 payload size
|
||||
const int CfgFreqCorrMinHz = 1000; // correct if deviation is larger than this number
|
||||
// NB! small value causes frequent corrections, which locks LoRa ISR
|
||||
const int CfgMaxAprsInMessageSize = 255; // maximum aprsis to rf message size
|
||||
|
||||
// csma parameters, overriden with KISS commands
|
||||
|
|
Ładowanie…
Reference in New Issue