overlay + new Symbols + callsign validation
This commit is contained in:
parent
232b7c65a2
commit
1a2535b6db
|
|
@ -3,6 +3,7 @@
|
|||
{
|
||||
"callsign": "NOCALL-7",
|
||||
"symbol": "[",
|
||||
"overlay": "/",
|
||||
"comment": "",
|
||||
"smart_beacon": {
|
||||
"active": true,
|
||||
|
|
@ -19,6 +20,7 @@
|
|||
{
|
||||
"callsign": "NOCALL-7",
|
||||
"symbol": ">",
|
||||
"overlay": "/",
|
||||
"comment": "",
|
||||
"smart_beacon": {
|
||||
"active": true,
|
||||
|
|
@ -35,6 +37,7 @@
|
|||
{
|
||||
"callsign": "NOCALL-7",
|
||||
"symbol": "j",
|
||||
"overlay": "/",
|
||||
"comment": "",
|
||||
"smart_beacon": {
|
||||
"active": true,
|
||||
|
|
@ -61,7 +64,6 @@
|
|||
"sendCommentAfterXBeacons": 10,
|
||||
"displayEcoMode": false,
|
||||
"displayTimeout": 4,
|
||||
"overlay": "/",
|
||||
"path": "WIDE1-1",
|
||||
"nonSmartBeaconRate": 15,
|
||||
"rememberStationTime": 30,
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ TinyGPSPlus gps;
|
|||
NimBLECharacteristic* pCharacteristic;
|
||||
OneButton userButton = OneButton(BUTTON_PIN, true, true);
|
||||
|
||||
String versionDate = "2023.07.18";
|
||||
String versionDate = "2023.07.24";
|
||||
|
||||
int myBeaconsIndex = 0;
|
||||
int myBeaconsSize = Config.beacons.size();
|
||||
|
|
@ -75,8 +75,6 @@ void setup() {
|
|||
logger.log(logging::LoggerLevel::LOGGER_LEVEL_INFO, "Main", "RichonGuzman -> CD2RXU --> LoRa APRS Tracker/Station");
|
||||
logger.log(logging::LoggerLevel::LOGGER_LEVEL_INFO, "Main", "Version: %s", versionDate);
|
||||
|
||||
Config.validateConfigFile(currentBeacon->callsign);
|
||||
|
||||
if (Config.ptt.active) {
|
||||
pinMode(Config.ptt.io_pin, OUTPUT);
|
||||
digitalWrite(Config.ptt.io_pin, Config.ptt.reverse ? HIGH : LOW);
|
||||
|
|
@ -104,6 +102,9 @@ void setup() {
|
|||
|
||||
void loop() {
|
||||
currentBeacon = &Config.beacons[myBeaconsIndex];
|
||||
if (statusState) {
|
||||
Config.validateConfigFile(currentBeacon->callsign);
|
||||
}
|
||||
|
||||
powerManagement.batteryManager();
|
||||
userButton.tick();
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ void Configuration::readFile(fs::FS &fs, const char *fileName) {
|
|||
|
||||
bcn.callsign = BeaconsArray[i]["callsign"].as<String>();
|
||||
bcn.symbol = BeaconsArray[i]["symbol"].as<String>();
|
||||
bcn.overlay = BeaconsArray[i]["overlay"].as<String>();
|
||||
bcn.comment = BeaconsArray[i]["comment"].as<String>();
|
||||
|
||||
bcn.smartBeaconState = BeaconsArray[i]["smart_beacon"]["active"].as<bool>();
|
||||
|
|
@ -60,7 +61,6 @@ void Configuration::readFile(fs::FS &fs, const char *fileName) {
|
|||
sendCommentAfterXBeacons = data["other"]["sendCommentAfterXBeacons"].as<int>();
|
||||
displayEcoMode = data["other"]["displayEcoMode"].as<bool>();
|
||||
displayTimeout = data["other"]["displayTimeout"].as<int>();
|
||||
overlay = data["other"]["overlay"].as<String>();
|
||||
path = data["other"]["path"].as<String>();
|
||||
nonSmartBeaconRate = data["other"]["nonSmartBeaconRate"].as<int>();
|
||||
rememberStationTime = data["other"]["rememberStationTime"].as<int>();
|
||||
|
|
@ -74,8 +74,8 @@ void Configuration::readFile(fs::FS &fs, const char *fileName) {
|
|||
|
||||
void Configuration::validateConfigFile(String currentBeaconCallsign) {
|
||||
if (currentBeaconCallsign.indexOf("NOCALL") != -1) {
|
||||
logger.log(logging::LoggerLevel::LOGGER_LEVEL_ERROR, "Config", "Change your settings in 'data/tracker_config.json' and upload it via 'Upload File System image'");
|
||||
show_display("ERROR", "Change your settings", "'tracker_config.json'", "upload it via --> ", "'Upload File System image'");
|
||||
logger.log(logging::LoggerLevel::LOGGER_LEVEL_ERROR, "Config", "Change all your callsigns in 'data/tracker_config.json' and upload it via 'Upload File System image'");
|
||||
show_display("ERROR", "Change all callsigns!", "'tracker_config.json'", "upload it via --> ", "'Upload File System image'");
|
||||
while (true) {
|
||||
delay(1000);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ class Beacon {
|
|||
public:
|
||||
String callsign;
|
||||
String symbol;
|
||||
String overlay;
|
||||
String comment;
|
||||
bool smartBeaconState;
|
||||
int slowRate;
|
||||
|
|
@ -50,7 +51,6 @@ public:
|
|||
int sendCommentAfterXBeacons;
|
||||
bool displayEcoMode;
|
||||
int displayTimeout;
|
||||
String overlay;
|
||||
String path;
|
||||
int nonSmartBeaconRate;
|
||||
int rememberStationTime;
|
||||
|
|
|
|||
|
|
@ -55,20 +55,37 @@ static const unsigned char jeepSymbol[] PROGMEM = {
|
|||
};
|
||||
|
||||
static const unsigned char bikeSymbol[] PROGMEM = {
|
||||
0b00011100, 0b00000000,
|
||||
0b00001000, 0b00000000,
|
||||
0b00000100, 0b01111100,
|
||||
0b00001111, 0b10100100,
|
||||
0b00001010, 0b00100100,
|
||||
0b00010010, 0b00010000,
|
||||
0b00100001, 0b00011000,
|
||||
0b00111101, 0b00111100,
|
||||
0b01000010, 0b11000010,
|
||||
0b01000010, 0b01000010,
|
||||
0b00100100, 0b00100100,
|
||||
0b00011000, 0b00011000,
|
||||
0b00000000, 0b00000000,
|
||||
0b00000000, 0b00000000
|
||||
0b00000001, 0b10000000,
|
||||
0b00000011, 0b11000000,
|
||||
0b00000001, 0b10000000,
|
||||
0b00000011, 0b10000000,
|
||||
0b00000111, 0b11000000,
|
||||
0b00001110, 0b11100000,
|
||||
0b00001110, 0b01111000,
|
||||
0b00011111, 0b11010000,
|
||||
0b00110111, 0b00101100,
|
||||
0b01001011, 0b10010010,
|
||||
0b10110101, 0b11101101,
|
||||
0b10110111, 0b10101101,
|
||||
0b01001001, 0b10010010,
|
||||
0b00110000, 0b00001100
|
||||
};
|
||||
|
||||
static const unsigned char motorcycleSymbol[] PROGMEM = {
|
||||
0b00000001, 0b10000000,
|
||||
0b00000011, 0b11000000,
|
||||
0b00000001, 0b10000000,
|
||||
0b00000011, 0b10000000,
|
||||
0b00000111, 0b11001000,
|
||||
0b00001110, 0b11100100,
|
||||
0b11101110, 0b01111110,
|
||||
0b01111111, 0b11111110,
|
||||
0b00110111, 0b00101100,
|
||||
0b01001011, 0b10010010,
|
||||
0b10110101, 0b11101101,
|
||||
0b11111111, 0b10101101,
|
||||
0b01001001, 0b10010010,
|
||||
0b00110000, 0b00001100
|
||||
};
|
||||
|
||||
/*static const unsigned char noSymbol[] PROGMEM = {
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@
|
|||
#include <Adafruit_GFX.h>
|
||||
#include <logger.h>
|
||||
#include <Wire.h>
|
||||
#include "custom_characters.h"
|
||||
#include "configuration.h"
|
||||
#include "pins_config.h"
|
||||
#include "display.h"
|
||||
|
||||
#include "configuration.h"
|
||||
#include "custom_characters.h"
|
||||
#define SYM_HEIGHT 14
|
||||
#define SYM_WIDTH 16
|
||||
|
||||
|
|
@ -16,9 +16,9 @@ extern Beacon *currentBeacon;
|
|||
extern int menuDisplay;
|
||||
extern bool symbolAvailable;
|
||||
|
||||
String symbolArray[5] = {"[", ">", "j", "b"};
|
||||
String symbolArray[5] = {"[", ">", "j", "b", "<"};
|
||||
int symbolArraySize = sizeof(symbolArray)/sizeof(symbolArray[0]);
|
||||
const uint8_t *symbolsAPRS[] = {runnerSymbol, carSymbol, jeepSymbol, bikeSymbol};
|
||||
const uint8_t *symbolsAPRS[] = {runnerSymbol, carSymbol, jeepSymbol, bikeSymbol, motorcycleSymbol};
|
||||
|
||||
// T-Beams bought with soldered OLED Screen comes with only 4 pins (VCC, GND, SDA, SCL)
|
||||
// If your board didn't come with 4 pins OLED Screen and comes with 5 and one of them is RST...
|
||||
|
|
|
|||
|
|
@ -386,7 +386,7 @@ void sendBeacon() {
|
|||
if (Config.path != "") {
|
||||
packet += "," + Config.path;
|
||||
}
|
||||
packet += ":!" + Config.overlay;
|
||||
packet += ":!" + currentBeacon->overlay;
|
||||
packet += GPS_Utils::encondeGPS();
|
||||
|
||||
if (currentBeacon->comment != "") {
|
||||
|
|
|
|||
Loading…
Reference in New Issue