changes to make it working back on ParaTNC targer

master
Mateusz Lubecki 2023-08-09 11:00:43 +02:00
rodzic 1b115e0b7b
commit d89d477de6
13 zmienionych plików z 160 dodań i 57 usunięć

Wyświetl plik

@ -20,6 +20,7 @@ C_SRCS += \
../src/rte_pwr.c \
../src/rte_rtu.c \
../src/rte_wx.c \
../src/software_version.c \
../src/wx_handler.c \
../src/wx_handler_humidity.c \
../src/wx_handler_pressure.c \
@ -43,6 +44,7 @@ OBJS += \
./src/rte_pwr.o \
./src/rte_rtu.o \
./src/rte_wx.o \
./src/software_version.o \
./src/wx_handler.o \
./src/wx_handler_humidity.o \
./src/wx_handler_pressure.o \
@ -66,6 +68,7 @@ C_DEPS += \
./src/rte_pwr.d \
./src/rte_rtu.d \
./src/rte_wx.d \
./src/software_version.d \
./src/wx_handler.d \
./src/wx_handler_humidity.d \
./src/wx_handler_pressure.d \

Wyświetl plik

@ -12,6 +12,7 @@ C_SRCS += \
../system/src/aprs/crc.c \
../system/src/aprs/dac.c \
../system/src/aprs/digi.c \
../system/src/aprs/status.c \
../system/src/aprs/telemetry.c \
../system/src/aprs/wx.c
@ -24,6 +25,7 @@ OBJS += \
./system/src/aprs/crc.o \
./system/src/aprs/dac.o \
./system/src/aprs/digi.o \
./system/src/aprs/status.o \
./system/src/aprs/telemetry.o \
./system/src/aprs/wx.o
@ -36,6 +38,7 @@ C_DEPS += \
./system/src/aprs/crc.d \
./system/src/aprs/dac.d \
./system/src/aprs/digi.d \
./system/src/aprs/status.d \
./system/src/aprs/telemetry.d \
./system/src/aprs/wx.d

Wyświetl plik

@ -58,6 +58,6 @@
<listEntry value="4"/>
</listAttribute>
<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;memoryBlockExpressionList context=&quot;Context string&quot;/&gt;&#10;"/>
<stringAttribute key="org.eclipse.embedcdt.debug.gdbjtag.core.PERIPHERALS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;peripherals/&gt;&#10;"/>
<stringAttribute key="org.eclipse.embedcdt.debug.gdbjtag.core.PERIPHERALS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;peripherals&gt;&#10; &lt;peripheral name=&quot;ADC1&quot;/&gt;&#10;&lt;/peripherals&gt;&#10;"/>
<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
</launchConfiguration>

Wyświetl plik

