Skip to content

Commit

Permalink
json config file / multi ssid / oled improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
roema committed Mar 7, 2021
1 parent 97dcd4f commit b96cbcc
Show file tree
Hide file tree
Showing 37 changed files with 9,141 additions and 8,720 deletions.
924 changes: 463 additions & 461 deletions ognbase/APRS.cpp

Large diffs are not rendered by default.

225 changes: 112 additions & 113 deletions ognbase/APRS.h
Original file line number Diff line number Diff line change
@@ -1,113 +1,112 @@
/*
* OGN.h
* Copyright (C) 2020 Manuel Rösel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include <string.h>
#include "SoC.h"


#ifndef OGNHELPER_H
#define OGNHELPER_H

//LKHS>APRS,TCPIP*,qAC,GLIDERN2:/211635h4902.45NI01429.51E&000/000/A=001689

struct aprs_reg_packet
{
String origin;
String callsign;
String timestamp;
String lat_deg;
String lat_min;
String lon_deg;
String lon_min;
String alt;
};

struct aprs_login_packet // user OGN123456 pass 12345 vers DemoApp 0.0.0 filter m/10
{
String user;
String pass;
String appname;
String version;
};

// LKHS>APRS,TCPIP*,qAC,GLIDERN2:>211635h v0.2.6.ARM CPU:0.2 RAM:777.7/972.2MB NTP:3.1ms/-3.8ppm 4.902V 0.583A +33.6C
struct aprs_stat_packet
{
String origin;
String callsign;
String timestamp;
String platform;
String cpu_usage;
String ram_max;
String ram_usage;
String realtime_clock;
String board_voltage;
String board_amperage;
String cpu_temperature;
};

// FLRDF0A52>APRS,qAS,LSTB:/220132h4658.70N/00707.72Ez090/054/A=001424 !W37! id06DF0A52 +020fpm +0.0rot 55.2dB 0e -6.2kHz gps4x6 s6.01 h03 rDDACC4 +5.0dBm hearD7EA hearDA95
struct aprs_airc_packet
{
String callsign;
String rec_callsign;
String timestamp;
String lat_deg;
String lat_min;
String lon_deg;
String lon_min;
String alt;
String heading;
String ground_speed;
String pos_precision;
String symbol_table;
String symbol;
String climbrate;
String sender_details;
String snr;
};

enum
{
OGN_OFF,
OGN_ON,
};

static bool OGN_APRS_Connect();

static bool OGN_APRS_DisConnect();


void OGN_APRS_Export();

void OGN_APRS_Weather();

int OGN_APRS_Register(ufo_t* this_aircraft);

void OGN_APRS_KeepAlive();

bool OGN_APRS_check_Wifi();

void OGN_APRS_Status(ufo_t* this_aircraft);

static int OGN_APRS_check_reg(String *);

int OGN_APRS_check_messages();

extern String ogn_callsign;
#endif /* OGNHELPER_H */
/*
* OGN.h
* Copyright (C) 2020 Manuel Rösel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include <string.h>
#include "SoC.h"


#ifndef OGNHELPER_H
#define OGNHELPER_H

//LKHS>APRS,TCPIP*,qAC,GLIDERN2:/211635h4902.45NI01429.51E&000/000/A=001689

struct aprs_reg_packet
{
String origin;
String callsign;
String timestamp;
String lat_deg;
String lat_min;
String lon_deg;
String lon_min;
String alt;
};

struct aprs_login_packet // user OGN123456 pass 12345 vers DemoApp 0.0.0 filter m/10
{
String user;
String pass;
String appname;
String version;
};

// LKHS>APRS,TCPIP*,qAC,GLIDERN2:>211635h v0.2.6.ARM CPU:0.2 RAM:777.7/972.2MB NTP:3.1ms/-3.8ppm 4.902V 0.583A +33.6C
struct aprs_stat_packet
{
String origin;
String callsign;
String timestamp;
String platform;
String cpu_usage;
String ram_max;
String ram_usage;
String realtime_clock;
String board_voltage;
String board_amperage;
String cpu_temperature;
};

// FLRDF0A52>APRS,qAS,LSTB:/220132h4658.70N/00707.72Ez090/054/A=001424 !W37! id06DF0A52 +020fpm +0.0rot 55.2dB 0e -6.2kHz gps4x6 s6.01 h03 rDDACC4 +5.0dBm hearD7EA hearDA95
struct aprs_airc_packet
{
String callsign;
String rec_callsign;
String timestamp;
String lat_deg;
String lat_min;
String lon_deg;
String lon_min;
String alt;
String heading;
String ground_speed;
String pos_precision;
String symbol_table;
String symbol;
String climbrate;
String sender_details;
String snr;
};

enum
{
OGN_OFF,
OGN_ON,
};

static bool OGN_APRS_Connect();

static bool OGN_APRS_DisConnect();


void OGN_APRS_Export();

void OGN_APRS_Weather();

int OGN_APRS_Register(ufo_t* this_aircraft);

void OGN_APRS_KeepAlive();

bool OGN_APRS_check_Wifi();

void OGN_APRS_Status(ufo_t* this_aircraft);

static int OGN_APRS_check_reg(String *);

int OGN_APRS_check_messages();

#endif /* OGNHELPER_H */
3 changes: 2 additions & 1 deletion ognbase/D1090.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "GDL90.h"
#include "EEPROM.h"
#include "Traffic.h"
#include "global.h"

