remove rabbiit ears, we're not americans

This commit is contained in:
2026-01-04 18:21:42 +01:00
parent 7acb1cc97b
commit 8f43648402
4 changed files with 1 additions and 86 deletions
-66
View File
@@ -240,7 +240,6 @@ byte spispeed;
char buff[16]; char buff[16];
char eonpicodeold[20][6]; char eonpicodeold[20][6];
char programTypePrevious[18]; char programTypePrevious[18];
char rabbitearstime[100][21];
const uint8_t* currentFont = nullptr; const uint8_t* currentFont = nullptr;
float vPerold; float vPerold;
int ActiveColor; int ActiveColor;
@@ -348,9 +347,6 @@ String PIold;
String PSold; String PSold;
String ptynold = " "; String ptynold = " ";
String PTYold; String PTYold;
String RabbitearsPassword;
String RabbitearsUser;
String RabbitearsHeader = "POST /tvdx/fm_spot HTTP/1.1\r\nHost: rabbitears.info\r\nUser-Agent: ESP32\r\nAccept: */*\r\nConnection: close\r\nContent-Type: application/json\r\nContent-Length: ";
String rds_clock; String rds_clock;
String rds_clockold; String rds_clockold;
String rds_date; String rds_date;
@@ -371,7 +367,6 @@ String XDRGTKRDS;
String XDRGTKRDSold; String XDRGTKRDSold;
uint16_t BW; uint16_t BW;
uint16_t MStatus; uint16_t MStatus;
uint16_t rabbitearspi[100]; // first is for 88.1, 2nd 88.3, etc. to 107.9 MHz
uint16_t SWMIBandPos; uint16_t SWMIBandPos;
uint16_t SWMIBandPosold; uint16_t SWMIBandPosold;
uint16_t TouchCalData[5]; uint16_t TouchCalData[5];
@@ -544,8 +539,6 @@ void setup() {
frequency_AIR = EEPROM.readUInt(EE_UINT16_FREQUENCY_AIR); frequency_AIR = EEPROM.readUInt(EE_UINT16_FREQUENCY_AIR);
#endif #endif
XDRGTK_key = EEPROM.readString(EE_STRING_XDRGTK_KEY); XDRGTK_key = EEPROM.readString(EE_STRING_XDRGTK_KEY);
RabbitearsUser = EEPROM.readString(EE_STRING_RABBITEARSUSER);
RabbitearsPassword = EEPROM.readString(EE_STRING_RABBITEARSPASSWORD);
usesquelch = EEPROM.readByte(EE_BYTE_USESQUELCH); usesquelch = EEPROM.readByte(EE_BYTE_USESQUELCH);
showmodulation = EEPROM.readByte(EE_BYTE_SHOWMODULATION); showmodulation = EEPROM.readByte(EE_BYTE_SHOWMODULATION);
amnb = EEPROM.readByte(EE_BYTE_AM_NB); amnb = EEPROM.readByte(EE_BYTE_AM_NB);
@@ -1041,7 +1034,6 @@ void loop() {
} }
} }
doLog(); doLog();
if (memorypos == scanstart) rabbitearssend();
DoMemoryPosTune(); DoMemoryPosTune();
radio.clearRDS(fullsearchrds); radio.clearRDS(fullsearchrds);
autologged = false; autologged = false;
@@ -1078,16 +1070,6 @@ void loop() {
if (!scanholdflag) delay(100); if (!scanholdflag) delay(100);
radio.getStatus(SStatus, USN, WAM, OStatus, BW, MStatus, CN); radio.getStatus(SStatus, USN, WAM, OStatus, BW, MStatus, CN);
if (RabbitearsUser.length() && RabbitearsPassword.length() && radio.rds.region != 0 && radio.rds.correctPI != 0 && frequency >= 8810 && frequency <= 10790 && !(frequency % 10) && ((frequency / 10) % 2)) {
byte i = (frequency / 10 - 881) / 2;
if (!rabbitearspi[i]) {
rabbitearspi[i] = radio.rds.correctPI;
const time_t epoch = rtc.getEpoch() + rtc.offset;
strftime(rabbitearstime[i], 21, "%FT%TZ", localtime(&epoch));
}
}
if (!initdxscan) { if (!initdxscan) {
switch (scancancel) { switch (scancancel) {
case CORRECTPI: case CORRECTPI:
@@ -4203,7 +4185,6 @@ void TuneUp() {
if (fmdefaultstepsize == 2 && stepsize == 0 && frequency == 8795) frequency = 8790; if (fmdefaultstepsize == 2 && stepsize == 0 && frequency == 8795) frequency = 8790;
if (frequency >= (HighEdgeSet * 10) + 1) { if (frequency >= (HighEdgeSet * 10) + 1) {
if (scandxmode) rabbitearssend();
frequency = LowEdgeSet * 10; frequency = LowEdgeSet * 10;
if (fmdefaultstepsize == 2 && stepsize == 0 && frequency == 8750) frequency = 8775; if (fmdefaultstepsize == 2 && stepsize == 0 && frequency == 8750) frequency = 8775;
if (edgebeep) EdgeBeeper(); if (edgebeep) EdgeBeeper();
@@ -4567,8 +4548,6 @@ void DefaultSettings() {
EEPROM.writeUInt(EE_UINT16_FREQUENCY_MW, 540); EEPROM.writeUInt(EE_UINT16_FREQUENCY_MW, 540);
EEPROM.writeUInt(EE_UINT16_FREQUENCY_SW, 1800); EEPROM.writeUInt(EE_UINT16_FREQUENCY_SW, 1800);
EEPROM.writeString(EE_STRING_XDRGTK_KEY, "password"); EEPROM.writeString(EE_STRING_XDRGTK_KEY, "password");
EEPROM.writeString(EE_STRING_RABBITEARSUSER, "");
EEPROM.writeString(EE_STRING_RABBITEARSPASSWORD, "");
EEPROM.writeByte(EE_BYTE_USESQUELCH, 1); EEPROM.writeByte(EE_BYTE_USESQUELCH, 1);
EEPROM.writeByte(EE_BYTE_SHOWMODULATION, 1); EEPROM.writeByte(EE_BYTE_SHOWMODULATION, 1);
EEPROM.writeByte(EE_BYTE_AM_NB, 0); EEPROM.writeByte(EE_BYTE_AM_NB, 0);
@@ -4920,10 +4899,6 @@ void startFMDXScan() {
initdxscan = true; initdxscan = true;
scanholdflag = false; scanholdflag = false;
autologged = false; autologged = false;
for (byte i = 0; i < 100; i++) {
rabbitearspi[i] = 0;
rabbitearstime[i][0] = 0;
}
if (menu) endMenu(); if (menu) endMenu();
if (afscreen || advancedRDS || rdsstatscreen) { if (afscreen || advancedRDS || rdsstatscreen) {
@@ -4963,47 +4938,6 @@ void startFMDXScan() {
if (XDRGTKUSB || XDRGTKTCP) DataPrint("J1\n"); if (XDRGTKUSB || XDRGTKTCP) DataPrint("J1\n");
} }
void rabbitearssend () {
byte i = 0;
bool hasreport = false;
for (i = 0; i < 100; i++) {
if (rabbitearspi[i]) {
hasreport = true;
break;
}
}
if (!hasreport) return;
if (WiFi.status() != WL_CONNECTED) return;
WiFiClient RabbitearsClient;
String json = String("{\"tuner_key\":\"");
json += RabbitearsUser;
json += String("\",\"password\":\"");
json += RabbitearsPassword;
json += String("\",");
json += String("\"signal\":{");
for (i = 0; i < 100; i++) {
if (rabbitearspi[i]) {
json += String("\"");
json += String((i * 2 + 881) * 100000);
json += String("\":{\"time\":\"");
json += String(rabbitearstime[i]);
json += String("\",\"pi_code\":");
json += String(rabbitearspi[i]);
json += String("},");
rabbitearspi[i] = 0;
}
}
json.remove(json.length() - 1); // remove trailing comma
json += String("}}");
if (RabbitearsClient.connect("rabbitears.info", 80)) {
String payload = RabbitearsHeader + json.length() + "\r\n\r\n" + json;
RabbitearsClient.print(payload);
RabbitearsClient.flush();
RabbitearsClient.stop();
}
}
void setAutoSpeedSPI() { void setAutoSpeedSPI() {
#ifdef DYNAMIC_SPI_SPEED #ifdef DYNAMIC_SPI_SPEED
switch (frequency / 10) { switch (frequency / 10) {
+1 -2
View File
@@ -342,8 +342,7 @@
#define EE_BYTE_MEMSTOPPOS 2227 #define EE_BYTE_MEMSTOPPOS 2227
#define EE_BYTE_MEMPIONLY 2228 #define EE_BYTE_MEMPIONLY 2228
#define EE_BYTE_MEMDOUBLEPI 2229 #define EE_BYTE_MEMDOUBLEPI 2229
#define EE_STRING_RABBITEARSUSER 2230 // blank space
#define EE_STRING_RABBITEARSPASSWORD 2241
#define EE_BYTE_WAITONLYONSIGNAL 2253 #define EE_BYTE_WAITONLYONSIGNAL 2253
#define EE_UINT16_CALTOUCH1 2254 #define EE_UINT16_CALTOUCH1 2254
#define EE_UINT16_CALTOUCH2 2258 #define EE_UINT16_CALTOUCH2 2258
-16
View File
@@ -5335,10 +5335,6 @@ void DoMenu() {
tftPrint(ACENTER, "http://192.168.4.1", 155, 174, PrimaryColor, PrimaryColorSmooth, 16); tftPrint(ACENTER, "http://192.168.4.1", 155, 174, PrimaryColor, PrimaryColorSmooth, 16);
char key [9]; char key [9];
XDRGTK_key.toCharArray(key, 9); XDRGTK_key.toCharArray(key, 9);
char rabbitearsuser [9];
RabbitearsUser.toCharArray(rabbitearsuser, 9);
char rabbitearspw [9];
RabbitearsPassword.toCharArray(rabbitearspw, 9);
UpdateFonts(1); UpdateFonts(1);
if (wifi) { if (wifi) {
wifi = false; wifi = false;
@@ -5346,26 +5342,14 @@ void DoMenu() {
} }
WiFiConnectParam XDRGTK_key_text("Set XDRGTK Password: (max 8 characters)"); WiFiConnectParam XDRGTK_key_text("Set XDRGTK Password: (max 8 characters)");
WiFiConnectParam XDRGTK_key_input("XDRGTK_key", "Password", key, 9); WiFiConnectParam XDRGTK_key_input("XDRGTK_key", "Password", key, 9);
WiFiConnectParam RabbitearsUser_text("Set rabbitears.info live bandscan user ID");
WiFiConnectParam RabbitearsUser_input("RabbitearsUser", "ID", rabbitearsuser, 9);
WiFiConnectParam RabbitearsPassword_text("Set rabbitears.info password");
WiFiConnectParam RabbitearsPassword_input("RabbitearsPassword", "Password", rabbitearspw, 9);
if (!setWiFiConnectParam) { if (!setWiFiConnectParam) {
wc.addParameter(&XDRGTK_key_text); wc.addParameter(&XDRGTK_key_text);
wc.addParameter(&XDRGTK_key_input); wc.addParameter(&XDRGTK_key_input);
wc.addParameter(&RabbitearsUser_text);
wc.addParameter(&RabbitearsUser_input);
wc.addParameter(&RabbitearsPassword_text);
wc.addParameter(&RabbitearsPassword_input);
setWiFiConnectParam = true; setWiFiConnectParam = true;
} }
wc.startConfigurationPortal(AP_WAIT); wc.startConfigurationPortal(AP_WAIT);
XDRGTK_key = XDRGTK_key_input.getValue(); XDRGTK_key = XDRGTK_key_input.getValue();
RabbitearsUser = RabbitearsUser_input.getValue();
RabbitearsPassword = RabbitearsPassword_input.getValue();
EEPROM.writeString(EE_STRING_XDRGTK_KEY, XDRGTK_key); EEPROM.writeString(EE_STRING_XDRGTK_KEY, XDRGTK_key);
EEPROM.writeString(EE_STRING_RABBITEARSUSER, RabbitearsUser);
EEPROM.writeString(EE_STRING_RABBITEARSPASSWORD, RabbitearsPassword);
EEPROM.commit(); EEPROM.commit();
UpdateFonts(0); UpdateFonts(0);
wifi = true; wifi = true;
-2
View File
@@ -197,8 +197,6 @@ extern String rds_clockold;
extern String stationIDold; extern String stationIDold;
extern String stationStateold; extern String stationStateold;
extern String XDRGTK_key; extern String XDRGTK_key;
extern String RabbitearsUser;
extern String RabbitearsPassword;
extern unsigned int ConverterSet; extern unsigned int ConverterSet;
extern unsigned int HighEdgeSet; extern unsigned int HighEdgeSet;
extern unsigned int LowEdgeSet; extern unsigned int LowEdgeSet;