@ -10,8 +10,8 @@
//#define _POWERSAVE_NORMAL
//#define _POWERSAVE_AGGRESIVE
/* ------------------ */
/* MODES OF OPERATION */
//!< ---------------------------
//!< MODES OF OPERATION
#define _METEO // Enable meteo station
@ -19,22 +19,21 @@
#define _DIGI_VISCOUS
//#define _DIGI_ONLY_789 // Limit digipeater to handle only -7, -8 and -9 SSIDs
//#define _GSM // only for ParaMETEO
#define _GSM // only for ParaMETEO
//#define _GSM_KEEP_MODEM_ALWAYS_ON
#define _WX_DOUBLE_TRANSMIT
/* MODES OF OPERATION */
/* ------------------ */
//!< MODES OF OPERATION
//!< ---------------------------
/**
* Enable support for Victron VE.Direct protocol. This is independent from wx sensor configuration
*/
//#define _VICTRON
/* ---------------------------- */
/* WEATHER/METEO CONFIGURATION */
//!< ---------------------------
//!< WEATHER/METEO CONFIGURATION
/**
* Three defines below enables or disabled listed communication drivers. Enabling any of then doesn't means
@ -54,10 +53,6 @@
// May be used even if _METEO is not enabled
#define _DALLAS_SPLIT_PIN // Must be enabled for all ParaTNC hardware revisions
/* WEATHER/METEO CONFIGURATION */
/* ---------------------------- */
/******** INTERNAL SENSORS CONFIGURATION *****************/
//#define _ANEMOMETER_TX20 // Use TX20 as an internal anemometer
@ -104,9 +99,12 @@
//#define _WIND_DAVIS
/*************** DATA SOURCES CONFIG ***********************/
//!< WEATHER/METEO CONFIGURATION
//!< ---------------------------
/* WEATHER/METEO CONFIGURATION */
/* ---------------------------- */
//!< -------------------------------------
//!< BASIC CONFIG - CALLSIGN, LOCATION etc
//#define _MUTE_RF // TODO: Not yet implemented - This will make station RXonly and disable all data transmission
//#define _MUTE_OWN // TODO: Not yet implemented - This will disable all self-generated packets (wx, telemetry, beacon)
@ -119,14 +117,14 @@
#define _LATNS 'N'
#define _LON 01919.18
#define _LONWE 'E'
#define _COMMENT "DigiW1 + WX = TXPower 1W = Pilsko, wyciag orczykowy VII, 1400m AMSL = sp8ebc@interia.pl"
#define _COMMENT "DigiW1 + WX = TXPower 1W = Pilsko, wyciag orczykowy VII, 1440m AMSL = sp8ebc@interia.pl"
// You can use only one of these below defines to choose symbol. Meteo data are are always transmitted with blue WX symbol
//#define _SYMBOL_DIGI // uncomment if you want digi symbol(green star with D inside)
#define _SYMBOL_WIDE1_DIGI // uncomment if you want 'little' digi symbol (green star with digit 1 overlaid)
//#define _SYMBOL_WIDE1_DIGI // uncomment if you want 'little' digi symbol (green star with digit 1 overlaid)
//#define _SYMBOL_HOUSE // uncomment if you want house symbol
//#define _SYMBOL_RXIGATE // uncomment if you want rxigate symbol (black diamond with R)
//#define _SYMBOL_IGATE // uncomment if you want igate symol (black diamond with I)
#define _SYMBOL_IGATE // uncomment if you want igate symol (black diamond with I)
//#define _SYMBOL_SAILBOAT
// Or you can keep commented all symbol defines and choose custom one based on data from APRS symbols table
@ -150,7 +148,7 @@
#define _DIGI_VISCOUS_DEALY 2
// Transmitting delay
#define _DELAY_BASE 14 // * 50ms. For example setting 10 gives 500msec delay. Maximum value is 20
#define _DELAY_BASE 19 // * 50ms. For example setting 10 gives 500msec delay. Maximum value is 20
//#define _RANDOM_DELAY // adds random delay TO fixed time set by _DELAY_BASE. This additional time can be
// from 100ms up to 1 sec in 100ms steps. Values are drawn from samples going from ADC
// so it is better to use Unsquelched output in radio to provide much more randomness
@ -158,6 +156,9 @@
//kind of semaphore. If radio channel is not occupied by any other transmission TX will be keyed up immediately,
//otherwise software will wait for clear conditions.
//!< BASIC CONFIG - CALLSIGN, LOCATION etc
//!< -------------------------------------
// Few IMPORTANT hints about setting transmit delay properly.
//
// Transmit delay is key parameter to maintain RF network free from packet losses and collisions. If your station will be
@ -171,8 +172,17 @@
// various lenght of preamble, some of them produce signal which might be impossible to decode by ParaTNC, so DCD
// is only one part of effective multiaccess to medium.
/* ---------------------------- */
/* MODBUS RTU CONFIGURATION */
//!< -------
//!< BUTTONS
#define _BUTTON_ONE_LEFT BUTTON_FUNCTION_SEND_BEACON
#define _BUTTON_TWO_RIGHT BUTTON_FUNCION_RESET_GSM_GPRS
//!< BUTTONS
//!< -------
//!< ------------------------
//!< MODBUS RTU CONFIGURATION
// scaling coefficients are used as follows
//
@ -249,9 +259,33 @@
//#define _RTU_SLAVE_WIND_DIRECTION_SORUCE 4
//#define _RTU_SLAVE_WIND_SPEED_SOURCE 4
//!< MODBUS RTU CONFIGURATION
//!< ------------------------
/* MODBUS RTU CONFIGURATION */
/* ---------------------------- */
//!< -----------------------
//!< GSM and APRS-IS and API
#define _GSM_APN_NAME "internet\0"
#define _GSM_APN_USER "internet\0"
#define _GSM_APN_PASS "internet\0"
//#define _GSM_API_ENABLE
#define _GSM_API_BASE_URL "http://157.25.103.93:22910/"
#define _GSM_API_STATION_NAME "bielsko"
#define _GSM_APRSIS_ENABLE
#define _GSM_APRSIS_PASSCODE 16823
#define _GSM_APRSIS_PORT 14580
#define _GSM_APRSIS_ADDRES "euro.aprs2.net\0"
//#define _GSM_APRSIS_ADDRES "78.88.56.14\0"
//!< GSM and APRS-IS and API
//!< -----------------------
//#define ENG1 ENGINEERING1_EARLY_TX_ASSERT | ENGINEERING1_PWRCYCLE_GSM_ON_NOCOMM
#define ENG1 ENGINEERING1_INH_WX_PWR_HNDL
//#define ENG2 ENGINEERING2_POWER_CYCLE_R
// Do not touch this
#if defined (_SYMBOL_DIGI) && !defined (_SYMBOL_WIDE1_DIGI) && !defined (_SYMBOL_HOUSE) && !defined (_SYMOL_RXIGATE) &&\

Wyświetl plik

@ -10,8 +10,8 @@
//#define _POWERSAVE_NORMAL
//#define _POWERSAVE_AGGRESIVE
/* ------------------ */
/* MODES OF OPERATION */
//!< ---------------------------
//!< MODES OF OPERATION
#define _METEO // Enable meteo station
@ -24,20 +24,21 @@
#define _WX_DOUBLE_TRANSMIT
/* MODES OF OPERATION */
/* ------------------ */
//!< MODES OF OPERATION
//!< ---------------------------
/**
* Enable support for Victron VE.Direct protocol. This is independent from wx sensor configuration
*/
//#define _VICTRON
/* ---------------------------- */
/* WEATHER/METEO CONFIGURATION */
//!< ---------------------------
//!< WEATHER/METEO CONFIGURATION
// If none of those three sources are chosen (uncommented) the software will use internal sensors
/**
* Three defines below enables or disabled listed communication drivers. Enabling any of then doesn't means
* that these are used as a data source automatically. That shall be set in 'DATA SOURCES CONFIG' section.
*/
//#define _UMB_MASTER
//#define _DAVIS_SERIAL
@ -52,7 +53,6 @@
// May be used even if _METEO is not enabled
#define _DALLAS_SPLIT_PIN // Must be enabled for all ParaTNC hardware revisions
/******** INTERNAL SENSORS CONFIGURATION *****************/
//#define _ANEMOMETER_TX20 // Use TX20 as an internal anemometer
@ -61,7 +61,10 @@
#define _SENSOR_MS5611
//#define _SENSOR_BME280
/******** INTERNAL SENSORS CONFIGURATION *****************/
/******** UMB MASTER CONFIGURATION *****************/
#define _UMB_SLAVE_ID 1
#define _UMB_SLAVE_CLASS 8
#define _UMB_CHANNEL_WINDSPEED 460
@ -69,8 +72,8 @@
#define _UMB_CHANNEL_WINDDIRECTION 580
#define _UMB_CHANNEL_TEMPERATURE 100
#define _UMB_CHANNEL_QFE 300
/******** UMB MASTER CONFIGURATION *****************/
/******** INTERNAL SENSORS CONFIGURATION *****************/
/*************** DATA SOURCES CONFIG ***********************/
#define _TEMPERATURE_INTERNAL
@ -96,9 +99,12 @@
//#define _WIND_DAVIS
/*************** DATA SOURCES CONFIG ***********************/
//!< WEATHER/METEO CONFIGURATION
//!< ---------------------------
/* WEATHER/METEO CONFIGURATION */
/* ---------------------------- */
//!< -------------------------------------
//!< BASIC CONFIG - CALLSIGN, LOCATION etc
//#define _MUTE_RF // TODO: Not yet implemented - This will make station RXonly and disable all data transmission
//#define _MUTE_OWN // TODO: Not yet implemented - This will disable all self-generated packets (wx, telemetry, beacon)
@ -111,7 +117,7 @@
#define _LATNS 'N'
#define _LON 01912.11
#define _LONWE 'E'
#define _COMMENT "WX only = TXPower 1W = Klub Zeglarski Halny, plywajaca keja manewrowa na J. Zywieckim = sp8ebc@interia.pl"
#define _COMMENT "WX only = TXPower 1W = Plywajaca keja manewrowa na J. Zywieckim = sp8ebc@interia.pl"
// You can use only one of these below defines to choose symbol. Meteo data are are always transmitted with blue WX symbol
//#define _SYMBOL_DIGI // uncomment if you want digi symbol(green star with D inside)
@ -134,7 +140,7 @@
#define _BCN_ON_STARTUP
#define _WX_INTERVAL 4 // WX packet interval in minutes
#define _BCN_INTERVAL 124 // Own beacon interval in minutes
#define _BCN_INTERVAL 126 // Own beacon interval in minutes
#define _PTT_PUSHPULL // Uncomment this if you want PTT line to work as Push-pull instead of Open Drain
#define _SERIAL_BAUDRATE 9600
@ -142,7 +148,7 @@
#define _DIGI_VISCOUS_DEALY 2
// Transmitting delay
#define _DELAY_BASE 14 // * 50ms. For example setting 10 gives 500msec delay. Maximum value is 20
#define _DELAY_BASE 19 // * 50ms. For example setting 10 gives 500msec delay. Maximum value is 20
//#define _RANDOM_DELAY // adds random delay TO fixed time set by _DELAY_BASE. This additional time can be
// from 100ms up to 1 sec in 100ms steps. Values are drawn from samples going from ADC
// so it is better to use Unsquelched output in radio to provide much more randomness
@ -150,6 +156,9 @@
//kind of semaphore. If radio channel is not occupied by any other transmission TX will be keyed up immediately,
//otherwise software will wait for clear conditions.
//!< BASIC CONFIG - CALLSIGN, LOCATION etc
//!< -------------------------------------
// Few IMPORTANT hints about setting transmit delay properly.
//
// Transmit delay is key parameter to maintain RF network free from packet losses and collisions. If your station will be
@ -163,8 +172,17 @@
// various lenght of preamble, some of them produce signal which might be impossible to decode by ParaTNC, so DCD
// is only one part of effective multiaccess to medium.
/* ---------------------------- */
/* MODBUS RTU CONFIGURATION */
//!< -------
//!< BUTTONS
#define _BUTTON_ONE_LEFT BUTTON_FUNCTION_SEND_BEACON
#define _BUTTON_TWO_RIGHT BUTTON_FUNCTION_SEND_WX
//!< BUTTONS
//!< -------
//!< ------------------------
//!< MODBUS RTU CONFIGURATION
// scaling coefficients are used as follows
//
@ -241,29 +259,31 @@
//#define _RTU_SLAVE_WIND_DIRECTION_SORUCE 4
//#define _RTU_SLAVE_WIND_SPEED_SOURCE 4
//!< MODBUS RTU CONFIGURATION
//!< ------------------------
/* MODBUS RTU CONFIGURATION */
/* ---------------------------- */
/* ---------------------------- */
/* GSM and APRS-IS and API */
//!< -----------------------
//!< GSM and APRS-IS and API
#define _GSM_APN_NAME "internet\0"
#define _GSM_APN_USER "internet\0"
#define _GSM_APN_PASS "internet\0"
#define _GSM_API_ENABLE
//#define _GSM_API_ENABLE
#define _GSM_API_BASE_URL "http://157.25.103.93:22910/"
#define _GSM_API_STATION_NAME "abakus"
#define _GSM_API_STATION_NAME "bielsko"
//#define _GSM_APRSIS_ENABLE
#define _GSM_APRSIS_ENABLE
#define _GSM_APRSIS_PASSCODE 16823
#define _GSM_APRSIS_PORT 14580
#define _GSM_APRSIS_ADDRES "euro.aprs2.net\0"
//#define _GSM_APRSIS_ADDRES "78.88.56.14\0"
/* GSM and APRS-IS and API */
/* ---------------------------- */
//!< GSM and APRS-IS and API
//!< -----------------------
//#define ENG1 ENGINEERING1_EARLY_TX_ASSERT | ENGINEERING1_PWRCYCLE_GSM_ON_NOCOMM
#define ENG1 ENGINEERING1_INH_WX_PWR_HNDL
#define ENG2 ENGINEERING2_POWER_CYCLE_R

