kopia lustrzana https://github.com/dl9rdz/rdz_ttgo_sonde
updated dfm serial numbers
rodzic
39f96e3bcd
commit
aaa33267d7
|
@ -32,7 +32,10 @@
|
|||
# Hm(suffix) hor. speed m/s (suffix: e.g. "m/s"; no suffix=>m/s as 16x8 bitmap for SSD1306 display only)
|
||||
# Hk(suffix) hor. speed km/h (suffix: e.g. "km/h"; no suffix=>km/h as 16x8 bitmap for SSD1306 display only)
|
||||
# V(suffix) vert. speef (suffix: e.g. "m/s"; no suffix=>m/s as 16x8 bitmap for SSD1306 display only)
|
||||
# Ix sonde ID (dfm format by x: d=>dxlaprs, a=>autorx, s=>real serial number)
|
||||
# Ix sonde ID (default/d: dxlaprs; s: short id, n: real serial number)
|
||||
# RS41,RS92: all identical R1234567
|
||||
# DFMx: ID M12345678; short ID and serial 12345678
|
||||
# M10: ID ME95231F0; short ID: M95231F0; serial 9062104592
|
||||
# Q signal quality statistics bar
|
||||
# T type string (RS41/DFM9/DFM6/RS92)
|
||||
# C afC value
|
||||
|
@ -223,7 +226,7 @@ key1action=+,0,F,W
|
|||
key2action=>,#,#,#
|
||||
timeaction=#,#,0
|
||||
color=FFD700
|
||||
0,0=Id
|
||||
0,0=Is
|
||||
color=0000FF
|
||||
0,11,-5.5=f
|
||||
1,1,6=c
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const char *version_name = "rdzTTGOsonde";
|
||||
const char *version_id = "devel20201128";
|
||||
const char *version_id = "devel20201128b";
|
||||
const int SPIFFS_MAJOR=2;
|
||||
const int SPIFFS_MINOR=4;
|
||||
|
|
|
@ -12,6 +12,19 @@
|
|||
#define DFM_DBG(x)
|
||||
#endif
|
||||
|
||||
// single data structure, search restarts after decoder change
|
||||
static struct st_dfmstat {
|
||||
int idcnt0;
|
||||
int idcnt1;
|
||||
int lastfrid;
|
||||
int lastfrcnt;
|
||||
uint8_t start[50];
|
||||
uint16_t dat[50*2];
|
||||
uint8_t cnt[50*2];
|
||||
uint8_t nameregok;
|
||||
uint8_t nameregtop;
|
||||
} dfmstate;
|
||||
|
||||
int DFM::setup(float frequency, int inv)
|
||||
{
|
||||
inverse = inv;
|
||||
|
@ -57,7 +70,8 @@ int DFM::setup(float frequency, int inv)
|
|||
DFM_DBG(Serial.println("Setting SYNC Config FAILED"));
|
||||
return 1;
|
||||
}
|
||||
if(sx1278.setPreambleDetect(0xA8)!=0) {
|
||||
//if(sx1278.setPreambleDetect(0xA8)!=0) {
|
||||
if(sx1278.setPreambleDetect(0xAA)!=0) {
|
||||
DFM_DBG(Serial.println("Setting PreambleDetect FAILED"));
|
||||
return 1;
|
||||
}
|
||||
|
@ -73,6 +87,7 @@ int DFM::setup(float frequency, int inv)
|
|||
|
||||
int retval = sx1278.setFrequency(frequency);
|
||||
sx1278.clearIRQFlags();
|
||||
memset((void *)&dfmstate, 0, sizeof(dfmstate));
|
||||
DFM_DBG(Serial.println("Setting SX1278 config for DFM finished\n"); Serial.println());
|
||||
return retval;
|
||||
}
|
||||
|
@ -163,18 +178,6 @@ void DFM::printRaw(const char *label, int len, int ret, const uint8_t *data)
|
|||
Serial.print(" ");
|
||||
}
|
||||
|
||||
// single data structure, search restarts after decoder change
|
||||
static struct st_dfmstat {
|
||||
int idcnt0;
|
||||
int idcnt1;
|
||||
int lastfrid;
|
||||
int lastfrcnt;
|
||||
uint8_t start[50];
|
||||
uint16_t dat[50*2];
|
||||
uint8_t cnt[50*2];
|
||||
uint8_t nameregok;
|
||||
uint8_t nameregtop;
|
||||
} dfmstate;
|
||||
|
||||
|
||||
#define DFMIDTHRESHOLD 2
|
||||
|
@ -197,7 +200,7 @@ void DFM::finddfname(uint8_t *b)
|
|||
uint32_t v = (st<<20) | (d<<4) | ix;
|
||||
if ( st > (dfmstate.lastfrid>>20) ) {
|
||||
dfmstate.lastfrid = v;
|
||||
Serial.print("MAXCH: "); Serial.println(st>>20);
|
||||
Serial.print("MAXCH: "); Serial.println(st);
|
||||
dfmstate.lastfrcnt = 0;
|
||||
} else if ( st == (dfmstate.lastfrid>>20) ) {
|
||||
/* same id found */
|
||||
|
@ -253,9 +256,14 @@ void DFM::finddfname(uint8_t *b)
|
|||
Serial.print("] CNT:");
|
||||
Serial.print(dfmstate.cnt[2*i]);
|
||||
Serial.print(",");
|
||||
Serial.println(dfmstate.cnt[2*i+1]);
|
||||
if(dfmstate.cnt[2*i]>DFMIDTHRESHOLD && dfmstate.cnt[2*i+1]>DFMIDTHRESHOLD) {
|
||||
if(dfmstate.idcnt0 == 0) {
|
||||
Serial.print(dfmstate.cnt[2*i+1]);
|
||||
Serial.print(",st=");
|
||||
Serial.print(st);
|
||||
Serial.print(",lastfrid=");
|
||||
Serial.println(dfmstate.lastfrid>>20);
|
||||
if( (dfmstate.cnt[2*i]>DFMIDTHRESHOLD && dfmstate.cnt[2*i+1]>DFMIDTHRESHOLD) ||
|
||||
(dfmstate.cnt[2*1]>0 && dfmstate.cnt[2*i+1]>0 && st == (dfmstate.lastfrid>>20) && (st>>4)>6) ) {
|
||||
if(dfmstate.idcnt0 <= 1) {
|
||||
dfmstate.idcnt0 = dfmstate.cnt[2*i];
|
||||
dfmstate.idcnt1 = dfmstate.cnt[2*i+1];
|
||||
dfmstate.nameregok = i;
|
||||
|
@ -294,6 +302,8 @@ void DFM::decodeCFG(uint8_t *cfg)
|
|||
#if 1
|
||||
// new ID
|
||||
finddfname(cfg);
|
||||
// new aprs ID (dxlaprs, autorx) is now "D" + serial (8 digits) by consensus
|
||||
memcpy(sonde.si()->ser, sonde.si()->id+1, 9);
|
||||
#else
|
||||
// old ID
|
||||
static int lowid, highid, idgood=0, type=0;
|
||||
|
|
|
@ -30,6 +30,9 @@ SPIClass spiDisp(HSPI);
|
|||
|
||||
const char *sondeTypeStr[NSondeTypes] = { "DFM6", "DFM9", "RS41", "RS92", "M10 " };
|
||||
|
||||
#define TYPE_IS_DFM(t) ( (t)==STYPE_DFM06 || (t)==STYPE_DFM09 )
|
||||
#define TYPE_IS_METEO(t) ( (t)==STYPE_M10 )
|
||||
|
||||
byte myIP_tiles[8*11];
|
||||
static uint8_t ap_tile[8]={0x00,0x04,0x22,0x92, 0x92, 0x22, 0x04, 0x00};
|
||||
|
||||
|
@ -455,10 +458,10 @@ void ILI9225Display::welcome() {
|
|||
setFont(5);
|
||||
int l=3*22;
|
||||
if(sonde.config.tft_orient&1) {
|
||||
drawString(0, 1*22, "RS41/92,DFM6/9,M10");
|
||||
drawString(0, 1*22, "RS41/92,DFM,M10");
|
||||
} else {
|
||||
drawString(0, 1*22, "RS41,RS92,");
|
||||
drawString(0, 2*22, "DFM6/9,M10");
|
||||
drawString(0, 2*22, "DFM,M10");
|
||||
l+=22;
|
||||
}
|
||||
drawString(0, l, version_id);
|
||||
|
@ -1029,24 +1032,24 @@ void Display::drawID(DispEntry *de) {
|
|||
drawString(de, "nnnnnnnn ");
|
||||
return;
|
||||
}
|
||||
// TODO: handle DFM6 IDs
|
||||
|
||||
if(!de->extra || de->extra[0]=='s') {
|
||||
// real serial number, as printed on sonde
|
||||
if(de->extra && de->extra[0]=='n') {
|
||||
// real serial number, as printed on sonde, can be up to 11 digits long
|
||||
drawString(de, sonde.si()->ser);
|
||||
} else if (de->extra[0]=='a') {
|
||||
// autorx sonde number ("DF9" and last 6 digits of real serial number)
|
||||
if(sonde.si()->type == STYPE_DFM09) {
|
||||
int n = strlen(sonde.si()->ser) - 6;
|
||||
if(n<0) n=0;
|
||||
memcpy(buf, "DF9", 3);
|
||||
memcpy(buf+3, sonde.si()->ser+n, 6);
|
||||
drawString(de, buf);
|
||||
} else if (de->extra && de->extra[0]=='s') {
|
||||
// short ID, max 8 digits (no initial "D" for DFM, "M" instead of "ME" for M10)
|
||||
if( TYPE_IS_DFM(sonde.si()->type) ) {
|
||||
drawString(de, sonde.si()->id+1);
|
||||
} else if (TYPE_IS_METEO(sonde.si()->type)) {
|
||||
char sid[9];
|
||||
sid[0]='M';
|
||||
memcpy(sid+1, sonde.si()->id+2, 8);
|
||||
sid[8] = 0;
|
||||
drawString(de, sid);
|
||||
} else {
|
||||
drawString(de, sonde.si()->ser);
|
||||
drawString(de, sonde.si()->id);
|
||||
}
|
||||
} else {
|
||||
// dxlAPRS sonde number (DF6 (why??) and 5 last digits of serial number as hex number
|
||||
// dxlAPRS sonde number, max 9 digits, as used on aprs.fi and radiosondy.info
|
||||
drawString(de, sonde.si()->id);
|
||||
}
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue