From 7fe1a17a2de895d2e3a3dd65408b913cf71d9418 Mon Sep 17 00:00:00 2001 From: M0WID Date: Sun, 18 Oct 2020 22:51:31 +0100 Subject: [PATCH] OTA Update Mode Console commands still to do Wifi tidied - commented stuff needs deleting --- Bandscope.ino | 4 +- IFsweep.ino | 4 +- RXsweep.ino | 4 +- SweepLo.ino | 7 +- data/index.html | 35 ++-- simpleSA.h | 4 +- simpleSA.ino | 87 +++++++++- simpleSA_wifi.cpp | 434 +++++++++++++++++++++++----------------------- simpleSA_wifi.h | 2 +- ui.cpp | 9 +- 10 files changed, 338 insertions(+), 252 deletions(-) diff --git a/Bandscope.ino b/Bandscope.ino index 1c74aba..8c97d61 100644 --- a/Bandscope.ino +++ b/Bandscope.ino @@ -497,7 +497,7 @@ static uint16_t chunkIndex; } - myFreq[oldSweepStep] = oldSweepFreq; // Store the frequency for XML file creation +// myFreq[oldSweepStep] = oldSweepFreq; // Store the frequency for XML file creation if ( autoSweepStep >= sweepPoints ) // If we have got to the end of the sweep @@ -513,7 +513,7 @@ static uint16_t chunkIndex; { myActual[setting.BandscopePoints-1] = rxRSSI; // Yes, save it myGain[setting.BandscopePoints-1] = gainReading; - myFreq[setting.BandscopePoints-1] = oldSweepFreq; +// myFreq[setting.BandscopePoints-1] = oldSweepFreq; } if ( showRSSI == 1 ) // Only show it once? diff --git a/IFsweep.ino b/IFsweep.ino index 763d009..f9f836c 100644 --- a/IFsweep.ino +++ b/IFsweep.ino @@ -449,7 +449,7 @@ static uint16_t chunkIndex; if ( oldSweepStep > 0 ) // Only push if not first point (two pixel wide img) img.pushSprite ( xOrigin+oldSweepStep-1, yOrigin ); - myFreq[oldSweepStep] = oldSweepFreq; // Store the frequency for XML file creation +// myFreq[oldSweepStep] = oldSweepFreq; // Store the frequency for XML file creation } // End of "if ( autoSweepFreq >= nextPointFreq )" @@ -467,7 +467,7 @@ static uint16_t chunkIndex; { myActual[displayPoints-1] = rxRSSI; // Yes, save it myGain[displayPoints-1] = gainReading; - myFreq[displayPoints-1] = oldSweepFreq; +// myFreq[displayPoints-1] = oldSweepFreq; } if ( showRSSI == 1 ) // Only show it once? diff --git a/RXsweep.ino b/RXsweep.ino index 7cd25a2..2ef61c9 100644 --- a/RXsweep.ino +++ b/RXsweep.ino @@ -496,7 +496,7 @@ static uint16_t bpfCalFirstSweepDone; if ( oldSweepStep > 0 ) // Only push if not first point (two pixel wide img) img.pushSprite ( xOrigin+oldSweepStep-1, yOrigin ); - myFreq[oldSweepStep] = oldSweepFreq; // Store the frequency for XML file creation +// myFreq[oldSweepStep] = oldSweepFreq; // Store the frequency for XML file creation } // End of "if ( autoSweepFreq >= nextPointFreq )" @@ -514,7 +514,7 @@ static uint16_t bpfCalFirstSweepDone; { myActual[displayPoints-1] = rxRSSI; // Yes, save it myGain[displayPoints-1] = gainReading; - myFreq[displayPoints-1] = oldSweepFreq; +// myFreq[displayPoints-1] = oldSweepFreq; } if ( showRSSI == 1 ) // Only show it once? diff --git a/SweepLo.ino b/SweepLo.ino index 935b2d6..791be57 100644 --- a/SweepLo.ino +++ b/SweepLo.ino @@ -198,6 +198,7 @@ static uint32_t tgIF; // Track gen IF - SA IF plus any offset if both SI4432 case 2: // generator mode tg_lo.TxMode ( trackGenSetting.LO_Drive ); // Set tracking generator LO on tg_if.TxMode ( trackGenSetting.IF_Drive ); // Set tracking generator IF on + delayMicroseconds(300); tg_lo.SetFrequency ( setting.IF_Freq + trackGenSetting.Offset + trackGenSetting.Frequency ); break; @@ -451,6 +452,7 @@ static uint32_t tgIF; // Track gen IF - SA IF plus any offset if both SI4432 JsonObject dataPoint = Points.createNestedObject (); // Add an object to the Json array to be pushed to the client dataPoint["x"] = oldSweepFreq/1000000.0; // Set the x(frequency) value dataPoint["y"] = rxRSSI; // Set the y (RSSI) value + dataPoint["g"] = gainReading; // Set the y (gain) value // Serial.printf ( "Add point chunkIndex %u, sweepStep %u of %u \n", chunkIndex, sweepStep, sweepPoints); chunkIndex++; // increment no of data points in current WiFi chunk @@ -463,6 +465,7 @@ static uint32_t tgIF; // Track gen IF - SA IF plus any offset if both SI4432 // Serial.print("D"); serializeJson ( jsonDocument, wsBuffer ); // Serial.printf("J%u", wsBuffer.length() ); + // Serial.println(wsBuffer); unsigned long s = millis(); webSocket.broadcastTXT ( wsBuffer ); // Send to all connected websocket clients if (millis() - s > 1000) @@ -681,7 +684,7 @@ static uint32_t tgIF; // Track gen IF - SA IF plus any offset if both SI4432 if ( oldSweepStep > 0 ) // Only push if not first point (two pixel wide img) img.pushSprite ( xOrigin+oldSweepStep-1, yOrigin ); - myFreq[oldSweepStep] = oldSweepFreq; // Store the frequency for XML file creation +// myFreq[oldSweepStep] = oldSweepFreq; // Store the frequency for XML file creation } // End of "if ( autoSweepFreq >= nextPointFreq )" @@ -702,7 +705,7 @@ static uint32_t tgIF; // Track gen IF - SA IF plus any offset if both SI4432 { myActual[displayPoints-1] = rxRSSI; // Yes, save it myGain[displayPoints-1] = gainReading; - myFreq[displayPoints-1] = oldSweepFreq; +// myFreq[displayPoints-1] = oldSweepFreq; } if ( showRSSI == 1 ) // Only show it once? diff --git a/data/index.html b/data/index.html index a564972..9295fd8 100644 --- a/data/index.html +++ b/data/index.html @@ -50,11 +50,11 @@
-