-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflexstm32.ino
895 lines (765 loc) · 17.9 KB
/
flexstm32.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
/*------------------------------------------------------------------------------------------------------*\
| |
| FlexTrak Firmware |
| |
\*------------------------------------------------------------------------------------------------------*/
#define VERSION "V1.06"
#define PRODUCT "FlexTrak"
#define DESCRIPTION "FlexTrak STM32"
#define SIG_1 'D'
#define SIG_2 'B'
#include <FlashStorage_STM32.h>
HardwareSerial Serial1(PA10, PA9); // Host Rx/Tx
HardwareSerial Serial2(A3, A2); // GPS Rx/Tx
HardwareSerial Serial6(PA12, PA11); // APRS Rx/Tx
#define Serial Serial1
#define GPS_Serial Serial2
#define APRS_Serial Serial6
//------------------------------------------------------------------------------------------------------
#define LED_OK PA1 // PB12
#define LED_WARN PB13
#define LORA_NSS PA4
#define LORA_DIO0 PB0
#define A0_MULTIPLIER 14.1
#define WIREBUS PB10
#define APRS_ENABLE PB15
#define APRS_PTT PB14 // PB2
#define APRS_DATA PA8 // PA11
#define CUTDOWN PB14
//------------------------------------------------------------------------------------------------------
#define SENTENCE_LENGTH 120 // This is more than sufficient for the standard sentence. Extend if needed; shorten if you are tight on memory.
#define PAYLOAD_LENGTH 16
#define FIELDLIST_LENGTH 24
#define COMMAND_BUFFER_LENGTH 70
//------------------------------------------------------------------------------------------------------
//
// Globals
struct TSettings
{
// Common
char PayloadID[PAYLOAD_LENGTH];
char FieldList[FIELDLIST_LENGTH];
// GPS
unsigned int FlightModeAltitude;
// LoRa
float LORAFrequency;
unsigned char Implicit; // 1=Implicit, 0=Explicit
unsigned char ErrorCoding;
unsigned char Bandwidth;
unsigned char SpreadingFactor;
unsigned char LowDataRateOptimize;
unsigned int LoRaCycleTime;
unsigned char LoRaSlot;
// SSDV
unsigned int LowImageCount;
unsigned int HighImageCount;
unsigned int High;
// APRS
float APRS_Frequency;
char APRS_Callsign[7]; // Max 6 characters
char APRS_SSID;
int APRS_PathAltitude;
char APRS_HighUseWide2;
int APRS_TxInterval;
char APRS_PreEmphasis;
char APRS_Random;
char APRS_TelemInterval;
// Prediction
float Prediction_CDA;
float Prediction_Weight;
long Prediction_Altitude;
// Cutdown
unsigned int CutdownAltitude;
unsigned char CutdownPeriod;
// Uplink
char EnableUplink;
char UplinkCode[16];
// DS18B20
unsigned char DS18B20_Address[8];
unsigned char IncludeFieldList;
} Settings;
typedef enum {fmIdle, fmLaunched, fmDescending, fmLanded} TFlightMode;
struct TGPS
{
int Day, Month, Year;
byte Hours, Minutes, Seconds;
unsigned long SecondsInDay; // Time in seconds since midnight
float Longitude, Latitude;
long Altitude, PreviousAltitude, MinimumAltitude, MaximumAltitude;
byte Satellites;
int Speed;
int Direction;
TFlightMode FlightMode;
byte FixType;
int Temperatures[2]; // C
byte InternalTemperature; // Index of internal temperature
int BatteryVoltage; // mV
byte GPSFlightMode;
byte PowerMode;
float AscentRate;
float PredictedLongitude, PredictedLatitude;
byte UseHostPosition;
float CDA, PredictedLandingSpeed;
float TimeTillLanding;
int LastPacketSNR;
int LastPacketRSSI;
unsigned int ReceivedCommandCount;
byte CutdownStatus;
int ExtraFields[6];
} GPS;
byte ShowGPS=1;
byte ShowLoRa=1;
byte HostPriority=0;
unsigned long HostTimeout=0;
unsigned char SSDVBuffer[256];
unsigned int SSDVBufferLength=0;
//------------------------------------------------------------------------------------------------------
void setup()
{
Serial.begin(38400);
Serial.println("");
Serial.print(DESCRIPTION);
Serial.print(' ');
Serial.println(VERSION);
if ((EEPROM.read(0) == SIG_1) && (EEPROM.read(1) == SIG_2))
{
// Store current (default) settings
Serial.println("Loaded settings from flash");
LoadSettings();
}
else
{
Serial.println("Loaded default settings");
SetDefaults();
}
SetupLEDs();
SetupCutdown();
SetupGPS();
SetupADC();
SetupLoRa();
Setupds18b20();
#ifdef APRS_DATA
SetupAPRS();
#endif
SetupPrediction();
}
void SetDefaults(void)
{
// Common settings
const static char DefaultPayloadID[] PROGMEM = "CHANGEME";
strcpy_P(Settings.PayloadID, (char *)DefaultPayloadID);
const static char DefaultFieldList[] PROGMEM = "0123456789ABCD";
strcpy_P(Settings.FieldList, (char *)DefaultFieldList);
// GPS Settings
Settings.FlightModeAltitude = 2000;
// LoRa Settings
Settings.LORAFrequency = 434.225;
Settings.LoRaCycleTime = 0;
Settings.LoRaSlot = -1;
LoRaDefaults();
// SSDV Settings
Settings.LowImageCount = 4;
Settings.HighImageCount = 8;
Settings.High = 2000;
// APRS Settings
Settings.APRS_Frequency = 144.8;
strcpy(Settings.APRS_Callsign, "");
Settings.APRS_SSID = 0;
Settings.APRS_PathAltitude = 1500;
Settings.APRS_HighUseWide2 = 1;
Settings.APRS_TxInterval = 20; // 60;
Settings.APRS_PreEmphasis = 1;
Settings.APRS_Random = 0; // 30;
Settings.APRS_TelemInterval = 0; // 2
// Landing prediction
Settings.Prediction_CDA = 0.7;
Settings.Prediction_Weight = 1.0;
Settings.Prediction_Altitude = 100;
// Uplink Settings
Settings.EnableUplink = 0;
strcat(Settings.UplinkCode, "");
Serial.println("Placing default settings in EEPROM");
SaveSettings();
}
void loop()
{
if (HostPriority)
{
if (CheckHost())
{
HostTimeout = millis() + 2000;
}
else if (millis() > HostTimeout)
{
HostPriority = 0;
}
}
else
{
CheckHost();
CheckGPS();
CheckLEDs();
CheckCutdown();
CheckLoRa();
CheckADC();
Checkds18b20();
#ifdef APRS_DATA
CheckAPRS();
#endif
CheckPrediction();
}
}
void ShowVersion(void)
{
Serial.print("VER=");
Serial.println(VERSION);
}
void LoadSettings(void)
{
EEPROM.get(2, Settings);
}
void SaveSettings(void)
{
// Signature
EEPROM.update(0, SIG_1);
EEPROM.update(1, SIG_2);
// Settings
EEPROM.put(2, Settings);
EEPROM.commit();
}
int CheckHost(void)
{
static char Line[COMMAND_BUFFER_LENGTH];
static unsigned int Length=0;
static unsigned int BinaryMode=0;
char Character;
int GotCharacters;
GotCharacters = 0;
while (Serial.available())
{
GotCharacters = 1;
Character = Serial.read();
if (BinaryMode)
{
Line[Length++] = Character;
if (--BinaryMode == 0)
{
ProcessCommand(Line+1);
Length = 0;
}
}
else if (Character == '~')
{
Line[0] = Character;
Length = 1;
}
else if (Character == '\r')
{
if (Length >= 3)
{
Line[Length] = '\0';
ProcessCommand(Line+1);
}
Length = 0;
}
else if (Length >= sizeof(Line))
{
Length = 0;
}
else if (Length > 0)
{
Line[Length++] = Character;
if (Length == 3)
{
if ((Line[1] == 'S') && (Line[2] == 'B'))
{
BinaryMode = 32;
}
}
}
}
return GotCharacters;
}
void ProcessCommand(char *Line)
{
int OK = 0;
if (Line[0] == 'G')
{
OK = ProcessGPSCommand(Line+1);
}
else if (Line[0] == 'C')
{
OK = ProcessCommonCommand(Line+1);
}
else if (Line[0] == 'L')
{
OK = ProcessLORACommand(Line+1);
}
else if (Line[0] == 'A')
{
OK = ProcessAPRSCommand(Line+1);
}
else if (Line[0] == 'S')
{
OK = ProcessSSDVCommand(Line+1);
}
else if (Line[0] == 'F')
{
OK = ProcessFieldCommand(Line+1);
}
else if (Line[0] == 'P')
{
OK = ProcessPredictionCommand(Line+1);
}
if (OK)
{
Serial.println("*");
}
else
{
Serial.println("?");
}
}
int ProcessPredictionCommand(char *Line)
{
int OK = 0;
if (Line[0] == 'C')
{
// CDA
float CDA = atof(Line+1);
if ((CDA > 0) && (CDA <= 10.0))
{
Settings.Prediction_CDA = CDA;
OK = 1;
}
}
else if (Line[0] == 'W')
{
// Payload Weight
float PayloadWeight = atof(Line+1);
if ((PayloadWeight > 0) && (PayloadWeight <= 10.0))
{
Settings.Prediction_Weight = PayloadWeight;
OK = 1;
}
}
else if (Line[0] == 'L')
{
// Landing Altitude
long LandingAltitude = atol(Line+1);
if ((LandingAltitude >= 0) && (LandingAltitude <= 5000))
{
Settings.Prediction_Altitude = LandingAltitude;
OK = 1;
}
}
return OK;
}
int ProcessGPSCommand(char *Line)
{
int OK = 0;
if (Line[0] == 'P')
{
ShowGPS = atoi(Line+1);
OK = 1;
}
else if (Line[0] == 'F')
{
// Flight mode altitude
unsigned int Altitude;
Altitude = atoi(Line+1);
if (Altitude < 8000)
{
Settings.FlightModeAltitude = Altitude;
OK = 1;
}
}
return OK;
}
int ProcessCommonCommand(char *Line)
{
int OK = 0;
if (Line[0] == 'H')
{
// HostPriority mode
HostPriority = Line[1] == '1';
HostTimeout = millis() + 2000;
OK = 1;
}
else if (Line[0] == 'P')
{
// Store payload ID
if (strlen(Line+1) < PAYLOAD_LENGTH)
{
strcpy(Settings.PayloadID, Line+1);
OK = 1;
}
}
else if (Line[0] == 'F')
{
// Store Field List
if (strlen(Line+1) < FIELDLIST_LENGTH)
{
strcpy(Settings.FieldList, Line+1);
OK = 1;
}
}
else if (Line[0] == 'R')
{
// Reset to default settings
SetDefaults();
OK = 1;
}
else if (Line[0] == 'S')
{
// Save settings to flash
SaveSettings();
OK = 1;
}
else if (Line[0] == 'E')
{
SendSettings();
OK = 1;
}
else if (Line[0] == 'V')
{
// Version number
ShowVersion();
OK = 1;
}
else if (Line[0] == 'C')
{
Serial.printf("PROD=%s\r\n", PRODUCT);
OK = 1;
}
else if (Line[0] == 'D')
{
Serial.printf("DESC=%s\r\n", DESCRIPTION);
OK = 1;
}
else if (Line[0] == 'A')
{
// Cutdown Altitude
Settings.CutdownAltitude = atoi(Line+1);
OK = 1;
}
else if (Line[0] == 'T')
{
// Cutdown Time
Settings.CutdownPeriod = atoi(Line+1);
OK = 1;
}
else if (Line[0] == 'L')
{
// Enable/Disable Field List
Settings.IncludeFieldList = Line[1] == '1';
OK = 1;
}
return OK;
}
int ProcessLORACommand(char *Line)
{
int OK = 0;
if (Line[0] == 'F')
{
// New frequency
double Frequency;
Frequency = atof(Line+1);
if ((Frequency >= 400) && (Frequency < 1000))
{
Settings.LORAFrequency = Frequency;
OK = 1;
}
}
else if (Line[0] == 'S')
{
// Spreading Factor
int SpreadingFactor = atoi(Line+1);
if ((SpreadingFactor >= 6) && (SpreadingFactor <= 12))
{
Settings.SpreadingFactor = SpreadingFactor << 4;
OK = 1;
}
}
else if (Line[0] == 'I')
{
int Implicit = atoi(Line+1);
Settings.Implicit = Implicit ? 1 : 0;
OK = 1;
}
else if (Line[0] == 'E')
{
// Error Coding
int ErrorCoding = atoi(Line+1);
if ((ErrorCoding >= 5) && (ErrorCoding <= 8))
{
Settings.ErrorCoding = (ErrorCoding - 4) << 1;
OK = 1;
}
}
else if (Line[0] == 'B')
{
// Bandwidth
int Bandwidth = atoi(Line+1);
if ((Bandwidth >= 0) && (Bandwidth <= 9))
{
Settings.Bandwidth = Bandwidth << 4;
OK = 1;
}
}
else if (Line[0] == 'L')
{
int LowDataRateOptimize = atoi(Line+1);
Settings.LowDataRateOptimize = LowDataRateOptimize ? 0x08 : 0;
OK = 1;
}
else if (Line[0] == 'T')
{
int LoRaCycleTime = atoi(Line+1);
if ((LoRaCycleTime >= 0) && (LoRaCycleTime <= 60))
{
Settings.LoRaCycleTime = LoRaCycleTime;
OK = 1;
}
}
else if (Line[0] == 'O')
{
int LoRaSlot = atoi(Line+1);
if ((LoRaSlot >= -1) && (LoRaSlot < 60))
{
Settings.LoRaSlot = LoRaSlot;
OK = 1;
}
}
else if (Line[0] == 'K')
{
Settings.EnableUplink = atoi(Line+1);
OK = 1;
}
else if (Line[0] == 'U')
{
strncpy(Settings.UplinkCode, Line+1, sizeof(Settings.UplinkCode));
OK = 1;
}
return OK;
}
int ProcessAPRSCommand(char *Line)
{
int OK = 0;
if (Line[0] == 'P')
{
// Store payload ID
if (strlen(Line+1) <= 6)
{
strcpy(Settings.APRS_Callsign, Line+1);
OK = 1;
}
}
else if (Line[0] == 'F')
{
// New frequency
double Frequency;
Frequency = atof(Line+1);
if ((Frequency >= 134) && (Frequency <= 174))
{
Settings.APRS_Frequency = Frequency;
// SetAPRSFrequency();
OK = 1;
}
}
else if (Line[0] == 'S')
{
// SSID
int SSID = atoi(Line+1);
if ((SSID >= 0) && (SSID <= 14))
{
Settings.APRS_SSID = SSID;
OK = 1;
}
}
else if (Line[0] == 'A')
{
// Path altitude
Settings.APRS_PathAltitude = atoi(Line+1);
OK = 1;
}
else if (Line[0] == 'W')
{
// Use Wide2
Settings.APRS_HighUseWide2 = atoi(Line+1);
OK = 1;
}
else if (Line[0] == 'I')
{
// Tx Interval in seconds
Settings.APRS_TxInterval = atoi(Line+1);
OK = 1;
}
else if (Line[0] == 'R')
{
// Random period
Settings.APRS_Random = atoi(Line+1);
OK = 1;
}
else if (Line[0] == 'M')
{
Settings.APRS_PreEmphasis = atoi(Line+1);
OK = 1;
}
else if (Line[0] == 'T')
{
Settings.APRS_TelemInterval = atoi(Line+1);
OK = 1;
}
return OK;
}
int ProcessSSDVCommand(char *Line)
{
int OK = 0;
if (Line[0] == 'C')
{
// Clear SSDV buffer
SSDVBufferLength = 0;
OK = 1;
}
else if (Line[0] == 'P')
{
// Hex SSDV Packet
unsigned char Upper=1;
unsigned char Value;
while (*(++Line))
{
if (Upper)
{
Value = HexToByte(*Line) << 4;
}
else
{
Value += HexToByte(*Line);
SSDVBuffer[SSDVBufferLength++] = Value;
}
Upper = 1 - Upper;
}
OK = 1;
Serial.print("SSDV=");
Serial.println(SSDVBufferLength);
}
else if (Line[0] == 'B')
{
// Binary SSDV Packet
int i;
for (i=0; i<32; i++)
{
SSDVBuffer[SSDVBufferLength++] = *(++Line);
}
OK = 1;
Serial.print(F("SSDV="));
Serial.println(SSDVBufferLength);
}
else if (Line[0] == 'S')
{
// SSDV Status
Serial.print("SSDV=");
Serial.println(SSDVBufferLength);
OK = 1;
}
else if (Line[0] == 'I')
{
// SSDV Image Count
sscanf(Line+1, "%d,%d,%d", &Settings.LowImageCount, Settings.HighImageCount, &Settings.High);
// Settings.ImageCount = atoi(Line+1);
OK = 1;
}
return OK;
}
int ProcessFieldCommand(char *Line)
{
int OK = 0;
if (Line[0] == 'A')
{
GPS.PredictedLatitude = atof(Line+1);
OK = 1;
}
else if (Line[0] == 'O')
{
GPS.PredictedLongitude = atof(Line+1);
OK = 1;
}
else if (Line[0] == 'T')
{
GPS.Latitude = atof(Line+1);
OK = 1;
}
else if (Line[0] == 'G')
{
GPS.Longitude = atof(Line+1);
OK = 1;
}
else if (Line[0] == 'U')
{
GPS.PreviousAltitude = GPS.Altitude;
GPS.Altitude = atoi(Line+1);
GPS.AscentRate = GPS.AscentRate * 0.7 + (GPS.Altitude - GPS.PreviousAltitude) * 0.3;
GPS.UseHostPosition = 5;
OK = 1;
}
else if ((Line[0] >= '0') && (Line[0] <= '5'))
{
GPS.ExtraFields[Line[0] - '0'] = atoi(Line+1);
OK = 1;
}
return OK;
}
unsigned char HexToByte(char ch)
{
int num=0;
if (ch>='0' && ch<='9')
{
num=ch-'0';
}
else if (ch>='A' && ch<='F')
{
num = ch + 10 - 'A';
}
else if (ch>='a' && ch<='f')
{
num = ch + 10 - 'a';
}
else
{
num=0;
}
return num;
}
void SendSettings(void)
{
Serial.printf("CP=%s\r\n", Settings.PayloadID);
Serial.printf("CF=%s\r\n", Settings.FieldList);
Serial.printf("CL=%d\n", Settings.IncludeFieldList ? 1 : 0);
Serial.printf("CA=%ld\r\n", Settings.CutdownAltitude);
Serial.printf("CT=%u\r\n", Settings.CutdownPeriod);
Serial.printf("GF=%u\r\n", Settings.FlightModeAltitude);
Serial.printf("LF=%.4f\r\n", Settings.LORAFrequency);
// Serial.printf("LM=%u\r\n", Settings.LoRaMode);
Serial.printf("LT=%u\r\n", Settings.LoRaCycleTime);
Serial.printf("LO=%u\r\n", Settings.LoRaSlot);
// Serial.printf("L1=%d\r\n", Settings.LoRaRepeatSlot1);
// Serial.printf("L2=%d\r\n", Settings.LoRaRepeatSlot2);
// Serial.printf("LB=%d\r\n", Settings.UseBinaryMode);
// Serial.printf("LN=%d\r\n", Settings.BinaryNode);
// Serial.printf("LC=%u\r\n", Settings.CallingCount);
Serial.printf("LE=%u\r\n", Settings.EnableUplink);
Serial.printf("LU=%s\r\n", Settings.UplinkCode);
Serial.printf("PC=%.1f\r\n", Settings.Prediction_CDA);
Serial.printf("PW=%.2f\r\n", Settings.Prediction_Weight);
Serial.printf("PL=%ld\r\n", Settings.Prediction_Altitude);
Serial.printf("AF=%.4f\r\n", Settings.APRS_Frequency);
Serial.printf("AP=%s\r\n", Settings.APRS_Callsign);
Serial.printf("AS=%d\r\n", Settings.APRS_SSID);
Serial.printf("AA=%d\r\n", Settings.APRS_PathAltitude);
Serial.printf("AW=%d\r\n", Settings.APRS_HighUseWide2 > 0);
Serial.printf("AI=%d\r\n", Settings.APRS_TxInterval);
Serial.printf("AM=%d\r\n", Settings.APRS_PreEmphasis > 0);
Serial.printf("AR=%d\r\n", Settings.APRS_Random);
Serial.printf("AT=%d\r\n", Settings.APRS_TelemInterval);
}