commit b5570da3aa4eca43280d529a421917e4c40f0727 Author: Xavier Date: Wed Aug 24 08:31:23 2022 +0200 first commit diff --git a/Display.pdf b/Display.pdf new file mode 100755 index 0000000..b9083bc Binary files /dev/null and b/Display.pdf differ diff --git a/README.md b/README.md new file mode 100755 index 0000000..49a0e99 --- /dev/null +++ b/README.md @@ -0,0 +1,108 @@ + RadioSonde Version 0.8.7 +============================ + + + + + + + + +Projet basé sur le travail de DL9RDZ +==================================== + +Pour TTGO LORA 32 esp32 pico D4 +Décodage de RadioSonde RS41 and DFM06/09 et M10 + +Attention à la version de votre TTGO! +vous devez modifier dans config.txt, le port de l'écran OLED +- TTGO v1: SDA=4 SCL=15, RST=16 +- TTGO v2: SDA=21 SCL=22, RST=16 + +## Version en production 0.8.5 devel 0.8.7 + +## 0.8.0 +travail de refonte et réécriture du code + +## 0.8.1 + +modification de la partie Web + +## 0.8.5 + +Evolution majeur du système +affichage du pourcentage de la batterie en mode scanning +création d'une fenetre Batterie, Boussole +suppresion lib et code TFT +création Azimute, elevation correction de Bugs majeur , mineur +Ajout fonction Smetre, Buzzer, QTH, Gps on off ... +mise à jour OTA +trop de modification pour toutes les expliciter! + +## 0.8.7 +correction bug Buzzer Off->On->Off +Add GainLNA RX SX1278FSK on Web config paramètre +Add update OTA Os + DataWeb +correction bugs sondmap.html +correction text upgrade Os et DataWeb +correction texte boussole S et N +correction bugs distance 4928Km si lat et lon =0 erroné +correction bugs fonction Vbat +Add Telemetry width export data.csv +Suppression µSD incompatible avec pin SX1278FSK et SPI +Add transfert Telemetry To µSD on put SD automatic + +## Les Boutons optionnel à ajouter(souder) +sur les GPIO 1002 et 1004 +attention: + ++5V--[ SW ]---GPIO----[ R1 ]---/ R1=10 ou 12KOhms + +- appuie court <1.5 seconds +- appuie double court 0.5 seconds +- appuie moyen 2-4 seconds +- appuie long >5 seconds + +## Wifi configuration + +Au démarrage, si aucune connexion possible au wifi paramètré, il monte un Wifi AP +le SSID et mot de passe par défaut est: Radiosonde +en mode AP, il doit être en 192.168.4.1, +mais vous avez aussi la possibilité de mettre http://radiosonde.local dans n'importe quel Wifi +connecté. + + + +## Mode Scanne + +Le fichier qrg.txt contient la liste par défaut des cannaux. +pour y configurer les noms, fréquences et mode [M=M10, 6=DFM06, 9=DFM09 et 4=RS41] + + +## Mode Réception + +En réception, une seul fréquence est décodé, les infos de la sonde (ID, GPS, RSSI, ...) +seront affichées dans plusieur fenetre à choisir ( 0 à 6) à configurer dans la page Web +rubrique config. +In receiving mode, a single frequency will be decoded, and sonde info (ID, GPS +coordinates, RSSI) will be displayed. The bar above the IP address indicates, +for the last 18 frames, if reception was successfull (|) or failed (.) +A DOUBLE press will switch to scanning mode. +A SHORT press will switch to the next channel in channels.txt + +## Mode Analyseur + +Le mode analyseur de spectre (400..406 MHz) est affiché (chaque ligne == 50 kHz) +Pour les cartes TTGO sans bouton configurable, il y a un nouveau paramètre dans config.txt: +- spectrum=10 // 0=off / 1-99 nombre de seconds pour afficher l'analyseur +- timer=1 // 0=off / 1= afficher le compte à rebours du spectre dans l'affichage du spectre +- marker=1 // 0=off / 1= afficher la fréquence dans l'affichage du spectre + +## Setup + +voir Setup.md pour l'installation! + +73 +Xavier + + diff --git a/RadioSonde_FSK/RadioSonde_FSK.ino b/RadioSonde_FSK/RadioSonde_FSK.ino new file mode 100755 index 0000000..b1c70f9 --- /dev/null +++ b/RadioSonde_FSK/RadioSonde_FSK.ino @@ -0,0 +1,2531 @@ +#include + +#include +#include +#include + +#include +//#include +//#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include "version.h" +#include "geteph.h" +#include "rs92gps.h" + +#include "spiffs_sd.h" + +int e; +enum MainState { ST_DECODER, ST_SPECTRUM, ST_WIFISCAN, ST_UPDATE, ST_TOUCHCALIB }; +static MainState mainState = ST_WIFISCAN; // ST_WIFISCAN; + +AsyncWebServer server(80); +AsyncWebSocket ws("/ws"); + +AXP20X_Class axp; +#define PMU_IRQ 35 +SemaphoreHandle_t axpSemaphore; +bool pmu_irq = false; + +String updateHost = "xavier.debert.free.fr"; +int updatePort = 80; +String updateBinM = "/RS/radiosonde/update.ino.bin"; +String updateBinD = "/RS/radiosondedevel/update.ino.bin"; +String *updateBin = &updateBinM; + +String updateDataWeb = "/RS/dataweb/index.html.txt"; +String updateDataWeb2 = "/RS/dataweb/sondemap.html.txt"; +String updateDataWeb3 = "/RS/dataweb/config.txt"; +String updateDataWeb4 = "/RS/dataweb/screens.txt"; +String updateDataWeb5 = "/RS/dataweb/style.css.txt"; +String updateDataWeb6 = "/RS/dataweb/qrg.txt"; +String updateDataWeb7 = "/RS/dataweb/networks.txt"; +String updateDataWeb8 = "/RS/dataweb/fontawesome-webfont.eot.txt"; +String updateDataWeb9 = "/RS/dataweb/fontawesome-webfont.woff.txt"; + +#define LOCALUDPPORT 9002 + +boolean connected = false; +WiFiUDP udp; +WiFiClient client; + +// KISS over TCP für communicating with APRSdroid +WiFiServer tncserver(14580); +WiFiClient tncclient; + +boolean forceReloadScreenConfig = false; + +enum KeyPress { KP_NONE = 0, KP_SHORT, KP_DOUBLE, KP_MID, KP_LONG }; + +// "doublepress" is now also used to eliminate key glitch on TTGO T-Beam startup (SENSOR_VN/GPIO39) +struct Button { + uint8_t pin; + uint32_t numberKeyPresses; + KeyPress pressed; + unsigned long keydownTime; + int8_t doublepress; + bool isTouched; +}; +Button button1 = {0, 0, KP_NONE, 0, -1, false}; +Button button2 = {0, 0, KP_NONE, 0, -1, false}; + +static int lastDisplay = 1; +static int currentDisplay = 1; + +// timestamp when spectrum display was activated +static unsigned long specTimer; + +// Read line from file, independent of line termination (LF or CR LF) +String readLine(Stream &stream) { + String s = stream.readStringUntil('\n'); + int len = s.length(); + if (len == 0) return s; + if (s.charAt(len - 1) == '\r') s.remove(len - 1); + return s; +} + +// Read line from file, without using dynamic memory allocation (String class) +// returns length line. +int readLine(Stream &stream, char *buffer, int maxlen) { + int n = stream.readBytesUntil('\n', buffer, maxlen); + buffer[n] = 0; + if(n <= 0) return 0; + if(buffer[n-1]=='\r') { buffer[n-1]=0; n--; } + return n; +} + +// Replaces placeholder with LED state value +String processor(const String& var) { + Serial.println(var); + if (var == "VERSION_NAME") { + return String(version_name); + } + if (var == "VERSION_ID") { + return String(version_id); + } + if (var == "AUTODETECT_INFO") { + char tmpstr[128]; + const char *fpstr; + int i = 0; + while (fingerprintValue[i] != sonde.fingerprint && fingerprintValue[i] != -1) i++; + if (fingerprintValue[i] == -1) { + fpstr = "Unknown board"; + } else { + fpstr = fingerprintText[i]; + } + snprintf(tmpstr, 128, "Fingerprint %d (%s)", sonde.fingerprint, fpstr); + return String(tmpstr); + } + return String(); +} + +const String sondeTypeSelect(int activeType) { + String sts = ""; + for (int i = 0; i < NSondeTypes; i++) { + sts += "