├── .gitattributes ├── Article REF └── APRS_LORA_11-22.pdf ├── README.md ├── bluetooth ├── README.md ├── btV3 │ ├── .gitignore │ ├── include │ │ └── README │ ├── lib │ │ ├── Afficheur │ │ │ ├── Afficheur.cpp │ │ │ ├── Afficheur.h │ │ │ └── images.h │ │ ├── AprsDroid │ │ │ ├── AprsDroid.cpp │ │ │ └── AprsDroid.h │ │ ├── DecodeAprs │ │ │ ├── DecodeAprs.cpp │ │ │ └── DecodeAprs.h │ │ ├── Digipeater │ │ │ ├── Digipeater.cpp │ │ │ └── Digipeater.h │ │ ├── LoraAprs │ │ │ ├── LoraAprs.cpp │ │ │ └── LoraAprs.h │ │ ├── Menu │ │ │ ├── Menu.cpp │ │ │ └── Menu.h │ │ └── README │ ├── nbproject │ │ ├── configurations.xml │ │ ├── private │ │ │ ├── CodeAssistancePathMapper.properties │ │ │ ├── c_standard_headers_indexer.c │ │ │ ├── configurations.xml │ │ │ ├── cpp_standard_headers_indexer.cpp │ │ │ ├── launcher.properties │ │ │ └── private.xml │ │ └── project.xml │ ├── platformio.ini │ ├── src │ │ └── main.cpp │ └── test │ │ └── README ├── configAPRSdroid │ ├── bluetooth.jpg │ ├── main_page.jpg │ ├── map.jpg │ ├── texte_brut.jpg │ └── tnc.jpg └── ttgo.jpg ├── firmwares ├── bluetooth │ ├── blue_firmware.bin │ ├── blue_partitions.bin │ └── bootloader.bin ├── igate │ ├── bootloader.bin │ ├── igate_firmware.bin │ └── igate_partitions.bin ├── igateAnalogique │ ├── ESP32IGate_V11_OLED.bin │ ├── boot.bin │ ├── bootloader.bin │ └── partitions.bin ├── resetgps │ ├── bootloader.bin │ ├── reset_firmware.bin │ └── reset_partitions.bin └── tracker │ ├── bootloader.bin │ ├── tracker_firmware.bin │ └── tracker_partitions.bin ├── igate ├── README.md ├── T3_V1.6.pdf ├── cablage_igate.png ├── configAPRSdroid │ ├── ip_address_port.jpg │ └── main_tcp-ip.jpg ├── display_oled │ └── oled.jpg ├── igateV4 │ ├── .gitignore │ ├── include │ │ └── README │ ├── lib │ │ ├── Afficheur │ │ │ ├── Afficheur.cpp │ │ │ ├── Afficheur.h │ │ │ └── images.h │ │ ├── AprsDroidTcp │ │ │ ├── AprsDroidTcp.cpp │ │ │ └── AprsDroidTcp.h │ │ ├── Aprsis │ │ │ ├── Aprsis.cpp │ │ │ └── Aprsis.h │ │ ├── AsyncTCP │ │ │ ├── AsyncTCP.cpp │ │ │ └── AsyncTCP.h │ │ ├── DecodeAprs │ │ │ ├── DecodeAprs.cpp │ │ │ └── DecodeAprs.h │ │ ├── Digipeater │ │ │ ├── Digipeater.cpp │ │ │ └── Digipeater.h │ │ ├── GestionWifi │ │ │ ├── GestionWifi.cpp │ │ │ └── GestionWifi.h │ │ ├── LoraAprs │ │ │ ├── LoraAprs.cpp │ │ │ └── LoraAprs.h │ │ ├── Menu │ │ │ ├── Menu.cpp │ │ │ └── Menu.h │ │ └── README │ ├── nbproject │ │ ├── configurations.xml │ │ ├── private │ │ │ ├── CodeAssistancePathMapper.properties │ │ │ ├── c_standard_headers_indexer.c │ │ │ ├── configurations.xml │ │ │ ├── cpp_standard_headers_indexer.cpp │ │ │ ├── launcher.properties │ │ │ └── private.xml │ │ └── project.xml │ ├── platformio.ini │ ├── src │ │ └── main.cpp │ └── test │ │ └── README ├── igateV5 │ ├── .gitignore │ ├── include │ │ └── README │ ├── lib │ │ ├── Afficheur │ │ │ ├── Afficheur.cpp │ │ │ ├── Afficheur.h │ │ │ └── images.h │ │ ├── AprsDroidTcp │ │ │ ├── AprsDroidTcp.cpp │ │ │ └── AprsDroidTcp.h │ │ ├── Aprsis │ │ │ ├── Aprsis.cpp │ │ │ └── Aprsis.h │ │ ├── AsyncTCP │ │ │ ├── AsyncTCP.cpp │ │ │ └── AsyncTCP.h │ │ ├── DecodeAprs │ │ │ ├── DecodeAprs.cpp │ │ │ └── DecodeAprs.h │ │ ├── Digipeater │ │ │ ├── Digipeater.cpp │ │ │ └── Digipeater.h │ │ ├── GestionWifi │ │ │ ├── GestionWifi.cpp │ │ │ └── GestionWifi.h │ │ ├── LoraAprs │ │ │ ├── LoraAprs.cpp │ │ │ └── LoraAprs.h │ │ ├── Menu │ │ │ ├── Menu.cpp │ │ │ └── Menu.h │ │ └── README │ ├── nbproject │ │ ├── configurations.xml │ │ ├── private │ │ │ ├── CodeAssistancePathMapper.properties │ │ │ ├── c_standard_headers_indexer.c │ │ │ ├── configurations.xml │ │ │ ├── cpp_standard_headers_indexer.cpp │ │ │ ├── launcher.properties │ │ │ └── private.xml │ │ └── project.xml │ ├── platformio.ini │ ├── src │ │ └── main.cpp │ └── test │ │ └── README └── ttgo.jpg ├── index.html ├── manifest ├── blue.json ├── igate.json ├── igateAnalogique.json ├── resetgps.json └── tracker.json ├── style.css └── tracker ├── AXP192-X-Powers.pdf ├── LilyGo_TBeam_V1.1.pdf ├── Platform_Model.PNG ├── README.md ├── TTGO_board.png ├── TTGO_pinout.png ├── TTGO_upper_lower.png ├── lora2.png ├── test.png ├── trackerV3 ├── .gitignore ├── include │ └── README ├── lib │ ├── LoraAprs │ │ ├── LoraAprs.cpp │ │ └── LoraAprs.h │ ├── Menu │ │ ├── Menu.cpp │ │ └── Menu.h │ ├── Message │ │ ├── Message.cpp │ │ └── Message.h │ ├── Position │ │ ├── Position.cpp │ │ └── Position.h │ ├── README │ └── power_management │ │ ├── power_management.cpp │ │ └── power_management.h ├── nbproject │ ├── configurations.xml │ ├── private │ │ ├── CodeAssistancePathMapper.properties │ │ ├── c_standard_headers_indexer.c │ │ ├── configurations.xml │ │ ├── cpp_standard_headers_indexer.cpp │ │ ├── launcher.properties │ │ └── private.xml │ └── project.xml ├── platformio.ini ├── src │ └── main.cpp └── test │ └── README └── u-blox8-M8_ReceiverDescrProtSpec_UBX-13003221.pdf /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /Article REF/APRS_LORA_11-22.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f4goh/lora-aprs-esp32/95cf2282bb9f8d09c3f771adb8758d17ec1505a1/Article REF/APRS_LORA_11-22.pdf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # LORA APRS with an esp32 2 | 3 | ## Automatic installation [firmwares](https://f4goh.github.io/lora-aprs-esp32/index.html) 4 | 5 | Project redone from [OE5BPA](https://github.com/lora-aprs) 6 | 7 | TTGO Product Features 8 | - ESP32 9 | - Lastest ESP32 Version: REV1 10 | - WIFI 11 | - Bluetooth 12 | - 8MB PSRAM 13 | - 4MB Flash 14 | - 3D Antenna 15 | 16 | 17 | LORA 18 | - HPD14A SX1278 compatible RFM98W 433MHz /470MHz LoRa Wireless transceiver module 19 | - Working voltage: 1.8~3.7v 20 | - Acceptable current:10~14mA 21 | - Transmit current: 22 | - 120mA@+20dBm 23 | - 90mA@+17dBm 24 | - 29mA@+13dBm 25 | 26 | Operating frequency: 433/470MHz(433HMz version) /868M/915M(868MHz version) 27 | Transmit power: +20dBm 28 | Receive sensitivity : 29 | -139dBm LoRa 62.5Khz SF=12 146bps 30 | -136dBm LoRa 125Khz SF=12 293bps 31 | -118dBm LoRa 125Khz SF=6 9380bps 32 | -123dBm FSK 5Khz 1.2Kbps 33 | Frequency error:+/-15KHz 34 | FIFO space : 64Byte 35 | Data rate :1.2K~300Kbps FSK 0.018K 37.5Kbps 36 | 37 | Modulation Mode :FSK,GFSK,MSK,GMSK,LoRa TM,OOK 38 | 39 | Interface form : SPI 40 | 41 | 42 | Sleep current :0.2uA@SLEEP 1.5uA IDLE 43 | Operating temperature :-40°- +85° 44 | Digital RSSI function 45 | Automatic frequency correction 46 | Automatic gain control 47 | Low voltage detection and temperature sensor 48 | Fast wake-up and frequency hopping 49 | Highly configurable data packet handler 50 | 51 | 52 | GPS 53 | 54 | GPS modules NEO-6M, 3V-5V power supply Universal 55 | Destined module with ceramic antenna, signal super 56 | Save the configuration parameter data EEPROM Down 57 | With data backup battery 58 | There are LED signal indicator 59 | Default Baud Rate: 9600 60 | 61 | Power 62 | 63 | Power Supply Input USB 5V/1A 64 | Charging current 500mA 65 | Battery Input 3.7-4.2V 66 | Charge IC AXP192 67 | 68 | 69 | More information: 70 | 71 | ## Lilygo [Lilygo](https://github.com/Xinyuan-LilyGO/LilyGO-T-Beam) 72 | 73 | ## SoftRF [SoftRF](https://github.com/LilyGO/SoftRF ) 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /bluetooth/README.md: -------------------------------------------------------------------------------- 1 | # Bluetooth 2 | 3 | ## Automatic installation [firmwares](https://f4goh.github.io/lora-aprs-esp32/index.html) 4 | 5 | *** 6 | ## TTGO BOARD 7 | 8 | ![TTGO](ttgo.jpg "TTGO BOARD") 9 | 10 | *** 11 | 12 | Serial monitor 115200 Bauds 13 | 14 | ```console 15 | rst:0rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) 16 | configsip: 188777542, SPIWP:0xee 17 | clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 18 | mode:DIO, clock div:2 19 | load:0x3fff0018,len:4 20 | load:0x3fff001c,len:1044 21 | load:0x40078000,len:10124 22 | load:0x40080400,len:5828 23 | entry 0x400806a8 24 | Set SPI pins! 25 | Set LoRa pins! 26 | frequency: 27 | 433775000 28 | LoRa init done! 29 | Tache RX en fonctionnement 30 | Tache Afficheur en fonctionnement 31 | 32 | >Press m key to enter menu 33 | ...help command for info 34 | 35 | >help 36 | Available commands 37 | Set callsign for digi : call f4goh-6 38 | Set frequency : freq 433775000 39 | Set latitude in degrees minutes decimal : latitude 4753.41N 40 | Set longitude in degrees minutes decimal : longitude 00016.61E 41 | Set new comment : comment hello 42 | Set Digipeater enable (0 or 1) : digi 1 43 | Show configuration : show 44 | Reset default configuration : raz 45 | Exit menu : exit 46 | >show 47 | Call is : f4goh-3 48 | Frequency is : 433775000 49 | latitude is : 4756.57N 50 | longitude is : 00016.03E 51 | Digipeater is : Disable 52 | Comment is : digi bt 53 | >>exit 54 | > 55 | Console exit 56 | bluetooth gate 57 | Tache RX Droid en fonctionnement 58 | Access point BT enable 59 | ``` 60 | 61 | ![TNC](configAPRSdroid/tnc.jpg "TNC") 62 | 63 | ![TEXTE](configAPRSdroid/texte_brut.jpg "TEXTE") 64 | 65 | ![BLUE](configAPRSdroid/bluetooth.jpg "BLUE") 66 | 67 | ![MAIN](configAPRSdroid/main_page.jpg "MAIN CNX") 68 | 69 | ![MAP](configAPRSdroid/map.jpg "MAP") 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /bluetooth/btV3/.gitignore: -------------------------------------------------------------------------------- 1 | .pio 2 | -------------------------------------------------------------------------------- /bluetooth/btV3/include/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for project header files. 3 | 4 | A header file is a file containing C declarations and macro definitions 5 | to be shared between several project source files. You request the use of a 6 | header file in your project source file (C, C++, etc) located in `src` folder 7 | by including it, with the C preprocessing directive `#include'. 8 | 9 | ```src/main.c 10 | 11 | #include "header.h" 12 | 13 | int main (void) 14 | { 15 | ... 16 | } 17 | ``` 18 | 19 | Including a header file produces the same results as copying the header file 20 | into each source file that needs it. Such copying would be time-consuming 21 | and error-prone. With a header file, the related declarations appear 22 | in only one place. If they need to be changed, they can be changed in one 23 | place, and programs that include the header file will automatically use the 24 | new version when next recompiled. The header file eliminates the labor of 25 | finding and changing all the copies as well as the risk that a failure to 26 | find one copy will result in inconsistencies within a program. 27 | 28 | In C, the usual convention is to give header files names that end with `.h'. 29 | It is most portable to use only letters, digits, dashes, and underscores in 30 | header file names, and at most one dot. 31 | 32 | Read more about using header files in official GCC documentation: 33 | 34 | * Include Syntax 35 | * Include Operation 36 | * Once-Only Headers 37 | * Computed Includes 38 | 39 | https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html 40 | -------------------------------------------------------------------------------- /bluetooth/btV3/lib/Afficheur/Afficheur.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | 7 | /* 8 | * File: Afficheur.cpp 9 | * Author: ale 10 | * 11 | * Created on 7 avril 2022, 19:54 12 | */ 13 | 14 | #include "Afficheur.h" 15 | 16 | 17 | // Address 0x3c on SDA and SCL 18 | 19 | 20 | Afficheur::Afficheur() : 21 | frameCount(1), 22 | overlaysCount(1), 23 | display(SSD1306Wire(0x3c, SDA, SCL, GEOMETRY_128_64)), 24 | ui(OLEDDisplayUi(&display)), 25 | frames{Afficheur::drawFrame1, Afficheur::drawFrame2,Afficheur::drawFrame3}, 26 | overlays{Afficheur::msOverlay}, 27 | rssi(0), 28 | compteurTrame(0), 29 | btCnx(false), 30 | disRssi(false), 31 | cnxError(false) 32 | { 33 | anchor = this; 34 | memset(&report, '\0', sizeof(aprs)); 35 | strcpy(report.callSign,CALLSIGN); 36 | 37 | ui.setActiveSymbol(activeSymbol); 38 | ui.setInactiveSymbol(inactiveSymbol); 39 | ui.setIndicatorPosition(BOTTOM); 40 | 41 | // Defines where the first frame is located in the bar. 42 | ui.setIndicatorDirection(LEFT_RIGHT); 43 | 44 | ui.setOverlays(overlays, overlaysCount); 45 | ui.setFrames(frames, frameCount); 46 | //ui.disableAutoTransition(); 47 | //ui.disableIndicator(); 48 | ui.disableAllIndicators(); 49 | ui.init(); 50 | 51 | display.flipScreenVertically(); 52 | 53 | xTaskCreatePinnedToCore(Afficheur::marshall, "afficheur", 10000, NULL, 2, &TaskHandle_Aff, 1); // creation de la tache 54 | } 55 | 56 | 57 | Afficheur::~Afficheur() { 58 | 59 | } 60 | 61 | 62 | void Afficheur::setErrorCnx(bool _cnxError){ 63 | cnxError=_cnxError; 64 | } 65 | 66 | 67 | /** 68 | * update connexion state 69 | * @param 2 bool 70 | */ 71 | 72 | 73 | void Afficheur::setCnxState(bool _btCnx) { 74 | btCnx=_btCnx; 75 | 76 | } 77 | 78 | 79 | void Afficheur::marshall(void * parametres) { 80 | anchor->scrollingAuto(); 81 | } 82 | 83 | /** 84 | * update rssi value 85 | * @param bool 86 | */ 87 | 88 | void Afficheur::displayRssi(bool _disRssi){ 89 | disRssi=_disRssi; 90 | } 91 | 92 | 93 | 94 | 95 | /** 96 | * set new RSSI 97 | * @param _rssi int 98 | */ 99 | 100 | 101 | void Afficheur::setRssi(int _rssi){ 102 | rssi=_rssi; 103 | } 104 | 105 | /** 106 | * task to scroll display between two pages 107 | */ 108 | 109 | 110 | void Afficheur::scrollingAuto() { 111 | Serial.println("Tache Afficheur en fonctionnement"); 112 | while (1) { 113 | vTaskDelay(1); //indispensable car sinon guru ?! 114 | ui.update(); 115 | } 116 | } 117 | 118 | /** 119 | * display overlay on 2 pages wifi enable and tcp/ip enable 120 | */ 121 | 122 | void Afficheur::msOverlay(OLEDDisplay *display, OLEDDisplayUiState* state) { 123 | String text; 124 | display->setFont(ArialMT_Plain_10); 125 | display->setTextAlignment(TEXT_ALIGN_LEFT); 126 | text=anchor->btCnx ? "EN." : "DIS."; 127 | text="BLUETOOTH "+text; 128 | display->drawString(0, 0, text); 129 | } 130 | 131 | /** 132 | * display page 1 133 | */ 134 | 135 | void Afficheur::drawFrame1(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y) { 136 | String msg; 137 | if (strcmp(anchor->report.callSign, CALLSIGN)==0) { 138 | display->setTextAlignment(TEXT_ALIGN_LEFT); 139 | display->drawXbm(x + 0, y + 20, TW_width, TW_height, TW_Logo_bits); 140 | display->setFont(ArialMT_Plain_24); 141 | display->drawString(45 + x, y+25, anchor->report.callSign); 142 | } else { 143 | //display->setFont(ArialMT_Plain_10); 144 | display->setFont(ArialMT_Plain_16); 145 | display->setTextAlignment(TEXT_ALIGN_RIGHT); 146 | display->drawString(128 + x, 10 + y, String(anchor->compteurTrame)); 147 | display->setTextAlignment(TEXT_ALIGN_LEFT); 148 | display->drawString(0 + x, 10 + y, anchor->report.callSign); 149 | display->drawString(0 + x, 26 + y, anchor->report.comment); 150 | if (anchor->disRssi) { 151 | msg = "RSSI: " + String(anchor->rssi) + " dBm"; 152 | display->drawString(0 + x, 26 + 16 + y, msg); 153 | } 154 | } 155 | } 156 | 157 | /** 158 | * display page 2 159 | */ 160 | 161 | 162 | void Afficheur::drawFrame2(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y) { 163 | display->setFont(ArialMT_Plain_24); 164 | if (anchor->cnxError) { 165 | display->setTextAlignment(TEXT_ALIGN_CENTER); 166 | display->drawString(64 + x, 20 + y, "ERROR"); 167 | } else { 168 | display->setTextAlignment(TEXT_ALIGN_LEFT); 169 | display->drawString(0 + x, 16 + y, anchor->report.latitude); 170 | display->drawString(0 + x, 16 + 24 + y, anchor->report.longitude); 171 | } 172 | } 173 | 174 | /** 175 | * display page 3 altitude course speed 176 | */ 177 | 178 | void Afficheur::drawFrame3(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y) { 179 | String msg; 180 | display->setFont(ArialMT_Plain_16); 181 | display->setTextAlignment(TEXT_ALIGN_LEFT); 182 | if (anchor->report.withAltitude) { 183 | msg = "Altitude " + String(anchor->report.altitudeMeters) + " m"; 184 | display->drawString(0 + x, 10 + y, msg); 185 | } 186 | if (anchor->report.withCourseSpeed) { 187 | msg = "Course " + String(anchor->report.course) + " °"; 188 | display->drawString(0 + x, 26 + y, msg); 189 | msg = "Speed " + String(anchor->report.course) + " kts"; 190 | display->drawString(0 + x, 26 + 16 + y, msg); 191 | } 192 | } 193 | 194 | /** 195 | * refresh data to display 196 | * @param msg char * message parsed to display 197 | */ 198 | 199 | void Afficheur::refresh(aprs _report) { 200 | compteurTrame++; 201 | memcpy(&report, &_report, sizeof (aprs)); 202 | if ((report.withCourseSpeed) || (report.withAltitude)) { 203 | frameCount = 3; 204 | } else { 205 | frameCount = 2; 206 | } 207 | ui.setFrames(frames, frameCount); 208 | Serial.println(report.callSign); 209 | Serial.println(report.latitude); 210 | Serial.println(report.longitude); 211 | Serial.println(report.symTableId); 212 | Serial.println(report.symCode); 213 | Serial.println(report.course); 214 | Serial.println(report.speed); 215 | Serial.println(report.altitude); 216 | Serial.println(report.altitudeMeters); 217 | Serial.println(report.comment); 218 | } 219 | 220 | Afficheur* Afficheur::anchor = NULL; 221 | 222 | -------------------------------------------------------------------------------- /bluetooth/btV3/lib/Afficheur/Afficheur.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File: Afficheur.h 3 | * From Author: philippe SIMIER Lycée Touchard Washington 4 | * Modified by Anthony Le Cren 5 | * Created on 11 février 2022, 11:15 6 | * Classe Afficheur pour le TTGO 7 | * spécialisation de SSD1306Wire 8 | * https://github.com/ThingPulse/esp8266-oled-ssd1306/blob/master/README.md 9 | * https://www.online-utility.org/image/convert/to/XBM 10 | */ 11 | 12 | #ifndef AFFICHEUR_H 13 | #define AFFICHEUR_H 14 | 15 | #include 16 | #include 17 | #include "OLEDDisplayUi.h" 18 | #include "images.h" 19 | 20 | #define CALLSIGN "F4KMN" 21 | 22 | typedef enum{ 23 | POSITION, 24 | WEATHER, 25 | MESSAGE 26 | } TYPE_APRS; 27 | 28 | 29 | #define CALL_LEN 10 30 | #define TIMESTAMP_LEN 6 31 | #define LATITUDE_LEN 8 32 | #define LONGITUDE_LEN 9 33 | #define ALTITUDE_LEN 6 34 | #define COURSE_LEN 3 35 | #define SPEED_LEN 3 36 | #define COMMENT_LEN 50 37 | 38 | 39 | typedef struct{ 40 | TYPE_APRS ta; 41 | char callSign[CALL_LEN+1]; 42 | char timeStamp[TIMESTAMP_LEN+1]; 43 | char longitude[LONGITUDE_LEN+1]; 44 | char latitude[LATITUDE_LEN+1]; 45 | char altitude[ALTITUDE_LEN+1]; 46 | int altitudeMeters; 47 | char course[COURSE_LEN+1]; 48 | char speed[SPEED_LEN+1]; 49 | char comment[COMMENT_LEN]; 50 | char symTableId; 51 | char symCode; 52 | bool compressed; 53 | bool withTimeStamp; 54 | bool withAltitude; 55 | bool withCourseSpeed; 56 | }aprs; 57 | 58 | 59 | class Afficheur { 60 | public: 61 | 62 | Afficheur(); 63 | virtual ~Afficheur(); 64 | 65 | void setCnxState(bool _btCnx); 66 | void setRssi(int _rssi); 67 | void displayRssi(bool _disRssi); 68 | void setErrorCnx(bool _cnxError); 69 | void refresh(aprs report); 70 | 71 | 72 | private: 73 | 74 | static void marshall(void * parametres); 75 | 76 | void scrollingAuto(); 77 | 78 | static void drawFrame1(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y); 79 | static void drawFrame2(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y); 80 | static void drawFrame3(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y); 81 | static void msOverlay(OLEDDisplay *display, OLEDDisplayUiState* state); 82 | 83 | 84 | int frameCount; // Nombre de pages à afficher 85 | int overlaysCount; 86 | SSD1306Wire display; 87 | OLEDDisplayUi ui; 88 | FrameCallback frames[3]; 89 | OverlayCallback overlays[1]; //affichage commun par dessus toutes les pages 90 | int rssi; 91 | uint8_t compteurTrame; 92 | bool btCnx; 93 | bool disRssi; 94 | bool cnxError; 95 | 96 | static Afficheur* anchor; 97 | 98 | TaskHandle_t TaskHandle_Aff; 99 | 100 | bool disAlti; 101 | aprs report; 102 | 103 | }; 104 | 105 | #endif /* AFFICHEUR_H */ 106 | -------------------------------------------------------------------------------- /bluetooth/btV3/lib/Afficheur/images.h: -------------------------------------------------------------------------------- 1 | #define TW_width 30 2 | #define TW_height 37 3 | const uint8_t TW_Logo_bits[] PROGMEM = { 4 | 0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0x3F, 5 | 0xFF, 0xFF, 0xFF, 0x3F, 0x0F, 0xE0, 0x01, 0x3C, 0x0F, 0xE0, 0x01, 0x3C, 6 | 0x0F, 0xE0, 0x01, 0x3C, 0x80, 0xE7, 0x79, 0x00, 0x80, 0xE7, 0x79, 0x00, 7 | 0x80, 0xE7, 0x79, 0x00, 0x8F, 0xE7, 0x79, 0x3C, 0x8F, 0xE7, 0x79, 0x3C, 8 | 0x8F, 0xE7, 0x79, 0x3C, 0x8F, 0xE7, 0x79, 0x3C, 0x8F, 0xE7, 0x79, 0x3C, 9 | 0x8F, 0xE7, 0x79, 0x3C, 0x8F, 0xE7, 0x79, 0x3C, 0x8F, 0xE7, 0x79, 0x3C, 10 | 0x8F, 0xE7, 0x79, 0x3C, 0x8F, 0xE7, 0x79, 0x3C, 0x8F, 0xE7, 0x79, 0x3C, 11 | 0x8F, 0xE7, 0x79, 0x3C, 0x8F, 0xE7, 0x79, 0x3C, 0x0E, 0xFF, 0x3F, 0x1C, 12 | 0x1E, 0xFF, 0x3F, 0x1E, 0x1C, 0xFE, 0x1F, 0x0E, 0x3C, 0x3C, 0x0F, 0x0F, 13 | 0x38, 0x18, 0x06, 0x07, 0x78, 0x00, 0x80, 0x07, 0xF0, 0x00, 0x80, 0x03, 14 | 0xF0, 0xC1, 0xC0, 0x03, 0xE0, 0xE3, 0xF1, 0x01, 0xC0, 0xF7, 0xFB, 0x00, 15 | 0x80, 0xFF, 0x7F, 0x00, 0x00, 0xFF, 0x3F, 0x00, 0x00, 0xFC, 0x0F, 0x00, 16 | 0x00, 0xE0, 0x01, 0x00}; 17 | 18 | 19 | const uint8_t activeSymbol[] PROGMEM = { 20 | B00000000, 21 | B00000000, 22 | B00011000, 23 | B00100100, 24 | B01000010, 25 | B01000010, 26 | B00100100, 27 | B00011000 28 | }; 29 | 30 | const uint8_t inactiveSymbol[] PROGMEM = { 31 | B00000000, 32 | B00000000, 33 | B00000000, 34 | B00000000, 35 | B00011000, 36 | B00011000, 37 | B00000000, 38 | B00000000 39 | }; 40 | -------------------------------------------------------------------------------- /bluetooth/btV3/lib/AprsDroid/AprsDroid.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | 7 | /* 8 | * File: AprsDroid.cpp 9 | * Author: ale 10 | * 11 | * Created on 11 avril 2022, 11:28 12 | */ 13 | 14 | #include "AprsDroid.h" 15 | 16 | AprsDroid::AprsDroid() { 17 | anchor = this; 18 | } 19 | 20 | AprsDroid::AprsDroid(const AprsDroid& orig) { 21 | } 22 | 23 | AprsDroid::~AprsDroid() { 24 | } 25 | 26 | bool AprsDroid::setup(const String _name) { 27 | name = _name; 28 | bt.begin(name); 29 | BaseType_t ret = xTaskCreatePinnedToCore(AprsDroid::marshall, "aprsdroid", 50000, NULL, 3, &TaskHandle_Rxbt, tskNO_AFFINITY); 30 | return (ret == pdPASS) ? true : false; 31 | } 32 | 33 | void AprsDroid::send(char* msg){ 34 | bt.println(msg); 35 | } 36 | 37 | int AprsDroid::getPduLength(){ 38 | return pduLength; 39 | } 40 | 41 | 42 | void AprsDroid::marshall(void * parametres) { 43 | anchor->receive(); 44 | } 45 | 46 | 47 | void AprsDroid::receive() { 48 | 49 | Serial.println("Tache RX Droid en fonctionnement"); 50 | int ptr = 0; 51 | char car; 52 | while (1) { 53 | vTaskDelay(1); //indispensable car sinon guru ?! 54 | if (bt.available()) { //tester avec le while 55 | if (ptr < MSG_MAX_LENGTH - 1) { 56 | car = (char) bt.read(); 57 | if (car != '\n') { 58 | msg[ptr++] = car; 59 | } else { 60 | msg[ptr] = '\0'; 61 | pduLength=ptr; 62 | ptr = 0; 63 | Serial.println("AprsDroid incomming"); 64 | Serial.println(msg); 65 | xQueueSend(queueRx, msg, 0); 66 | } 67 | } else { 68 | msg[ptr] = '\0'; 69 | ptr = 0; 70 | } 71 | } 72 | } 73 | } 74 | 75 | 76 | QueueHandle_t AprsDroid::queueRx = xQueueCreate(3, sizeof (msg)); 77 | AprsDroid* AprsDroid::anchor = NULL; 78 | -------------------------------------------------------------------------------- /bluetooth/btV3/lib/AprsDroid/AprsDroid.h: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | 7 | /* 8 | * File: AprsDroid.h 9 | * Author: ale 10 | * 11 | * Created on 11 avril 2022, 11:28 12 | */ 13 | 14 | 15 | 16 | 17 | #ifndef APRSDROID_H 18 | #define APRSDROID_H 19 | 20 | #include 21 | #include 22 | 23 | #define MSG_MAX_LENGTH 100 24 | 25 | class AprsDroid { 26 | public: 27 | AprsDroid(); 28 | AprsDroid(const AprsDroid& orig); 29 | virtual ~AprsDroid(); 30 | bool setup(const String _name); 31 | void send(char* msg); 32 | int getPduLength(); 33 | static QueueHandle_t queueRx; 34 | 35 | private: 36 | TaskHandle_t TaskHandle_Rxbt; 37 | void receive(); 38 | static AprsDroid* anchor; 39 | static void marshall(void *); 40 | BluetoothSerial bt; 41 | String name; 42 | char msg[MSG_MAX_LENGTH]; 43 | int pduLength; 44 | 45 | }; 46 | 47 | #endif /* APRSDROID_H */ 48 | 49 | 50 | -------------------------------------------------------------------------------- /bluetooth/btV3/lib/DecodeAprs/DecodeAprs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | 7 | /* 8 | * File: DecodeAprs.h 9 | * Author: ale 10 | * 11 | * Created on 10 mai 2022, 15:31 12 | */ 13 | 14 | #ifndef DECODEAPRS_H 15 | #define DECODEAPRS_H 16 | 17 | //#include 18 | #include 19 | #include 20 | #include 21 | 22 | #define BODY_LEN 100 23 | 24 | class DecodeAprs : public Afficheur 25 | { 26 | public: 27 | DecodeAprs(); 28 | DecodeAprs(const DecodeAprs& orig); 29 | virtual ~DecodeAprs(); 30 | bool parse(char* msg); 31 | 32 | private: 33 | bool split(char *str, char car); 34 | bool extractCall(char *msg); 35 | int countChar(char *msg, char car); 36 | void clearMem(); 37 | bool checkAprsAndTimeStamp(); 38 | bool parsePositionId(); 39 | bool checkAltitude(); 40 | bool checkCourseSpeed(); 41 | bool parseComment(); 42 | char body[BODY_LEN]; 43 | aprs report; 44 | 45 | 46 | }; 47 | 48 | #endif /* DECODEAPRS_H */ 49 | 50 | -------------------------------------------------------------------------------- /bluetooth/btV3/lib/Digipeater/Digipeater.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | 7 | /* 8 | * File: Digipeater.cpp 9 | * Author: ale 10 | * 11 | * Created on 11 mai 2022, 12:43 12 | */ 13 | 14 | #include "Digipeater.h" 15 | 16 | Digipeater::Digipeater(String _call,String _latitude,String _longitude, String _comment) { 17 | beaconMsg=_call+">APDR16:!"+_latitude+"I"+_longitude+"#"+_comment; 18 | memset(callDigi, '\0', CALL_LEN); 19 | nbPaths=0; 20 | _call.toCharArray(callDigi,CALL_LEN); 21 | clearMem(); 22 | } 23 | 24 | Digipeater::Digipeater(const Digipeater& orig) { 25 | } 26 | 27 | Digipeater::~Digipeater() { 28 | } 29 | 30 | void Digipeater::clearMem() { 31 | memset(head, '\0', HEAD_LEN); 32 | memset(body, '\0', BODY_LEN); 33 | memset(fromCall, '\0', CALL_LEN); 34 | memset(path, '\0', PATH_LEN); 35 | memset(pdu, '\0', PDU_LEN); 36 | for (int n = 0; n < MAX_PATHS; n++) { 37 | memset(pathTab[n], '\0', CALL_LEN); 38 | } 39 | } 40 | 41 | bool Digipeater::split(char *msg, char *partA, char *partB,char car) { 42 | char *pch; 43 | int tailleA,tailleB; 44 | bool ret=false; 45 | pch = strchr(msg, car); 46 | if (pch != NULL) { 47 | tailleA=pch-msg; 48 | tailleB=strlen(msg)-(pch-msg)-1; 49 | strncpy(partA,msg,tailleA); 50 | strncpy(partB,pch+1,tailleB); 51 | ret=true; 52 | } 53 | return ret; 54 | } 55 | 56 | int Digipeater::countChar(char *msg, char car) { 57 | int n; 58 | int cpt = 0; 59 | for (n = 0; n < strlen(msg); n++) { 60 | if (msg[n] == car) { 61 | cpt++; 62 | } 63 | } 64 | return cpt; 65 | } 66 | 67 | bool Digipeater::splitPath(){ 68 | int n; 69 | int cpt = 0; 70 | char temp[CALL_LEN] = {0}; 71 | int m = 0; 72 | if (countChar(path, ',') >= MAX_PATHS - 1) { 73 | Serial.print("Full : "); 74 | Serial.println(cpt); 75 | return false; 76 | } 77 | for (n = 0; n < strlen(path) + 1; n++) { 78 | if ((path[n] != ',') && (path[n] != '\0')) { 79 | temp[m] = path[n]; 80 | m++; 81 | } else { 82 | strncpy(pathTab[cpt], temp, CALL_LEN); 83 | memset(temp, '\0', CALL_LEN); 84 | m = 0; 85 | cpt++; 86 | } 87 | } 88 | nbPaths = cpt; 89 | Serial.println(cpt); 90 | for (n = 0; n < cpt; n++) { 91 | Serial.println(pathTab[n]); 92 | } 93 | return true; 94 | } 95 | 96 | bool Digipeater::routing(char* msg) { 97 | clearMem(); 98 | Serial.println(strlen(msg)); 99 | if (strlen(msg) == 0) { 100 | return false; 101 | } 102 | if (split(msg, head, body, ':') == false) { 103 | return false; 104 | } 105 | Serial.println(head); 106 | Serial.println(body); 107 | if (strlen(head) == 0) { 108 | return false; 109 | } 110 | if (split(head, fromCall, path, '>') == false) { 111 | return false; 112 | } 113 | Serial.println(fromCall); 114 | Serial.println(path); 115 | if (splitPath() == false) { 116 | return false; 117 | } 118 | if (addPath()==false){ 119 | Serial.println("Bad Path"); 120 | } 121 | return true; 122 | } 123 | 124 | bool Digipeater::addPath() { 125 | int n; 126 | if (strcmp(fromCall, callDigi) == 0) { 127 | Serial.println("Own call"); 128 | return false; 129 | } 130 | for (n = 0; n < nbPaths; n++) { 131 | if (strcmp(pathTab[n], callDigi) == 0) { 132 | Serial.println("Call inside PATH"); 133 | return false; 134 | 135 | } 136 | } 137 | if (strncmp(pathTab[nbPaths - 1], "WIDE", 4) != 0) { 138 | Serial.println("No WIDE"); 139 | return false; 140 | } 141 | if (pathTab[nbPaths - 1][5] == '*') { 142 | Serial.println("End PATH"); 143 | return false; 144 | } 145 | strcpy(pathTab[nbPaths], pathTab[nbPaths - 1]); 146 | memset(pathTab[nbPaths - 1], '\0', CALL_LEN); 147 | strcpy(pathTab[nbPaths - 1], callDigi); 148 | nbPaths++; 149 | pathTab[nbPaths - 1][6]--; 150 | if (pathTab[nbPaths - 1][6] == '0') { 151 | pathTab[nbPaths - 1][5] = '*'; 152 | pathTab[nbPaths - 1][6] = '\0'; 153 | } 154 | Serial.println(nbPaths); 155 | for (n = 0; n < nbPaths; n++) { 156 | Serial.println(pathTab[n]); 157 | } 158 | return true; 159 | } 160 | 161 | 162 | char * Digipeater::getMsg(){ 163 | int n; 164 | memset(pdu, '\0', PDU_LEN); 165 | snprintf(pdu, PDU_LEN, "%s>", fromCall); 166 | for (n = 0; n < nbPaths-1; n++) { 167 | strcat(pdu, pathTab[n]); 168 | strcat(pdu, ","); 169 | } 170 | strcat(pdu, pathTab[nbPaths-1]); 171 | strcat(pdu, ":"); 172 | strcat(pdu, body); 173 | Serial.println(pdu); 174 | return pdu; 175 | } 176 | 177 | char * Digipeater::getBeacon(){ 178 | memset(pdu, '\0', PDU_LEN); 179 | beaconMsg.toCharArray(pdu,PDU_LEN); 180 | return pdu; 181 | } 182 | 183 | 184 | void Digipeater::check(char *msg){ 185 | char *nr; 186 | if (routing(msg)){ 187 | nr=getMsg(); 188 | Serial.println(msg); 189 | Serial.println(nr); 190 | }; 191 | } 192 | 193 | void Digipeater::test(){ 194 | 195 | char msg1[]="F4GOH-9>APDR16,F4GOH-2,WIDE1-1:=4753.42N/00016.61Eb/A=000399 lora aprs"; 196 | check(msg1); 197 | char msg2[]="F4GOH-9>APDR16,WIDE2-2:=4753.42N/00016.61Eb/A=000399 lora aprs"; 198 | check(msg2); 199 | //char msg3[]="F4GOH-9>APDR16,F4GOH-2,F4GOH-3,F4GOH-4,WIDE2*:=4753.42N/00016.61Eb/A=000399 lora aprs"; 200 | //check(msg3); 201 | } 202 | -------------------------------------------------------------------------------- /bluetooth/btV3/lib/Digipeater/Digipeater.h: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | 7 | /* 8 | * File: Digipeater.h 9 | * Author: ale 10 | * 11 | * Created on 11 mai 2022, 12:43 12 | */ 13 | 14 | #ifndef DIGIPEATER_H 15 | #define DIGIPEATER_H 16 | 17 | #include 18 | #include 19 | 20 | 21 | #define MAX_PATHS 5 22 | #define HEAD_LEN 80 23 | #define PATH_LEN 70 24 | #define BODY_LEN 100 25 | #define CALL_LEN 10 26 | #define PDU_LEN 150 27 | 28 | 29 | class Digipeater { 30 | public: 31 | Digipeater(String _call,String _latitude,String _longitude, String _comment); 32 | Digipeater(const Digipeater& orig); 33 | virtual ~Digipeater(); 34 | bool routing(char* msg); 35 | char * getMsg(); 36 | void test(); 37 | char * getBeacon(); 38 | 39 | 40 | private: 41 | bool split(char *str, char *partA, char *partB,char car); 42 | bool splitPath(); 43 | bool addPath(); 44 | int countChar(char *msg, char car); 45 | void check(char *msg); 46 | void clearMem(); 47 | 48 | 49 | String beaconMsg; 50 | char callDigi[CALL_LEN]; 51 | char head[HEAD_LEN]; 52 | char body[BODY_LEN]; 53 | char fromCall[CALL_LEN]; 54 | char path[PATH_LEN]; 55 | char pathTab[MAX_PATHS][CALL_LEN]; 56 | char pdu[PDU_LEN]; 57 | int nbPaths; 58 | 59 | }; 60 | 61 | #endif /* DIGIPEATER_H */ 62 | 63 | //F4GOH-9>APDR16,F4GOH-2,F4GOH-3,F4GOH-4*:=4753.00N/00016.72Eb/A=000399 lora aprs"+ "\n" -------------------------------------------------------------------------------- /bluetooth/btV3/lib/LoraAprs/LoraAprs.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | 7 | /* 8 | * File: LoraAprs.cpp 9 | * Author: ale 10 | * 11 | * Created on 19 mars 2022, 18:04 12 | */ 13 | 14 | #include "LoraAprs.h" 15 | 16 | LoraAprs::LoraAprs(long _frequency,int _spreadingFactor,long _signalBandwith, int _codingRate,int _txPower): 17 | frequency(_frequency), 18 | spreadingFactor(_spreadingFactor), 19 | signalBandwith(_signalBandwith), 20 | codingRate(_codingRate), 21 | txPower(_txPower) 22 | { 23 | anchor = this; 24 | txing=false; 25 | } 26 | 27 | LoraAprs::LoraAprs(const LoraAprs& orig) { 28 | } 29 | 30 | LoraAprs::~LoraAprs() { 31 | } 32 | 33 | void LoraAprs::setup(){ 34 | Serial.println("Set SPI pins!"); 35 | SPI.begin(LORA_SCK, LORA_MISO, LORA_MOSI, LORA_CS); 36 | 37 | Serial.println("Set LoRa pins!"); 38 | setPins(LORA_CS, LORA_RST, LORA_IRQ); 39 | 40 | 41 | Serial.println("frequency: "); 42 | Serial.println(String(frequency)); 43 | if (!begin(frequency)) { 44 | Serial.println("Starting LoRa failed!"); 45 | while (true) { 46 | } 47 | } 48 | setSpreadingFactor(spreadingFactor); 49 | setSignalBandwidth(signalBandwith); 50 | setCodingRate4(codingRate); 51 | enableCrc(); 52 | 53 | setTxPower(txPower);//Config.lora.power); 54 | Serial.println("LoRa init done!"); 55 | //msg.reserve(100); 56 | //Serial.println(msg.size())); 57 | xTaskCreatePinnedToCore(LoraAprs::marshall, "lora_rx", 50000, NULL, 3, &TaskHandle_Rx, tskNO_AFFINITY); // creation de la tache 58 | } 59 | 60 | void LoraAprs::send(char* msg,int length){ 61 | txing=true; 62 | beginPacket(); 63 | // Header: 64 | write('<'); 65 | write(0xFF); 66 | write(0x01); 67 | // APRS Data: 68 | write((const uint8_t *) msg,length); 69 | endPacket(); 70 | txing=false; 71 | } 72 | 73 | void LoraAprs::marshall(void * parametres) { 74 | anchor->receive(); 75 | } 76 | 77 | bool LoraAprs::checkMessage() { 78 | 79 | if (!parsePacket()) { 80 | return false; 81 | } 82 | // read header: 83 | char dummy[4]; 84 | readBytes(dummy, 3); 85 | if (dummy[0] != '<') { 86 | // is no APRS message, ignore message 87 | while (available()) { 88 | read(); 89 | } 90 | return false; 91 | } 92 | // read APRS data: 93 | int n=0; 94 | while (available() && n wired on pcb AND connected to header pin LORA1 23 | * #define LORA_IO2 32 // GPIO32 - SX1276 IO2 -> wired on pcb AND connected to header pin LORA2 24 | */ 25 | 26 | #ifndef LORAAPRS_H 27 | #define LORAAPRS_H 28 | 29 | #include 30 | #include 31 | #include 32 | 33 | 34 | #define FREQUENCY 433775000 35 | #define SPREADING_FACTOR 12 36 | #define SIGNAL_BANDWIDTH 125000 37 | #define CODING_RATE_4 5 38 | #define TX_POWER 20 39 | #define MSG_MAX_LENGTH 100 40 | 41 | 42 | class LoraAprs : public LoRaClass { 43 | public: 44 | LoraAprs(long _frequency=FREQUENCY, 45 | int _spreadingFactor=SPREADING_FACTOR, 46 | long _signalBandwith=SIGNAL_BANDWIDTH, 47 | int _codingRate=CODING_RATE_4, 48 | int _txPower=TX_POWER); 49 | LoraAprs(const LoraAprs& orig); 50 | virtual ~LoraAprs(); 51 | 52 | 53 | void setup(); 54 | void send(char* msg,int length); 55 | 56 | static QueueHandle_t queueRx; 57 | 58 | private: 59 | TaskHandle_t TaskHandle_Rx; 60 | void receive(); 61 | static LoraAprs* anchor; 62 | static void marshall(void *); 63 | bool checkMessage(); 64 | char msg[MSG_MAX_LENGTH]; 65 | long frequency; 66 | int spreadingFactor; 67 | long signalBandwith; 68 | int codingRate; 69 | int txPower; 70 | bool txing; 71 | 72 | }; 73 | 74 | #endif /* LORAAPRS_H */ 75 | 76 | -------------------------------------------------------------------------------- /bluetooth/btV3/lib/Menu/Menu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File: Menu.h 3 | * Author: philippe SIMIER Touchard Washington Le Mans 4 | * 5 | * Created on 22 avril 2022, 17:11 6 | */ 7 | 8 | #ifndef MENU_H 9 | #define MENU_H 10 | #include 11 | #include 12 | #include // Classe pour écrire et lire la configuration 13 | 14 | #define FREQUENCY 433775000 15 | #define TIMEOUT_MENU 10 16 | 17 | 18 | class Menu { 19 | 20 | public: 21 | Menu(); 22 | Menu(const Menu& orig); 23 | virtual ~Menu(); 24 | 25 | void run(); 26 | void setup(); 27 | 28 | // Méthodes associées aux commandes 29 | static void _call_(ArgList& L, Stream& S); 30 | static void _freq_(ArgList& L, Stream& S); 31 | static void _latitude_(ArgList& L, Stream& S); 32 | static void _longitude_(ArgList& L, Stream& S); 33 | static void _comment_(ArgList& L, Stream& S); 34 | static void _config_(ArgList& L, Stream& S); 35 | static void _raz_(ArgList& L, Stream& S); 36 | 37 | static void _exit_(ArgList& L, Stream& S); 38 | static void _help_(ArgList& L, Stream& S); 39 | static void _unknown(String& L, Stream& S); 40 | static void _digi_(ArgList& L, Stream& S); 41 | 42 | 43 | private: 44 | 45 | bool exitFlag; 46 | Console *con; 47 | Preferences *configuration; 48 | static Menu* anchor; 49 | bool acceptCmd(String cmd, int longMin, int longMax); 50 | 51 | }; 52 | 53 | #endif /* MENU_H */ 54 | -------------------------------------------------------------------------------- /bluetooth/btV3/lib/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for project specific (private) libraries. 3 | PlatformIO will compile them to static libraries and link into executable file. 4 | 5 | The source code of each library should be placed in a an own separate directory 6 | ("lib/your_library_name/[here are source files]"). 7 | 8 | For example, see a structure of the following two libraries `Foo` and `Bar`: 9 | 10 | |--lib 11 | | | 12 | | |--Bar 13 | | | |--docs 14 | | | |--examples 15 | | | |--src 16 | | | |- Bar.c 17 | | | |- Bar.h 18 | | | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html 19 | | | 20 | | |--Foo 21 | | | |- Foo.c 22 | | | |- Foo.h 23 | | | 24 | | |- README --> THIS FILE 25 | | 26 | |- platformio.ini 27 | |--src 28 | |- main.c 29 | 30 | and a contents of `src/main.c`: 31 | ``` 32 | #include 33 | #include 34 | 35 | int main (void) 36 | { 37 | ... 38 | } 39 | 40 | ``` 41 | 42 | PlatformIO Library Dependency Finder will find automatically dependent 43 | libraries scanning project source files. 44 | 45 | More information about PlatformIO Library Dependency Finder 46 | - https://docs.platformio.org/page/librarymanager/ldf.html 47 | -------------------------------------------------------------------------------- /bluetooth/btV3/nbproject/private/CodeAssistancePathMapper.properties: -------------------------------------------------------------------------------- 1 | # Automatic path mapper. CRC = 1 2 | -------------------------------------------------------------------------------- /bluetooth/btV3/nbproject/private/c_standard_headers_indexer.c: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * Oracle and Java are registered trademarks of Oracle and/or its affiliates. 7 | * Other names may be trademarks of their respective owners. 8 | * 9 | * The contents of this file are subject to the terms of either the GNU 10 | * General Public License Version 2 only ("GPL") or the Common 11 | * Development and Distribution License("CDDL") (collectively, the 12 | * "License"). You may not use this file except in compliance with the 13 | * License. You can obtain a copy of the License at 14 | * http://www.netbeans.org/cddl-gplv2.html 15 | * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the 16 | * specific language governing permissions and limitations under the 17 | * License. When distributing the software, include this License Header 18 | * Notice in each file and include the License file at 19 | * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this 20 | * particular file as subject to the "Classpath" exception as provided 21 | * by Oracle in the GPL Version 2 section of the License file that 22 | * accompanied this code. If applicable, add the following below the 23 | * License Header, with the fields enclosed by brackets [] replaced by 24 | * your own identifying information: 25 | * "Portions Copyrighted [year] [name of copyright owner]" 26 | * 27 | * If you wish your version of this file to be governed by only the CDDL 28 | * or only the GPL Version 2, indicate your decision by adding 29 | * "[Contributor] elects to include this software in this distribution 30 | * under the [CDDL or GPL Version 2] license." If you do not indicate a 31 | * single choice of license, a recipient has the option to distribute 32 | * your version of this file under either the CDDL, the GPL Version 2 or 33 | * to extend the choice of license to its licensees as provided above. 34 | * However, if you add GPL Version 2 code and therefore, elected the GPL 35 | * Version 2 license, then the option applies only if the new code is 36 | * made subject to such option by the copyright holder. 37 | * 38 | * Contributor(s): 39 | */ 40 | 41 | // List of standard headers was taken in http://en.cppreference.com/w/c/header 42 | 43 | #include // Conditionally compiled macro that compares its argument to zero 44 | #include // Functions to determine the type contained in character data 45 | #include // Macros reporting error conditions 46 | #include // Limits of float types 47 | #include // Sizes of basic types 48 | #include // Localization utilities 49 | #include // Common mathematics functions 50 | #include // Nonlocal jumps 51 | #include // Signal handling 52 | #include // Variable arguments 53 | #include // Common macro definitions 54 | #include // Input/output 55 | #include // String handling 56 | #include // General utilities: memory management, program utilities, string conversions, random numbers 57 | #include // Time/date utilities 58 | #include // (since C95) Alternative operator spellings 59 | #include // (since C95) Extended multibyte and wide character utilities 60 | #include // (since C95) Wide character classification and mapping utilities 61 | #ifdef _STDC_C99 62 | #include // (since C99) Complex number arithmetic 63 | #include // (since C99) Floating-point environment 64 | #include // (since C99) Format conversion of integer types 65 | #include // (since C99) Boolean type 66 | #include // (since C99) Fixed-width integer types 67 | #include // (since C99) Type-generic math (macros wrapping math.h and complex.h) 68 | #endif 69 | #ifdef _STDC_C11 70 | #include // (since C11) alignas and alignof convenience macros 71 | #include // (since C11) Atomic types 72 | #include // (since C11) noreturn convenience macros 73 | #include // (since C11) Thread library 74 | #include // (since C11) UTF-16 and UTF-32 character utilities 75 | #endif 76 | -------------------------------------------------------------------------------- /bluetooth/btV3/nbproject/private/configurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Afficheur.cpp 10 | Afficheur.h 11 | images.h 12 | 13 | 14 | AprsDroid.cpp 15 | AprsDroid.h 16 | 17 | 18 | DecodeAprs.cpp 19 | DecodeAprs.h 20 | 21 | 22 | Digipeater.cpp 23 | Digipeater.h 24 | 25 | 26 | LoraAprs.cpp 27 | LoraAprs.h 28 | 29 | 30 | Menu.cpp 31 | Menu.h 32 | 33 | 34 | 35 | main.cpp 36 | 37 | 38 | 39 | platformio.ini 40 | 41 | 42 | 43 | 44 | 45 | 46 | localhost 47 | 2 48 | 49 | 50 | 51 | . 52 | ${AUTO_FOLDER} 53 | 54 | ${AUTO_FOLDER} 55 | 56 | ${MAKE} ${ITEM_NAME}.o 57 | ${AUTO_COMPILE} 58 | 59 | ${AUTO_COMPILE} 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | gdb 75 | 76 | 77 | 78 | "${OUTPUT_PATH}" 79 | pio run --target upload 80 | 81 | pio run --target upload 82 | 83 | false 84 | 0 85 | 0 86 | 87 | 88 | 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /bluetooth/btV3/nbproject/private/launcher.properties: -------------------------------------------------------------------------------- 1 | # Launchers File syntax: 2 | # 3 | # [Must-have property line] 4 | # launcher1.runCommand= 5 | # [Optional extra properties] 6 | # launcher1.displayName= 7 | # launcher1.hide= 8 | # launcher1.buildCommand= 9 | # launcher1.runDir= 10 | # launcher1.runInOwnTab= 11 | # launcher1.symbolFiles= 12 | # launcher1.env.= 13 | # (If this value is quoted with ` it is handled as a native command which execution result will become the value) 14 | # [Common launcher properties] 15 | # common.runDir= 16 | # (This value is overwritten by a launcher specific runDir value if the latter exists) 17 | # common.env.= 18 | # (Environment variables from common launcher are merged with launcher specific variables) 19 | # common.symbolFiles= 20 | # (This value is overwritten by a launcher specific symbolFiles value if the latter exists) 21 | # 22 | # In runDir, symbolFiles and env fields you can use these macroses: 23 | # ${PROJECT_DIR} - project directory absolute path 24 | # ${OUTPUT_PATH} - linker output path (relative to project directory path) 25 | # ${OUTPUT_BASENAME}- linker output filename 26 | # ${TESTDIR} - test files directory (relative to project directory path) 27 | # ${OBJECTDIR} - object files directory (relative to project directory path) 28 | # ${CND_DISTDIR} - distribution directory (relative to project directory path) 29 | # ${CND_BUILDDIR} - build directory (relative to project directory path) 30 | # ${CND_PLATFORM} - platform name 31 | # ${CND_CONF} - configuration name 32 | # ${CND_DLIB_EXT} - dynamic library extension 33 | # 34 | # All the project launchers must be listed in the file! 35 | # 36 | # launcher1.runCommand=... 37 | # launcher2.runCommand=... 38 | # ... 39 | # common.runDir=... 40 | # common.env.KEY=VALUE 41 | 42 | # launcher1.runCommand= -------------------------------------------------------------------------------- /bluetooth/btV3/nbproject/private/private.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0 5 | 0 6 | 7 | 8 | 9 | 10 | file:/home/ale/NetBeansProjects/ttgo/igateV3/lib/Menu/Menu.cpp 11 | file:/home/ale/NetBeansProjects/ttgo/igateV3/lib/DecodeAprs/DecodeAprs.cpp 12 | file:/home/ale/NetBeansProjects/ttgo/igateV3/lib/AprsDroid/AprsDroid.cpp 13 | file:/home/ale/NetBeansProjects/ttgo/igateV3/lib/LoraAprs/LoraAprs.cpp 14 | file:/home/ale/NetBeansProjects/ttgo/igateV3/lib/AprsDroid/AprsDroid.h 15 | file:/home/ale/NetBeansProjects/ttgo/igateV3/platformio.ini 16 | file:/home/ale/NetBeansProjects/ttgo/igateV3/src/main.cpp 17 | file:/home/ale/NetBeansProjects/ttgo/igateV3/lib/Afficheur/Afficheur.h 18 | file:/home/ale/NetBeansProjects/ttgo/igateV3/lib/Afficheur/Afficheur.cpp 19 | file:/home/ale/NetBeansProjects/ttgo/igateV3/lib/LoraAprs/LoraAprs.h 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /bluetooth/btV3/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.cnd.makeproject 4 | 5 | 6 | igateV3 7 | 8 | cpp 9 | h 10 | UTF-8 11 | 12 | 13 | . 14 | 15 | 16 | 17 | Default 18 | 0 19 | 20 | 21 | 22 | false 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /bluetooth/btV3/platformio.ini: -------------------------------------------------------------------------------- 1 | ; PlatformIO Project Configuration File 2 | ; 3 | ; Build options: build flags, source filter 4 | ; Upload options: custom upload port, speed and extra flags 5 | ; Library options: dependencies, extra library storages 6 | ; Advanced options: extra scripting 7 | ; 8 | ; Please visit documentation for the other options and examples 9 | ; https://docs.platformio.org/page/projectconf.html 10 | 11 | [env:ttgo-lora32-v21] 12 | platform = espressif32 13 | board = ttgo-lora32-v21 14 | framework = arduino 15 | #board_build.partitions = min_spiffs.csv 16 | lib_deps = 17 | sandeepmistry/LoRa@^0.8.0 18 | akoro/Console@^1.2.1 19 | -------------------------------------------------------------------------------- /bluetooth/btV3/src/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * File: main.cpp 3 | * Author: F4GOH - KF4GOH 4 | * Created on 6 avril 2022, 13:14 5 | * bluetooth Version FOR APRS Droid 6 | * LoRa iGATE : https://github.com/f4goh/lora-aprs-esp32 7 | * 8 | * LoRa 9 | * ==== 10 | * #ID: 1167 11 | * An Arduino library for sending and receiving data using LoRa radios. Supports Semtech SX1276/77/78/79 based boards/shields. 12 | * pio lib install 1167 13 | * Library Manager: LoRa @ 0.8.0 has been installed! 14 | * 15 | * Console 16 | * ======= 17 | * #ID: 6893 18 | * Small user console class for embedded systems based on arduino framework 19 | * pio lib install 6893 20 | * Library Manager: Console @ 1.2.1 has been installed! 21 | * 22 | * Library : ESP32Time @ 1.0.4 23 | * installation : pio lib install 11703 24 | * 25 | * Bibliothèque : Oled 26 | * installation : pio lib install 2978 27 | * 28 | * todo : 29 | * improve parser 30 | */ 31 | #include 32 | #include 33 | #include // Afficheur SSD1306 34 | #include 35 | #include 36 | #include 37 | #include // Classe commandes via la console 38 | #include 39 | #include 40 | 41 | 42 | #define LED 25 //green led 43 | #define FREQUENCY 433775000 44 | #define BEACON_INTERVAL 15 45 | 46 | LoraAprs lora; 47 | DecodeAprs *afficheur; 48 | AprsDroid *ad; 49 | Console con; 50 | Preferences configuration; 51 | Menu *leMenu; 52 | Digipeater *digi; 53 | 54 | ESP32Time rtc; 55 | 56 | void erreur(){ 57 | Serial.print("Bluetooth Sartup"); 58 | Serial.println("Check configuration"); 59 | afficheur->setErrorCnx(true); 60 | while(1){ 61 | 62 | } 63 | } 64 | 65 | void sendBeacon(){ 66 | char * pdu; 67 | pdu=digi->getBeacon(); 68 | Serial.println(pdu); 69 | lora.send(pdu,strlen(pdu)); 70 | } 71 | 72 | 73 | void setup() { 74 | //nvs_flash_erase(); // erase the NVS partition and... 75 | //nvs_flash_init(); // initialize the NVS partition. 76 | Serial.begin(115200); 77 | pinMode(LED, OUTPUT); 78 | rtc.setTime(30, 59, 15, 17, 1, 2021); // 17th Jan 2021 15:59:30 date bidon 79 | lora.setup(); 80 | afficheur = new DecodeAprs; 81 | 82 | leMenu = new Menu; // Menu de configuration 83 | leMenu->setup(); 84 | configuration.begin("bluetooth", false); 85 | digi = new Digipeater(configuration.getString("call"),configuration.getString("latitude"),configuration.getString("longitude"),configuration.getString("comment")); 86 | 87 | bool ret; 88 | 89 | lora.setFrequency(configuration.getLong("freq")); 90 | Serial.println("bluetooth gate"); 91 | ad = new AprsDroid; 92 | ret = ad->setup("LoRa Droid"); 93 | if (ret) { 94 | Serial.println("Access point BT enable"); 95 | afficheur->setCnxState(ret); 96 | } 97 | else{ 98 | erreur(); 99 | } 100 | 101 | } 102 | 103 | 104 | void loop() { 105 | char * pdu; 106 | char msg[MSG_MAX_LENGTH]; 107 | char car; 108 | if (Serial.available() > 0) { 109 | car = Serial.read(); 110 | if (car == 'b') { //test beacon 111 | sendBeacon(); 112 | } 113 | } 114 | if (xQueueReceive(lora.queueRx, msg, 0) == pdPASS) { //lora -> bluetooth 115 | Serial.println("msg queue"); 116 | Serial.println(msg); 117 | Serial.print("with RSSI "); 118 | Serial.println(lora.packetRssi()); 119 | afficheur->setRssi(lora.packetRssi()); 120 | afficheur->displayRssi(true); 121 | afficheur->parse(msg); 122 | ad->send(msg); //via bt 123 | if (configuration.getBool("digi")) { //digi 124 | if (digi->routing(msg)) { 125 | pdu = digi->getMsg(); 126 | Serial.println(pdu); 127 | lora.send(pdu, strlen(pdu)); 128 | } 129 | } 130 | } 131 | if (xQueueReceive(ad->queueRx, msg, 0) == pdPASS) { //bluetooth-> lora 132 | Serial.println("msg bt queue"); 133 | Serial.println(msg); 134 | afficheur->displayRssi(false); 135 | afficheur->parse(msg); 136 | digitalWrite(LED, HIGH); 137 | lora.send(msg, ad->getPduLength()); 138 | digitalWrite(LED, LOW); 139 | } 140 | 141 | if (configuration.getBool("digi")) { 142 | if (((rtc.getMinute() % BEACON_INTERVAL) == 0) && (rtc.getSecond()==0)) { 143 | sendBeacon(); 144 | } 145 | } 146 | delay(1); 147 | } 148 | -------------------------------------------------------------------------------- /bluetooth/btV3/test/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for PlatformIO Unit Testing and project tests. 3 | 4 | Unit Testing is a software testing method by which individual units of 5 | source code, sets of one or more MCU program modules together with associated 6 | control data, usage procedures, and operating procedures, are tested to 7 | determine whether they are fit for use. Unit testing finds problems early 8 | in the development cycle. 9 | 10 | More information about PlatformIO Unit Testing: 11 | - https://docs.platformio.org/page/plus/unit-testing.html 12 | -------------------------------------------------------------------------------- /bluetooth/configAPRSdroid/bluetooth.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f4goh/lora-aprs-esp32/95cf2282bb9f8d09c3f771adb8758d17ec1505a1/bluetooth/configAPRSdroid/bluetooth.jpg -------------------------------------------------------------------------------- /bluetooth/configAPRSdroid/main_page.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f4goh/lora-aprs-esp32/95cf2282bb9f8d09c3f771adb8758d17ec1505a1/bluetooth/configAPRSdroid/main_page.jpg -------------------------------------------------------------------------------- /bluetooth/configAPRSdroid/map.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f4goh/lora-aprs-esp32/95cf2282bb9f8d09c3f771adb8758d17ec1505a1/bluetooth/configAPRSdroid/map.jpg -------------------------------------------------------------------------------- /bluetooth/configAPRSdroid/texte_brut.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f4goh/lora-aprs-esp32/95cf2282bb9f8d09c3f771adb8758d17ec1505a1/bluetooth/configAPRSdroid/texte_brut.jpg -------------------------------------------------------------------------------- /bluetooth/configAPRSdroid/tnc.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f4goh/lora-aprs-esp32/95cf2282bb9f8d09c3f771adb8758d17ec1505a1/bluetooth/configAPRSdroid/tnc.jpg -------------------------------------------------------------------------------- /bluetooth/ttgo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f4goh/lora-aprs-esp32/95cf2282bb9f8d09c3f771adb8758d17ec1505a1/bluetooth/ttgo.jpg -------------------------------------------------------------------------------- /firmwares/bluetooth/blue_firmware.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f4goh/lora-aprs-esp32/95cf2282bb9f8d09c3f771adb8758d17ec1505a1/firmwares/bluetooth/blue_firmware.bin -------------------------------------------------------------------------------- /firmwares/bluetooth/blue_partitions.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f4goh/lora-aprs-esp32/95cf2282bb9f8d09c3f771adb8758d17ec1505a1/firmwares/bluetooth/blue_partitions.bin -------------------------------------------------------------------------------- /firmwares/bluetooth/bootloader.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f4goh/lora-aprs-esp32/95cf2282bb9f8d09c3f771adb8758d17ec1505a1/firmwares/bluetooth/bootloader.bin -------------------------------------------------------------------------------- /firmwares/igate/bootloader.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f4goh/lora-aprs-esp32/95cf2282bb9f8d09c3f771adb8758d17ec1505a1/firmwares/igate/bootloader.bin -------------------------------------------------------------------------------- /firmwares/igate/igate_firmware.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f4goh/lora-aprs-esp32/95cf2282bb9f8d09c3f771adb8758d17ec1505a1/firmwares/igate/igate_firmware.bin -------------------------------------------------------------------------------- /firmwares/igate/igate_partitions.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f4goh/lora-aprs-esp32/95cf2282bb9f8d09c3f771adb8758d17ec1505a1/firmwares/igate/igate_partitions.bin -------------------------------------------------------------------------------- /firmwares/igateAnalogique/ESP32IGate_V11_OLED.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f4goh/lora-aprs-esp32/95cf2282bb9f8d09c3f771adb8758d17ec1505a1/firmwares/igateAnalogique/ESP32IGate_V11_OLED.bin -------------------------------------------------------------------------------- /firmwares/igateAnalogique/boot.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f4goh/lora-aprs-esp32/95cf2282bb9f8d09c3f771adb8758d17ec1505a1/firmwares/igateAnalogique/boot.bin -------------------------------------------------------------------------------- /firmwares/igateAnalogique/bootloader.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f4goh/lora-aprs-esp32/95cf2282bb9f8d09c3f771adb8758d17ec1505a1/firmwares/igateAnalogique/bootloader.bin -------------------------------------------------------------------------------- /firmwares/igateAnalogique/partitions.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f4goh/lora-aprs-esp32/95cf2282bb9f8d09c3f771adb8758d17ec1505a1/firmwares/igateAnalogique/partitions.bin -------------------------------------------------------------------------------- /firmwares/resetgps/bootloader.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f4goh/lora-aprs-esp32/95cf2282bb9f8d09c3f771adb8758d17ec1505a1/firmwares/resetgps/bootloader.bin -------------------------------------------------------------------------------- /firmwares/resetgps/reset_firmware.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f4goh/lora-aprs-esp32/95cf2282bb9f8d09c3f771adb8758d17ec1505a1/firmwares/resetgps/reset_firmware.bin -------------------------------------------------------------------------------- /firmwares/resetgps/reset_partitions.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f4goh/lora-aprs-esp32/95cf2282bb9f8d09c3f771adb8758d17ec1505a1/firmwares/resetgps/reset_partitions.bin -------------------------------------------------------------------------------- /firmwares/tracker/bootloader.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f4goh/lora-aprs-esp32/95cf2282bb9f8d09c3f771adb8758d17ec1505a1/firmwares/tracker/bootloader.bin -------------------------------------------------------------------------------- /firmwares/tracker/tracker_firmware.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f4goh/lora-aprs-esp32/95cf2282bb9f8d09c3f771adb8758d17ec1505a1/firmwares/tracker/tracker_firmware.bin -------------------------------------------------------------------------------- /firmwares/tracker/tracker_partitions.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f4goh/lora-aprs-esp32/95cf2282bb9f8d09c3f771adb8758d17ec1505a1/firmwares/tracker/tracker_partitions.bin -------------------------------------------------------------------------------- /igate/README.md: -------------------------------------------------------------------------------- 1 | # Igate 2 | 3 | ## Automatic installation [firmwares](https://f4goh.github.io/lora-aprs-esp32/index.html) 4 | 5 | *** 6 | ## TTGO BOARD 7 | 8 | ![TTGO](ttgo.jpg "TTGO BOARD") 9 | 10 | *** 11 | 12 | ## TTGO TEST with esp32 and RA02 (SX1278) 13 | 14 | Igate software recognize TTGO lora32 V1 15 | 16 | change i2c lines in BoardFinder.cpp file to use ssd1306 display 17 | 18 | ```c++ 19 | BoardConfig TTGO_LORA32_V1 ("TTGO_LORA32_V1", eTTGO_LORA32_V1, 21, 22, 0x3C, 0, 5, 19, 27, 18, 14, 26); 20 | ``` 21 | 22 | ![TTGO](cablage_igate.png "TTGO TEST") 23 | 24 | 25 | ![DISPLAY](display_oled/oled.jpg "DISPLAY") 26 | 27 | 28 | Serial monitor 115200 Bauds 29 | 30 | ```console 31 | rst:0rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) 32 | configsip: 188777542, SPIWP:0xee 33 | clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 34 | mode:DIO, clock div:2 35 | load:0x3fff0018,len:4 36 | load:0x3fff001c,len:1044 37 | load:0x40078000,len:10124 38 | load:0x40080400,len:5828 39 | entry 0x400806a8 40 | Set SPI pins! 41 | Set LoRa pins! 42 | frequency: 43 | 433775000 44 | LoRa init done! 45 | Tache RX en fonctionnement 46 | Tache Afficheur en fonctionnement 47 | 48 | >Press m key to enter menu 49 | ..help command for info 50 | 51 | >help 52 | Available commands 53 | Set ssid : ssid mywifi 54 | Set password : pass toto 55 | Set new callsign : call f4goh-6 56 | Set latitude in degrees minutes decimal : latitude 4753.41N 57 | Set longitude in degrees minutes decimal : longitude 00016.61E 58 | Set new comment : comment hello 59 | Set frequency : freq 433775000 60 | Enable wifi for igate (aprs.fi) : internet 1 61 | Enable local wifi Access Point for AprsDroid : internet 0 62 | When disable igate, local wifi AP are enable 63 | Set server : server euro.aprs2.net 64 | Set port : port 14580 65 | Set Digipeater enable (0 or 1) : digi 1 66 | Show configuration : show 67 | Reset default configuration : raz 68 | Exit menu : exit 69 | >show 70 | Ssid is : Livebox-xxxx 71 | password is : toto 72 | Call is : f4goh-1 73 | Frequency is : 433775000 74 | latitude is : 4753.41N 75 | longitude is : 00016.61E 76 | Internet is : Enable 77 | TCP Access point is : Disable 78 | Server is : euro.aprs2.net 79 | Port is : 14580 80 | Digipeater is : Disable 81 | Comment is : LoRa iGATE : https://github.com/f4goh/lora-aprs-esp32 82 | >exit 83 | > 84 | Console exit 85 | wifi igate on internet 86 | 15001 87 | Client Wifi 88 | ..... 89 | WiFi connecté 90 | Adresse IP : 192.168.1.36 91 | Adresse IP de la gateway : 192.168.1.1 92 | Tache Wifi en fonctionnement 93 | Tache APRS-IS en fonctionnement 94 | Connexion au serveur Aprs done 95 | 231220 96 | Re init Connexion APRS.. 97 | connexion Serveur APRS en cours... 98 | user f4goh-1 pass 15001 vers ESP32-APRS-IS 1.0 99 | connexion au serveur aprs 100 | # aprsc 2.1.11-g80df3b4 101 | # logresp f4goh-1 verified, server T2BIO 102 | Connexion APRS ok 103 | f4goh-1>APLG01:=4753.41NL00016.61E&LoRa iGATE : https://github.com/f4goh/lora-aprs-esp32 104 | ``` 105 | *** 106 | ## APRSDroid in ACCESS POINT 107 | 108 | SSID is APRS Droid 109 | password is totototo 110 | 111 | ```console 112 | Enable local wifi Access Point for AprsDroid : internet 0 113 | ``` 114 | 115 | ![MAIN](configAPRSdroid/main_tcp-ip.jpg "MAIN CNX") 116 | 117 | ![IPADD](configAPRSdroid/ip_address_port.jpg "MAIN CNX") 118 | 119 | 120 | -------------------------------------------------------------------------------- /igate/T3_V1.6.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f4goh/lora-aprs-esp32/95cf2282bb9f8d09c3f771adb8758d17ec1505a1/igate/T3_V1.6.pdf -------------------------------------------------------------------------------- /igate/cablage_igate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f4goh/lora-aprs-esp32/95cf2282bb9f8d09c3f771adb8758d17ec1505a1/igate/cablage_igate.png -------------------------------------------------------------------------------- /igate/configAPRSdroid/ip_address_port.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f4goh/lora-aprs-esp32/95cf2282bb9f8d09c3f771adb8758d17ec1505a1/igate/configAPRSdroid/ip_address_port.jpg -------------------------------------------------------------------------------- /igate/configAPRSdroid/main_tcp-ip.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f4goh/lora-aprs-esp32/95cf2282bb9f8d09c3f771adb8758d17ec1505a1/igate/configAPRSdroid/main_tcp-ip.jpg -------------------------------------------------------------------------------- /igate/display_oled/oled.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f4goh/lora-aprs-esp32/95cf2282bb9f8d09c3f771adb8758d17ec1505a1/igate/display_oled/oled.jpg -------------------------------------------------------------------------------- /igate/igateV4/.gitignore: -------------------------------------------------------------------------------- 1 | .pio 2 | -------------------------------------------------------------------------------- /igate/igateV4/include/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for project header files. 3 | 4 | A header file is a file containing C declarations and macro definitions 5 | to be shared between several project source files. You request the use of a 6 | header file in your project source file (C, C++, etc) located in `src` folder 7 | by including it, with the C preprocessing directive `#include'. 8 | 9 | ```src/main.c 10 | 11 | #include "header.h" 12 | 13 | int main (void) 14 | { 15 | ... 16 | } 17 | ``` 18 | 19 | Including a header file produces the same results as copying the header file 20 | into each source file that needs it. Such copying would be time-consuming 21 | and error-prone. With a header file, the related declarations appear 22 | in only one place. If they need to be changed, they can be changed in one 23 | place, and programs that include the header file will automatically use the 24 | new version when next recompiled. The header file eliminates the labor of 25 | finding and changing all the copies as well as the risk that a failure to 26 | find one copy will result in inconsistencies within a program. 27 | 28 | In C, the usual convention is to give header files names that end with `.h'. 29 | It is most portable to use only letters, digits, dashes, and underscores in 30 | header file names, and at most one dot. 31 | 32 | Read more about using header files in official GCC documentation: 33 | 34 | * Include Syntax 35 | * Include Operation 36 | * Once-Only Headers 37 | * Computed Includes 38 | 39 | https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html 40 | -------------------------------------------------------------------------------- /igate/igateV4/lib/Afficheur/Afficheur.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File: Afficheur.h 3 | * From Author: philippe SIMIER Lycée Touchard Washington 4 | * Modified by Anthony Le Cren 5 | * Created on 11 février 2022, 11:15 6 | * Classe Afficheur pour le TTGO 7 | * spécialisation de SSD1306Wire 8 | * https://github.com/ThingPulse/esp8266-oled-ssd1306/blob/master/README.md 9 | * https://www.online-utility.org/image/convert/to/XBM 10 | */ 11 | 12 | #ifndef AFFICHEUR_H 13 | #define AFFICHEUR_H 14 | 15 | #include 16 | #include 17 | #include "OLEDDisplayUi.h" 18 | #include "images.h" 19 | 20 | #define CALLSIGN "F4KMN" 21 | 22 | typedef enum{ 23 | POSITION, 24 | WEATHER, 25 | MESSAGE 26 | } TYPE_APRS; 27 | 28 | 29 | #define CALL_LEN 10 30 | #define TIMESTAMP_LEN 6 31 | #define LATITUDE_LEN 8 32 | #define LONGITUDE_LEN 9 33 | #define ALTITUDE_LEN 6 34 | #define COURSE_LEN 3 35 | #define SPEED_LEN 3 36 | #define COMMENT_LEN 50 37 | 38 | 39 | typedef struct{ 40 | TYPE_APRS ta; 41 | char callSign[CALL_LEN+1]; 42 | char timeStamp[TIMESTAMP_LEN+1]; 43 | char longitude[LONGITUDE_LEN+1]; 44 | char latitude[LATITUDE_LEN+1]; 45 | char altitude[ALTITUDE_LEN+1]; 46 | int altitudeMeters; 47 | char course[COURSE_LEN+1]; 48 | char speed[SPEED_LEN+1]; 49 | char comment[COMMENT_LEN]; 50 | char symTableId; 51 | char symCode; 52 | bool compressed; 53 | bool withTimeStamp; 54 | bool withAltitude; 55 | bool withCourseSpeed; 56 | }aprs; 57 | 58 | 59 | class Afficheur { 60 | public: 61 | 62 | Afficheur(); 63 | virtual ~Afficheur(); 64 | 65 | void setCnxState(bool _wifiCnx,bool _aprsIsCnx); 66 | void setRssi(int _rssi); 67 | void displayRssi(bool _disRssi); 68 | void setErrorCnx(bool _cnxError); 69 | void refresh(aprs report); 70 | 71 | 72 | private: 73 | 74 | static void marshall(void * parametres); 75 | 76 | void scrollingAuto(); 77 | 78 | static void drawFrame1(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y); 79 | static void drawFrame2(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y); 80 | static void drawFrame3(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y); 81 | static void msOverlay(OLEDDisplay *display, OLEDDisplayUiState* state); 82 | 83 | 84 | int frameCount; // Nombre de pages à afficher 85 | int overlaysCount; 86 | SSD1306Wire display; 87 | OLEDDisplayUi ui; 88 | FrameCallback frames[3]; 89 | OverlayCallback overlays[1]; //affichage commun par dessus toutes les pages 90 | int rssi; 91 | uint8_t compteurTrame; 92 | bool wifiCnx; 93 | bool aprsIsCnx; 94 | bool disRssi; 95 | bool cnxError; 96 | 97 | static Afficheur* anchor; 98 | 99 | TaskHandle_t TaskHandle_Aff; 100 | 101 | bool disAlti; 102 | aprs report; 103 | 104 | }; 105 | 106 | #endif /* AFFICHEUR_H */ 107 | -------------------------------------------------------------------------------- /igate/igateV4/lib/Afficheur/images.h: -------------------------------------------------------------------------------- 1 | #define TW_width 30 2 | #define TW_height 37 3 | const uint8_t TW_Logo_bits[] PROGMEM = { 4 | 0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0x3F, 5 | 0xFF, 0xFF, 0xFF, 0x3F, 0x0F, 0xE0, 0x01, 0x3C, 0x0F, 0xE0, 0x01, 0x3C, 6 | 0x0F, 0xE0, 0x01, 0x3C, 0x80, 0xE7, 0x79, 0x00, 0x80, 0xE7, 0x79, 0x00, 7 | 0x80, 0xE7, 0x79, 0x00, 0x8F, 0xE7, 0x79, 0x3C, 0x8F, 0xE7, 0x79, 0x3C, 8 | 0x8F, 0xE7, 0x79, 0x3C, 0x8F, 0xE7, 0x79, 0x3C, 0x8F, 0xE7, 0x79, 0x3C, 9 | 0x8F, 0xE7, 0x79, 0x3C, 0x8F, 0xE7, 0x79, 0x3C, 0x8F, 0xE7, 0x79, 0x3C, 10 | 0x8F, 0xE7, 0x79, 0x3C, 0x8F, 0xE7, 0x79, 0x3C, 0x8F, 0xE7, 0x79, 0x3C, 11 | 0x8F, 0xE7, 0x79, 0x3C, 0x8F, 0xE7, 0x79, 0x3C, 0x0E, 0xFF, 0x3F, 0x1C, 12 | 0x1E, 0xFF, 0x3F, 0x1E, 0x1C, 0xFE, 0x1F, 0x0E, 0x3C, 0x3C, 0x0F, 0x0F, 13 | 0x38, 0x18, 0x06, 0x07, 0x78, 0x00, 0x80, 0x07, 0xF0, 0x00, 0x80, 0x03, 14 | 0xF0, 0xC1, 0xC0, 0x03, 0xE0, 0xE3, 0xF1, 0x01, 0xC0, 0xF7, 0xFB, 0x00, 15 | 0x80, 0xFF, 0x7F, 0x00, 0x00, 0xFF, 0x3F, 0x00, 0x00, 0xFC, 0x0F, 0x00, 16 | 0x00, 0xE0, 0x01, 0x00}; 17 | 18 | 19 | const uint8_t activeSymbol[] PROGMEM = { 20 | B00000000, 21 | B00000000, 22 | B00011000, 23 | B00100100, 24 | B01000010, 25 | B01000010, 26 | B00100100, 27 | B00011000 28 | }; 29 | 30 | const uint8_t inactiveSymbol[] PROGMEM = { 31 | B00000000, 32 | B00000000, 33 | B00000000, 34 | B00000000, 35 | B00011000, 36 | B00011000, 37 | B00000000, 38 | B00000000 39 | }; 40 | -------------------------------------------------------------------------------- /igate/igateV4/lib/AprsDroidTcp/AprsDroidTcp.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | 7 | /* 8 | * File: AprsDroidTcp.cpp 9 | * Author: ale 10 | * 11 | * Created on 11 avril 2022, 11:28 12 | */ 13 | 14 | #include "AprsDroidTcp.h" 15 | 16 | AprsDroidTcp::AprsDroidTcp() { 17 | anchor = this; 18 | } 19 | 20 | AprsDroidTcp::AprsDroidTcp(const AprsDroidTcp& orig) { 21 | } 22 | 23 | AprsDroidTcp::~AprsDroidTcp() { 24 | } 25 | 26 | bool AprsDroidTcp::setup() { 27 | server.begin(); 28 | BaseType_t ret = xTaskCreatePinnedToCore(AprsDroidTcp::marshall, "aprsdroid", 10000, NULL, 3, &TaskHandle_Rxbt, 0); 29 | return (ret == pdPASS) ? true : false; 30 | } 31 | 32 | void AprsDroidTcp::CheckForConnections() 33 | { 34 | if (server.hasClient()) 35 | { 36 | // If we are already connected to another computer, 37 | // then reject the new connection. Otherwise accept 38 | // the connection. 39 | if (remoteClient.connected()) 40 | { 41 | Serial.println("Connection rejected"); 42 | server.available().stop(); 43 | } 44 | else 45 | { 46 | Serial.println("Connection accepted"); 47 | remoteClient = server.available(); 48 | } 49 | } 50 | } 51 | 52 | bool AprsDroidTcp::getCnxState(){ 53 | bool ret=false; 54 | if (remoteClient.connected()){ 55 | ret=true; 56 | } 57 | return ret; 58 | } 59 | 60 | void AprsDroidTcp::send(char* msg) { 61 | if (remoteClient.connected()) { 62 | remoteClient.println(msg); 63 | } 64 | } 65 | 66 | int AprsDroidTcp::getPduLength(){ 67 | return pduLength; 68 | } 69 | 70 | 71 | void AprsDroidTcp::marshall(void * parametres) { 72 | anchor->receive(); 73 | } 74 | 75 | 76 | void AprsDroidTcp::receive() { 77 | 78 | Serial.println("Tache Wifi Droid en fonctionnement"); 79 | int ptr = 0; 80 | char car; 81 | while (1) { 82 | vTaskDelay(1); //indispensable car sinon guru ?! 83 | CheckForConnections(); 84 | while (remoteClient.connected() && remoteClient.available()) { 85 | if (ptr < MSG_MAX_LENGTH - 1) { 86 | car = (char) remoteClient.read(); 87 | //Serial.print(car); 88 | if (car != '\n') { 89 | msg[ptr++] = car; 90 | } else { 91 | msg[ptr] = '\0'; 92 | pduLength=ptr; 93 | ptr = 0; 94 | Serial.println("AprsDroidTcp incomming"); 95 | Serial.println(msg); 96 | xQueueSend(queueRx, msg, 0); 97 | } 98 | } else { 99 | msg[ptr] = '\0'; 100 | ptr = 0; 101 | } 102 | } 103 | } 104 | } 105 | 106 | 107 | QueueHandle_t AprsDroidTcp::queueRx = xQueueCreate(3, sizeof (msg)); 108 | AprsDroidTcp* AprsDroidTcp::anchor = NULL; 109 | -------------------------------------------------------------------------------- /igate/igateV4/lib/AprsDroidTcp/AprsDroidTcp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | 7 | /* 8 | * File: AprsDroidTcp.h 9 | * Author: ale 10 | * 11 | * Created on 11 avril 2022, 11:28 12 | */ 13 | 14 | 15 | 16 | 17 | #ifndef APRSDROIDTCP_H 18 | #define APRSDROIDTCP_H 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | 25 | #define MSG_MAX_LENGTH 100 26 | #define SERVER_PORT 14580 27 | 28 | 29 | class AprsDroidTcp { 30 | public: 31 | AprsDroidTcp(); 32 | AprsDroidTcp(const AprsDroidTcp& orig); 33 | virtual ~AprsDroidTcp(); 34 | bool setup(); 35 | void send(char* msg); 36 | int getPduLength(); 37 | bool getCnxState(); 38 | 39 | static QueueHandle_t queueRx; 40 | 41 | private: 42 | TaskHandle_t TaskHandle_Rxbt; 43 | void CheckForConnections(); 44 | void receive(); 45 | static AprsDroidTcp* anchor; 46 | static void marshall(void *); 47 | 48 | WiFiServer server= WiFiServer(SERVER_PORT); 49 | WiFiClient remoteClient; 50 | 51 | 52 | char msg[MSG_MAX_LENGTH]; 53 | int pduLength; 54 | 55 | }; 56 | 57 | #endif /* APRSDROIDTCP_H */ 58 | 59 | 60 | -------------------------------------------------------------------------------- /igate/igateV4/lib/Aprsis/Aprsis.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | 7 | /* 8 | * File: Aprsis.cpp 9 | * Author: ale 10 | * 11 | * Created on 8 avril 2022, 19:04 12 | * todo: 13 | * check server alive every 20 seconds 14 | */ 15 | 16 | #include "Aprsis.h" 17 | 18 | Aprsis::Aprsis() 19 | { 20 | tool_name=TOOL_NAME; 21 | version=VERSION; 22 | anchor = this; 23 | timeNow = 0; 24 | } 25 | 26 | Aprsis::Aprsis(const Aprsis& orig) { 27 | } 28 | 29 | Aprsis::~Aprsis() { 30 | } 31 | 32 | 33 | bool Aprsis::setup(const String _user, const String _latitude,const String _longitude,const String _message,const String _server,const int _port) { 34 | user=_user; 35 | passcode=passCode(user); 36 | longitude =_longitude; 37 | latitude=_latitude; 38 | message=_message; 39 | serverAprs=_server; 40 | portAprs=_port; 41 | BaseType_t ret=xTaskCreatePinnedToCore(Aprsis::marshall, "gestion_aprsis", 10000, NULL, 2, &TaskHandle_Ait, 1); 42 | return (ret==pdPASS) ? true : false; 43 | } 44 | 45 | 46 | 47 | bool Aprsis::isConnected() { 48 | return cnxState; 49 | } 50 | 51 | void Aprsis::setRssi(int _rssi){ 52 | rssi=_rssi; 53 | } 54 | 55 | 56 | void Aprsis::marshall(void * parametres) { 57 | anchor->aprsIsTask(); 58 | } 59 | 60 | 61 | 62 | String Aprsis::passCode(String call){ 63 | call.toUpperCase(); 64 | int id=call.indexOf('-'); 65 | if (id!=-1){ 66 | call=call.substring(0,id); 67 | } 68 | int hash=0x73e2; 69 | int i=0; 70 | int len=call.length(); 71 | while (iuser + ">APLG01:=" + anchor->latitude + "L" + anchor->longitude + "&" + anchor->message + "\n\r"; 91 | /* 92 | A Quoi ça sert ? 93 | client.onPoll([](void* arg, AsyncClient * c) { 94 | Serial.printf("p:%lu\n\r", millis()); 95 | }); 96 | */ 97 | 98 | client.onAck([](void* arg, AsyncClient * c, size_t len, uint32_t time) { 99 | Serial.printf("a:%u:%u\n\r", len, time); 100 | 101 | }); 102 | 103 | client.onDisconnect([](void* arg, AsyncClient * c) { 104 | Serial.printf("Disconnect tcp \n\r"); 105 | c->close(); 106 | anchor->cnxState = false; 107 | }); 108 | 109 | client.onError([](void* arg, AsyncClient * c, int8_t error) { 110 | Serial.printf("Error: %s\n\r", c->errorToString(error)); 111 | //digitalWrite(led4, HIGH); 112 | c->close(); 113 | }); 114 | client.onTimeout([](void* arg, AsyncClient * c, uint32_t time) { 115 | Serial.printf("Timeout\n\r"); 116 | Serial.println(time); 117 | }); 118 | 119 | client.onConnect([](void* arg, AsyncClient * c) { 120 | anchor->cnxState = true; 121 | Serial.println("tcp APRS Server Connected"); 122 | //digitalWrite(led4, LOW); 123 | String login = "user " + anchor->user + " pass " + anchor->passcode + " vers " + anchor->tool_name + " " + anchor->version + "\n\r"; 124 | c->write(login.c_str()); 125 | 126 | }); 127 | client.onData([](void* arg, AsyncClient * c, void* data, size_t len) { 128 | anchor->timeNow=millis(); 129 | Serial.printf("Data received with length: %d\n\r", len); 130 | String line((char*) data); 131 | if (line.startsWith("#")) { 132 | line = line.substring(0, line.indexOf('\n')); 133 | Serial.println(line); 134 | if (line.indexOf("logresp") != -1) { 135 | if (line.indexOf("unverified") == -1) { 136 | Serial.println("User verified with passcode!"); 137 | } 138 | } 139 | } 140 | }); 141 | 142 | int cpt = BEACON_DELAY; 143 | String strMsg; 144 | 145 | Serial.print("APRS IS Task running core : "); 146 | Serial.println(xPortGetCoreID()); 147 | 148 | 149 | while (true) { 150 | //char missatge[100]; 151 | vTaskDelay(1); 152 | if (millis() - anchor->timeNow > RECONNECT_SERVER_DELAY) { 153 | client.close(); //pb de connection Ethernet sur point d'accès WiFi, il faut se reconnecter 154 | anchor->timeNow=millis(); 155 | } 156 | if (!client.connected()) { 157 | Serial.println("Try to connect"); 158 | if (!client.connect(anchor->serverAprs.c_str(), anchor->portAprs)) { 159 | Serial.println("Something went wrong on connecting! Is the server reachable?"); 160 | vTaskDelay(RECONNECT_DELAY); 161 | } 162 | vTaskDelay(CONNECT_DELAY); 163 | } 164 | if (client.connected()) { 165 | if (cpt == BEACON_DELAY) { //envoie la position balise périodiquement 166 | client.write(msgBeacon.c_str()); 167 | Serial.println(msgBeacon); 168 | cpt = 0; 169 | } 170 | cpt++; 171 | if (xQueueReceive(queueMsg, msg, 0) == pdPASS) { //0 au lieu de portMAX_DELAY = non bloquant 172 | Serial.println("msg aprsis queue"); 173 | Serial.println(msg); 174 | strMsg = String(msg) + " RSSI:" + String(rssi) + " dBm\n\r"; 175 | client.write(strMsg.c_str()); //non testé 176 | //client.add(missatge,sizeof(missatge)); //autre version non testé 177 | //client.send(); 178 | 179 | } 180 | } 181 | } 182 | } 183 | 184 | 185 | 186 | 187 | QueueHandle_t Aprsis::queueMsg = xQueueCreate(3, sizeof (msg)); 188 | Aprsis* Aprsis::anchor = NULL; 189 | 190 | /* 191 | * pour plus tard peut être... 192 | vTaskSuspend( xHandle ); 193 | vTaskResume( xHandle ); 194 | */ 195 | -------------------------------------------------------------------------------- /igate/igateV4/lib/Aprsis/Aprsis.h: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | 7 | /* 8 | * File: Aprsis.h 9 | * Author: ale 10 | * 11 | * Created on 8 avril 2022, 19:04 12 | */ 13 | 14 | #ifndef APRSIS_H 15 | #define APRSIS_H 16 | 17 | #include 18 | #include 19 | #define TOOL_NAME "ESP32-APRS-IS" 20 | #define VERSION "1.1" 21 | #define MSG_MAX_LENGTH 100 22 | //#define APRS_SERVER "euro.aprs2.net" 23 | //#define APRS_PORT 14580 24 | #define BEACON_DELAY 15*60*1000 //15 minutes 25 | #define RECONNECT_DELAY 5*1000 //5 secondes 26 | #define CONNECT_DELAY 2*1000 //2 secondes 27 | #define RECONNECT_SERVER_DELAY 30*1000 //30 secondes is pas de données entrantes # aprsc 2.1.11-g80df3b4 7 Aug 2022 16:57:48 GMT T2SWEDEN 95.216.197.75:14580 28 | 29 | 30 | 31 | class Aprsis { 32 | public: 33 | Aprsis(); 34 | Aprsis(const Aprsis& orig); 35 | virtual ~Aprsis(); 36 | bool setup(const String _user,const String _latitude,const String _longitude,const String _message,const String _server,const int _port); 37 | 38 | 39 | bool isConnected(); 40 | 41 | void setRssi(int _rssi); 42 | static QueueHandle_t queueMsg; 43 | 44 | private: 45 | TaskHandle_t TaskHandle_Ait; 46 | static Aprsis* anchor; 47 | static void marshall(void *); 48 | void aprsIsTask(); 49 | String passCode(String call); 50 | 51 | 52 | String user; 53 | String passcode; 54 | String tool_name; 55 | String version; 56 | String longitude; 57 | String latitude; 58 | String message; 59 | String serverAprs; 60 | int portAprs; 61 | int rssi; 62 | bool cnxState; 63 | char msg[MSG_MAX_LENGTH]; 64 | uint32_t timeNow; 65 | 66 | }; 67 | 68 | #endif /* APRSIS_H */ 69 | -------------------------------------------------------------------------------- /igate/igateV4/lib/DecodeAprs/DecodeAprs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | 7 | /* 8 | * File: DecodeAprs.h 9 | * Author: ale 10 | * 11 | * Created on 10 mai 2022, 15:31 12 | */ 13 | 14 | #ifndef DECODEAPRS_H 15 | #define DECODEAPRS_H 16 | 17 | //#include 18 | #include 19 | #include 20 | #include 21 | 22 | #define BODY_LEN 100 23 | 24 | class DecodeAprs : public Afficheur 25 | { 26 | public: 27 | DecodeAprs(); 28 | DecodeAprs(const DecodeAprs& orig); 29 | virtual ~DecodeAprs(); 30 | bool parse(char* msg); 31 | 32 | private: 33 | bool split(char *str, char car); 34 | bool extractCall(char *msg); 35 | int countChar(char *msg, char car); 36 | void clearMem(); 37 | bool checkAprsAndTimeStamp(); 38 | bool parsePositionId(); 39 | bool checkAltitude(); 40 | bool checkCourseSpeed(); 41 | bool parseComment(); 42 | char body[BODY_LEN]; 43 | aprs report; 44 | 45 | 46 | }; 47 | 48 | #endif /* DECODEAPRS_H */ 49 | 50 | -------------------------------------------------------------------------------- /igate/igateV4/lib/Digipeater/Digipeater.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | 7 | /* 8 | * File: Digipeater.cpp 9 | * Author: ale 10 | * 11 | * Created on 11 mai 2022, 12:43 12 | */ 13 | 14 | #include "Digipeater.h" 15 | 16 | Digipeater::Digipeater(String _call,String _latitude,String _longitude, String _comment) { 17 | beaconMsg=_call+">APDR16:!"+_latitude+"I"+_longitude+"#"+_comment; 18 | memset(callDigi, '\0', CALL_LEN); 19 | nbPaths=0; 20 | _call.toCharArray(callDigi,CALL_LEN); 21 | clearMem(); 22 | } 23 | 24 | Digipeater::Digipeater(const Digipeater& orig) { 25 | } 26 | 27 | Digipeater::~Digipeater() { 28 | } 29 | 30 | void Digipeater::clearMem() { 31 | memset(head, '\0', HEAD_LEN); 32 | memset(body, '\0', BODY_LEN); 33 | memset(fromCall, '\0', CALL_LEN); 34 | memset(path, '\0', PATH_LEN); 35 | memset(pdu, '\0', PDU_LEN); 36 | for (int n = 0; n < MAX_PATHS; n++) { 37 | memset(pathTab[n], '\0', CALL_LEN); 38 | } 39 | } 40 | 41 | bool Digipeater::split(char *msg, char *partA, char *partB,char car) { 42 | char *pch; 43 | int tailleA,tailleB; 44 | bool ret=false; 45 | pch = strchr(msg, car); 46 | if (pch != NULL) { 47 | tailleA=pch-msg; 48 | tailleB=strlen(msg)-(pch-msg)-1; 49 | strncpy(partA,msg,tailleA); 50 | strncpy(partB,pch+1,tailleB); 51 | ret=true; 52 | } 53 | return ret; 54 | } 55 | 56 | int Digipeater::countChar(char *msg, char car) { 57 | int n; 58 | int cpt = 0; 59 | for (n = 0; n < strlen(msg); n++) { 60 | if (msg[n] == car) { 61 | cpt++; 62 | } 63 | } 64 | return cpt; 65 | } 66 | 67 | bool Digipeater::splitPath(){ 68 | int n; 69 | int cpt = 0; 70 | char temp[CALL_LEN] = {0}; 71 | int m = 0; 72 | if (countChar(path, ',') >= MAX_PATHS - 1) { 73 | Serial.print("Full : "); 74 | Serial.println(cpt); 75 | return false; 76 | } 77 | for (n = 0; n < strlen(path) + 1; n++) { 78 | if ((path[n] != ',') && (path[n] != '\0')) { 79 | temp[m] = path[n]; 80 | m++; 81 | } else { 82 | strncpy(pathTab[cpt], temp, CALL_LEN); 83 | memset(temp, '\0', CALL_LEN); 84 | m = 0; 85 | cpt++; 86 | } 87 | } 88 | nbPaths = cpt; 89 | Serial.println(cpt); 90 | for (n = 0; n < cpt; n++) { 91 | Serial.println(pathTab[n]); 92 | } 93 | return true; 94 | } 95 | 96 | bool Digipeater::routing(char* msg) { 97 | clearMem(); 98 | Serial.println(strlen(msg)); 99 | if (strlen(msg) == 0) { 100 | return false; 101 | } 102 | if (split(msg, head, body, ':') == false) { 103 | return false; 104 | } 105 | Serial.println(head); 106 | Serial.println(body); 107 | if (strlen(head) == 0) { 108 | return false; 109 | } 110 | if (split(head, fromCall, path, '>') == false) { 111 | return false; 112 | } 113 | Serial.println(fromCall); 114 | Serial.println(path); 115 | if (splitPath() == false) { 116 | return false; 117 | } 118 | if (addPath()==false){ 119 | Serial.println("Bad Path"); 120 | } 121 | return true; 122 | } 123 | 124 | bool Digipeater::addPath() { 125 | int n; 126 | if (strcmp(fromCall, callDigi) == 0) { 127 | Serial.println("Own call"); 128 | return false; 129 | } 130 | for (n = 0; n < nbPaths; n++) { 131 | if (strcmp(pathTab[n], callDigi) == 0) { 132 | Serial.println("Call inside PATH"); 133 | return false; 134 | 135 | } 136 | } 137 | if (strncmp(pathTab[nbPaths - 1], "WIDE", 4) != 0) { 138 | Serial.println("No WIDE"); 139 | return false; 140 | } 141 | if (pathTab[nbPaths - 1][5] == '*') { 142 | Serial.println("End PATH"); 143 | return false; 144 | } 145 | strcpy(pathTab[nbPaths], pathTab[nbPaths - 1]); 146 | memset(pathTab[nbPaths - 1], '\0', CALL_LEN); 147 | strcpy(pathTab[nbPaths - 1], callDigi); 148 | nbPaths++; 149 | pathTab[nbPaths - 1][6]--; 150 | if (pathTab[nbPaths - 1][6] == '0') { 151 | pathTab[nbPaths - 1][5] = '*'; 152 | pathTab[nbPaths - 1][6] = '\0'; 153 | } 154 | Serial.println(nbPaths); 155 | for (n = 0; n < nbPaths; n++) { 156 | Serial.println(pathTab[n]); 157 | } 158 | return true; 159 | } 160 | 161 | 162 | char * Digipeater::getMsg(){ 163 | int n; 164 | memset(pdu, '\0', PDU_LEN); 165 | snprintf(pdu, PDU_LEN, "%s>", fromCall); 166 | for (n = 0; n < nbPaths-1; n++) { 167 | strcat(pdu, pathTab[n]); 168 | strcat(pdu, ","); 169 | } 170 | strcat(pdu, pathTab[nbPaths-1]); 171 | strcat(pdu, ":"); 172 | strcat(pdu, body); 173 | Serial.println(pdu); 174 | return pdu; 175 | } 176 | 177 | char * Digipeater::getBeacon(){ 178 | memset(pdu, '\0', PDU_LEN); 179 | beaconMsg.toCharArray(pdu,PDU_LEN); 180 | return pdu; 181 | } 182 | 183 | 184 | void Digipeater::check(char *msg){ 185 | char *nr; 186 | if (routing(msg)){ 187 | nr=getMsg(); 188 | Serial.println(msg); 189 | Serial.println(nr); 190 | }; 191 | } 192 | 193 | void Digipeater::test(){ 194 | 195 | char msg1[]="F4GOH-9>APDR16,F4GOH-2,WIDE1-1:=4753.42N/00016.61Eb/A=000399 lora aprs"; 196 | check(msg1); 197 | char msg2[]="F4GOH-9>APDR16,WIDE2-2:=4753.42N/00016.61Eb/A=000399 lora aprs"; 198 | check(msg2); 199 | //char msg3[]="F4GOH-9>APDR16,F4GOH-2,F4GOH-3,F4GOH-4,WIDE2*:=4753.42N/00016.61Eb/A=000399 lora aprs"; 200 | //check(msg3); 201 | } 202 | -------------------------------------------------------------------------------- /igate/igateV4/lib/Digipeater/Digipeater.h: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | 7 | /* 8 | * File: Digipeater.h 9 | * Author: ale 10 | * 11 | * Created on 11 mai 2022, 12:43 12 | */ 13 | 14 | #ifndef DIGIPEATER_H 15 | #define DIGIPEATER_H 16 | 17 | #include 18 | #include 19 | 20 | 21 | #define MAX_PATHS 5 22 | #define HEAD_LEN 80 23 | #define PATH_LEN 70 24 | #define BODY_LEN 100 25 | #define CALL_LEN 10 26 | #define PDU_LEN 150 27 | 28 | 29 | class Digipeater { 30 | public: 31 | Digipeater(String _call,String _latitude,String _longitude, String _comment); 32 | Digipeater(const Digipeater& orig); 33 | virtual ~Digipeater(); 34 | bool routing(char* msg); 35 | char * getMsg(); 36 | void test(); 37 | char * getBeacon(); 38 | 39 | 40 | private: 41 | bool split(char *str, char *partA, char *partB,char car); 42 | bool splitPath(); 43 | bool addPath(); 44 | int countChar(char *msg, char car); 45 | void check(char *msg); 46 | void clearMem(); 47 | 48 | 49 | String beaconMsg; 50 | char callDigi[CALL_LEN]; 51 | char head[HEAD_LEN]; 52 | char body[BODY_LEN]; 53 | char fromCall[CALL_LEN]; 54 | char path[PATH_LEN]; 55 | char pathTab[MAX_PATHS][CALL_LEN]; 56 | char pdu[PDU_LEN]; 57 | int nbPaths; 58 | 59 | }; 60 | 61 | #endif /* DIGIPEATER_H */ 62 | 63 | //F4GOH-9>APDR16,F4GOH-2,F4GOH-3,F4GOH-4*:=4753.00N/00016.72Eb/A=000399 lora aprs"+ "\n" -------------------------------------------------------------------------------- /igate/igateV4/lib/GestionWifi/GestionWifi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File: GestionWifi.h 3 | * Author: ale 4 | * 5 | * Created on 9 avril 2022, 09:04 6 | * https://randomnerdtutorials.com/esp32-useful-wi-fi-functions-arduino/#10 7 | * https://randomnerdtutorials.com/esp32-wifimulti/ 8 | */ 9 | 10 | #ifndef GESTIONWIFI_H 11 | #define GESTIONWIFI_H 12 | 13 | #include 14 | #include 15 | #define TIMEOUT 10*1000 16 | //#define TIME_RECONNECT 10*1000 17 | 18 | enum wifiMode{ 19 | ACCES_POINT, 20 | CLIENT 21 | }; 22 | 23 | class GestionWifi { 24 | public: 25 | GestionWifi(); 26 | GestionWifi(const GestionWifi& orig); 27 | virtual ~GestionWifi(); 28 | 29 | bool setup(const char* _ssid,const char* _password, wifiMode _wMode); 30 | bool connexion(); 31 | 32 | bool connected(); 33 | String getIP(); 34 | 35 | private: 36 | static void WiFiEvent(WiFiEvent_t event,WiFiEventInfo_t info); 37 | 38 | TaskHandle_t TaskHandle_Gwt; 39 | static GestionWifi* anchor; 40 | //static void marshall(void *); 41 | //void checkWifiTask(); 42 | char *ssid; 43 | char *password; 44 | IPAddress ip; 45 | IPAddress subnet; 46 | IPAddress gateway; 47 | wifiMode wMode; 48 | bool wifi_connected; 49 | 50 | 51 | }; 52 | 53 | #endif /* GESTIONWIFI_H */ 54 | 55 | -------------------------------------------------------------------------------- /igate/igateV4/lib/LoraAprs/LoraAprs.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | 7 | /* 8 | * File: LoraAprs.cpp 9 | * Author: ale 10 | * 11 | * Created on 19 mars 2022, 18:04 12 | */ 13 | 14 | #include "LoraAprs.h" 15 | 16 | LoraAprs::LoraAprs(long _frequency,int _spreadingFactor,long _signalBandwith, int _codingRate,int _txPower): 17 | frequency(_frequency), 18 | spreadingFactor(_spreadingFactor), 19 | signalBandwith(_signalBandwith), 20 | codingRate(_codingRate), 21 | txPower(_txPower) 22 | { 23 | anchor = this; 24 | txing=false; 25 | } 26 | 27 | LoraAprs::LoraAprs(const LoraAprs& orig) { 28 | } 29 | 30 | LoraAprs::~LoraAprs() { 31 | } 32 | 33 | void LoraAprs::setup(){ 34 | Serial.println("Set SPI pins!"); 35 | SPI.begin(LORA_SCK, LORA_MISO, LORA_MOSI, LORA_CS); 36 | 37 | Serial.println("Set LoRa pins!"); 38 | setPins(LORA_CS, LORA_RST, LORA_IRQ); 39 | 40 | 41 | Serial.println("frequency: "); 42 | Serial.println(String(frequency)); 43 | if (!begin(frequency)) { 44 | Serial.println("Starting LoRa failed!"); 45 | while (true) { 46 | } 47 | } 48 | setSpreadingFactor(spreadingFactor); 49 | setSignalBandwidth(signalBandwith); 50 | setCodingRate4(codingRate); 51 | enableCrc(); 52 | 53 | setTxPower(txPower);//Config.lora.power); 54 | Serial.println("LoRa init done!"); 55 | //msg.reserve(100); 56 | //Serial.println(msg.size())); 57 | xTaskCreatePinnedToCore(LoraAprs::marshall, "lora_rx", 10000, NULL, 3, &TaskHandle_Rx, 1); // creation de la tache 58 | } 59 | 60 | void LoraAprs::send(char* msg,int length){ 61 | txing=true; 62 | beginPacket(); 63 | // Header: 64 | write('<'); 65 | write(0xFF); 66 | write(0x01); 67 | // APRS Data: 68 | write((const uint8_t *) msg,length); 69 | endPacket(); 70 | txing=false; 71 | } 72 | 73 | void LoraAprs::marshall(void * parametres) { 74 | anchor->receive(); 75 | } 76 | 77 | bool LoraAprs::checkMessage() { 78 | 79 | if (!parsePacket()) { 80 | return false; 81 | } 82 | // read header: 83 | char dummy[4]; 84 | readBytes(dummy, 3); 85 | if (dummy[0] != '<') { 86 | // is no APRS message, ignore message 87 | while (available()) { 88 | read(); 89 | } 90 | return false; 91 | } 92 | // read APRS data: 93 | int n=0; 94 | while (available() && n wired on pcb AND connected to header pin LORA1 23 | * #define LORA_IO2 32 // GPIO32 - SX1276 IO2 -> wired on pcb AND connected to header pin LORA2 24 | */ 25 | 26 | #ifndef LORAAPRS_H 27 | #define LORAAPRS_H 28 | 29 | #include 30 | #include 31 | #include 32 | 33 | 34 | #define FREQUENCY 433775000 35 | #define SPREADING_FACTOR 12 36 | #define SIGNAL_BANDWIDTH 125000 37 | #define CODING_RATE_4 5 38 | #define TX_POWER 20 39 | #define MSG_MAX_LENGTH 100 40 | 41 | 42 | class LoraAprs : public LoRaClass { 43 | public: 44 | LoraAprs(long _frequency=FREQUENCY, 45 | int _spreadingFactor=SPREADING_FACTOR, 46 | long _signalBandwith=SIGNAL_BANDWIDTH, 47 | int _codingRate=CODING_RATE_4, 48 | int _txPower=TX_POWER); 49 | LoraAprs(const LoraAprs& orig); 50 | virtual ~LoraAprs(); 51 | 52 | 53 | void setup(); 54 | void send(char* msg,int length); 55 | 56 | static QueueHandle_t queueRx; 57 | 58 | private: 59 | TaskHandle_t TaskHandle_Rx; 60 | void receive(); 61 | static LoraAprs* anchor; 62 | static void marshall(void *); 63 | bool checkMessage(); 64 | char msg[MSG_MAX_LENGTH]; 65 | long frequency; 66 | int spreadingFactor; 67 | long signalBandwith; 68 | int codingRate; 69 | int txPower; 70 | bool txing; 71 | 72 | }; 73 | 74 | #endif /* LORAAPRS_H */ 75 | 76 | -------------------------------------------------------------------------------- /igate/igateV4/lib/Menu/Menu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File: Menu.h 3 | * Author: philippe SIMIER Touchard Washington Le Mans 4 | * 5 | * Created on 22 avril 2022, 17:11 6 | */ 7 | 8 | #ifndef MENU_H 9 | #define MENU_H 10 | #include 11 | #include 12 | #include // Classe pour écrire et lire la configuration 13 | 14 | #define FREQUENCY 433775000 15 | #define TIMEOUT_MENU 10 16 | 17 | 18 | class Menu { 19 | 20 | public: 21 | Menu(); 22 | Menu(const Menu& orig); 23 | virtual ~Menu(); 24 | 25 | void run(); 26 | void setup(); 27 | 28 | // Méthodes associées aux commandes 29 | static void _call_(ArgList& L, Stream& S); 30 | static void _ssid_(ArgList& L, Stream& S); 31 | static void _pass_(ArgList& L, Stream& S); 32 | static void _freq_(ArgList& L, Stream& S); 33 | static void _latitude_(ArgList& L, Stream& S); 34 | static void _longitude_(ArgList& L, Stream& S); 35 | static void _comment_(ArgList& L, Stream& S); 36 | static void _config_(ArgList& L, Stream& S); 37 | static void _raz_(ArgList& L, Stream& S); 38 | static void _internet_(ArgList& L, Stream& S); 39 | static void _server_(ArgList& L, Stream& S); 40 | static void _port_(ArgList& L, Stream& S); 41 | 42 | static void _exit_(ArgList& L, Stream& S); 43 | static void _help_(ArgList& L, Stream& S); 44 | static void _unknown(String& L, Stream& S); 45 | static void _digi_(ArgList& L, Stream& S); 46 | 47 | private: 48 | 49 | bool exitFlag; 50 | Console *con; 51 | Preferences *configuration; 52 | static Menu* anchor; 53 | bool acceptCmd(String cmd, int longMin, int longMax); 54 | 55 | }; 56 | 57 | #endif /* MENU_H */ 58 | -------------------------------------------------------------------------------- /igate/igateV4/lib/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for project specific (private) libraries. 3 | PlatformIO will compile them to static libraries and link into executable file. 4 | 5 | The source code of each library should be placed in a an own separate directory 6 | ("lib/your_library_name/[here are source files]"). 7 | 8 | For example, see a structure of the following two libraries `Foo` and `Bar`: 9 | 10 | |--lib 11 | | | 12 | | |--Bar 13 | | | |--docs 14 | | | |--examples 15 | | | |--src 16 | | | |- Bar.c 17 | | | |- Bar.h 18 | | | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html 19 | | | 20 | | |--Foo 21 | | | |- Foo.c 22 | | | |- Foo.h 23 | | | 24 | | |- README --> THIS FILE 25 | | 26 | |- platformio.ini 27 | |--src 28 | |- main.c 29 | 30 | and a contents of `src/main.c`: 31 | ``` 32 | #include 33 | #include 34 | 35 | int main (void) 36 | { 37 | ... 38 | } 39 | 40 | ``` 41 | 42 | PlatformIO Library Dependency Finder will find automatically dependent 43 | libraries scanning project source files. 44 | 45 | More information about PlatformIO Library Dependency Finder 46 | - https://docs.platformio.org/page/librarymanager/ldf.html 47 | -------------------------------------------------------------------------------- /igate/igateV4/nbproject/private/CodeAssistancePathMapper.properties: -------------------------------------------------------------------------------- 1 | # Automatic path mapper. CRC = 1 2 | -------------------------------------------------------------------------------- /igate/igateV4/nbproject/private/c_standard_headers_indexer.c: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * Oracle and Java are registered trademarks of Oracle and/or its affiliates. 7 | * Other names may be trademarks of their respective owners. 8 | * 9 | * The contents of this file are subject to the terms of either the GNU 10 | * General Public License Version 2 only ("GPL") or the Common 11 | * Development and Distribution License("CDDL") (collectively, the 12 | * "License"). You may not use this file except in compliance with the 13 | * License. You can obtain a copy of the License at 14 | * http://www.netbeans.org/cddl-gplv2.html 15 | * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the 16 | * specific language governing permissions and limitations under the 17 | * License. When distributing the software, include this License Header 18 | * Notice in each file and include the License file at 19 | * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this 20 | * particular file as subject to the "Classpath" exception as provided 21 | * by Oracle in the GPL Version 2 section of the License file that 22 | * accompanied this code. If applicable, add the following below the 23 | * License Header, with the fields enclosed by brackets [] replaced by 24 | * your own identifying information: 25 | * "Portions Copyrighted [year] [name of copyright owner]" 26 | * 27 | * If you wish your version of this file to be governed by only the CDDL 28 | * or only the GPL Version 2, indicate your decision by adding 29 | * "[Contributor] elects to include this software in this distribution 30 | * under the [CDDL or GPL Version 2] license." If you do not indicate a 31 | * single choice of license, a recipient has the option to distribute 32 | * your version of this file under either the CDDL, the GPL Version 2 or 33 | * to extend the choice of license to its licensees as provided above. 34 | * However, if you add GPL Version 2 code and therefore, elected the GPL 35 | * Version 2 license, then the option applies only if the new code is 36 | * made subject to such option by the copyright holder. 37 | * 38 | * Contributor(s): 39 | */ 40 | 41 | // List of standard headers was taken in http://en.cppreference.com/w/c/header 42 | 43 | #include // Conditionally compiled macro that compares its argument to zero 44 | #include // Functions to determine the type contained in character data 45 | #include // Macros reporting error conditions 46 | #include // Limits of float types 47 | #include // Sizes of basic types 48 | #include // Localization utilities 49 | #include // Common mathematics functions 50 | #include // Nonlocal jumps 51 | #include // Signal handling 52 | #include // Variable arguments 53 | #include // Common macro definitions 54 | #include // Input/output 55 | #include // String handling 56 | #include // General utilities: memory management, program utilities, string conversions, random numbers 57 | #include // Time/date utilities 58 | #include // (since C95) Alternative operator spellings 59 | #include // (since C95) Extended multibyte and wide character utilities 60 | #include // (since C95) Wide character classification and mapping utilities 61 | #ifdef _STDC_C99 62 | #include // (since C99) Complex number arithmetic 63 | #include // (since C99) Floating-point environment 64 | #include // (since C99) Format conversion of integer types 65 | #include // (since C99) Boolean type 66 | #include // (since C99) Fixed-width integer types 67 | #include // (since C99) Type-generic math (macros wrapping math.h and complex.h) 68 | #endif 69 | #ifdef _STDC_C11 70 | #include // (since C11) alignas and alignof convenience macros 71 | #include // (since C11) Atomic types 72 | #include // (since C11) noreturn convenience macros 73 | #include // (since C11) Thread library 74 | #include // (since C11) UTF-16 and UTF-32 character utilities 75 | #endif 76 | -------------------------------------------------------------------------------- /igate/igateV4/nbproject/private/configurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Afficheur.cpp 10 | Afficheur.h 11 | images.h 12 | 13 | 14 | AprsDroidTcp.cpp 15 | AprsDroidTcp.h 16 | 17 | 18 | Aprsis.cpp 19 | Aprsis.h 20 | 21 | 22 | AsyncTCP.cpp 23 | AsyncTCP.h 24 | 25 | 26 | DecodeAprs.cpp 27 | DecodeAprs.h 28 | 29 | 30 | Digipeater.cpp 31 | Digipeater.h 32 | 33 | 34 | GestionWifi.cpp 35 | GestionWifi.h 36 | 37 | 38 | LoraAprs.cpp 39 | LoraAprs.h 40 | 41 | 42 | Menu.cpp 43 | Menu.h 44 | 45 | 46 | 47 | main.cpp 48 | 49 | 50 | 51 | platformio.ini 52 | 53 | 54 | 55 | 56 | 57 | 58 | localhost 59 | 2 60 | 61 | 62 | 63 | . 64 | ${AUTO_FOLDER} 65 | 66 | ${AUTO_FOLDER} 67 | 68 | ${MAKE} ${ITEM_NAME}.o 69 | ${AUTO_COMPILE} 70 | 71 | ${AUTO_COMPILE} 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | gdb 87 | 88 | 89 | 90 | "${OUTPUT_PATH}" 91 | pio run --target upload 92 | 93 | pio run --target upload 94 | 95 | false 96 | 0 97 | 0 98 | 99 | 100 | 101 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /igate/igateV4/nbproject/private/launcher.properties: -------------------------------------------------------------------------------- 1 | # Launchers File syntax: 2 | # 3 | # [Must-have property line] 4 | # launcher1.runCommand= 5 | # [Optional extra properties] 6 | # launcher1.displayName= 7 | # launcher1.hide= 8 | # launcher1.buildCommand= 9 | # launcher1.runDir= 10 | # launcher1.runInOwnTab= 11 | # launcher1.symbolFiles= 12 | # launcher1.env.= 13 | # (If this value is quoted with ` it is handled as a native command which execution result will become the value) 14 | # [Common launcher properties] 15 | # common.runDir= 16 | # (This value is overwritten by a launcher specific runDir value if the latter exists) 17 | # common.env.= 18 | # (Environment variables from common launcher are merged with launcher specific variables) 19 | # common.symbolFiles= 20 | # (This value is overwritten by a launcher specific symbolFiles value if the latter exists) 21 | # 22 | # In runDir, symbolFiles and env fields you can use these macroses: 23 | # ${PROJECT_DIR} - project directory absolute path 24 | # ${OUTPUT_PATH} - linker output path (relative to project directory path) 25 | # ${OUTPUT_BASENAME}- linker output filename 26 | # ${TESTDIR} - test files directory (relative to project directory path) 27 | # ${OBJECTDIR} - object files directory (relative to project directory path) 28 | # ${CND_DISTDIR} - distribution directory (relative to project directory path) 29 | # ${CND_BUILDDIR} - build directory (relative to project directory path) 30 | # ${CND_PLATFORM} - platform name 31 | # ${CND_CONF} - configuration name 32 | # ${CND_DLIB_EXT} - dynamic library extension 33 | # 34 | # All the project launchers must be listed in the file! 35 | # 36 | # launcher1.runCommand=... 37 | # launcher2.runCommand=... 38 | # ... 39 | # common.runDir=... 40 | # common.env.KEY=VALUE 41 | 42 | # launcher1.runCommand= -------------------------------------------------------------------------------- /igate/igateV4/nbproject/private/private.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0 5 | 0 6 | 7 | 8 | 9 | 10 | file:/home/ale/NetBeansProjects/ttgo/igateV4/lib/AsyncTCP/AsyncTCP.cpp 11 | file:/home/ale/NetBeansProjects/ttgo/igateV4/lib/Aprsis/Aprsis.h 12 | file:/home/ale/NetBeansProjects/ttgo/igateV4/lib/AprsDroidTcp/AprsDroidTcp.cpp 13 | file:/home/ale/NetBeansProjects/ttgo/igateV4/lib/AsyncTCP/AsyncTCP.h 14 | file:/home/ale/NetBeansProjects/ttgo/igateV4/lib/GestionWifi/GestionWifi.h 15 | file:/home/ale/NetBeansProjects/ttgo/igateV4/lib/Aprsis/Aprsis.cpp 16 | file:/home/ale/NetBeansProjects/ttgo/igateV4/lib/GestionWifi/GestionWifi.cpp 17 | file:/home/ale/NetBeansProjects/ttgo/igateV4/src/main.cpp 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /igate/igateV4/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.cnd.makeproject 4 | 5 | 6 | igateV4 7 | 8 | cpp 9 | h 10 | UTF-8 11 | 12 | 13 | . 14 | 15 | 16 | 17 | Default 18 | 0 19 | 20 | 21 | 22 | false 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /igate/igateV4/platformio.ini: -------------------------------------------------------------------------------- 1 | ; PlatformIO Project Configuration File 2 | ; 3 | ; Build options: build flags, source filter 4 | ; Upload options: custom upload port, speed and extra flags 5 | ; Library options: dependencies, extra library storages 6 | ; Advanced options: extra scripting 7 | ; 8 | ; Please visit documentation for the other options and examples 9 | ; https://docs.platformio.org/page/projectconf.html 10 | 11 | [env:ttgo-lora32-v21] 12 | platform = espressif32 13 | board = ttgo-lora32-v21 14 | framework = arduino 15 | lib_deps = 16 | sandeepmistry/LoRa@^0.8.0 17 | akoro/Console@^1.2.1 18 | -------------------------------------------------------------------------------- /igate/igateV4/test/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for PlatformIO Unit Testing and project tests. 3 | 4 | Unit Testing is a software testing method by which individual units of 5 | source code, sets of one or more MCU program modules together with associated 6 | control data, usage procedures, and operating procedures, are tested to 7 | determine whether they are fit for use. Unit testing finds problems early 8 | in the development cycle. 9 | 10 | More information about PlatformIO Unit Testing: 11 | - https://docs.platformio.org/page/plus/unit-testing.html 12 | -------------------------------------------------------------------------------- /igate/igateV5/.gitignore: -------------------------------------------------------------------------------- 1 | .pio 2 | -------------------------------------------------------------------------------- /igate/igateV5/include/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for project header files. 3 | 4 | A header file is a file containing C declarations and macro definitions 5 | to be shared between several project source files. You request the use of a 6 | header file in your project source file (C, C++, etc) located in `src` folder 7 | by including it, with the C preprocessing directive `#include'. 8 | 9 | ```src/main.c 10 | 11 | #include "header.h" 12 | 13 | int main (void) 14 | { 15 | ... 16 | } 17 | ``` 18 | 19 | Including a header file produces the same results as copying the header file 20 | into each source file that needs it. Such copying would be time-consuming 21 | and error-prone. With a header file, the related declarations appear 22 | in only one place. If they need to be changed, they can be changed in one 23 | place, and programs that include the header file will automatically use the 24 | new version when next recompiled. The header file eliminates the labor of 25 | finding and changing all the copies as well as the risk that a failure to 26 | find one copy will result in inconsistencies within a program. 27 | 28 | In C, the usual convention is to give header files names that end with `.h'. 29 | It is most portable to use only letters, digits, dashes, and underscores in 30 | header file names, and at most one dot. 31 | 32 | Read more about using header files in official GCC documentation: 33 | 34 | * Include Syntax 35 | * Include Operation 36 | * Once-Only Headers 37 | * Computed Includes 38 | 39 | https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html 40 | -------------------------------------------------------------------------------- /igate/igateV5/lib/Afficheur/Afficheur.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File: Afficheur.h 3 | * From Author: philippe SIMIER Lycée Touchard Washington 4 | * Modified by Anthony Le Cren 5 | * Created on 11 février 2022, 11:15 6 | * Classe Afficheur pour le TTGO 7 | * spécialisation de SSD1306Wire 8 | * https://github.com/ThingPulse/esp8266-oled-ssd1306/blob/master/README.md 9 | * https://www.online-utility.org/image/convert/to/XBM 10 | */ 11 | 12 | #ifndef AFFICHEUR_H 13 | #define AFFICHEUR_H 14 | 15 | #include 16 | #include 17 | #include "OLEDDisplayUi.h" 18 | #include "images.h" 19 | 20 | #define CALLSIGN "F4KMN" 21 | #define VERSION "V5" 22 | 23 | typedef enum{ 24 | POSITION, 25 | WEATHER, 26 | MESSAGE 27 | } TYPE_APRS; 28 | 29 | 30 | #define CALL_LEN 10 31 | #define TIMESTAMP_LEN 6 32 | #define LATITUDE_LEN 8 33 | #define LONGITUDE_LEN 9 34 | #define ALTITUDE_LEN 6 35 | #define COURSE_LEN 3 36 | #define SPEED_LEN 3 37 | #define COMMENT_LEN 50 38 | 39 | 40 | typedef struct{ 41 | TYPE_APRS ta; 42 | char callSign[CALL_LEN+1]; 43 | char timeStamp[TIMESTAMP_LEN+1]; 44 | char longitude[LONGITUDE_LEN+1]; 45 | char latitude[LATITUDE_LEN+1]; 46 | char altitude[ALTITUDE_LEN+1]; 47 | int altitudeMeters; 48 | char course[COURSE_LEN+1]; 49 | char speed[SPEED_LEN+1]; 50 | char comment[COMMENT_LEN]; 51 | char symTableId; 52 | char symCode; 53 | bool compressed; 54 | bool withTimeStamp; 55 | bool withAltitude; 56 | bool withCourseSpeed; 57 | }aprs; 58 | 59 | 60 | class Afficheur { 61 | public: 62 | 63 | Afficheur(); 64 | virtual ~Afficheur(); 65 | 66 | void setCnxState(bool _wifiCnx,bool _aprsIsCnx); 67 | void setRssi(int _rssi); 68 | void displayRssi(bool _disRssi); 69 | void setErrorCnx(bool _cnxError); 70 | void refresh(aprs report); 71 | 72 | 73 | private: 74 | 75 | static void marshall(void * parametres); 76 | 77 | void scrollingAuto(); 78 | 79 | static void drawFrame1(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y); 80 | static void drawFrame2(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y); 81 | static void drawFrame3(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int16_t y); 82 | static void msOverlay(OLEDDisplay *display, OLEDDisplayUiState* state); 83 | 84 | 85 | int frameCount; // Nombre de pages à afficher 86 | int overlaysCount; 87 | SSD1306Wire display; 88 | OLEDDisplayUi ui; 89 | FrameCallback frames[3]; 90 | OverlayCallback overlays[1]; //affichage commun par dessus toutes les pages 91 | int rssi; 92 | uint8_t compteurTrame; 93 | bool wifiCnx; 94 | bool aprsIsCnx; 95 | bool disRssi; 96 | bool cnxError; 97 | 98 | static Afficheur* anchor; 99 | 100 | TaskHandle_t TaskHandle_Aff; 101 | 102 | bool disAlti; 103 | aprs report; 104 | 105 | }; 106 | 107 | #endif /* AFFICHEUR_H */ 108 | -------------------------------------------------------------------------------- /igate/igateV5/lib/Afficheur/images.h: -------------------------------------------------------------------------------- 1 | #define TW_width 30 2 | #define TW_height 37 3 | const uint8_t TW_Logo_bits[] PROGMEM = { 4 | 0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0x3F, 5 | 0xFF, 0xFF, 0xFF, 0x3F, 0x0F, 0xE0, 0x01, 0x3C, 0x0F, 0xE0, 0x01, 0x3C, 6 | 0x0F, 0xE0, 0x01, 0x3C, 0x80, 0xE7, 0x79, 0x00, 0x80, 0xE7, 0x79, 0x00, 7 | 0x80, 0xE7, 0x79, 0x00, 0x8F, 0xE7, 0x79, 0x3C, 0x8F, 0xE7, 0x79, 0x3C, 8 | 0x8F, 0xE7, 0x79, 0x3C, 0x8F, 0xE7, 0x79, 0x3C, 0x8F, 0xE7, 0x79, 0x3C, 9 | 0x8F, 0xE7, 0x79, 0x3C, 0x8F, 0xE7, 0x79, 0x3C, 0x8F, 0xE7, 0x79, 0x3C, 10 | 0x8F, 0xE7, 0x79, 0x3C, 0x8F, 0xE7, 0x79, 0x3C, 0x8F, 0xE7, 0x79, 0x3C, 11 | 0x8F, 0xE7, 0x79, 0x3C, 0x8F, 0xE7, 0x79, 0x3C, 0x0E, 0xFF, 0x3F, 0x1C, 12 | 0x1E, 0xFF, 0x3F, 0x1E, 0x1C, 0xFE, 0x1F, 0x0E, 0x3C, 0x3C, 0x0F, 0x0F, 13 | 0x38, 0x18, 0x06, 0x07, 0x78, 0x00, 0x80, 0x07, 0xF0, 0x00, 0x80, 0x03, 14 | 0xF0, 0xC1, 0xC0, 0x03, 0xE0, 0xE3, 0xF1, 0x01, 0xC0, 0xF7, 0xFB, 0x00, 15 | 0x80, 0xFF, 0x7F, 0x00, 0x00, 0xFF, 0x3F, 0x00, 0x00, 0xFC, 0x0F, 0x00, 16 | 0x00, 0xE0, 0x01, 0x00}; 17 | 18 | 19 | const uint8_t activeSymbol[] PROGMEM = { 20 | B00000000, 21 | B00000000, 22 | B00011000, 23 | B00100100, 24 | B01000010, 25 | B01000010, 26 | B00100100, 27 | B00011000 28 | }; 29 | 30 | const uint8_t inactiveSymbol[] PROGMEM = { 31 | B00000000, 32 | B00000000, 33 | B00000000, 34 | B00000000, 35 | B00011000, 36 | B00011000, 37 | B00000000, 38 | B00000000 39 | }; 40 | -------------------------------------------------------------------------------- /igate/igateV5/lib/AprsDroidTcp/AprsDroidTcp.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | 7 | /* 8 | * File: AprsDroidTcp.cpp 9 | * Author: ale 10 | * 11 | * Created on 11 avril 2022, 11:28 12 | */ 13 | 14 | #include "AprsDroidTcp.h" 15 | 16 | AprsDroidTcp::AprsDroidTcp() { 17 | anchor = this; 18 | } 19 | 20 | AprsDroidTcp::AprsDroidTcp(const AprsDroidTcp& orig) { 21 | } 22 | 23 | AprsDroidTcp::~AprsDroidTcp() { 24 | } 25 | 26 | bool AprsDroidTcp::setup() { 27 | server.begin(); 28 | BaseType_t ret = xTaskCreatePinnedToCore(AprsDroidTcp::marshall, "aprsdroid", 10000, NULL, 3, &TaskHandle_Rxbt, 0); 29 | return (ret == pdPASS) ? true : false; 30 | } 31 | 32 | void AprsDroidTcp::CheckForConnections() 33 | { 34 | if (server.hasClient()) 35 | { 36 | // If we are already connected to another computer, 37 | // then reject the new connection. Otherwise accept 38 | // the connection. 39 | if (remoteClient.connected()) 40 | { 41 | Serial.println("Connection rejected"); 42 | server.available().stop(); 43 | } 44 | else 45 | { 46 | Serial.println("Connection accepted"); 47 | remoteClient = server.available(); 48 | } 49 | } 50 | } 51 | 52 | bool AprsDroidTcp::getCnxState(){ 53 | bool ret=false; 54 | if (remoteClient.connected()){ 55 | ret=true; 56 | } 57 | return ret; 58 | } 59 | 60 | void AprsDroidTcp::send(char* msg) { 61 | if (remoteClient.connected()) { 62 | remoteClient.println(msg); 63 | } 64 | } 65 | 66 | int AprsDroidTcp::getPduLength(){ 67 | return pduLength; 68 | } 69 | 70 | 71 | void AprsDroidTcp::marshall(void * parametres) { 72 | anchor->receive(); 73 | } 74 | 75 | 76 | void AprsDroidTcp::receive() { 77 | 78 | Serial.println("Tache Wifi Droid en fonctionnement"); 79 | int ptr = 0; 80 | char car; 81 | while (1) { 82 | vTaskDelay(1); //indispensable car sinon guru ?! 83 | CheckForConnections(); 84 | while (remoteClient.connected() && remoteClient.available()) { 85 | if (ptr < MSG_MAX_LENGTH - 1) { 86 | car = (char) remoteClient.read(); 87 | //Serial.print(car); 88 | if (car != '\n') { 89 | msg[ptr++] = car; 90 | } else { 91 | msg[ptr] = '\0'; 92 | pduLength=ptr; 93 | ptr = 0; 94 | Serial.println("AprsDroidTcp incomming"); 95 | Serial.println(msg); 96 | xQueueSend(queueRx, msg, 0); 97 | } 98 | } else { 99 | msg[ptr] = '\0'; 100 | ptr = 0; 101 | } 102 | } 103 | } 104 | } 105 | 106 | 107 | QueueHandle_t AprsDroidTcp::queueRx = xQueueCreate(3, sizeof (msg)); 108 | AprsDroidTcp* AprsDroidTcp::anchor = NULL; 109 | -------------------------------------------------------------------------------- /igate/igateV5/lib/AprsDroidTcp/AprsDroidTcp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | 7 | /* 8 | * File: AprsDroidTcp.h 9 | * Author: ale 10 | * 11 | * Created on 11 avril 2022, 11:28 12 | */ 13 | 14 | 15 | 16 | 17 | #ifndef APRSDROIDTCP_H 18 | #define APRSDROIDTCP_H 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | 25 | #define MSG_MAX_LENGTH 100 26 | #define SERVER_PORT 14580 27 | 28 | 29 | class AprsDroidTcp { 30 | public: 31 | AprsDroidTcp(); 32 | AprsDroidTcp(const AprsDroidTcp& orig); 33 | virtual ~AprsDroidTcp(); 34 | bool setup(); 35 | void send(char* msg); 36 | int getPduLength(); 37 | bool getCnxState(); 38 | 39 | static QueueHandle_t queueRx; 40 | 41 | private: 42 | TaskHandle_t TaskHandle_Rxbt; 43 | void CheckForConnections(); 44 | void receive(); 45 | static AprsDroidTcp* anchor; 46 | static void marshall(void *); 47 | 48 | WiFiServer server= WiFiServer(SERVER_PORT); 49 | WiFiClient remoteClient; 50 | 51 | 52 | char msg[MSG_MAX_LENGTH]; 53 | int pduLength; 54 | 55 | }; 56 | 57 | #endif /* APRSDROIDTCP_H */ 58 | 59 | 60 | -------------------------------------------------------------------------------- /igate/igateV5/lib/Aprsis/Aprsis.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | 7 | /* 8 | * File: Aprsis.cpp 9 | * Author: ale 10 | * 11 | * Created on 8 avril 2022, 19:04 12 | * todo: 13 | * check server alive every 20 seconds 14 | */ 15 | 16 | #include "Aprsis.h" 17 | 18 | Aprsis::Aprsis() 19 | { 20 | tool_name=TOOL_NAME; 21 | version=VERSIONIS; 22 | anchor = this; 23 | timeNow = 0; 24 | } 25 | 26 | Aprsis::Aprsis(const Aprsis& orig) { 27 | } 28 | 29 | Aprsis::~Aprsis() { 30 | } 31 | 32 | 33 | bool Aprsis::setup(const String _user, const String _latitude,const String _longitude,const String _message,const String _server,const int _port) { 34 | user=_user; 35 | passcode=passCode(user); 36 | longitude =_longitude; 37 | latitude=_latitude; 38 | message=_message; 39 | serverAprs=_server; 40 | portAprs=_port; 41 | BaseType_t ret=xTaskCreatePinnedToCore(Aprsis::marshall, "gestion_aprsis", 10000, NULL, 2, &TaskHandle_Ait, 1); 42 | return (ret==pdPASS) ? true : false; 43 | } 44 | 45 | 46 | 47 | bool Aprsis::isConnected() { 48 | return cnxState; 49 | } 50 | 51 | void Aprsis::setRssi(int _rssi){ 52 | rssi=_rssi; 53 | } 54 | 55 | 56 | void Aprsis::marshall(void * parametres) { 57 | anchor->aprsIsTask(); 58 | } 59 | 60 | 61 | 62 | String Aprsis::passCode(String call){ 63 | call.toUpperCase(); 64 | int id=call.indexOf('-'); 65 | if (id!=-1){ 66 | call=call.substring(0,id); 67 | } 68 | int hash=0x73e2; 69 | int i=0; 70 | int len=call.length(); 71 | while (iuser + ">APLG01:=" + anchor->latitude + "L" + anchor->longitude + "&" + anchor->message + "\n\r"; 91 | /* 92 | A Quoi ça sert ? 93 | client.onPoll([](void* arg, AsyncClient * c) { 94 | Serial.printf("p:%lu\n\r", millis()); 95 | }); 96 | */ 97 | 98 | client.onAck([](void* arg, AsyncClient * c, size_t len, uint32_t time) { 99 | Serial.printf("a:%u:%u\n\r", len, time); 100 | 101 | }); 102 | 103 | client.onDisconnect([](void* arg, AsyncClient * c) { 104 | Serial.printf("Disconnect tcp \n\r"); 105 | c->close(); 106 | anchor->cnxState = false; 107 | }); 108 | 109 | client.onError([](void* arg, AsyncClient * c, int8_t error) { 110 | Serial.printf("Error: %s\n\r", c->errorToString(error)); 111 | //digitalWrite(led4, HIGH); 112 | c->close(); 113 | }); 114 | client.onTimeout([](void* arg, AsyncClient * c, uint32_t time) { 115 | Serial.printf("Timeout\n\r"); 116 | Serial.println(time); 117 | }); 118 | 119 | client.onConnect([](void* arg, AsyncClient * c) { 120 | anchor->cnxState = true; 121 | Serial.println("tcp APRS Server Connected"); 122 | //digitalWrite(led4, LOW); 123 | String login = "user " + anchor->user + " pass " + anchor->passcode + " vers " + anchor->tool_name + " " + anchor->version + "\n\r"; 124 | c->write(login.c_str()); 125 | 126 | }); 127 | client.onData([](void* arg, AsyncClient * c, void* data, size_t len) { 128 | anchor->timeNow=millis(); 129 | Serial.printf("Data received with length: %d\n\r", len); 130 | String line((char*) data); 131 | if (line.startsWith("#")) { 132 | line = line.substring(0, line.indexOf('\n')); 133 | Serial.println(line); 134 | if (line.indexOf("logresp") != -1) { 135 | if (line.indexOf("unverified") == -1) { 136 | Serial.println("User verified with passcode!"); 137 | } 138 | } 139 | } 140 | }); 141 | 142 | int cpt = BEACON_DELAY; 143 | String strMsg; 144 | 145 | Serial.print("APRS IS Task running core : "); 146 | Serial.println(xPortGetCoreID()); 147 | 148 | 149 | while (true) { 150 | //char missatge[100]; 151 | vTaskDelay(1); 152 | if (millis() - anchor->timeNow > RECONNECT_SERVER_DELAY) { 153 | client.close(); //pb de connection Ethernet sur point d'accès WiFi, il faut se reconnecter 154 | anchor->timeNow=millis(); 155 | } 156 | if (!client.connected()) { 157 | Serial.println("Try to connect"); 158 | if (!client.connect(anchor->serverAprs.c_str(), anchor->portAprs)) { 159 | Serial.println("Something went wrong on connecting! Is the server reachable?"); 160 | vTaskDelay(RECONNECT_DELAY); 161 | } 162 | vTaskDelay(CONNECT_DELAY); 163 | } 164 | if (client.connected()) { 165 | if (cpt == BEACON_DELAY) { //envoie la position balise périodiquement 166 | client.write(msgBeacon.c_str()); 167 | Serial.println(msgBeacon); 168 | cpt = 0; 169 | } 170 | cpt++; 171 | if (xQueueReceive(queueMsg, msg, 0) == pdPASS) { //0 au lieu de portMAX_DELAY = non bloquant 172 | Serial.println("msg aprsis queue"); 173 | Serial.println(rssi); 174 | 175 | if (rssi<0){ 176 | strMsg = String(msg) + " RSSI" + String(rssi) + " dBm\n\r"; //ajout option pour envoyer le rssi ou mode message 177 | } 178 | else{ 179 | strMsg = String(msg) + "\n\r"; 180 | } 181 | Serial.println(msg); 182 | client.write(strMsg.c_str()); //non testé 183 | //client.add(missatge,sizeof(missatge)); //autre version non testé 184 | //client.send(); 185 | 186 | } 187 | } 188 | } 189 | } 190 | 191 | 192 | 193 | 194 | QueueHandle_t Aprsis::queueMsg = xQueueCreate(3, sizeof (msg)); 195 | Aprsis* Aprsis::anchor = NULL; 196 | 197 | /* 198 | * pour plus tard peut être... 199 | vTaskSuspend( xHandle ); 200 | vTaskResume( xHandle ); 201 | */ 202 | -------------------------------------------------------------------------------- /igate/igateV5/lib/Aprsis/Aprsis.h: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | 7 | /* 8 | * File: Aprsis.h 9 | * Author: ale 10 | * 11 | * Created on 8 avril 2022, 19:04 12 | */ 13 | 14 | #ifndef APRSIS_H 15 | #define APRSIS_H 16 | 17 | #include 18 | #include 19 | #define TOOL_NAME "ESP32-APRS-IS" 20 | #define VERSIONIS "1.1" 21 | #define MSG_MAX_LENGTH 100 22 | //#define APRS_SERVER "euro.aprs2.net" 23 | //#define APRS_PORT 14580 24 | #define BEACON_DELAY 15*60*1000 //15 minutes 25 | #define RECONNECT_DELAY 5*1000 //5 secondes 26 | #define CONNECT_DELAY 2*1000 //2 secondes 27 | #define RECONNECT_SERVER_DELAY 30*1000 //30 secondes is pas de données entrantes # aprsc 2.1.11-g80df3b4 7 Aug 2022 16:57:48 GMT T2SWEDEN 95.216.197.75:14580 28 | 29 | 30 | 31 | class Aprsis { 32 | public: 33 | Aprsis(); 34 | Aprsis(const Aprsis& orig); 35 | virtual ~Aprsis(); 36 | bool setup(const String _user,const String _latitude,const String _longitude,const String _message,const String _server,const int _port); 37 | 38 | 39 | bool isConnected(); 40 | 41 | void setRssi(int _rssi); 42 | static QueueHandle_t queueMsg; 43 | 44 | private: 45 | TaskHandle_t TaskHandle_Ait; 46 | static Aprsis* anchor; 47 | static void marshall(void *); 48 | void aprsIsTask(); 49 | String passCode(String call); 50 | 51 | 52 | String user; 53 | String passcode; 54 | String tool_name; 55 | String version; 56 | String longitude; 57 | String latitude; 58 | String message; 59 | String serverAprs; 60 | int portAprs; 61 | int rssi; 62 | bool cnxState; 63 | char msg[MSG_MAX_LENGTH]; 64 | uint32_t timeNow; 65 | 66 | }; 67 | 68 | #endif /* APRSIS_H */ 69 | -------------------------------------------------------------------------------- /igate/igateV5/lib/DecodeAprs/DecodeAprs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | 7 | /* 8 | * File: DecodeAprs.h 9 | * Author: ale 10 | * 11 | * Created on 10 mai 2022, 15:31 12 | */ 13 | 14 | #ifndef DECODEAPRS_H 15 | #define DECODEAPRS_H 16 | 17 | //#include 18 | #include 19 | #include 20 | #include 21 | 22 | #define BODY_LEN 100 23 | 24 | class DecodeAprs : public Afficheur 25 | { 26 | public: 27 | DecodeAprs(); 28 | DecodeAprs(const DecodeAprs& orig); 29 | virtual ~DecodeAprs(); 30 | bool parse(char* msg); 31 | 32 | private: 33 | bool split(char *str, char car); 34 | bool extractCall(char *msg); 35 | int countChar(char *msg, char car); 36 | void clearMem(); 37 | bool checkAprsAndTimeStamp(); 38 | bool parsePositionId(); 39 | bool checkAltitude(); 40 | bool checkCourseSpeed(); 41 | bool parseComment(); 42 | char body[BODY_LEN]; 43 | aprs report; 44 | 45 | 46 | }; 47 | 48 | #endif /* DECODEAPRS_H */ 49 | 50 | -------------------------------------------------------------------------------- /igate/igateV5/lib/Digipeater/Digipeater.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | 7 | /* 8 | * File: Digipeater.cpp 9 | * Author: ale 10 | * 11 | * Created on 11 mai 2022, 12:43 12 | */ 13 | 14 | #include "Digipeater.h" 15 | 16 | Digipeater::Digipeater(String _call,String _latitude,String _longitude, String _comment) { 17 | beaconMsg=_call+">APDR16:!"+_latitude+"I"+_longitude+"#"+_comment; 18 | memset(callDigi, '\0', CALL_LEN); 19 | nbPaths=0; 20 | _call.toCharArray(callDigi,CALL_LEN); 21 | clearMem(); 22 | } 23 | 24 | Digipeater::Digipeater(const Digipeater& orig) { 25 | } 26 | 27 | Digipeater::~Digipeater() { 28 | } 29 | 30 | void Digipeater::clearMem() { 31 | memset(head, '\0', HEAD_LEN); 32 | memset(body, '\0', BODY_LEN); 33 | memset(fromCall, '\0', CALL_LEN); 34 | memset(path, '\0', PATH_LEN); 35 | memset(pdu, '\0', PDU_LEN); 36 | for (int n = 0; n < MAX_PATHS; n++) { 37 | memset(pathTab[n], '\0', CALL_LEN); 38 | } 39 | } 40 | 41 | bool Digipeater::split(char *msg, char *partA, char *partB,char car) { 42 | char *pch; 43 | int tailleA,tailleB; 44 | bool ret=false; 45 | pch = strchr(msg, car); 46 | if (pch != NULL) { 47 | tailleA=pch-msg; 48 | tailleB=strlen(msg)-(pch-msg)-1; 49 | strncpy(partA,msg,tailleA); 50 | strncpy(partB,pch+1,tailleB); 51 | ret=true; 52 | } 53 | return ret; 54 | } 55 | 56 | int Digipeater::countChar(char *msg, char car) { 57 | int n; 58 | int cpt = 0; 59 | for (n = 0; n < strlen(msg); n++) { 60 | if (msg[n] == car) { 61 | cpt++; 62 | } 63 | } 64 | return cpt; 65 | } 66 | 67 | bool Digipeater::splitPath(){ 68 | int n; 69 | int cpt = 0; 70 | char temp[CALL_LEN] = {0}; 71 | int m = 0; 72 | if (countChar(path, ',') >= MAX_PATHS - 1) { 73 | Serial.print("Full : "); 74 | Serial.println(cpt); 75 | return false; 76 | } 77 | for (n = 0; n < strlen(path) + 1; n++) { 78 | if ((path[n] != ',') && (path[n] != '\0')) { 79 | temp[m] = path[n]; 80 | m++; 81 | } else { 82 | strncpy(pathTab[cpt], temp, CALL_LEN); 83 | memset(temp, '\0', CALL_LEN); 84 | m = 0; 85 | cpt++; 86 | } 87 | } 88 | nbPaths = cpt; 89 | Serial.println(cpt); 90 | for (n = 0; n < cpt; n++) { 91 | Serial.println(pathTab[n]); 92 | } 93 | return true; 94 | } 95 | 96 | bool Digipeater::routing(char* msg) { 97 | clearMem(); 98 | Serial.println(strlen(msg)); 99 | if (strlen(msg) == 0) { 100 | return false; 101 | } 102 | if (split(msg, head, body, ':') == false) { 103 | return false; 104 | } 105 | Serial.println(head); 106 | Serial.println(body); 107 | if (strlen(head) == 0) { 108 | return false; 109 | } 110 | if (split(head, fromCall, path, '>') == false) { 111 | return false; 112 | } 113 | Serial.println(fromCall); 114 | Serial.println(path); 115 | if (splitPath() == false) { 116 | return false; 117 | } 118 | if (addPath()==false){ 119 | Serial.println("Bad Path"); 120 | } 121 | return true; 122 | } 123 | 124 | bool Digipeater::addPath() { 125 | int n; 126 | if (strcmp(fromCall, callDigi) == 0) { 127 | Serial.println("Own call"); 128 | return false; 129 | } 130 | for (n = 0; n < nbPaths; n++) { 131 | if (strcmp(pathTab[n], callDigi) == 0) { 132 | Serial.println("Call inside PATH"); 133 | return false; 134 | 135 | } 136 | } 137 | if (strncmp(pathTab[nbPaths - 1], "WIDE", 4) != 0) { 138 | Serial.println("No WIDE"); 139 | return false; 140 | } 141 | if (pathTab[nbPaths - 1][5] == '*') { 142 | Serial.println("End PATH"); 143 | return false; 144 | } 145 | strcpy(pathTab[nbPaths], pathTab[nbPaths - 1]); 146 | memset(pathTab[nbPaths - 1], '\0', CALL_LEN); 147 | strcpy(pathTab[nbPaths - 1], callDigi); 148 | nbPaths++; 149 | pathTab[nbPaths - 1][6]--; 150 | if (pathTab[nbPaths - 1][6] == '0') { 151 | pathTab[nbPaths - 1][5] = '*'; 152 | pathTab[nbPaths - 1][6] = '\0'; 153 | } 154 | Serial.println(nbPaths); 155 | for (n = 0; n < nbPaths; n++) { 156 | Serial.println(pathTab[n]); 157 | } 158 | return true; 159 | } 160 | 161 | 162 | char * Digipeater::getMsg(){ 163 | int n; 164 | memset(pdu, '\0', PDU_LEN); 165 | snprintf(pdu, PDU_LEN, "%s>", fromCall); 166 | for (n = 0; n < nbPaths-1; n++) { 167 | strcat(pdu, pathTab[n]); 168 | strcat(pdu, ","); 169 | } 170 | strcat(pdu, pathTab[nbPaths-1]); 171 | strcat(pdu, ":"); 172 | strcat(pdu, body); 173 | Serial.println(pdu); 174 | return pdu; 175 | } 176 | 177 | char * Digipeater::getBeacon(){ 178 | memset(pdu, '\0', PDU_LEN); 179 | beaconMsg.toCharArray(pdu,PDU_LEN); 180 | return pdu; 181 | } 182 | 183 | 184 | void Digipeater::check(char *msg){ 185 | char *nr; 186 | if (routing(msg)){ 187 | nr=getMsg(); 188 | Serial.println(msg); 189 | Serial.println(nr); 190 | }; 191 | } 192 | 193 | void Digipeater::test(){ 194 | 195 | char msg1[]="F4GOH-9>APDR16,F4GOH-2,WIDE1-1:=4753.42N/00016.61Eb/A=000399 lora aprs"; 196 | check(msg1); 197 | char msg2[]="F4GOH-9>APDR16,WIDE2-2:=4753.42N/00016.61Eb/A=000399 lora aprs"; 198 | check(msg2); 199 | //char msg3[]="F4GOH-9>APDR16,F4GOH-2,F4GOH-3,F4GOH-4,WIDE2*:=4753.42N/00016.61Eb/A=000399 lora aprs"; 200 | //check(msg3); 201 | } 202 | -------------------------------------------------------------------------------- /igate/igateV5/lib/Digipeater/Digipeater.h: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | 7 | /* 8 | * File: Digipeater.h 9 | * Author: ale 10 | * 11 | * Created on 11 mai 2022, 12:43 12 | */ 13 | 14 | #ifndef DIGIPEATER_H 15 | #define DIGIPEATER_H 16 | 17 | #include 18 | #include 19 | 20 | 21 | #define MAX_PATHS 5 22 | #define HEAD_LEN 80 23 | #define PATH_LEN 70 24 | #define BODY_LEN 100 25 | #define CALL_LEN 10 26 | #define PDU_LEN 150 27 | 28 | 29 | class Digipeater { 30 | public: 31 | Digipeater(String _call,String _latitude,String _longitude, String _comment); 32 | Digipeater(const Digipeater& orig); 33 | virtual ~Digipeater(); 34 | bool routing(char* msg); 35 | char * getMsg(); 36 | void test(); 37 | char * getBeacon(); 38 | 39 | 40 | private: 41 | bool split(char *str, char *partA, char *partB,char car); 42 | bool splitPath(); 43 | bool addPath(); 44 | int countChar(char *msg, char car); 45 | void check(char *msg); 46 | void clearMem(); 47 | 48 | 49 | String beaconMsg; 50 | char callDigi[CALL_LEN]; 51 | char head[HEAD_LEN]; 52 | char body[BODY_LEN]; 53 | char fromCall[CALL_LEN]; 54 | char path[PATH_LEN]; 55 | char pathTab[MAX_PATHS][CALL_LEN]; 56 | char pdu[PDU_LEN]; 57 | int nbPaths; 58 | 59 | }; 60 | 61 | #endif /* DIGIPEATER_H */ 62 | 63 | //F4GOH-9>APDR16,F4GOH-2,F4GOH-3,F4GOH-4*:=4753.00N/00016.72Eb/A=000399 lora aprs"+ "\n" -------------------------------------------------------------------------------- /igate/igateV5/lib/GestionWifi/GestionWifi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File: GestionWifi.h 3 | * Author: ale 4 | * 5 | * Created on 9 avril 2022, 09:04 6 | * https://randomnerdtutorials.com/esp32-useful-wi-fi-functions-arduino/#10 7 | * https://randomnerdtutorials.com/esp32-wifimulti/ 8 | */ 9 | 10 | #ifndef GESTIONWIFI_H 11 | #define GESTIONWIFI_H 12 | 13 | #include 14 | #include 15 | #define TIMEOUT 10*1000 16 | //#define TIME_RECONNECT 10*1000 17 | 18 | enum wifiMode{ 19 | ACCES_POINT, 20 | CLIENT 21 | }; 22 | 23 | class GestionWifi { 24 | public: 25 | GestionWifi(); 26 | GestionWifi(const GestionWifi& orig); 27 | virtual ~GestionWifi(); 28 | 29 | bool setup(const char* _ssid,const char* _password, wifiMode _wMode); 30 | bool connexion(); 31 | 32 | bool connected(); 33 | String getIP(); 34 | 35 | private: 36 | static void WiFiEvent(WiFiEvent_t event,WiFiEventInfo_t info); 37 | 38 | TaskHandle_t TaskHandle_Gwt; 39 | static GestionWifi* anchor; 40 | //static void marshall(void *); 41 | //void checkWifiTask(); 42 | char *ssid; 43 | char *password; 44 | IPAddress ip; 45 | IPAddress subnet; 46 | IPAddress gateway; 47 | wifiMode wMode; 48 | bool wifi_connected; 49 | 50 | 51 | }; 52 | 53 | #endif /* GESTIONWIFI_H */ 54 | 55 | -------------------------------------------------------------------------------- /igate/igateV5/lib/LoraAprs/LoraAprs.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | 7 | /* 8 | * File: LoraAprs.cpp 9 | * Author: ale 10 | * 11 | * Created on 19 mars 2022, 18:04 12 | */ 13 | 14 | #include "LoraAprs.h" 15 | 16 | LoraAprs::LoraAprs(long _frequency,int _spreadingFactor,long _signalBandwith, int _codingRate,int _txPower): 17 | frequency(_frequency), 18 | spreadingFactor(_spreadingFactor), 19 | signalBandwith(_signalBandwith), 20 | codingRate(_codingRate), 21 | txPower(_txPower) 22 | { 23 | anchor = this; 24 | txing=false; 25 | } 26 | 27 | LoraAprs::LoraAprs(const LoraAprs& orig) { 28 | } 29 | 30 | LoraAprs::~LoraAprs() { 31 | } 32 | 33 | void LoraAprs::setup(){ 34 | Serial.println("Set SPI pins!"); 35 | SPI.begin(LORA_SCK, LORA_MISO, LORA_MOSI, LORA_CS); 36 | 37 | Serial.println("Set LoRa pins!"); 38 | setPins(LORA_CS, LORA_RST, LORA_IRQ); 39 | 40 | 41 | Serial.println("frequency: "); 42 | Serial.println(String(frequency)); 43 | if (!begin(frequency)) { 44 | Serial.println("Starting LoRa failed!"); 45 | while (true) { 46 | } 47 | } 48 | setSpreadingFactor(spreadingFactor); 49 | setSignalBandwidth(signalBandwith); 50 | setCodingRate4(codingRate); 51 | enableCrc(); 52 | 53 | setTxPower(txPower);//Config.lora.power); 54 | Serial.println("LoRa init done!"); 55 | //msg.reserve(100); 56 | //Serial.println(msg.size())); 57 | xTaskCreatePinnedToCore(LoraAprs::marshall, "lora_rx", 10000, NULL, 3, &TaskHandle_Rx, 1); // creation de la tache 58 | } 59 | 60 | void LoraAprs::send(char* msg,int length){ 61 | txing=true; 62 | beginPacket(); 63 | // Header: 64 | write('<'); 65 | write(0xFF); 66 | write(0x01); 67 | // APRS Data: 68 | write((const uint8_t *) msg,length); 69 | endPacket(); 70 | txing=false; 71 | } 72 | 73 | void LoraAprs::marshall(void * parametres) { 74 | anchor->receive(); 75 | } 76 | 77 | bool LoraAprs::checkMessage() { 78 | 79 | if (!parsePacket()) { 80 | return false; 81 | } 82 | // read header: 83 | char dummy[4]; 84 | readBytes(dummy, 3); 85 | if (dummy[0] != '<') { 86 | // is no APRS message, ignore message 87 | while (available()) { 88 | read(); 89 | } 90 | return false; 91 | } 92 | // read APRS data: 93 | int n=0; 94 | while (available() && n wired on pcb AND connected to header pin LORA1 23 | * #define LORA_IO2 32 // GPIO32 - SX1276 IO2 -> wired on pcb AND connected to header pin LORA2 24 | */ 25 | 26 | #ifndef LORAAPRS_H 27 | #define LORAAPRS_H 28 | 29 | #include 30 | #include 31 | #include 32 | 33 | 34 | #define FREQUENCY 433775000 35 | #define SPREADING_FACTOR 12 36 | #define SIGNAL_BANDWIDTH 125000 37 | #define CODING_RATE_4 5 38 | #define TX_POWER 20 39 | #define MSG_MAX_LENGTH 100 40 | 41 | 42 | class LoraAprs : public LoRaClass { 43 | public: 44 | LoraAprs(long _frequency=FREQUENCY, 45 | int _spreadingFactor=SPREADING_FACTOR, 46 | long _signalBandwith=SIGNAL_BANDWIDTH, 47 | int _codingRate=CODING_RATE_4, 48 | int _txPower=TX_POWER); 49 | LoraAprs(const LoraAprs& orig); 50 | virtual ~LoraAprs(); 51 | 52 | 53 | void setup(); 54 | void send(char* msg,int length); 55 | 56 | static QueueHandle_t queueRx; 57 | 58 | private: 59 | TaskHandle_t TaskHandle_Rx; 60 | void receive(); 61 | static LoraAprs* anchor; 62 | static void marshall(void *); 63 | bool checkMessage(); 64 | char msg[MSG_MAX_LENGTH]; 65 | long frequency; 66 | int spreadingFactor; 67 | long signalBandwith; 68 | int codingRate; 69 | int txPower; 70 | bool txing; 71 | 72 | }; 73 | 74 | #endif /* LORAAPRS_H */ 75 | 76 | -------------------------------------------------------------------------------- /igate/igateV5/lib/Menu/Menu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File: Menu.h 3 | * Author: philippe SIMIER Touchard Washington Le Mans 4 | * 5 | * Created on 22 avril 2022, 17:11 6 | */ 7 | 8 | #ifndef MENU_H 9 | #define MENU_H 10 | #include 11 | #include 12 | #include // Classe pour écrire et lire la configuration 13 | 14 | #define FREQUENCY 433775000 15 | #define TIMEOUT_MENU 10 16 | 17 | 18 | class Menu { 19 | 20 | public: 21 | Menu(); 22 | Menu(const Menu& orig); 23 | virtual ~Menu(); 24 | 25 | void run(); 26 | void setup(); 27 | 28 | // Méthodes associées aux commandes 29 | static void _call_(ArgList& L, Stream& S); 30 | static void _ssid_(ArgList& L, Stream& S); 31 | static void _pass_(ArgList& L, Stream& S); 32 | static void _freq_(ArgList& L, Stream& S); 33 | static void _latitude_(ArgList& L, Stream& S); 34 | static void _longitude_(ArgList& L, Stream& S); 35 | static void _comment_(ArgList& L, Stream& S); 36 | static void _config_(ArgList& L, Stream& S); 37 | static void _raz_(ArgList& L, Stream& S); 38 | static void _internet_(ArgList& L, Stream& S); 39 | static void _server_(ArgList& L, Stream& S); 40 | static void _port_(ArgList& L, Stream& S); 41 | 42 | static void _exit_(ArgList& L, Stream& S); 43 | static void _help_(ArgList& L, Stream& S); 44 | static void _unknown(String& L, Stream& S); 45 | static void _digi_(ArgList& L, Stream& S); 46 | static void _rssi_(ArgList& L, Stream& S); 47 | private: 48 | 49 | bool exitFlag; 50 | Console *con; 51 | Preferences *configuration; 52 | static Menu* anchor; 53 | bool acceptCmd(String cmd, int longMin, int longMax); 54 | 55 | }; 56 | 57 | #endif /* MENU_H */ 58 | -------------------------------------------------------------------------------- /igate/igateV5/lib/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for project specific (private) libraries. 3 | PlatformIO will compile them to static libraries and link into executable file. 4 | 5 | The source code of each library should be placed in a an own separate directory 6 | ("lib/your_library_name/[here are source files]"). 7 | 8 | For example, see a structure of the following two libraries `Foo` and `Bar`: 9 | 10 | |--lib 11 | | | 12 | | |--Bar 13 | | | |--docs 14 | | | |--examples 15 | | | |--src 16 | | | |- Bar.c 17 | | | |- Bar.h 18 | | | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html 19 | | | 20 | | |--Foo 21 | | | |- Foo.c 22 | | | |- Foo.h 23 | | | 24 | | |- README --> THIS FILE 25 | | 26 | |- platformio.ini 27 | |--src 28 | |- main.c 29 | 30 | and a contents of `src/main.c`: 31 | ``` 32 | #include 33 | #include 34 | 35 | int main (void) 36 | { 37 | ... 38 | } 39 | 40 | ``` 41 | 42 | PlatformIO Library Dependency Finder will find automatically dependent 43 | libraries scanning project source files. 44 | 45 | More information about PlatformIO Library Dependency Finder 46 | - https://docs.platformio.org/page/librarymanager/ldf.html 47 | -------------------------------------------------------------------------------- /igate/igateV5/nbproject/private/CodeAssistancePathMapper.properties: -------------------------------------------------------------------------------- 1 | # Automatic path mapper. CRC = 1 2 | -------------------------------------------------------------------------------- /igate/igateV5/nbproject/private/c_standard_headers_indexer.c: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * Oracle and Java are registered trademarks of Oracle and/or its affiliates. 7 | * Other names may be trademarks of their respective owners. 8 | * 9 | * The contents of this file are subject to the terms of either the GNU 10 | * General Public License Version 2 only ("GPL") or the Common 11 | * Development and Distribution License("CDDL") (collectively, the 12 | * "License"). You may not use this file except in compliance with the 13 | * License. You can obtain a copy of the License at 14 | * http://www.netbeans.org/cddl-gplv2.html 15 | * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the 16 | * specific language governing permissions and limitations under the 17 | * License. When distributing the software, include this License Header 18 | * Notice in each file and include the License file at 19 | * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this 20 | * particular file as subject to the "Classpath" exception as provided 21 | * by Oracle in the GPL Version 2 section of the License file that 22 | * accompanied this code. If applicable, add the following below the 23 | * License Header, with the fields enclosed by brackets [] replaced by 24 | * your own identifying information: 25 | * "Portions Copyrighted [year] [name of copyright owner]" 26 | * 27 | * If you wish your version of this file to be governed by only the CDDL 28 | * or only the GPL Version 2, indicate your decision by adding 29 | * "[Contributor] elects to include this software in this distribution 30 | * under the [CDDL or GPL Version 2] license." If you do not indicate a 31 | * single choice of license, a recipient has the option to distribute 32 | * your version of this file under either the CDDL, the GPL Version 2 or 33 | * to extend the choice of license to its licensees as provided above. 34 | * However, if you add GPL Version 2 code and therefore, elected the GPL 35 | * Version 2 license, then the option applies only if the new code is 36 | * made subject to such option by the copyright holder. 37 | * 38 | * Contributor(s): 39 | */ 40 | 41 | // List of standard headers was taken in http://en.cppreference.com/w/c/header 42 | 43 | #include // Conditionally compiled macro that compares its argument to zero 44 | #include // Functions to determine the type contained in character data 45 | #include // Macros reporting error conditions 46 | #include // Limits of float types 47 | #include // Sizes of basic types 48 | #include // Localization utilities 49 | #include // Common mathematics functions 50 | #include // Nonlocal jumps 51 | #include // Signal handling 52 | #include // Variable arguments 53 | #include // Common macro definitions 54 | #include // Input/output 55 | #include // String handling 56 | #include // General utilities: memory management, program utilities, string conversions, random numbers 57 | #include // Time/date utilities 58 | #include // (since C95) Alternative operator spellings 59 | #include // (since C95) Extended multibyte and wide character utilities 60 | #include // (since C95) Wide character classification and mapping utilities 61 | #ifdef _STDC_C99 62 | #include // (since C99) Complex number arithmetic 63 | #include // (since C99) Floating-point environment 64 | #include // (since C99) Format conversion of integer types 65 | #include // (since C99) Boolean type 66 | #include // (since C99) Fixed-width integer types 67 | #include // (since C99) Type-generic math (macros wrapping math.h and complex.h) 68 | #endif 69 | #ifdef _STDC_C11 70 | #include // (since C11) alignas and alignof convenience macros 71 | #include // (since C11) Atomic types 72 | #include // (since C11) noreturn convenience macros 73 | #include // (since C11) Thread library 74 | #include // (since C11) UTF-16 and UTF-32 character utilities 75 | #endif 76 | -------------------------------------------------------------------------------- /igate/igateV5/nbproject/private/configurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Afficheur.cpp 10 | Afficheur.h 11 | images.h 12 | 13 | 14 | AprsDroidTcp.cpp 15 | AprsDroidTcp.h 16 | 17 | 18 | Aprsis.cpp 19 | Aprsis.h 20 | 21 | 22 | AsyncTCP.cpp 23 | AsyncTCP.h 24 | 25 | 26 | DecodeAprs.cpp 27 | DecodeAprs.h 28 | 29 | 30 | Digipeater.cpp 31 | Digipeater.h 32 | 33 | 34 | GestionWifi.cpp 35 | GestionWifi.h 36 | 37 | 38 | LoraAprs.cpp 39 | LoraAprs.h 40 | 41 | 42 | Menu.cpp 43 | Menu.h 44 | 45 | 46 | 47 | main.cpp 48 | 49 | 50 | 51 | platformio.ini 52 | 53 | 54 | 55 | 56 | 57 | 58 | localhost 59 | 2 60 | 61 | 62 | 63 | . 64 | ${AUTO_FOLDER} 65 | 66 | ${AUTO_FOLDER} 67 | 68 | ${MAKE} ${ITEM_NAME}.o 69 | ${AUTO_COMPILE} 70 | 71 | ${AUTO_COMPILE} 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | gdb 87 | 88 | 89 | 90 | "${OUTPUT_PATH}" 91 | pio run --target upload 92 | 93 | pio run --target upload 94 | 95 | false 96 | 0 97 | 0 98 | 99 | 100 | 101 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /igate/igateV5/nbproject/private/launcher.properties: -------------------------------------------------------------------------------- 1 | # Launchers File syntax: 2 | # 3 | # [Must-have property line] 4 | # launcher1.runCommand= 5 | # [Optional extra properties] 6 | # launcher1.displayName= 7 | # launcher1.hide= 8 | # launcher1.buildCommand= 9 | # launcher1.runDir= 10 | # launcher1.runInOwnTab= 11 | # launcher1.symbolFiles= 12 | # launcher1.env.= 13 | # (If this value is quoted with ` it is handled as a native command which execution result will become the value) 14 | # [Common launcher properties] 15 | # common.runDir= 16 | # (This value is overwritten by a launcher specific runDir value if the latter exists) 17 | # common.env.= 18 | # (Environment variables from common launcher are merged with launcher specific variables) 19 | # common.symbolFiles= 20 | # (This value is overwritten by a launcher specific symbolFiles value if the latter exists) 21 | # 22 | # In runDir, symbolFiles and env fields you can use these macroses: 23 | # ${PROJECT_DIR} - project directory absolute path 24 | # ${OUTPUT_PATH} - linker output path (relative to project directory path) 25 | # ${OUTPUT_BASENAME}- linker output filename 26 | # ${TESTDIR} - test files directory (relative to project directory path) 27 | # ${OBJECTDIR} - object files directory (relative to project directory path) 28 | # ${CND_DISTDIR} - distribution directory (relative to project directory path) 29 | # ${CND_BUILDDIR} - build directory (relative to project directory path) 30 | # ${CND_PLATFORM} - platform name 31 | # ${CND_CONF} - configuration name 32 | # ${CND_DLIB_EXT} - dynamic library extension 33 | # 34 | # All the project launchers must be listed in the file! 35 | # 36 | # launcher1.runCommand=... 37 | # launcher2.runCommand=... 38 | # ... 39 | # common.runDir=... 40 | # common.env.KEY=VALUE 41 | 42 | # launcher1.runCommand= -------------------------------------------------------------------------------- /igate/igateV5/nbproject/private/private.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0 5 | 0 6 | 7 | 8 | 9 | 10 | file:/home/ale/NetBeansProjects/ttgo/igateV5/lib/DecodeAprs/DecodeAprs.cpp 11 | file:/home/ale/NetBeansProjects/ttgo/igateV5/platformio.ini 12 | file:/home/ale/NetBeansProjects/ttgo/igateV5/lib/DecodeAprs/DecodeAprs.h 13 | file:/home/ale/NetBeansProjects/ttgo/igateV5/src/main.cpp 14 | file:/home/ale/NetBeansProjects/ttgo/igateV5/lib/GestionWifi/GestionWifi.cpp 15 | file:/home/ale/NetBeansProjects/ttgo/igateV5/lib/Afficheur/Afficheur.h 16 | file:/home/ale/NetBeansProjects/ttgo/igateV5/lib/Aprsis/Aprsis.cpp 17 | file:/home/ale/NetBeansProjects/ttgo/igateV5/lib/Afficheur/Afficheur.cpp 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /igate/igateV5/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.cnd.makeproject 4 | 5 | 6 | igateV5 7 | 8 | cpp 9 | h 10 | UTF-8 11 | 12 | 13 | . 14 | 15 | 16 | 17 | Default 18 | 0 19 | 20 | 21 | 22 | false 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /igate/igateV5/platformio.ini: -------------------------------------------------------------------------------- 1 | ; PlatformIO Project Configuration File 2 | ; 3 | ; Build options: build flags, source filter 4 | ; Upload options: custom upload port, speed and extra flags 5 | ; Library options: dependencies, extra library storages 6 | ; Advanced options: extra scripting 7 | ; 8 | ; Please visit documentation for the other options and examples 9 | ; https://docs.platformio.org/page/projectconf.html 10 | 11 | [env:ttgo-lora32-v21] 12 | platform = espressif32 13 | board = ttgo-lora32-v21 14 | framework = arduino 15 | lib_deps = 16 | sandeepmistry/LoRa@^0.8.0 17 | akoro/Console@^1.2.1 18 | thingpulse/ESP8266 and ESP32 OLED driver for SSD1306 displays@^4.3.0 19 | fbiego/ESP32Time@^2.0.0 20 | -------------------------------------------------------------------------------- /igate/igateV5/test/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for PlatformIO Test Runner and project tests. 3 | 4 | Unit Testing is a software testing method by which individual units of 5 | source code, sets of one or more MCU program modules together with associated 6 | control data, usage procedures, and operating procedures, are tested to 7 | determine whether they are fit for use. Unit testing finds problems early 8 | in the development cycle. 9 | 10 | More information about PlatformIO Unit Testing: 11 | - https://docs.platformio.org/en/latest/advanced/unit-testing/index.html 12 | -------------------------------------------------------------------------------- /igate/ttgo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f4goh/lora-aprs-esp32/95cf2282bb9f8d09c3f771adb8758d17ec1505a1/igate/ttgo.jpg -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | Install Firmware 13 | 14 | 18 | 19 | 20 | 21 |
22 | 23 |

Install LORA APRS Firmware

24 | 25 |
26 |
    27 |
  1. Connect the ESP device to your computer
    using USB or serial-to-USB adapter
  2. 28 |
  3. Select the firmware variant suitable for
    your device
  4. 29 |
  5. Hit "Install" and select the correct port
    or find help if no device found
  6. 30 |
  7. New send SMS with SMSGTE
  8. 31 |
32 |
33 | 51 |

52 |

53 | 54 | 55 | Your browser does not support Web Serial.
Open this page in Google Chrome or
Microsoft Edge instead 56 | . 57 |
58 |
59 |

60 |
61 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /manifest/blue.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Bluetooth", 3 | "version": "2021.12.0-dev", 4 | "home_assistant_domain": "lora aprs", 5 | "new_install_prompt_erase": true, 6 | "builds": [ 7 | { 8 | "chipFamily": "ESP32", 9 | "parts": [ 10 | { "path": "../firmwares/bluetooth/bootloader.bin", "offset": 4096 }, 11 | { "path": "../firmwares/bluetooth/blue_partitions.bin", "offset": 32768 }, 12 | { "path": "../firmwares/bluetooth/blue_firmware.bin", "offset": 65536 } 13 | ] 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /manifest/igate.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "igate", 3 | "version": "2022.12.0-dev", 4 | "home_assistant_domain": "lora aprs", 5 | "new_install_prompt_erase": true, 6 | "builds": [ 7 | { 8 | "chipFamily": "ESP32", 9 | "parts": [ 10 | { "path": "../firmwares/igate/bootloader.bin", "offset": 4096 }, 11 | { "path": "../firmwares/igate/igate_partitions.bin", "offset": 32768 }, 12 | { "path": "../firmwares/igate/igate_firmware.bin", "offset": 65536 } 13 | ] 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /manifest/igateAnalogique.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "igateAnalogique", 3 | "version": "2024.1.0-dev", 4 | "home_assistant_domain": "esp32 aprs", 5 | "new_install_prompt_erase": true, 6 | "builds": [ 7 | { 8 | "chipFamily": "ESP32", 9 | "parts": [ 10 | { "path": "../firmwares/igateAnalogique/boot.bin", "offset": 57344 }, 11 | { "path": "../firmwares/igateAnalogique/bootloader.bin", "offset": 4096 }, 12 | { "path": "../firmwares/igateAnalogique/partitions.bin", "offset": 32768 }, 13 | { "path": "../firmwares/igateAnalogique/ESP32IGate_V11_OLED.bin", "offset": 65536 } 14 | ] 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /manifest/resetgps.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Reset GPS 1.00", 3 | "version": "2022.1.0-dev", 4 | "home_assistant_domain": "lora aprs", 5 | "new_install_prompt_erase": true, 6 | "builds": [ 7 | { 8 | "chipFamily": "ESP32", 9 | "parts": [ 10 | { "path": "../firmwares/resetgps/bootloader.bin", "offset": 4096 }, 11 | { "path": "../firmwares/resetgps/reset_partitions.bin", "offset": 32768 }, 12 | { "path": "../firmwares/resetgps/reset_firmware.bin", "offset": 65536 } 13 | ] 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /manifest/tracker.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Tracker", 3 | "version": "2022.12.0-dev", 4 | "home_assistant_domain": "lora aprs", 5 | "new_install_prompt_erase": true, 6 | "builds": [ 7 | { 8 | "chipFamily": "ESP32", 9 | "parts": [ 10 | { "path": "../firmwares/tracker/bootloader.bin", "offset": 4096 }, 11 | { "path": "../firmwares/tracker/tracker_partitions.bin", "offset": 32768 }, 12 | { "path": "../firmwares/tracker/tracker_firmware.bin", "offset": 65536 } 13 | ] 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /style.css: -------------------------------------------------------------------------------- 1 | /* 2 | To change this license header, choose License Headers in Project Properties. 3 | To change this template file, choose Tools | Templates 4 | and open the template in the editor. 5 | */ 6 | /* 7 | Created on : 8 janv. 2022, 10:33:52 8 | Author : anthony 9 | */ 10 | div,fieldset,input,select{ 11 | padding:5px; 12 | font-size:1em; 13 | 14 | } 15 | 16 | #prog{ 17 | display:inline-block; 18 | color:#eaeaea; 19 | min-width:340px; 20 | } 21 | 22 | fieldset{ 23 | background:#4f4f4f; 24 | } 25 | 26 | p{ 27 | margin:0.5em 0; 28 | } 29 | input{ 30 | width:100%; 31 | box-sizing:border-box; 32 | -webkit-box-sizing:border-box; 33 | -moz-box-sizing:border-box; 34 | background:#dddddd; 35 | color:#000000; 36 | } 37 | input[type=checkbox],input[type=radio]{ 38 | width:1em; 39 | margin-right:6px; 40 | vertical-align:-1px; 41 | } 42 | input[type=range]{ 43 | width:99%; 44 | } 45 | select{ 46 | width:100%; 47 | background:#dddddd; 48 | color:#000000; 49 | } 50 | textarea{ 51 | resize:vertical; 52 | width:98%; 53 | height:318px; 54 | padding:5px; 55 | overflow:auto; 56 | background:#1f1f1f; 57 | color:#65c115; 58 | } 59 | body{ 60 | text-align:center; 61 | font-family:verdana,sans-serif; 62 | background:#252525; 63 | } 64 | td{ 65 | padding:0px; 66 | } 67 | button{ 68 | border:0; 69 | border-radius:0.3rem; 70 | background:#1fa3ec; 71 | color:#faffff; 72 | line-height:2.4rem; 73 | font-size:1.2rem; 74 | width:100%; 75 | -webkit-transition-duration:0.4s; 76 | transition-duration:0.4s; 77 | cursor:pointer; 78 | } 79 | button:hover{ 80 | background:#0e70a4; 81 | } 82 | .bred{ 83 | background:#d43535; 84 | } 85 | .bred:hover{ 86 | background:#931f1f; 87 | } 88 | .bgrn{ 89 | background:#47c266; 90 | } 91 | .bgrn:hover{ 92 | background:#5aaf6f; 93 | } 94 | a{ 95 | color:#1fa3ec; 96 | text-decoration:none; 97 | } 98 | .p{ 99 | float:left; 100 | text-align:left; 101 | } 102 | .q{ 103 | float:right; 104 | text-align:right; 105 | } 106 | .r{ 107 | border-radius:0.3em; 108 | padding:2px;margin:6px 2px; 109 | } 110 | .pick-variant{ 111 | margin-bottom:16px; 112 | } 113 | -------------------------------------------------------------------------------- /tracker/AXP192-X-Powers.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f4goh/lora-aprs-esp32/95cf2282bb9f8d09c3f771adb8758d17ec1505a1/tracker/AXP192-X-Powers.pdf -------------------------------------------------------------------------------- /tracker/LilyGo_TBeam_V1.1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f4goh/lora-aprs-esp32/95cf2282bb9f8d09c3f771adb8758d17ec1505a1/tracker/LilyGo_TBeam_V1.1.pdf -------------------------------------------------------------------------------- /tracker/Platform_Model.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f4goh/lora-aprs-esp32/95cf2282bb9f8d09c3f771adb8758d17ec1505a1/tracker/Platform_Model.PNG -------------------------------------------------------------------------------- /tracker/README.md: -------------------------------------------------------------------------------- 1 | # Tracker 2 | 3 | ## Automatic installation [firmwares](https://f4goh.github.io/lora-aprs-esp32/index.html) 4 | 5 | [Reset GPS](https://github.com/lora-aprs/TTGO-T-Beam_GPS-reset) 1st on TTGO before programming 6 | 7 | Complementary files 8 | 9 | - AXP192 (power management) 10 | - LilyGo_TBeam_V1.1 schematics 11 | 12 | *** 13 | ## TTGO BOARD 14 | 15 | ![TTGO](TTGO_upper_lower.png "TTGO BOARD") 16 | 17 | *** 18 | 19 | ## TTGO PINOUT 20 | 21 | ![TTGO](TTGO_pinout.png "TTGO PINOUT") 22 | 23 | ## TTGO mechanical dimension 24 | 25 | ![TTGO](TTGO_board.png "mechanical dimension") 26 | 27 | ## TTGO dynamic model 28 | 29 | ![TTGO](Platform_Model.PNG "dynamic model") 30 | 31 | 32 | Serial monitor 115200 Bauds 33 | 34 | ```console 35 | rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) 36 | configsip: 0, SPIWP:0xee 37 | clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 38 | mode:DIO, clock div:2 39 | load:0x3fff0018,len:4 40 | load:0x3fff001c,len:1044 41 | load:0x40078000,len:10124 42 | load:0x40080400,len:5828 43 | entry 0x400806a8 44 | AXP192 init done! 45 | Set SPI pins! 46 | Set LoRa pins! 47 | frequency: 48 | 433775000 49 | LoRa init done! 50 | 51 | >Press m key to enter menu 52 | ..help command for info 53 | 54 | >help 55 | Available commands 56 | Set new callsign : call f4goh-6 57 | Set frequency : freq 433775000 58 | Set car symbol : symbol > 59 | Set second txing into the minute : second 20 60 | Set new comment : comment hello 61 | Set Battery measurement in comment (0 or 1) : setbat 1 62 | Set altitude feild in pdu (0 or 1) : setalt 1 63 | Set Course/Speed feild in pdu (0 or 1) : setcs 1 64 | Set compression position (0 or 1) : setcomp 1 65 | Set dynamic Platform Model : navmod portable 66 | navmod stationary 67 | navmod pedestrian 68 | navmod automotive 69 | navmod sea 70 | navmod airborne1g 71 | navmod airborne2g 72 | navmod airborne4g 73 | navmod wrist 74 | navmod bike 75 | Set SMS (0 :disable, 1 :google, 2 :locator) : setsms 1 76 | Set SMS minutes txing interval : setsmsmin 15 77 | Set SMS phone numer : setsmsph +336xxxxxxxx 78 | Show configuration : show 79 | Reset default configuration : raz 80 | Exit menu : exit 81 | >show 82 | Call is : f4goh-9 83 | Symbol is : b 84 | Frequency is : 433775000 85 | Transmit at second : 20 86 | Battery measurement is : Enable 87 | Altitude is : Enable 88 | Course/Speed is : Disable 89 | Compression is : Disable 90 | Dynamic Platform Model is : airborne1g 91 | SMS feature is : Google place URL 92 | SMS minute interval is : 2 93 | SMS phone is : +336xxxxxxxx 94 | Compression is : Disable 95 | Comment is : hello 96 | >exit 97 | Console exit 98 | Dynamic platform model changed successfully! 99 | The new dynamic model is: airborne1g 100 | 09:00:20 101 | f4goh-9>APLT00,WIDE1-1:!4753.41N/00016.61Eb000/000/A=000249Bat:3.89V/585mA 102 | 09:00:24 103 | 09:00:25 104 | ... 105 | 08:44:56 106 | JN07DV33 107 | F4GOH-9>APLT00,WIDE1-1::SMSGTE :@+336xxxxxxxx https://www.google.fr/maps/place/47.8902,0.2768{18 108 | 08:45:01 109 | ``` 110 | 111 | -------------------------------------------------------------------------------- /tracker/TTGO_board.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f4goh/lora-aprs-esp32/95cf2282bb9f8d09c3f771adb8758d17ec1505a1/tracker/TTGO_board.png -------------------------------------------------------------------------------- /tracker/TTGO_pinout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f4goh/lora-aprs-esp32/95cf2282bb9f8d09c3f771adb8758d17ec1505a1/tracker/TTGO_pinout.png -------------------------------------------------------------------------------- /tracker/TTGO_upper_lower.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f4goh/lora-aprs-esp32/95cf2282bb9f8d09c3f771adb8758d17ec1505a1/tracker/TTGO_upper_lower.png -------------------------------------------------------------------------------- /tracker/lora2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f4goh/lora-aprs-esp32/95cf2282bb9f8d09c3f771adb8758d17ec1505a1/tracker/lora2.png -------------------------------------------------------------------------------- /tracker/test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f4goh/lora-aprs-esp32/95cf2282bb9f8d09c3f771adb8758d17ec1505a1/tracker/test.png -------------------------------------------------------------------------------- /tracker/trackerV3/.gitignore: -------------------------------------------------------------------------------- 1 | .pio 2 | -------------------------------------------------------------------------------- /tracker/trackerV3/include/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for project header files. 3 | 4 | A header file is a file containing C declarations and macro definitions 5 | to be shared between several project source files. You request the use of a 6 | header file in your project source file (C, C++, etc) located in `src` folder 7 | by including it, with the C preprocessing directive `#include'. 8 | 9 | ```src/main.c 10 | 11 | #include "header.h" 12 | 13 | int main (void) 14 | { 15 | ... 16 | } 17 | ``` 18 | 19 | Including a header file produces the same results as copying the header file 20 | into each source file that needs it. Such copying would be time-consuming 21 | and error-prone. With a header file, the related declarations appear 22 | in only one place. If they need to be changed, they can be changed in one 23 | place, and programs that include the header file will automatically use the 24 | new version when next recompiled. The header file eliminates the labor of 25 | finding and changing all the copies as well as the risk that a failure to 26 | find one copy will result in inconsistencies within a program. 27 | 28 | In C, the usual convention is to give header files names that end with `.h'. 29 | It is most portable to use only letters, digits, dashes, and underscores in 30 | header file names, and at most one dot. 31 | 32 | Read more about using header files in official GCC documentation: 33 | 34 | * Include Syntax 35 | * Include Operation 36 | * Once-Only Headers 37 | * Computed Includes 38 | 39 | https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html 40 | -------------------------------------------------------------------------------- /tracker/trackerV3/lib/LoraAprs/LoraAprs.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | 7 | /* 8 | * File: LoraAprs.cpp 9 | * Author: ale 10 | * 11 | * Created on 19 mars 2022, 18:04 12 | */ 13 | 14 | #include "LoraAprs.h" 15 | 16 | LoraAprs::LoraAprs(long _frequency,int _spreadingFactor,long _signalBandwith, int _codingRate,int _txPower): 17 | frequency(_frequency), 18 | spreadingFactor(_spreadingFactor), 19 | signalBandwith(_signalBandwith), 20 | codingRate(_codingRate), 21 | txPower(_txPower) 22 | { 23 | } 24 | 25 | LoraAprs::LoraAprs(const LoraAprs& orig) { 26 | } 27 | 28 | LoraAprs::~LoraAprs() { 29 | } 30 | 31 | void LoraAprs::setup(){ 32 | Serial.println("Set SPI pins!"); 33 | SPI.begin(LORA_SCK, LORA_MISO, LORA_MOSI, LORA_CS); 34 | 35 | Serial.println("Set LoRa pins!"); 36 | setPins(LORA_CS, LORA_RST, LORA_IRQ); 37 | 38 | 39 | Serial.println("frequency: "); 40 | Serial.println(String(frequency)); 41 | if (!begin(frequency)) { 42 | Serial.println("Starting LoRa failed!"); 43 | while (true) { 44 | } 45 | } 46 | setSpreadingFactor(spreadingFactor); 47 | setSignalBandwidth(signalBandwith); 48 | setCodingRate4(codingRate); 49 | enableCrc(); 50 | 51 | setTxPower(txPower);//Config.lora.power); 52 | Serial.println("LoRa init done!"); 53 | } 54 | 55 | void LoraAprs::send(char* msg,int length){ 56 | beginPacket(); 57 | // Header: 58 | write('<'); 59 | write(0xFF); 60 | write(0x01); 61 | // APRS Data: 62 | write((const uint8_t *) msg,length); 63 | endPacket(); 64 | } 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /tracker/trackerV3/lib/LoraAprs/LoraAprs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | 7 | /* 8 | * File: LoraAprs.h 9 | * Author: ale 10 | * 11 | * Created on 19 mars 2022, 18:04 12 | * TRX SX1278 pinout is in pins_arduino.h file (board environement) 13 | * /home/ale/.platformio/packages/framework-arduinoespressif32/variants/tbeam 14 | * // SPI LoRa Radio 15 | * #define LORA_SCK 5 // GPIO5 - SX1276 SCK 16 | * #define LORA_MISO 19 // GPIO19 - SX1276 MISO 17 | * #define LORA_MOSI 27 // GPIO27 - SX1276 MOSI 18 | * #define LORA_CS 18 // GPIO18 - SX1276 CS 19 | * #define LORA_RST 23 // GPIO23 - SX1276 RST 20 | * #define LORA_IRQ 26 // GPIO26 - SX1276 IO0 21 | * #define LORA_IO0 LORA_IRQ // alias 22 | * #define LORA_IO1 33 // GPIO33 - SX1276 IO1 -> wired on pcb AND connected to header pin LORA1 23 | * #define LORA_IO2 32 // GPIO32 - SX1276 IO2 -> wired on pcb AND connected to header pin LORA2 24 | */ 25 | 26 | #ifndef LORAAPRS_H 27 | #define LORAAPRS_H 28 | 29 | #include 30 | #include 31 | 32 | 33 | #define FREQUENCY 433775000 34 | #define SPREADING_FACTOR 12 35 | #define SIGNAL_BANDWIDTH 125000 36 | #define CODING_RATE_4 5 37 | #define TX_POWER 20 38 | 39 | 40 | class LoraAprs : public LoRaClass { 41 | public: 42 | LoraAprs(long _frequency=FREQUENCY, 43 | int _spreadingFactor=SPREADING_FACTOR, 44 | long _signalBandwith=SIGNAL_BANDWIDTH, 45 | int _codingRate=CODING_RATE_4, 46 | int _txPower=TX_POWER); 47 | LoraAprs(const LoraAprs& orig); 48 | virtual ~LoraAprs(); 49 | void setup(); 50 | void send(char* msg,int length); 51 | 52 | 53 | 54 | private: 55 | long frequency; 56 | int spreadingFactor; 57 | long signalBandwith; 58 | int codingRate; 59 | int txPower; 60 | 61 | }; 62 | 63 | #endif /* LORAAPRS_H */ 64 | 65 | -------------------------------------------------------------------------------- /tracker/trackerV3/lib/Menu/Menu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File: Menu.h 3 | * Author: philippe SIMIER Touchard Washington Le Mans 4 | * 5 | * Created on 22 avril 2022, 17:11 6 | */ 7 | 8 | #ifndef MENU_H 9 | #define MENU_H 10 | #include 11 | #include 12 | #include // Classe pour écrire et lire la configuration 13 | 14 | #define FREQUENCY 433775000 15 | #define TIMEOUT_MENU 10 16 | #define NB_DYN_MODES 10 17 | 18 | class Menu { 19 | 20 | public: 21 | Menu(); 22 | Menu(const Menu& orig); 23 | virtual ~Menu(); 24 | 25 | void run(); 26 | void setup(); 27 | String getDynModName(uint8_t model); 28 | 29 | private: 30 | // Méthodes associées aux commandes 31 | static void _call_(ArgList& L, Stream& S); 32 | static void _second_(ArgList& L, Stream& S); 33 | static void _freq_(ArgList& L, Stream& S); 34 | static void _symbol_(ArgList& L, Stream& S); 35 | static void _comment_(ArgList& L, Stream& S); 36 | static void _setbat_(ArgList& L, Stream& S); 37 | static void _setalt_(ArgList& L, Stream& S); 38 | static void _setcs_(ArgList& L, Stream& S); 39 | static void _setcomp_(ArgList& L, Stream& S); 40 | static void _config_(ArgList& L, Stream& S); 41 | static void _raz_(ArgList& L, Stream& S); 42 | static void _exit_(ArgList& L, Stream& S); 43 | static void _help_(ArgList& L, Stream& S); 44 | static void _unknown(String& L, Stream& S); 45 | static void _navmod_(ArgList& L, Stream& S); 46 | static void _setsms_(ArgList& L, Stream& S); 47 | static void _setsmsmin_(ArgList& L, Stream& S); 48 | static void _setsmsph_(ArgList& L, Stream& S); 49 | 50 | bool exitFlag; 51 | Console *con; 52 | Preferences *configuration; 53 | static Menu* anchor; 54 | bool acceptCmd(String cmd, int longMin, int longMax); 55 | String dynModelLst[NB_DYN_MODES]; 56 | }; 57 | 58 | #endif /* MENU_H */ 59 | -------------------------------------------------------------------------------- /tracker/trackerV3/lib/Message/Message.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | 7 | /* 8 | * File: Message.cpp 9 | * Author: ale 10 | * 11 | * Created on 5 décembre 2022, 18:18 12 | */ 13 | 14 | #include "Message.h" 15 | 16 | Message:: Message(String _callsign,String _destination,String _path,String _phone): 17 | callsign(_callsign), 18 | destination(_destination), 19 | path(_path), 20 | phone(_phone), 21 | configuration(new Preferences()) 22 | { 23 | 24 | } 25 | 26 | Message::Message(const Message& orig) { 27 | } 28 | 29 | Message::~Message() { 30 | delete configuration; 31 | } 32 | 33 | int Message::getPduLength() { 34 | return pduLength; 35 | } 36 | 37 | void Message::setPosition(float _latitude, float _longitude) { 38 | latitude=_latitude; 39 | longitude=_longitude; 40 | } 41 | 42 | void Message::setComment(String _comment) { 43 | comment=_comment; 44 | if (comment.length() > 67) { 45 | comment = comment.substring(0, 67); //67 char max 46 | } 47 | } 48 | 49 | void Message::setPhone(String _phone){ 50 | phone=_phone; 51 | } 52 | 53 | void Message::setCallsign(String _callsign){ 54 | callsign=_callsign; 55 | } 56 | 57 | 58 | char* Message::getPduSMS(msgMode mode){ 59 | String header; 60 | int messageId; 61 | if (mode==GOOGLE){ 62 | comment="https://www.google.fr/maps/place/"; //https://www.google.fr/maps/place/48.5643,0.69195 63 | } 64 | 65 | header = callsign + ">" + destination + "," + path + "::SMSGTE :@" + phone + " " + comment; 66 | char messageArray[150]; 67 | header.toCharArray(messageArray, 150); 68 | 69 | configuration->begin("tracker", false); 70 | messageId=configuration->getInt("messageId"); 71 | messageId++; 72 | if (messageId > MAX_MESSAGES_ID) { 73 | messageId = 0; 74 | } 75 | if (mode == GOOGLE) { 76 | snprintf(pdu, sizeof (pdu), "%s%2.4f,%2.4f{%d", messageArray, latitude,longitude,messageId); 77 | } else { 78 | snprintf(pdu, sizeof (pdu), "%s{%d", messageArray, messageId); 79 | } 80 | 81 | configuration->putInt("messageId", messageId); 82 | configuration->end(); 83 | //header.toCharArray(pdu,150); 84 | pduLength = strlen(pdu); 85 | return pdu; 86 | } 87 | 88 | 89 | //https://www.google.fr/maps/place/48.5643,0.69195 90 | /* 91 | 2 messages identiques avec id différent envoyé 92 | 93 | 2 messages différents avec id identique non reçu 94 | 95 | */ -------------------------------------------------------------------------------- /tracker/trackerV3/lib/Message/Message.h: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | 7 | /* 8 | * File: Message.h 9 | * Author: ale 10 | * 11 | * Created on 5 décembre 2022, 18:18 12 | */ 13 | 14 | #ifndef MESSAGE_H 15 | #define MESSAGE_H 16 | 17 | #include 18 | #include 19 | 20 | #define MAX_MESSAGES_ID 99999 21 | 22 | enum msgMode { 23 | FREE_TXT, 24 | GOOGLE 25 | }; 26 | 27 | 28 | 29 | class Message { 30 | public: 31 | Message(String _callsign,String _destination,String _path,String _phone); 32 | Message(const Message& orig); 33 | virtual ~Message(); 34 | 35 | char* getPduSMS(msgMode mode); 36 | int getPduLength(); 37 | void setPosition(float _latitude, float _longitude); 38 | void setComment(String _comment); 39 | void setPhone(String _phone); 40 | void setCallsign(String _callsign); 41 | 42 | 43 | private: 44 | String callsign; 45 | String destination; 46 | String path; 47 | String phone; 48 | Preferences *configuration; 49 | char pdu[150]; 50 | int pduLength; 51 | String comment; 52 | float latitude,longitude; 53 | 54 | 55 | 56 | 57 | }; 58 | 59 | #endif /* MESSAGE_H */ 60 | 61 | -------------------------------------------------------------------------------- /tracker/trackerV3/lib/Position/Position.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File: Position.h 3 | * Author: philippe & Anthony (F4GOH) 4 | * 5 | * Created on 7 août 2021, 08:00 6 | * Modified on 13 août 2021, 18:00 7 | */ 8 | 9 | #ifndef POSITION_H 10 | #define POSITION_H 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | //String _callsign = "", 17 | // 18 | 19 | enum locatorDigits { 20 | QUATRE_DIGITS, 21 | SIX_DIGITS, 22 | HUIT_DIGITS 23 | }; 24 | 25 | 26 | 27 | class Position { 28 | public: 29 | Position (String _callsign, 30 | String _destination, 31 | String _path, 32 | const float _latitude, 33 | const float _longitude, 34 | String _comment = "", 35 | const char _symboleTable = '/', 36 | const char _symbole= '>' 37 | ); 38 | 39 | Position(const Position& orig); 40 | virtual ~Position(); 41 | 42 | char* getPduAprs(bool compressed = false); 43 | void setLatitude(const float _latitude); 44 | void setLongitude(const float _longitude); 45 | void setComment(String _comment); 46 | void setCallsign(String _callsign); 47 | void setDestination(String _destination); 48 | void setPath(String _path); 49 | void setAltitude(const float _alt); 50 | void enableAltitude(bool _altEnable); 51 | void setSymbol(const char _symbole); 52 | void setCourse(const int _course); 53 | void setSpeed(const int _speed); 54 | void enableCourseSpeed(bool _courseSpeedEnable); 55 | char * latlng2loc(locatorDigits nb); 56 | 57 | 58 | int getPduLength(); 59 | 60 | 61 | protected: 62 | void latitude_to_str(); 63 | void longitude_to_str(); 64 | void convBase91(int x, char* base91); 65 | char slat[9]; 66 | char slong[10]; 67 | String callsign; 68 | String destination; 69 | String path; 70 | float latitude; 71 | float longitude; 72 | char symboleTable; 73 | char symbole; 74 | char pdu[150]; 75 | int pduLength; 76 | 77 | 78 | private: 79 | 80 | int alt; 81 | int course; 82 | int speed; 83 | bool courseSpeedEnable; 84 | bool altEnable; 85 | String comment; 86 | char locator[9]; 87 | 88 | void latitude_to_comp_str(); 89 | void longitude_to_comp_str(); 90 | }; 91 | 92 | #endif /* POSITION_H */ -------------------------------------------------------------------------------- /tracker/trackerV3/lib/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for project specific (private) libraries. 3 | PlatformIO will compile them to static libraries and link into executable file. 4 | 5 | The source code of each library should be placed in a an own separate directory 6 | ("lib/your_library_name/[here are source files]"). 7 | 8 | For example, see a structure of the following two libraries `Foo` and `Bar`: 9 | 10 | |--lib 11 | | | 12 | | |--Bar 13 | | | |--docs 14 | | | |--examples 15 | | | |--src 16 | | | |- Bar.c 17 | | | |- Bar.h 18 | | | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html 19 | | | 20 | | |--Foo 21 | | | |- Foo.c 22 | | | |- Foo.h 23 | | | 24 | | |- README --> THIS FILE 25 | | 26 | |- platformio.ini 27 | |--src 28 | |- main.c 29 | 30 | and a contents of `src/main.c`: 31 | ``` 32 | #include 33 | #include 34 | 35 | int main (void) 36 | { 37 | ... 38 | } 39 | 40 | ``` 41 | 42 | PlatformIO Library Dependency Finder will find automatically dependent 43 | libraries scanning project source files. 44 | 45 | More information about PlatformIO Library Dependency Finder 46 | - https://docs.platformio.org/page/librarymanager/ldf.html 47 | -------------------------------------------------------------------------------- /tracker/trackerV3/lib/power_management/power_management.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "power_management.h" 3 | 4 | // cppcheck-suppress uninitMemberVar 5 | PowerManagement::PowerManagement() { 6 | } 7 | 8 | // cppcheck-suppress unusedFunction 9 | bool PowerManagement::begin(TwoWire &port) { 10 | bool result = axp.begin(port, AXP192_SLAVE_ADDRESS); 11 | if (!result) { 12 | axp.setDCDC1Voltage(3300); 13 | } 14 | return result; 15 | } 16 | 17 | // cppcheck-suppress unusedFunction 18 | void PowerManagement::activateLoRa() { 19 | axp.setPowerOutPut(AXP192_LDO2, AXP202_ON); 20 | } 21 | 22 | // cppcheck-suppress unusedFunction 23 | void PowerManagement::deactivateLoRa() { 24 | axp.setPowerOutPut(AXP192_LDO2, AXP202_OFF); 25 | } 26 | 27 | // cppcheck-suppress unusedFunction 28 | void PowerManagement::activateGPS() { 29 | axp.setPowerOutPut(AXP192_LDO3, AXP202_ON); 30 | } 31 | 32 | // cppcheck-suppress unusedFunction 33 | void PowerManagement::deactivateGPS() { 34 | axp.setPowerOutPut(AXP192_LDO3, AXP202_OFF); 35 | } 36 | 37 | // cppcheck-suppress unusedFunction 38 | void PowerManagement::activateOLED() { 39 | axp.setPowerOutPut(AXP192_DCDC1, AXP202_ON); 40 | } 41 | 42 | // cppcheck-suppress unusedFunction 43 | void PowerManagement::decativateOLED() { 44 | axp.setPowerOutPut(AXP192_DCDC1, AXP202_OFF); 45 | } 46 | 47 | // cppcheck-suppress unusedFunction 48 | void PowerManagement::activateMeasurement() { 49 | axp.adc1Enable(AXP202_BATT_CUR_ADC1 | AXP202_BATT_VOL_ADC1, true); 50 | } 51 | 52 | // cppcheck-suppress unusedFunction 53 | void PowerManagement::deactivateMeasurement() { 54 | axp.adc1Enable(AXP202_BATT_CUR_ADC1 | AXP202_BATT_VOL_ADC1, false); 55 | } 56 | 57 | // cppcheck-suppress unusedFunction 58 | double PowerManagement::getBatteryVoltage() { 59 | return axp.getBattVoltage() / 1000.0; 60 | } 61 | 62 | // cppcheck-suppress unusedFunction 63 | double PowerManagement::getBatteryChargeDischargeCurrent() { 64 | if (axp.isChargeing()) { 65 | return axp.getBattChargeCurrent(); 66 | } 67 | return -1.0 * axp.getBattDischargeCurrent(); 68 | } 69 | 70 | bool PowerManagement::isBatteryConnect() { 71 | return axp.isBatteryConnect(); 72 | } 73 | -------------------------------------------------------------------------------- /tracker/trackerV3/lib/power_management/power_management.h: -------------------------------------------------------------------------------- 1 | #ifndef POWER_MANAGEMENT_H_ 2 | #define POWER_MANAGEMENT_H_ 3 | 4 | #include 5 | #include 6 | 7 | class PowerManagement { 8 | public: 9 | PowerManagement(); 10 | bool begin(TwoWire &port); 11 | 12 | void activateLoRa(); 13 | void deactivateLoRa(); 14 | 15 | void activateGPS(); 16 | void deactivateGPS(); 17 | 18 | void activateOLED(); 19 | void decativateOLED(); 20 | 21 | void activateMeasurement(); 22 | void deactivateMeasurement(); 23 | 24 | double getBatteryVoltage(); 25 | double getBatteryChargeDischargeCurrent(); 26 | 27 | bool isBatteryConnect(); 28 | 29 | private: 30 | AXP20X_Class axp; 31 | }; 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /tracker/trackerV3/nbproject/private/CodeAssistancePathMapper.properties: -------------------------------------------------------------------------------- 1 | # Automatic path mapper. CRC = 1 2 | -------------------------------------------------------------------------------- /tracker/trackerV3/nbproject/private/c_standard_headers_indexer.c: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 | * 4 | * Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved. 5 | * 6 | * Oracle and Java are registered trademarks of Oracle and/or its affiliates. 7 | * Other names may be trademarks of their respective owners. 8 | * 9 | * The contents of this file are subject to the terms of either the GNU 10 | * General Public License Version 2 only ("GPL") or the Common 11 | * Development and Distribution License("CDDL") (collectively, the 12 | * "License"). You may not use this file except in compliance with the 13 | * License. You can obtain a copy of the License at 14 | * http://www.netbeans.org/cddl-gplv2.html 15 | * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the 16 | * specific language governing permissions and limitations under the 17 | * License. When distributing the software, include this License Header 18 | * Notice in each file and include the License file at 19 | * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this 20 | * particular file as subject to the "Classpath" exception as provided 21 | * by Oracle in the GPL Version 2 section of the License file that 22 | * accompanied this code. If applicable, add the following below the 23 | * License Header, with the fields enclosed by brackets [] replaced by 24 | * your own identifying information: 25 | * "Portions Copyrighted [year] [name of copyright owner]" 26 | * 27 | * If you wish your version of this file to be governed by only the CDDL 28 | * or only the GPL Version 2, indicate your decision by adding 29 | * "[Contributor] elects to include this software in this distribution 30 | * under the [CDDL or GPL Version 2] license." If you do not indicate a 31 | * single choice of license, a recipient has the option to distribute 32 | * your version of this file under either the CDDL, the GPL Version 2 or 33 | * to extend the choice of license to its licensees as provided above. 34 | * However, if you add GPL Version 2 code and therefore, elected the GPL 35 | * Version 2 license, then the option applies only if the new code is 36 | * made subject to such option by the copyright holder. 37 | * 38 | * Contributor(s): 39 | */ 40 | 41 | // List of standard headers was taken in http://en.cppreference.com/w/c/header 42 | 43 | #include // Conditionally compiled macro that compares its argument to zero 44 | #include // Functions to determine the type contained in character data 45 | #include // Macros reporting error conditions 46 | #include // Limits of float types 47 | #include // Sizes of basic types 48 | #include // Localization utilities 49 | #include // Common mathematics functions 50 | #include // Nonlocal jumps 51 | #include // Signal handling 52 | #include // Variable arguments 53 | #include // Common macro definitions 54 | #include // Input/output 55 | #include // String handling 56 | #include // General utilities: memory management, program utilities, string conversions, random numbers 57 | #include // Time/date utilities 58 | #include // (since C95) Alternative operator spellings 59 | #include // (since C95) Extended multibyte and wide character utilities 60 | #include // (since C95) Wide character classification and mapping utilities 61 | #ifdef _STDC_C99 62 | #include // (since C99) Complex number arithmetic 63 | #include // (since C99) Floating-point environment 64 | #include // (since C99) Format conversion of integer types 65 | #include // (since C99) Boolean type 66 | #include // (since C99) Fixed-width integer types 67 | #include // (since C99) Type-generic math (macros wrapping math.h and complex.h) 68 | #endif 69 | #ifdef _STDC_C11 70 | #include // (since C11) alignas and alignof convenience macros 71 | #include // (since C11) Atomic types 72 | #include // (since C11) noreturn convenience macros 73 | #include // (since C11) Thread library 74 | #include // (since C11) UTF-16 and UTF-32 character utilities 75 | #endif 76 | -------------------------------------------------------------------------------- /tracker/trackerV3/nbproject/private/configurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | LoraAprs.cpp 10 | LoraAprs.h 11 | 12 | 13 | Menu.cpp 14 | Menu.h 15 | 16 | 17 | Message.cpp 18 | Message.h 19 | 20 | 21 | Position.cpp 22 | Position.h 23 | 24 | 25 | power_management.cpp 26 | power_management.h 27 | 28 | 29 | 30 | main.cpp 31 | 32 | 33 | 34 | platformio.ini 35 | 36 | 37 | 38 | 39 | 40 | 41 | localhost 42 | 2 43 | 44 | 45 | 46 | . 47 | ${AUTO_FOLDER} 48 | 49 | ${AUTO_FOLDER} 50 | 51 | ${MAKE} ${ITEM_NAME}.o 52 | ${AUTO_COMPILE} 53 | 54 | ${AUTO_COMPILE} 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | gdb 70 | 71 | 72 | 73 | "${OUTPUT_PATH}" 74 | pio run --target upload 75 | 76 | pio run --target upload 77 | 78 | false 79 | 0 80 | 0 81 | 82 | 83 | 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /tracker/trackerV3/nbproject/private/launcher.properties: -------------------------------------------------------------------------------- 1 | # Launchers File syntax: 2 | # 3 | # [Must-have property line] 4 | # launcher1.runCommand= 5 | # [Optional extra properties] 6 | # launcher1.displayName= 7 | # launcher1.hide= 8 | # launcher1.buildCommand= 9 | # launcher1.runDir= 10 | # launcher1.runInOwnTab= 11 | # launcher1.symbolFiles= 12 | # launcher1.env.= 13 | # (If this value is quoted with ` it is handled as a native command which execution result will become the value) 14 | # [Common launcher properties] 15 | # common.runDir= 16 | # (This value is overwritten by a launcher specific runDir value if the latter exists) 17 | # common.env.= 18 | # (Environment variables from common launcher are merged with launcher specific variables) 19 | # common.symbolFiles= 20 | # (This value is overwritten by a launcher specific symbolFiles value if the latter exists) 21 | # 22 | # In runDir, symbolFiles and env fields you can use these macroses: 23 | # ${PROJECT_DIR} - project directory absolute path 24 | # ${OUTPUT_PATH} - linker output path (relative to project directory path) 25 | # ${OUTPUT_BASENAME}- linker output filename 26 | # ${TESTDIR} - test files directory (relative to project directory path) 27 | # ${OBJECTDIR} - object files directory (relative to project directory path) 28 | # ${CND_DISTDIR} - distribution directory (relative to project directory path) 29 | # ${CND_BUILDDIR} - build directory (relative to project directory path) 30 | # ${CND_PLATFORM} - platform name 31 | # ${CND_CONF} - configuration name 32 | # ${CND_DLIB_EXT} - dynamic library extension 33 | # 34 | # All the project launchers must be listed in the file! 35 | # 36 | # launcher1.runCommand=... 37 | # launcher2.runCommand=... 38 | # ... 39 | # common.runDir=... 40 | # common.env.KEY=VALUE 41 | 42 | # launcher1.runCommand= -------------------------------------------------------------------------------- /tracker/trackerV3/nbproject/private/private.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0 5 | 0 6 | 7 | 8 | 9 | 10 | file:/home/ale/NetBeansProjects/ttgo/trackerV3/lib/Position/Position.cpp 11 | file:/home/ale/NetBeansProjects/ttgo/trackerV3/platformio.ini 12 | file:/home/ale/NetBeansProjects/ttgo/trackerV3/lib/Menu/Menu.cpp 13 | file:/home/ale/NetBeansProjects/ttgo/trackerV3/lib/LoraAprs/LoraAprs.h 14 | file:/home/ale/NetBeansProjects/ttgo/trackerV3/lib/Position/Position.h 15 | file:/home/ale/NetBeansProjects/ttgo/trackerV3/lib/Message/Message.cpp 16 | file:/home/ale/NetBeansProjects/ttgo/trackerV3/src/main.cpp 17 | file:/home/ale/NetBeansProjects/ttgo/trackerV3/lib/Message/Message.h 18 | file:/home/ale/NetBeansProjects/ttgo/trackerV3/lib/Menu/Menu.h 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /tracker/trackerV3/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.cnd.makeproject 4 | 5 | 6 | trackerV3 7 | 8 | cpp 9 | h 10 | UTF-8 11 | 12 | 13 | . 14 | 15 | 16 | 17 | Default 18 | 0 19 | 20 | 21 | 22 | false 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /tracker/trackerV3/platformio.ini: -------------------------------------------------------------------------------- 1 | ; PlatformIO Project Configuration File 2 | ; 3 | ; Build options: build flags, source filter 4 | ; Upload options: custom upload port, speed and extra flags 5 | ; Library options: dependencies, extra library storages 6 | ; Advanced options: extra scripting 7 | ; 8 | ; Please visit documentation for the other options and examples 9 | ; https://docs.platformio.org/page/projectconf.html 10 | 11 | [env:ttgo-t-beam] 12 | platform = espressif32 13 | board = ttgo-t-beam 14 | framework = arduino 15 | lib_deps = 16 | lewisxhe/AXP202X_Library@^1.1.3 17 | sandeepmistry/LoRa@^0.8.0 18 | mikalhart/TinyGPSPlus@^1.0.3 19 | akoro/Console@^1.2.1 20 | sparkfun/SparkFun u-blox Arduino Library@^1.8.11 21 | -------------------------------------------------------------------------------- /tracker/trackerV3/test/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for PlatformIO Test Runner and project tests. 3 | 4 | Unit Testing is a software testing method by which individual units of 5 | source code, sets of one or more MCU program modules together with associated 6 | control data, usage procedures, and operating procedures, are tested to 7 | determine whether they are fit for use. Unit testing finds problems early 8 | in the development cycle. 9 | 10 | More information about PlatformIO Unit Testing: 11 | - https://docs.platformio.org/en/latest/advanced/unit-testing/index.html 12 | -------------------------------------------------------------------------------- /tracker/u-blox8-M8_ReceiverDescrProtSpec_UBX-13003221.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/f4goh/lora-aprs-esp32/95cf2282bb9f8d09c3f771adb8758d17ec1505a1/tracker/u-blox8-M8_ReceiverDescrProtSpec_UBX-13003221.pdf --------------------------------------------------------------------------------