Wyświetl plik

@ -25,6 +25,7 @@
#include "main.h"
#include "rte_main.h"
#include "gsm/sim800c.h"
#include "software_version.h"
//!< Dummy variable used only as end of definition marker in tables
extern char did_dummy_data;
@ -62,8 +63,17 @@ extern char did_dummy_data;
//!< Definition of all DIDs with theirs source data for PARATNC platform
#if defined (PARATNC)
#define DIDS_STRING(ENTRY) \
ENTRY(0xFD01U, software_version_str) \
#define DIDS_FLOAT(ENTRY) \
ENTRY(0x2000U, rte_wx_temperature_average_external_valid, DID_EMPTY, DID_EMPTY) \
ENTRY(0x2001U, rte_wx_temperature_internal_valid, DID_EMPTY, DID_EMPTY) \
ENTRY(0x2002U, rte_wx_pressure_history[0], rte_wx_pressure_history[1], rte_wx_pressure_history[2]) \
#define DIDS_NUMERIC(ENTRY) \
ENTRY(0xFFFFU, &did_dummy_data, &did_dummy_data, &did_dummy_data)
ENTRY(0xFFFFU, did_dummy_data, did_dummy_data, did_dummy_data) \
#endif
#endif /* KISS_DID_CONFIGURATION_H_ */

