Merge branch 'master' of github.com:SQ9MDD/TTGO-T-Beam-LoRa-APRS into master_sq9mdd

This commit is contained in:
Łukasz Nidecki 2021-04-21 22:28:34 +02:00
commit e3e49dc318
10 changed files with 100 additions and 76 deletions

View File

@ -38,3 +38,16 @@ After connection with APRX based DIGI it can be used as KISS-TNC
* ((FIX TX)) - information about the forced manual sending of a frame with the position saved in the configuration when GPS is off or no fix
* ((AUT TX)) - information about sending automatic positioning frame when GPS is turned off
* ((KISSTX)) - information about sending the frame sent by KISS
## How to binary first flash readme... (thanx SP6VWX)
* Download the appropriate binary file for your board from;
* https://github.com/SQ9MDD/TTGO-T-Beam-LoRa-APRS/releases
* Download current version of the esphome-flasher tool
* https://github.com/esphome/esphome-flasher/releases
* Connect your board to your USB port and open ESPHome Flasher.
* If your board is not showing under Serial Port then you likely need to install the drivers for the CP210X serial chip. In Windows you can check by searching “Device Manager” and ensuring the device is shown under “Ports”.
* In ESPHome Flasher, refresh the serial ports and select your board's serial port.
* Browse to the downloaded firmware and select the correct firmware based on the board type.
* Select/Press Flash ESP.
* Once complete, “Done! Flashing is complete!” will be shown.
* any subsequent updates can be done via WWW

View File

@ -197,7 +197,7 @@
</section>
</div>
<footer>
<center><b>Contributors in order of appearance:</b> OE1ACM, OE3CJB, SQ9MDD, SQ5RWU, DJ1AN, M0IGA, SQ5WPR</center>
<center><b>Contributors in order of appearance:</b> OE1ACM, OE3CJB, SQ9MDD, SQ5RWU, DJ1AN, M0IGA, SQ5WPR, DO2JMG, SP6VWX</center>
<center><b>Latest stable version:</b> <a href=https://github.com/SQ9MDD/TTGO-T-Beam-LoRa-APRS>https://github.com/SQ9MDD/TTGO-T-Beam-LoRa-APRS</a></center>
<center><b>Licensed under:</b> CC BY-NC-SA</center>
<center><!--VERSION--></center>

View File

@ -1,5 +1,4 @@
#include <Arduino.h>
#include "TTGO_T-Beam_LoRa_APRS_config.h"
#include <KISS_TO_TNC2.h>
#if defined(ENABLE_BLUETOOTH)

View File

@ -1,5 +1,4 @@
#include <Arduino.h>
#include "TTGO_T-Beam_LoRa_APRS_config.h"
#include <WiFi.h>
#include <WebServer.h>
#include <ESPmDNS.h>

View File

@ -19,10 +19,8 @@ PROGMEM static const BG_RF95::ModemConfig MODEM_CONFIG_TABLE[] =
{
// 1d, 1e, 26
{ 0x72, 0x74, 0x00}, // Bw125Cr45Sf128 (the chip default)
{ 0x92, 0x74, 0x00}, // Bw500Cr45Sf128
{ 0x48, 0x94, 0x00}, // Bw31_25Cr48Sf512
{ 0x78, 0xc4, 0x00}, // Bw125Cr48Sf4096
{ 0x72, 0xc7, 0x8}, // BG 125 cr45 sf12
{ 0x76, 0x94, 0x04}, // Bw125Cr47Sf512
{ 0x72, 0xb4, 0x00}, // Bw125Cr45Sf2048
{ 0x88, 0xc4, 0x00}, // Bw250Cr48Sf4096
};

View File

@ -543,10 +543,9 @@ public:
typedef enum
{
Bw125Cr45Sf128 = 0, ///< Bw = 125 kHz, Cr = 4/5, Sf = 128chips/symbol, CRC on. Default medium range
Bw500Cr45Sf128, ///< Bw = 500 kHz, Cr = 4/5, Sf = 128chips/symbol, CRC on. Fast+short range
Bw31_25Cr48Sf512, ///< Bw = 31.25 kHz, Cr = 4/8, Sf = 512chips/symbol, CRC on. Slow+long range
Bw125Cr48Sf4096, ///< Bw = 125 kHz, Cr = 4/8, Sf = 4096chips/symbol, CRC on. Slow+long range
Bw125Cr45Sf4096, ///< APRS
Bw125Cr47Sf512, /// 1200 bps
Bw125Cr45Sf2048, ///<Bw = 125 kHz Cr = 4/5, Sf= 2048 chips/symbol, CRC on.
Bw250Cr48Sf4096, ///< Bw = 250 kHz, Cr = 4/8, Sf = 4096chips/symbol, CRC on.
} ModemConfigChoice;

View File

@ -11,55 +11,100 @@
[env]
framework = arduino
monitor_speed = 115200
build_flags = -Wl,--gc-sections,--relax
board_build.partitions = partitions.csv
board_build.embed_files =
board_build.embed_files =
data_embed/index.html.out
data_embed/style.css.out
data_embed/js.js.out
extra_scripts =
extra_scripts =
pre:tools/buildscript_versioning.py
pre:tools/compress_assets.py
lib_deps =
lib_deps =
RadioHead
TinyGPSPlus
Adafruit SSD1306
Adafruit GFX Library
Adafruit Unified Sensor
AXP202X_Library
SparkFun u-blox Arduino Library
https://github.com/SQ9MDD/AXP202X_Library.git
SparkFun u-blox Arduino Library
build_flags =
-Wl,--gc-sections,--relax
-D 'KISS_PROTOCOL'
-D 'CALLSIGN="N0CALL-0"'
-D 'DIGI_PATH="ECHO"'
-D 'FIXED_BEACON_EN'
-D 'LATIDUDE_PRESET="0000.00N"'
-D 'LONGITUDE_PRESET="00000.00E"'
-D 'APRS_SYMBOL_TABLE="/"'
-D 'APRS_SYMBOL="["'
-D 'MY_COMMENT="Lora Tracker"'
-D 'SHOW_ALT'
-D 'SHOW_BATT'
-D 'SHOW_RX_PACKET'
-D 'SHOW_RX_TIME=10000'
-D 'TXFREQ=433.775'
-D 'SPEED_1200' ; comment out to set 300baud
-D 'TXdbmW=20'
-D 'ENABLE_OLED'
-D 'ENABLE_LED_SIGNALING'
-D 'NETWORK_TNC_PORT=8001'
-D 'MAX_TIME_TO_NEXT_TX=360000L'
-D 'FIX_BEACON_INTERVAL=1800000L'
[env:ttgo-t-beam-v1.0]
platform = espressif32 @ 3.0.0
board = ttgo-t-beam
build_flags = ${env.build_flags} -D T_BEAM_V1_0
build_flags =
${env.build_flags}
-D T_BEAM_V1_0
-D ENABLE_WIFI
-D ENABLE_BLUETOOTH
[env:ttgo-t-beam-v0.7]
platform = espressif32 @ 3.0.0
board = ttgo-t-beam
build_flags = ${env.build_flags} -D T_BEAM_V0_7
build_flags =
${env.build_flags}
-D ENABLE_WIFI
-D T_BEAM_V0_7
[env:ttgo-lora32-v2.1]
platform = espressif32 @ 3.1.1
board = ttgo-lora32-v21
build_flags = ${env.build_flags} -D LORA32_21
build_flags =
${env.build_flags}
-D ENABLE_WIFI
-D LORA32_21
[env:ttgo-lora32-v2]
platform = espressif32 @ 3.1.1
board = ttgo-lora32-v2
build_flags = ${env.build_flags} -D LORA32_2
build_flags =
${env.build_flags}
-D ENABLE_WIFI
-D LORA32_2
[env:ttgo-lora32-v1]
platform = espressif32 @ 3.1.1
board = ttgo-lora32-v1
build_flags = ${env.build_flags} -D LORA32_1
build_flags =
${env.build_flags}
-D ENABLE_WIFI
-D LORA32_1
[env:Heltec-WiFi-v1]
platform = espressif32 @ 3.1.1
board = heltec_wifi_kit_32
build_flags = ${env.build_flags} -D HELTEC_V1
build_flags =
${env.build_flags}
-D ENABLE_WIFI
-D HELTEC_V1
[env:Heltec-WiFi-v2]
platform = espressif32 @ 3.1.1
board = heltec_wifi_kit_32_v2
build_flags = ${env.build_flags} -D HELTEC_V2
build_flags =
${env.build_flags}
-D ENABLE_WIFI
-D HELTEC_V2

View File

@ -4,9 +4,8 @@
// TTGO T-Beam v1.0 only
//
// licensed under CC BY-NC-SA
// Includes
#include <TTGO_T-Beam_LoRa_APRS_config.h> // to config user parameters
//#include <TTGO_T-Beam_LoRa_APRS_config.h> // to config user parameters
#include <Arduino.h>
#include <SPI.h>
#include <BG_RF95.h> // library from OE1ACM
@ -34,6 +33,12 @@
// oled address
#define SSD1306_ADDRESS 0x3C
// SPI config
#define SPI_sck 5
#define SPI_miso 19
#define SPI_mosi 27
#define SPI_ss 18
// IO config
#ifdef T_BEAM_V1_0
#define I2C_SDA 21
@ -319,7 +324,11 @@ void loraSend(byte lora_LTXPower, float lora_FREQ, const String &message) {
int messageSize = min(message.length(), sizeof(lora_TXBUFF) - 1);
message.toCharArray((char*)lora_TXBUFF, messageSize + 1, 0);
rf95.setModemConfig(BG_RF95::Bw125Cr45Sf4096);
#ifdef SPEED_1200
rf95.setModemConfig(BG_RF95::Bw125Cr47Sf512);
#else
rf95.setModemConfig(BG_RF95::Bw125Cr45Sf4096);
#endif
rf95.setFrequency(lora_FREQ);
rf95.setTxPower(lora_LTXPower);
rf95.sendAPRS(lora_TXBUFF, messageSize);
@ -453,6 +462,8 @@ void sendTelemetryFrame() {
// + SETUP --------------------------------------------------------------+//
void setup(){
SPI.begin(SPI_sck,SPI_miso,SPI_mosi,SPI_ss); //DO2JMG Heltec Patch
#ifdef BUZZER
ledcSetup(0,1E5,12);
ledcAttachPin(BUZZER,0);
@ -606,6 +617,7 @@ void setup(){
#ifdef T_BEAM_V1_0
if (!axp.begin(Wire, AXP192_SLAVE_ADDRESS)) {
}
axp.setLowTemp(0xFF); //SP6VWX Set low charging temperature
axp.setPowerOutPut(AXP192_LDO2, AXP202_ON); // LoRa
axp.setPowerOutPut(AXP192_LDO3, AXP202_ON); // switch on GPS
axp.setPowerOutPut(AXP192_DCDC2, AXP202_ON);
@ -671,7 +683,11 @@ void setup(){
batt_read();
writedisplaytext("LoRa-APRS","","Init:","ADC OK!","BAT: "+String(BattVolts,1),"");
rf95.setFrequency(433.775);
rf95.setModemConfig(BG_RF95::Bw125Cr45Sf4096); // hard coded because of double definition
#ifdef SPEED_1200
rf95.setModemConfig(BG_RF95::Bw125Cr47Sf512);
#else
rf95.setModemConfig(BG_RF95::Bw125Cr45Sf4096);
#endif
rf95.setTxPower(txPower);
delay(250);
#ifdef KISS_PROTOCOL
@ -731,7 +747,7 @@ void loop() {
if(gps_state == true){
gps_state = false;
#ifdef T_BEAM_V1_0
axp.setPowerOutPut(AXP192_LDO3, AXP202_OFF); // GPS OFF
axp.setPowerOutPut(AXP192_LDO3, AXP202_OFF); // GPS OFF
#endif
writedisplaytext("((GPSOFF))","","","","","");
next_fixed_beacon = millis() + fix_beacon_interval;

View File

@ -1,44 +0,0 @@
// licensed under CC BY-NC-SA
// Please do not edit this file. !!!!!!!
// Configuration shuld be done via www. Default WiFi pasword for AP is: xxxxxxxxxx
#define KISS_PROTOCOL // If enabled send and receive data in SIMPLE KISS format to serial, bluetooth and tcp port
#define CALLSIGN "N0CALL-0" // this option is available via WWW // enter your callsign here - less then 6 letter callsigns please add "spaces" so total length is 6 (without SSID)
#define DIGI_PATH "ECHO" // this option is available via WWW // one hope, please use simple ECHO alias
#define FIXED_BEACON_EN // this option is available via WWW // allows cyclic sending of a bicon when GPS is turned off
#define LATIDUDE_PRESET "0000.00N" // this option is available via WWW // please in APRS notation: DDMM.mmN or DDMM.mmS (used for manual or fixed beacon sending)
#define LONGITUDE_PRESET "00000.00E" // this option is available via WWW // please in APRS notation: DDDMM.mmE or DDDMM.mmW (used for manual or fixed beacon sending)
#define APRS_SYMBOL_TABLE "/" // this option is available via WWW // set primary or secondary symbols table
#define APRS_SYMBOL "[" // this option is available via WWW // other symbols are: "[" => RUNNER, "b" => BICYCLE, "<" => MOTORCYCLE, "R" => Recreation Vehicle
#define MY_COMMENT "Lora Tracker" // this option is available via WWW // add your coment here - if empty then no comment is sent max 64 bytes
#define SHOW_ALT // this option is available via WWW // send Altitude in frame
#define SHOW_BATT // this option is available via WWW // send battery voltage at the end of comment (we need beggining for QSY message format)
#define SHOW_RX_PACKET // this option is available via WWW // uncomment to show received LoRa APS packets for the time given below
#define SHOW_RX_TIME 10000 // this option is available via WWW // show RX packet for milliseconds (5000 = 5secs)
#define TXFREQ 433.775 // Set transmit frequency in MHz
#define TXdbmW 20 // Set transmit power in dBm 17-50mW, 18-63mW, 19-80mW, 20-100mW
#define ENABLE_OLED // this option is available via WWW // enable oled
#define ENABLE_LED_SIGNALING // enable red and blue led signalling
//#define ENABLE_TNC_SELF_TELEMETRY //
// #define LOCAL_KISS_ECHO // echoing KISS frame back
//#define KISS_DEBUG //
#define NETWORK_TNC_PORT 8001 // Set KISS TCP Port
//#define ENABLE_WIFI_CLIENT_DEBUG //
#define MAX_TIME_TO_NEXT_TX 360000L // TRANSMIT INTERVAL set here MAXIMUM time in ms(!) for smart beaconing - minimum time is always 1 min = 60 secs = 60000L !!!
#define FIX_BEACON_INTERVAL 1800000L // Fixed beacon interwal (when GPS is disabled and FIXED_BEACON_EN is enabled) 30min default
//#define TNC_SELF_TELEMETRY_INTERVAL (5 * 60 * 1000) //
#ifdef T_BEAM_V1_0
#define ENABLE_WIFI // enable WiFi conection do not turn off
#define ENABLE_BLUETOOTH // if enabled here this option is available via WWW // bluetooth KISS interface enabl
//#define BLUETOOTH_PIN "0000" // bluetooth pairing pin
#elif T_BEAM_V0_7
#define ENABLE_WIFI // enable WiFi conection do not turn off
#define ENABLE_BLUETOOTH // if enabled here this option is available via WWW // bluetooth KISS interface enabl
//#define BLUETOOTH_PIN "0000" // bluetooth pairing pin
#else
#define ENABLE_WIFI // enable WiFi conection
//#define ENABLE_BLUETOOTH // Lora32 board WiFi or Bluetooth
//#define BLUETOOTH_PIN "0000" // bluetooth pairing pin
#endif

View File

@ -1,5 +1,4 @@
#include <taskGPS.h>
#include "TTGO_T-Beam_LoRa_APRS_config.h"
#include <SparkFun_Ublox_Arduino_Library.h>
SFE_UBLOX_GPS myGPS;
@ -25,11 +24,11 @@ void taskGPS(void *parameter) {
if(myGPS.begin(gpsSerial)){
myGPS.setUART1Output(COM_TYPE_NMEA); //Set the UART port to output NMEA only
//myGPS.saveConfiguration(); //Save the current settings to flash and BBR
myGPS.disableNMEAMessage(UBX_NMEA_GLL, COM_PORT_UART1);
myGPS.disableNMEAMessage(UBX_NMEA_GSA, COM_PORT_UART1);
myGPS.disableNMEAMessage(UBX_NMEA_GSV, COM_PORT_UART1);
myGPS.disableNMEAMessage(UBX_NMEA_VTG, COM_PORT_UART1);
myGPS.disableNMEAMessage(UBX_NMEA_RMC, COM_PORT_UART1);
myGPS.enableNMEAMessage(UBX_NMEA_GLL, COM_PORT_UART1);
myGPS.enableNMEAMessage(UBX_NMEA_GSA, COM_PORT_UART1);
myGPS.enableNMEAMessage(UBX_NMEA_GSV, COM_PORT_UART1);
myGPS.enableNMEAMessage(UBX_NMEA_VTG, COM_PORT_UART1);
myGPS.enableNMEAMessage(UBX_NMEA_RMC, COM_PORT_UART1);
myGPS.enableNMEAMessage(UBX_NMEA_GGA, COM_PORT_UART1);
//myGPS.saveConfiguration(); //Save the current settings to flash and BBR
delay(1000);