#define ADDR_TO_HEX_STR(s, c) (s += ((c) < 0x10 ? "0" : "") + String((c), HEX))

Expand Down Expand Up @@ -75,7 +76,7 @@ void D1090_Export()
{
distance = Container[i].distance;

if (distance < settings->range)
if (distance < ogn_range)
{
double altitude;
/* If the aircraft's data has standard pressure altitude - make use it */
Expand Down
44 changes: 22 additions & 22 deletions ognbase/EEPROM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ void EEPROM_setup()

void EEPROM_defaults()
{
eeprom_block.field.magic = SOFTRF_EEPROM_MAGIC;
eeprom_block.field.version = SOFTRF_EEPROM_VERSION;
eeprom_block.field.settings.mode = SOFTRF_MODE_GROUND;
eeprom_block.field.settings.rf_protocol = RF_PROTOCOL_OGNTP;
eeprom_block.field.settings.rf_protocol2 = RF_PROTOCOL_LEGACY;
eeprom_block.field.settings.band = RF_BAND_EU;
eeprom_block.field.magic = SOFTRF_EEPROM_MAGIC;
eeprom_block.field.version = SOFTRF_EEPROM_VERSION;
eeprom_block.field.settings.mode = SOFTRF_MODE_GROUND;
//eeprom_block.field.settings.rf_protocol = RF_PROTOCOL_OGNTP;
//eeprom_block.field.settings.rf_protocol2 = RF_PROTOCOL_LEGACY;
//eeprom_block.field.settings.band = RF_BAND_EU;
eeprom_block.field.settings.aircraft_type = AIRCRAFT_TYPE_GLIDER;
eeprom_block.field.settings.txpower = RF_TX_POWER_FULL;
eeprom_block.field.settings.bluetooth = BLUETOOTH_OFF;
Expand All @@ -110,22 +110,22 @@ void EEPROM_defaults()
eeprom_block.field.settings.nmea_out = NMEA_OFF;
#endif

eeprom_block.field.settings.gdl90 = GDL90_OFF;
eeprom_block.field.settings.d1090 = D1090_OFF;
eeprom_block.field.settings.json = JSON_OFF;
eeprom_block.field.settings.stealth = false;
eeprom_block.field.settings.no_track = false;
eeprom_block.field.settings.power_save = POWER_SAVE_NONE;
eeprom_block.field.settings.freq_corr = 0;
eeprom_block.field.settings.range = 10;
eeprom_block.field.settings.sxlna = true;
eeprom_block.field.settings.ogndebug = false;
eeprom_block.field.settings.ogndebugp = 12000;
eeprom_block.field.settings.ignore_stealth = false;
eeprom_block.field.settings.ignore_no_track = false;
eeprom_block.field.settings.sleep_mode = 0;
eeprom_block.field.settings.sleep_after_rx_idle = 3600;
eeprom_block.field.settings.wake_up_timer = 3600;
eeprom_block.field.settings.gdl90 = GDL90_OFF;
eeprom_block.field.settings.d1090 = D1090_OFF;
eeprom_block.field.settings.json = JSON_OFF;
eeprom_block.field.settings.stealth = false;
eeprom_block.field.settings.no_track = false;
eeprom_block.field.settings.power_save = POWER_SAVE_NONE;
eeprom_block.field.settings.freq_corr = 0;
//eeprom_block.field.settings.range = 10;
//eeprom_block.field.settings.sxlna = true;
//eeprom_block.field.settings.ogndebug = false;
//eeprom_block.field.settings.ogndebugp = 12000;
//eeprom_block.field.settings.ignore_stealth = false;
//eeprom_block.field.settings.ignore_no_track = false;
//eeprom_block.field.settings.sleep_mode = 0;
//eeprom_block.field.settings.sleep_after_rx_idle = 3600;
//eeprom_block.field.settings.wake_up_timer = 3600;
}

void EEPROM_store()
Expand Down
26 changes: 13 additions & 13 deletions ognbase/EEPROM.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
typedef struct Settings
{
uint8_t mode;
uint8_t rf_protocol;
uint8_t band;
//uint8_t rf_protocol;
//uint8_t band;
uint8_t aircraft_type;
uint8_t txpower;
uint8_t volume;
Expand All @@ -57,17 +57,17 @@ typedef struct Settings

uint8_t power_save;
int8_t freq_corr; /* +/-, kHz */
int16_t range; /*OGN Basestation max Range*/
bool sxlna; /*SX1276 agcref settings*/
bool ogndebug; /*debug on*/
uint16_t ogndebugp; /*debug port*/
bool ignore_stealth;
bool ignore_no_track;
uint8_t rf_protocol2;
uint8_t sleep_mode;
uint16_t sleep_after_rx_idle;
uint16_t wake_up_timer;
bool zabbix_en;
//int16_t range; /*OGN Basestation max Range*/
//bool sxlna; /*SX1276 agcref settings*/
//bool ogndebug; /*debug on*/
//uint16_t ogndebugp; /*debug port*/
//bool ignore_stealth;
//bool ignore_no_track;
//uint8_t rf_protocol2;
//uint8_t sleep_mode;
//uint16_t sleep_after_rx_idle;
//uint16_t wake_up_timer;
//bool zabbix_en;
} settings_t;

typedef struct EEPROM_S
Expand Down
Loading

0 comments on commit b96cbcc

Please sign in to comment.