Wyświetl plik

@ -190,6 +190,10 @@ inline uint8_t io_get_cntrl_vbat_s(void) {
return 0;
}
inline uint8_t io_get_cntrl_vbat_m(void) {
return 1;
}
#endif
#endif /* IO_H_ */

Wyświetl plik

@ -10,9 +10,7 @@
#include "drivers/serial.h"
#include "gsm/sim800_state_t.h"
#define SW_VER "EA24"
#define SW_DATE "22072023"
#define SW_KISS_PROTO "B"
#include "software_version.h"
#define SYSTICK_TICKS_PER_SECONDS 100
#define SYSTICK_TICKS_PERIOD 10

Wyświetl plik

@ -0,0 +1,17 @@
/*
* software_version.h
*
* Created on: Aug 7, 2023
* Author: mateusz
*/
#ifndef SOFTWARE_VERSION_H_
#define SOFTWARE_VERSION_H_
#define SW_VER "EA24"
#define SW_DATE "22072023"
#define SW_KISS_PROTO "B"
extern const char software_version_str[5];
#endif /* SOFTWARE_VERSION_H_ */

Wyświetl plik

@ -621,5 +621,7 @@ int16_t packet_tx_get_minutes_to_next_wx(void) {
}
void packet_tx_force_gsm_status(void) {
#ifdef STM32L471xx
packet_tx_gsm_status_sent = 0;
#endif
}

Wyświetl plik

@ -18,7 +18,6 @@ uint8_t rte_main_trigger_modbus_status = 0;
uint8_t rte_main_trigger_wx_packet = 0;
#ifdef PARAMETEO
uint16_t rte_main_battery_voltage;

Wyświetl plik

@ -0,0 +1,12 @@
/*
* software_version.c
*
* Software version was declared previously in main.h as a #define
*
* Created on: Aug 7, 2023
* Author: mateusz
*/
#include "software_version.h"
const char software_version_str[5] = SW_VER;

Wyświetl plik

@ -21,7 +21,7 @@ uint32_t samplecount;
/*********************************************************************************************************************/
void AD_Restart(void) {
/*********************************************************************************************************************/
#ifdef STM32L471xx
// check if conversion is done or not
if ((ADC1->ISR & ADC_ISR_EOC) == 0) {
// stop adc conversion
@ -33,6 +33,7 @@ void AD_Restart(void) {
// start ADC back again
ADC1->CR |= ADC_CR_ADSTART;
}
#endif
}