Moving config to platformio.ini.

Set baud rate to 1200
pull/30/head
Rysiek Labus 2021-04-21 20:32:49 +02:00
parent fdde545a97
commit cd1a4c4252
8 changed files with 68 additions and 67 deletions

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,7 +11,6 @@
[env]
framework = arduino
monitor_speed = 115200
build_flags = -Wl,--gc-sections,--relax
board_build.partitions = partitions.csv
board_build.embed_files =
data_embed/index.html.out
@ -27,39 +26,85 @@ lib_deps =
Adafruit GFX Library
Adafruit Unified Sensor
https://github.com/SQ9MDD/AXP202X_Library.git
SparkFun u-blox Arduino Library
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'
-D 'TXdbmW=0'
-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
platform = espressif32 @ 3.1.1
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,10 +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
@ -326,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);
@ -681,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

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;