kopia lustrzana https://github.com/bristol-seds/pico-tracker
[ubseds17] start preparations for ubseds17, with ariss
rodzic
a11af1bdb5
commit
f59c70ef4f
|
@ -22,7 +22,7 @@
|
|||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "hw_config/main-solar-only.h"
|
||||
//#include "hw_config/main-solar-only.h"
|
||||
//#include "hw_config/ubseds16.h"
|
||||
//#include "hw_config/low-power-solar.h"
|
||||
#include "hw_config/low-power-solar.h"
|
||||
//#include "hw_config/low-power-side.h"
|
||||
|
|
|
@ -162,13 +162,13 @@
|
|||
* Cold out
|
||||
*/
|
||||
#define COLD_OUT_TEMPERATURE (-70.0)
|
||||
#define COLD_OUT_SECONDS (15*60) /* 15 minutes */
|
||||
#define COLD_OUT_COUNT_MAX (16*4) /* up to 16 hours*/
|
||||
#define COLD_OUT_SECONDS (5*60) /* 5 minutes */
|
||||
#define COLD_OUT_COUNT_MAX (12) /* up to 1 hour */
|
||||
|
||||
/**
|
||||
* Cycle Times
|
||||
*/
|
||||
#define CYCLE_TIME_FAST (0) /* shortest hibernate */
|
||||
#define CYCLE_TIME_FAST (30) /* shortest hibernate */
|
||||
#define CYCLE_TIME_SLOW (100) /* once every two minutes */
|
||||
|
||||
/**
|
||||
|
@ -226,8 +226,9 @@
|
|||
/**
|
||||
* Telemetry
|
||||
*/
|
||||
#define TELEMETRY_USE_GEOFENCE 1
|
||||
#define TELEMETRY_FREQUENCY 434600000
|
||||
#define TELEMETRY_ENABLE 1
|
||||
#define TELEMETRY_USE_GEOFENCE 0
|
||||
#define TELEMETRY_FREQUENCY 434612500
|
||||
#define TELEMETRY_POWER RF_POWER_8dBm
|
||||
|
||||
/**
|
||||
|
@ -241,8 +242,8 @@
|
|||
* ARISS APRS
|
||||
* Geofence used is only "no aprs"
|
||||
*/
|
||||
#define ARISS_ENABLE 0
|
||||
#define ARISS_USE_GEOFENCE 0
|
||||
#define ARISS_ENABLE 1
|
||||
#define ARISS_USE_GEOFENCE 1
|
||||
#define ARISS_FREQUENCY 145825000
|
||||
|
||||
/**
|
||||
|
|
|
@ -45,7 +45,7 @@ typedef enum {
|
|||
*/
|
||||
#define MAXIDLE_WHILE_TELEMETRY_ACTIVE 60000
|
||||
#define MAXIDLE_WAIT_FOR_NEXT_TELEMETRY 30000
|
||||
#define MAXIDLE_WAIT_FOR_GPS 1000
|
||||
#define MAXIDLE_WAIT_FOR_GPS 30000
|
||||
|
||||
struct idle_counter {
|
||||
uint32_t while_telemetry_active;
|
||||
|
|
|
@ -81,18 +81,18 @@ uint16_t format_telemetry_string(char* string, struct tracker_datapoint* dp,
|
|||
/* sprintf - full string (approx 90 chars) */
|
||||
len += sprintf(string + len,
|
||||
// "%s,%02u:%02u:%02u,%02u%02u%02u,%02.4f,%03.4f,%ld,%u,%u,%.2f,%.1f,%.1f",
|
||||
// "%s,%02u:%02u:%02u,%02u%02u%02u,%02.4f,%03.4f,%ld,%u,%u,%.2f,%.2f,%.1f,%.1f",
|
||||
"%s,%02u:%02u:%02u,%02u%02u%02u,%02.4f,%03.4f,%ld,%u,%.2f,%.1f,%ld,%d",
|
||||
"%s,%02u:%02u:%02u,%02u%02u%02u,%02.4f,%03.4f,%ld,%u,%u,%.2f,%.2f,%.1f,%.1f,%d",
|
||||
// "%s,%02u:%02u:%02u,%02u%02u%02u,%02.4f,%03.4f,%ld,%u,%.2f,%.1f,%ld,%d",
|
||||
CALLSIGN, /* 2+6+2+1=11 */
|
||||
dp->time.hour, dp->time.minute, dp->time.second, /* 2+1+2+1+2+1=9 */
|
||||
dp->time.year%100, dp->time.month, dp->time.day, /* 2+2+2+1=7 */
|
||||
lat_fmt, lon_fmt, altitude, dp->satillite_count, /* 3+1+4+1 + 4+1+4+1 + 5+1 + 2+1 = 28 */
|
||||
// dp->time_to_first_fix, /* 2+1 = 3 */
|
||||
dp->time_to_first_fix, /* 2+1 = 3 */
|
||||
dp->battery, /* 1+1+2+1 = 5 */
|
||||
// dp->solar, /* 1+1+2+1 = 5 */
|
||||
// dp->thermistor_temperature, /* 3+1+1+1 = 6 */
|
||||
dp->solar, /* 1+1+2+1 = 5 */
|
||||
dp->thermistor_temperature, /* 3+1+1+1 = 6 */
|
||||
dp->radio_die_temperature, /* 3+1+1+1 = 6 */
|
||||
dp->xosc_error,
|
||||
// dp->xosc_error,
|
||||
dp->flash_status);
|
||||
/* sum = 80 (must be less than or equal to 114) */
|
||||
|
||||
|
@ -211,13 +211,13 @@ void aprs_telemetry(struct tracker_datapoint* dp, uint32_t n)
|
|||
telemetry_aprs_set_frequency(location_aprs_frequency());
|
||||
|
||||
/* Set rf path */
|
||||
// if ((get_battery_use_state() == BATTERY_GOOD) && /* battery good, */
|
||||
// (get_battery_charge_state() != BATTERY_DISCHARGING) && /* plenty of power and */
|
||||
// ((n % 4) == 0)) { /* one-in-four times */
|
||||
// telemetry_aprs_set_rf_path(SI_RF_PATH_AMPLIFIER); /* try the amplified path */
|
||||
// } else {
|
||||
if ((get_battery_use_state() == BATTERY_GOOD) && /* battery good, */
|
||||
(get_battery_charge_state() != BATTERY_DISCHARGING) && /* plenty of power and */
|
||||
((n % 10) == 0)) { /* one-in-ten times */
|
||||
telemetry_aprs_set_rf_path(SI_RF_PATH_AMPLIFIER); /* try the amplified path */
|
||||
} else {
|
||||
telemetry_aprs_set_rf_path(SI_RF_PATH_BYPASS);
|
||||
// }
|
||||
}
|
||||
|
||||
/* Transmit packet and wait */
|
||||
telemetry_start(TELEMETRY_APRS, 0xFFFF);
|
||||
|
@ -238,6 +238,8 @@ void ariss_telemetry(struct tracker_datapoint* dp)
|
|||
|
||||
char* prefix = location_prefix();
|
||||
char* call = location_aprs_call();
|
||||
char ariss_comment[10];
|
||||
sprintf(ariss_comment, "%s via ARISS", prefix);
|
||||
|
||||
/* Set location */
|
||||
aprs_set_datapoint(dp);
|
||||
|
@ -250,9 +252,9 @@ void ariss_telemetry(struct tracker_datapoint* dp)
|
|||
// NO BACKLOG VIA ARISS TO START WITH
|
||||
// backlog_dp_ptr = get_backlog();
|
||||
// if (backlog_dp_ptr != NULL) { /* Backlog comment if we can */
|
||||
// aprs_set_backlog_comment(backlog_dp_ptr, prefix);
|
||||
// aprs_set_backlog_comment(backlog_dp_ptr, ariss_comment);
|
||||
// } else {
|
||||
aprs_set_comment(prefix);
|
||||
aprs_set_comment(ariss_comment);
|
||||
|
||||
/* Set frequency */
|
||||
telemetry_aprs_set_frequency(ARISS_FREQUENCY); /* TODO correct for doppler here */
|
||||
|
|
|
@ -97,14 +97,10 @@ void telemetry_sequence(struct tracker_datapoint* dp, uint32_t n)
|
|||
}
|
||||
#endif
|
||||
|
||||
/* CEASE ARISS AT THE END OF SEPTEMBER */
|
||||
if (dp->time.month > 9) { return; }
|
||||
|
||||
/* ARISS */
|
||||
#if ARISS_ENABLE
|
||||
if ((get_battery_use_state() == BATTERY_GOOD) && /* battery good, */
|
||||
(get_battery_charge_state() == BATTERY_CHARGING) && /* receiving power and */
|
||||
((n % 3) == 0)) { /* one-in-three times */
|
||||
((n % 2) == 0)) { /* one-in-two times */
|
||||
#if ARISS_USE_GEOFENCE
|
||||
if (location_aprs_could_tx()) { /* transmit anywhere it's not disallowed */
|
||||
#endif
|
||||
|
|
|
@ -7,6 +7,8 @@ class telemetry_format_ssid:
|
|||
def __init__(self, ssid):
|
||||
if ssid == '11':
|
||||
self.flight_nr = 15
|
||||
if ssid == '12':
|
||||
self.flight_nr = 17
|
||||
else:
|
||||
raise ValueError("Telemetry format does not know about this ssid!")
|
||||
|
||||
|
@ -24,11 +26,16 @@ class telemetry_format_ssid:
|
|||
"UNIT.Volts,Celsius,Celcius",
|
||||
"EQNS.0,.001,0,0,.1,-273.2,0,.1,-273.2"]
|
||||
|
||||
elif self.flight_nr in [15]:
|
||||
elif self.flight_nr in [15,17]:
|
||||
return ["PARM.Battery,Solar,External Temperature,Internal Temperature,GPS TTFF",
|
||||
"UNIT.Volts,Volts,Celsius,Celcius",
|
||||
"EQNS.0,.001,0,0,.001,0,0,.1,-273.2,0,.1,-273.2"]
|
||||
|
||||
elif self.flight_nr in [18]:
|
||||
return ["PARM.Battery,Internal Temperature,GPS Satellites,BTRFS Errors",
|
||||
"UNIT.Volts,Celcius",
|
||||
"EQNS.0,.001,0,0,.1,-273.2"]
|
||||
|
||||
else:
|
||||
raise ValueError("aprs_equations does not know about this flight!")
|
||||
|
||||
|
@ -40,8 +47,10 @@ class telemetry_format_ssid:
|
|||
def base91_encoded_len(self):
|
||||
if self.flight_nr in [13,14]:
|
||||
return 10 # 5 analogue values
|
||||
elif self.flight_nr in [15]:
|
||||
elif self.flight_nr in [15,17]:
|
||||
return 10 # 5 analogue values
|
||||
elif self.flight_nr in [18]:
|
||||
return 8 # 4 analogue values
|
||||
else:
|
||||
raise ValueError("baseb91_encode_len does not know about this flight!")
|
||||
|
||||
|
@ -57,7 +66,7 @@ class telemetry_format_ssid:
|
|||
'satellites': (values[3]),
|
||||
'ttff': (values[4])
|
||||
}
|
||||
elif self.flight_nr in [15]:
|
||||
elif self.flight_nr in [15,17]:
|
||||
self.datum = {
|
||||
'battery': (values[0] / 1000.0), # mV -> V
|
||||
'solar': (values[1] / 1000.0), # mV -> V
|
||||
|
@ -65,6 +74,13 @@ class telemetry_format_ssid:
|
|||
'temperature_i': (values[3] / 10.0) - 273.2, # dK -> degC
|
||||
'ttff': (values[4])
|
||||
}
|
||||
if self.flight_nr in [18]:
|
||||
self.datum = {
|
||||
'battery': (values[0] / 1000.0), # mV -> V
|
||||
'temperature_i': (values[1] / 10.0) - 273.2, # dK -> degC
|
||||
'satellites': (values[2]),
|
||||
'btrfs_errors': (values[3]),
|
||||
}
|
||||
else:
|
||||
raise ValueError("decode_values does not know about this flight!")
|
||||
|
||||
|
@ -80,9 +96,13 @@ class telemetry_format_ssid:
|
|||
return ("{satellites},{ttff},{battery},"
|
||||
"{temperature_e},{temperature_i}").format(**datum)
|
||||
|
||||
elif self.flight_nr in [15]:
|
||||
elif self.flight_nr in [15,17]:
|
||||
return ("-1,{ttff},{battery},{solar},"
|
||||
"{temperature_e},{temperature_i}").format(**datum)
|
||||
|
||||
elif self.flight_nr in [18]:
|
||||
return ("{satellites},{battery},"
|
||||
"{temperature_i},{btrfs_errors}").format(**datum)
|
||||
else:
|
||||
raise ValueError("ukhas_format does not know about this flight!")
|
||||
|
||||
|
@ -96,9 +116,13 @@ class telemetry_format_ssid:
|
|||
return ("{battery}V {temperature_e}C {temperature_i}C "
|
||||
"sats {satellites} ttff {ttff}").format(**datum)
|
||||
|
||||
elif self.flight_nr in [15]:
|
||||
elif self.flight_nr in [15,17]:
|
||||
return ("{battery}V {solar}V {temperature_e}C {temperature_i}C "
|
||||
"ttff {ttff}").format(**datum)
|
||||
|
||||
elif self.flight_nr in [18]:
|
||||
return ("{battery}V {temperature_i}C "
|
||||
"sats {satellites} btrfs {btrfs_errors}").format(**datum)
|
||||
else:
|
||||
raise ValueError("stringify does not know about this flight!")
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue