[ubseds17] start preparations for ubseds17, with ariss

main-solar-only
Richard Meadows 2016-08-13 00:48:02 +01:00
rodzic a11af1bdb5
commit f59c70ef4f
6 zmienionych plików z 57 dodań i 34 usunięć

Wyświetl plik

@ -22,7 +22,7 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 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/ubseds16.h"
//#include "hw_config/low-power-solar.h" #include "hw_config/low-power-solar.h"
//#include "hw_config/low-power-side.h" //#include "hw_config/low-power-side.h"

Wyświetl plik

@ -162,13 +162,13 @@
* Cold out * Cold out
*/ */
#define COLD_OUT_TEMPERATURE (-70.0) #define COLD_OUT_TEMPERATURE (-70.0)
#define COLD_OUT_SECONDS (15*60) /* 15 minutes */ #define COLD_OUT_SECONDS (5*60) /* 5 minutes */
#define COLD_OUT_COUNT_MAX (16*4) /* up to 16 hours*/ #define COLD_OUT_COUNT_MAX (12) /* up to 1 hour */
/** /**
* Cycle Times * 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 */ #define CYCLE_TIME_SLOW (100) /* once every two minutes */
/** /**
@ -226,8 +226,9 @@
/** /**
* Telemetry * Telemetry
*/ */
#define TELEMETRY_USE_GEOFENCE 1 #define TELEMETRY_ENABLE 1
#define TELEMETRY_FREQUENCY 434600000 #define TELEMETRY_USE_GEOFENCE 0
#define TELEMETRY_FREQUENCY 434612500
#define TELEMETRY_POWER RF_POWER_8dBm #define TELEMETRY_POWER RF_POWER_8dBm
/** /**
@ -241,8 +242,8 @@
* ARISS APRS * ARISS APRS
* Geofence used is only "no aprs" * Geofence used is only "no aprs"
*/ */
#define ARISS_ENABLE 0 #define ARISS_ENABLE 1
#define ARISS_USE_GEOFENCE 0 #define ARISS_USE_GEOFENCE 1
#define ARISS_FREQUENCY 145825000 #define ARISS_FREQUENCY 145825000
/** /**

Wyświetl plik

@ -45,7 +45,7 @@ typedef enum {
*/ */
#define MAXIDLE_WHILE_TELEMETRY_ACTIVE 60000 #define MAXIDLE_WHILE_TELEMETRY_ACTIVE 60000
#define MAXIDLE_WAIT_FOR_NEXT_TELEMETRY 30000 #define MAXIDLE_WAIT_FOR_NEXT_TELEMETRY 30000
#define MAXIDLE_WAIT_FOR_GPS 1000 #define MAXIDLE_WAIT_FOR_GPS 30000
struct idle_counter { struct idle_counter {
uint32_t while_telemetry_active; uint32_t while_telemetry_active;

Wyświetl plik

@ -81,18 +81,18 @@ uint16_t format_telemetry_string(char* string, struct tracker_datapoint* dp,
/* sprintf - full string (approx 90 chars) */ /* sprintf - full string (approx 90 chars) */
len += sprintf(string + len, 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,%.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,%u,%.2f,%.2f,%.1f,%.1f,%d",
"%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,%.2f,%.1f,%ld,%d",
CALLSIGN, /* 2+6+2+1=11 */ CALLSIGN, /* 2+6+2+1=11 */
dp->time.hour, dp->time.minute, dp->time.second, /* 2+1+2+1+2+1=9 */ 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 */ 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 */ 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->battery, /* 1+1+2+1 = 5 */
// dp->solar, /* 1+1+2+1 = 5 */ dp->solar, /* 1+1+2+1 = 5 */
// dp->thermistor_temperature, /* 3+1+1+1 = 6 */ dp->thermistor_temperature, /* 3+1+1+1 = 6 */
dp->radio_die_temperature, /* 3+1+1+1 = 6 */ dp->radio_die_temperature, /* 3+1+1+1 = 6 */
dp->xosc_error, // dp->xosc_error,
dp->flash_status); dp->flash_status);
/* sum = 80 (must be less than or equal to 114) */ /* 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()); telemetry_aprs_set_frequency(location_aprs_frequency());
/* Set rf path */ /* Set rf path */
// if ((get_battery_use_state() == BATTERY_GOOD) && /* battery good, */ if ((get_battery_use_state() == BATTERY_GOOD) && /* battery good, */
// (get_battery_charge_state() != BATTERY_DISCHARGING) && /* plenty of power and */ (get_battery_charge_state() != BATTERY_DISCHARGING) && /* plenty of power and */
// ((n % 4) == 0)) { /* one-in-four times */ ((n % 10) == 0)) { /* one-in-ten times */
// telemetry_aprs_set_rf_path(SI_RF_PATH_AMPLIFIER); /* try the amplified path */ telemetry_aprs_set_rf_path(SI_RF_PATH_AMPLIFIER); /* try the amplified path */
// } else { } else {
telemetry_aprs_set_rf_path(SI_RF_PATH_BYPASS); telemetry_aprs_set_rf_path(SI_RF_PATH_BYPASS);
// } }
/* Transmit packet and wait */ /* Transmit packet and wait */
telemetry_start(TELEMETRY_APRS, 0xFFFF); telemetry_start(TELEMETRY_APRS, 0xFFFF);
@ -238,6 +238,8 @@ void ariss_telemetry(struct tracker_datapoint* dp)
char* prefix = location_prefix(); char* prefix = location_prefix();
char* call = location_aprs_call(); char* call = location_aprs_call();
char ariss_comment[10];
sprintf(ariss_comment, "%s via ARISS", prefix);
/* Set location */ /* Set location */
aprs_set_datapoint(dp); aprs_set_datapoint(dp);
@ -250,9 +252,9 @@ void ariss_telemetry(struct tracker_datapoint* dp)
// NO BACKLOG VIA ARISS TO START WITH // NO BACKLOG VIA ARISS TO START WITH
// backlog_dp_ptr = get_backlog(); // backlog_dp_ptr = get_backlog();
// if (backlog_dp_ptr != NULL) { /* Backlog comment if we can */ // 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 { // } else {
aprs_set_comment(prefix); aprs_set_comment(ariss_comment);
/* Set frequency */ /* Set frequency */
telemetry_aprs_set_frequency(ARISS_FREQUENCY); /* TODO correct for doppler here */ telemetry_aprs_set_frequency(ARISS_FREQUENCY); /* TODO correct for doppler here */

Wyświetl plik

@ -97,14 +97,10 @@ void telemetry_sequence(struct tracker_datapoint* dp, uint32_t n)
} }
#endif #endif
/* CEASE ARISS AT THE END OF SEPTEMBER */
if (dp->time.month > 9) { return; }
/* ARISS */ /* ARISS */
#if ARISS_ENABLE #if ARISS_ENABLE
if ((get_battery_use_state() == BATTERY_GOOD) && /* battery good, */ if ((get_battery_use_state() == BATTERY_GOOD) && /* battery good, */
(get_battery_charge_state() == BATTERY_CHARGING) && /* receiving power and */ ((n % 2) == 0)) { /* one-in-two times */
((n % 3) == 0)) { /* one-in-three times */
#if ARISS_USE_GEOFENCE #if ARISS_USE_GEOFENCE
if (location_aprs_could_tx()) { /* transmit anywhere it's not disallowed */ if (location_aprs_could_tx()) { /* transmit anywhere it's not disallowed */
#endif #endif

Wyświetl plik

@ -7,6 +7,8 @@ class telemetry_format_ssid:
def __init__(self, ssid): def __init__(self, ssid):
if ssid == '11': if ssid == '11':
self.flight_nr = 15 self.flight_nr = 15
if ssid == '12':
self.flight_nr = 17
else: else:
raise ValueError("Telemetry format does not know about this ssid!") raise ValueError("Telemetry format does not know about this ssid!")
@ -24,11 +26,16 @@ class telemetry_format_ssid:
"UNIT.Volts,Celsius,Celcius", "UNIT.Volts,Celsius,Celcius",
"EQNS.0,.001,0,0,.1,-273.2,0,.1,-273.2"] "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", return ["PARM.Battery,Solar,External Temperature,Internal Temperature,GPS TTFF",
"UNIT.Volts,Volts,Celsius,Celcius", "UNIT.Volts,Volts,Celsius,Celcius",
"EQNS.0,.001,0,0,.001,0,0,.1,-273.2,0,.1,-273.2"] "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: else:
raise ValueError("aprs_equations does not know about this flight!") raise ValueError("aprs_equations does not know about this flight!")
@ -40,8 +47,10 @@ class telemetry_format_ssid:
def base91_encoded_len(self): def base91_encoded_len(self):
if self.flight_nr in [13,14]: if self.flight_nr in [13,14]:
return 10 # 5 analogue values return 10 # 5 analogue values
elif self.flight_nr in [15]: elif self.flight_nr in [15,17]:
return 10 # 5 analogue values return 10 # 5 analogue values
elif self.flight_nr in [18]:
return 8 # 4 analogue values
else: else:
raise ValueError("baseb91_encode_len does not know about this flight!") raise ValueError("baseb91_encode_len does not know about this flight!")
@ -57,7 +66,7 @@ class telemetry_format_ssid:
'satellites': (values[3]), 'satellites': (values[3]),
'ttff': (values[4]) 'ttff': (values[4])
} }
elif self.flight_nr in [15]: elif self.flight_nr in [15,17]:
self.datum = { self.datum = {
'battery': (values[0] / 1000.0), # mV -> V 'battery': (values[0] / 1000.0), # mV -> V
'solar': (values[1] / 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 'temperature_i': (values[3] / 10.0) - 273.2, # dK -> degC
'ttff': (values[4]) '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: else:
raise ValueError("decode_values does not know about this flight!") raise ValueError("decode_values does not know about this flight!")
@ -80,9 +96,13 @@ class telemetry_format_ssid:
return ("{satellites},{ttff},{battery}," return ("{satellites},{ttff},{battery},"
"{temperature_e},{temperature_i}").format(**datum) "{temperature_e},{temperature_i}").format(**datum)
elif self.flight_nr in [15]: elif self.flight_nr in [15,17]:
return ("-1,{ttff},{battery},{solar}," return ("-1,{ttff},{battery},{solar},"
"{temperature_e},{temperature_i}").format(**datum) "{temperature_e},{temperature_i}").format(**datum)
elif self.flight_nr in [18]:
return ("{satellites},{battery},"
"{temperature_i},{btrfs_errors}").format(**datum)
else: else:
raise ValueError("ukhas_format does not know about this flight!") 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 " return ("{battery}V {temperature_e}C {temperature_i}C "
"sats {satellites} ttff {ttff}").format(**datum) "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 " return ("{battery}V {solar}V {temperature_e}C {temperature_i}C "
"ttff {ttff}").format(**datum) "ttff {ttff}").format(**datum)
elif self.flight_nr in [18]:
return ("{battery}V {temperature_i}C "
"sats {satellites} btrfs {btrfs_errors}").format(**datum)
else: else:
raise ValueError("stringify does not know about this flight!") raise ValueError("stringify does not know about this flight!")