From 6da1423650e903497907c6476fddd2c08c3086f6 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 26 Dec 2020 16:02:03 -0500 Subject: [PATCH 001/252] moved initialization of FSK and BPSK values --- afsk/main.c | 56 +++++++++++++++++++++++++++-------------------------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index f4619065..1910d60e 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -489,31 +489,7 @@ int main(int argc, char * argv[]) { other_max[i] = -1000.0; } - while (loop-- != 0) { - frames_sent++; - - #ifdef DEBUG_LOGGING - fprintf(stderr, "INFO: Battery voltage: %f V Battery Threshold %f V\n", batteryVoltage, batteryThreshold); - #endif - if ((batteryVoltage > 1.0) && (batteryVoltage < batteryThreshold)) // no battery INA219 will give 0V, no battery plugged into INA219 will read < 1V - { - fprintf(stderr, "Battery voltage too low: %f V - shutting down!\n", batteryVoltage); - digitalWrite(txLed, txLedOff); - digitalWrite(onLed, onLedOff); - sleep(1); - digitalWrite(onLed, onLedOn); - sleep(1); - digitalWrite(onLed, onLedOff); - sleep(1); - digitalWrite(onLed, onLedOn); - sleep(1); - digitalWrite(onLed, onLedOff); - - popen("sudo shutdown -h now > /dev/null 2>&1", "r"); - sleep(10); - } - - if (mode == FSK) { + if (mode == FSK) { bitRate = 200; rsFrames = 1; payloads = 1; @@ -556,6 +532,32 @@ int main(int argc, char * argv[]) { bufLen, bufLen / (samples * frameCnt), bitRate, bufLen / (samples * frameCnt * bitRate), samplePeriod); } + + + while (loop-- != 0) { + frames_sent++; + + #ifdef DEBUG_LOGGING + fprintf(stderr, "INFO: Battery voltage: %f V Battery Threshold %f V\n", batteryVoltage, batteryThreshold); + #endif + if ((batteryVoltage > 1.0) && (batteryVoltage < batteryThreshold)) // no battery INA219 will give 0V, no battery plugged into INA219 will read < 1V + { + fprintf(stderr, "Battery voltage too low: %f V - shutting down!\n", batteryVoltage); + digitalWrite(txLed, txLedOff); + digitalWrite(onLed, onLedOff); + sleep(1); + digitalWrite(onLed, onLedOn); + sleep(1); + digitalWrite(onLed, onLedOff); + sleep(1); + digitalWrite(onLed, onLedOn); + sleep(1); + digitalWrite(onLed, onLedOff); + + popen("sudo shutdown -h now > /dev/null 2>&1", "r"); + sleep(10); + } + // sleep(1); // Delay 1 second ctr = 0; #ifdef DEBUG_LOGGING @@ -1046,10 +1048,10 @@ void get_tlm_fox() { #ifdef DEBUG_LOGGING printf("Tx LED On\n"); #endif - +/* while ((millis() - sampleTime) < (unsigned int)samplePeriod) sleep((unsigned int)sleepTime); - +*/ digitalWrite(txLed, txLedOff); #ifdef DEBUG_LOGGING printf("Tx LED Off\n"); From 8b28cf1c17ab2ee043482adafaf638ef4cd3f117 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 26 Dec 2020 16:07:05 -0500 Subject: [PATCH 002/252] added time printf --- afsk/main.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 1910d60e..8a9a1095 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -482,7 +482,7 @@ int main(int argc, char * argv[]) { for (int i = 0; i < 17; i++) { sensor_min[i] = 1000.0; sensor_max[i] = -1000.0; - printf("Sensor min and max initialized!"); + // printf("Sensor min and max initialized!"); } for (int i = 0; i < 3; i++) { other_min[i] = 1000.0; @@ -532,11 +532,15 @@ int main(int argc, char * argv[]) { bufLen, bufLen / (samples * frameCnt), bitRate, bufLen / (samples * frameCnt * bitRate), samplePeriod); } - + long int loopTime; + loopTime = millis(); while (loop-- != 0) { - frames_sent++; - +// frames_sent++; + + printf("++++ Loop time: %d +++++\n", millis() - loopTime); + loopTime = millis(); + #ifdef DEBUG_LOGGING fprintf(stderr, "INFO: Battery voltage: %f V Battery Threshold %f V\n", batteryVoltage, batteryThreshold); #endif @@ -1273,7 +1277,7 @@ void get_tlm_fox() { if (current[count1] > current_max[count1]) current_max[count1] = current[count1]; - printf("Vmin %f Vmax %f Imin %f Imax %f \n", voltage_min[count1], voltage_max[count1], current_min[count1], current_max[count1]); + // printf("Vmin %f Vmax %f Imin %f Imax %f \n", voltage_min[count1], voltage_max[count1], current_min[count1], current_max[count1]); } if ((sensor_payload[0] == 'O') && (sensor_payload[1] == 'K')) { @@ -1283,7 +1287,7 @@ void get_tlm_fox() { if (sensor[count1] > sensor_max[count1]) sensor_max[count1] = sensor[count1]; - printf("Smin %f Smax %f \n", sensor_min[count1], sensor_max[count1]); + // printf("Smin %f Smax %f \n", sensor_min[count1], sensor_max[count1]); } } @@ -1293,7 +1297,7 @@ void get_tlm_fox() { if (other[count1] > other_max[count1]) other_max[count1] = other[count1]; - printf("Other min %f max %f \n", other_min[count1], other_max[count1]); + // printf("Other min %f max %f \n", other_min[count1], other_max[count1]); } if (mode == FSK) { From 642f625363d5d3dda0cb0cf1513fd996bebda365 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 26 Dec 2020 16:10:10 -0500 Subject: [PATCH 003/252] removed sensor printf --- afsk/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 8a9a1095..2678b065 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1182,7 +1182,7 @@ void get_tlm_fox() { if (token != NULL) { sensor[count1] = (float) atof(token); #ifdef DEBUG_LOGGING - printf("sensor: %f ", sensor[count1]); + // printf("sensor: %f ", sensor[count1]); #endif token = strtok(NULL, space); } @@ -1686,10 +1686,10 @@ void get_tlm_fox() { } // digitalWrite (0, HIGH); - if (mode == FSK) - firstTime = 0; - else if (frames_sent > 0) //5) +// if (mode == FSK) firstTime = 0; +// else if (frames_sent > 0) //5) +// firstTime = 0; return; } From af945401f796486fd4ff965b319988ccd2bf3220 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 26 Dec 2020 16:16:33 -0500 Subject: [PATCH 004/252] moved sim_mode code --- afsk/main.c | 161 +++++++++++++++++++++++++++------------------------- 1 file changed, 83 insertions(+), 78 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 2678b065..899c2d58 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1065,7 +1065,88 @@ void get_tlm_fox() { sampleTime = (int) millis(); } else printf("first time - no sleep\n"); + + + float voltage[9], current[9], sensor[17], other[3]; + memset(voltage, 0, sizeof(voltage)); + memset(current, 0, sizeof(current)); + memset(sensor, 0, sizeof(sensor)); + memset(other, 0, sizeof(other)); + + if (sim_mode) { + // simulated telemetry + + double time = ((long int)millis() - time_start) / 1000.0; + + if ((time - eclipse_time) > period) { + eclipse = (eclipse == 1) ? 0 : 1; + eclipse_time = time; + printf("\n\nSwitching eclipse mode! \n\n"); + } + + /* + double Xi = eclipse * amps_max[0] * sin(2.0 * 3.14 * time / (46.0 * speed)) * fabs(sin(2.0 * 3.14 * time / (46.0 * speed))) + rnd_float(-2, 2); + double Yi = eclipse * amps_max[1] * sin((2.0 * 3.14 * time / (46.0 * speed)) + (3.14/2.0)) * fabs(sin((2.0 * 3.14 * time / (46.0 * speed)) + (3.14/2.0))) + rnd_float(-2, 2); + double Zi = eclipse * amps_max[2] * sin((2.0 * 3.14 * time / (46.0 * speed)) + 3.14 + angle[2]) * fabs(sin((2.0 * 3.14 * time / (46.0 * speed)) + 3.14 + angle[2])) + rnd_float(-2, 2); + */ + double Xi = eclipse * amps_max[0] * (float) sin(2.0 * 3.14 * time / (46.0 * speed)) + rnd_float(-2, 2); + double Yi = eclipse * amps_max[1] * (float) sin((2.0 * 3.14 * time / (46.0 * speed)) + (3.14 / 2.0)) + rnd_float(-2, 2); + double Zi = eclipse * amps_max[2] * (float) sin((2.0 * 3.14 * time / (46.0 * speed)) + 3.14 + angle[2]) + rnd_float(-2, 2); + + double Xv = eclipse * volts_max[0] * (float) sin(2.0 * 3.14 * time / (46.0 * speed)) + rnd_float(-0.2, 0.2); + double Yv = eclipse * volts_max[1] * (float) sin((2.0 * 3.14 * time / (46.0 * speed)) + (3.14 / 2.0)) + rnd_float(-0.2, 0.2); + double Zv = 2.0 * eclipse * volts_max[2] * (float) sin((2.0 * 3.14 * time / (46.0 * speed)) + 3.14 + angle[2]) + rnd_float(-0.2, 0.2); + // printf("Yi: %f Zi: %f %f %f Zv: %f \n", Yi, Zi, amps_max[2], angle[2], Zv); + + current[map[PLUS_X]] = (Xi >= 0) ? Xi : 0; + current[map[MINUS_X]] = (Xi >= 0) ? 0 : ((-1.0f) * Xi); + current[map[PLUS_Y]] = (Yi >= 0) ? Yi : 0; + current[map[MINUS_Y]] = (Yi >= 0) ? 0 : ((-1.0f) * Yi); + current[map[PLUS_Z]] = (Zi >= 0) ? Zi : 0; + current[map[MINUS_Z]] = (Zi >= 0) ? 0 : ((-1.0f) * Zi); + + voltage[map[PLUS_X]] = (Xv >= 1) ? Xv : rnd_float(0.9, 1.1); + voltage[map[MINUS_X]] = (Xv <= -1) ? ((-1.0f) * Xv) : rnd_float(0.9, 1.1); + voltage[map[PLUS_Y]] = (Yv >= 1) ? Yv : rnd_float(0.9, 1.1); + voltage[map[MINUS_Y]] = (Yv <= -1) ? ((-1.0f) * Yv) : rnd_float(0.9, 1.1); + voltage[map[PLUS_Z]] = (Zv >= 1) ? Zv : rnd_float(0.9, 1.1); + voltage[map[MINUS_Z]] = (Zv <= -1) ? ((-1.0f) * Zv) : rnd_float(0.9, 1.1); + + // printf("temp: %f Time: %f Eclipse: %d : %f %f | %f %f | %f %f\n",tempS, time, eclipse, voltage[map[PLUS_X]], voltage[map[MINUS_X]], voltage[map[PLUS_Y]], voltage[map[MINUS_Y]], current[map[PLUS_Z]], current[map[MINUS_Z]]); + + tempS += (eclipse > 0) ? ((temp_max - tempS) / 50.0f) : ((temp_min - tempS) / 50.0f); + tempS += +rnd_float(-1.0, 1.0); + // IHUcpuTemp = (int)((tempS + rnd_float(-1.0, 1.0)) * 10 + 0.5); + other[IHU_TEMP] = tempS; + + voltage[map[BUS]] = rnd_float(5.0, 5.005); + current[map[BUS]] = rnd_float(158, 171); + + // float charging = current[map[PLUS_X]] + current[map[MINUS_X]] + current[map[PLUS_Y]] + current[map[MINUS_Y]] + current[map[PLUS_Z]] + current[map[MINUS_Z]]; + float charging = eclipse * (fabs(amps_max[0] * 0.707) + fabs(amps_max[1] * 0.707) + rnd_float(-4.0, 4.0)); + + current[map[BAT]] = ((current[map[BUS]] * voltage[map[BUS]]) / batt) - charging; + + // printf("charging: %f bat curr: %f bus curr: %f bat volt: %f bus volt: %f \n",charging, current[map[BAT]], current[map[BUS]], batt, voltage[map[BUS]]); + + batt -= (batt > 3.5) ? current[map[BAT]] / 30000 : current[map[BAT]] / 3000; + if (batt < 3.0) { + batt = 3.0; + NormalModeFailure = 1; + printf("Safe Mode!\n"); + } else + NormalModeFailure = 0; + + if (batt > 4.5) + batt = 4.5; + + voltage[map[BAT]] = batt + rnd_float(-0.01, 0.01); + + // end of simulated telemetry + } + +else { int count1; char * token; char cmdbuffer[1000]; @@ -1078,11 +1159,7 @@ void get_tlm_fox() { const char space[2] = " "; token = strtok(cmdbuffer, space); - float voltage[9], current[9], sensor[17], other[3]; - memset(voltage, 0, sizeof(voltage)); - memset(current, 0, sizeof(current)); - memset(sensor, 0, sizeof(sensor)); - memset(other, 0, sizeof(other)); + for (count1 = 0; count1 < 8; count1++) { if (token != NULL) { @@ -1192,79 +1269,7 @@ void get_tlm_fox() { } } - - if (sim_mode) { - // simulated telemetry - - double time = ((long int)millis() - time_start) / 1000.0; - - if ((time - eclipse_time) > period) { - eclipse = (eclipse == 1) ? 0 : 1; - eclipse_time = time; - printf("\n\nSwitching eclipse mode! \n\n"); - } - - /* - double Xi = eclipse * amps_max[0] * sin(2.0 * 3.14 * time / (46.0 * speed)) * fabs(sin(2.0 * 3.14 * time / (46.0 * speed))) + rnd_float(-2, 2); - double Yi = eclipse * amps_max[1] * sin((2.0 * 3.14 * time / (46.0 * speed)) + (3.14/2.0)) * fabs(sin((2.0 * 3.14 * time / (46.0 * speed)) + (3.14/2.0))) + rnd_float(-2, 2); - double Zi = eclipse * amps_max[2] * sin((2.0 * 3.14 * time / (46.0 * speed)) + 3.14 + angle[2]) * fabs(sin((2.0 * 3.14 * time / (46.0 * speed)) + 3.14 + angle[2])) + rnd_float(-2, 2); - */ - double Xi = eclipse * amps_max[0] * (float) sin(2.0 * 3.14 * time / (46.0 * speed)) + rnd_float(-2, 2); - double Yi = eclipse * amps_max[1] * (float) sin((2.0 * 3.14 * time / (46.0 * speed)) + (3.14 / 2.0)) + rnd_float(-2, 2); - double Zi = eclipse * amps_max[2] * (float) sin((2.0 * 3.14 * time / (46.0 * speed)) + 3.14 + angle[2]) + rnd_float(-2, 2); - - double Xv = eclipse * volts_max[0] * (float) sin(2.0 * 3.14 * time / (46.0 * speed)) + rnd_float(-0.2, 0.2); - double Yv = eclipse * volts_max[1] * (float) sin((2.0 * 3.14 * time / (46.0 * speed)) + (3.14 / 2.0)) + rnd_float(-0.2, 0.2); - double Zv = 2.0 * eclipse * volts_max[2] * (float) sin((2.0 * 3.14 * time / (46.0 * speed)) + 3.14 + angle[2]) + rnd_float(-0.2, 0.2); - - // printf("Yi: %f Zi: %f %f %f Zv: %f \n", Yi, Zi, amps_max[2], angle[2], Zv); - - current[map[PLUS_X]] = (Xi >= 0) ? Xi : 0; - current[map[MINUS_X]] = (Xi >= 0) ? 0 : ((-1.0f) * Xi); - current[map[PLUS_Y]] = (Yi >= 0) ? Yi : 0; - current[map[MINUS_Y]] = (Yi >= 0) ? 0 : ((-1.0f) * Yi); - current[map[PLUS_Z]] = (Zi >= 0) ? Zi : 0; - current[map[MINUS_Z]] = (Zi >= 0) ? 0 : ((-1.0f) * Zi); - - voltage[map[PLUS_X]] = (Xv >= 1) ? Xv : rnd_float(0.9, 1.1); - voltage[map[MINUS_X]] = (Xv <= -1) ? ((-1.0f) * Xv) : rnd_float(0.9, 1.1); - voltage[map[PLUS_Y]] = (Yv >= 1) ? Yv : rnd_float(0.9, 1.1); - voltage[map[MINUS_Y]] = (Yv <= -1) ? ((-1.0f) * Yv) : rnd_float(0.9, 1.1); - voltage[map[PLUS_Z]] = (Zv >= 1) ? Zv : rnd_float(0.9, 1.1); - voltage[map[MINUS_Z]] = (Zv <= -1) ? ((-1.0f) * Zv) : rnd_float(0.9, 1.1); - - // printf("temp: %f Time: %f Eclipse: %d : %f %f | %f %f | %f %f\n",tempS, time, eclipse, voltage[map[PLUS_X]], voltage[map[MINUS_X]], voltage[map[PLUS_Y]], voltage[map[MINUS_Y]], current[map[PLUS_Z]], current[map[MINUS_Z]]); - - tempS += (eclipse > 0) ? ((temp_max - tempS) / 50.0f) : ((temp_min - tempS) / 50.0f); - tempS += +rnd_float(-1.0, 1.0); - // IHUcpuTemp = (int)((tempS + rnd_float(-1.0, 1.0)) * 10 + 0.5); - other[IHU_TEMP] = tempS; - - voltage[map[BUS]] = rnd_float(5.0, 5.005); - current[map[BUS]] = rnd_float(158, 171); - - // float charging = current[map[PLUS_X]] + current[map[MINUS_X]] + current[map[PLUS_Y]] + current[map[MINUS_Y]] + current[map[PLUS_Z]] + current[map[MINUS_Z]]; - float charging = eclipse * (fabs(amps_max[0] * 0.707) + fabs(amps_max[1] * 0.707) + rnd_float(-4.0, 4.0)); - - current[map[BAT]] = ((current[map[BUS]] * voltage[map[BUS]]) / batt) - charging; - - // printf("charging: %f bat curr: %f bus curr: %f bat volt: %f bus volt: %f \n",charging, current[map[BAT]], current[map[BUS]], batt, voltage[map[BUS]]); - - batt -= (batt > 3.5) ? current[map[BAT]] / 30000 : current[map[BAT]] / 3000; - if (batt < 3.0) { - batt = 3.0; - NormalModeFailure = 1; - printf("Safe Mode!\n"); - } else - NormalModeFailure = 0; - - if (batt > 4.5) - batt = 4.5; - - voltage[map[BAT]] = batt + rnd_float(-0.01, 0.01); - - // end of simulated telemetry - } + } for (count1 = 0; count1 < 8; count1++) { if (voltage[count1] < voltage_min[count1]) From 5a8adeea2f5cf9f7318a9fe89b03b793b286f944 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 26 Dec 2020 16:19:25 -0500 Subject: [PATCH 005/252] typos --- afsk/main.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 899c2d58..9d89271d 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1068,6 +1068,7 @@ void get_tlm_fox() { float voltage[9], current[9], sensor[17], other[3]; + char sensor_payload[500]; memset(voltage, 0, sizeof(voltage)); memset(current, 0, sizeof(current)); memset(sensor, 0, sizeof(sensor)); @@ -1205,7 +1206,7 @@ else { } fclose(cpuTempSensor); - char sensor_payload[500]; + if (payload == ON) { STEMBoardFailure = 0; @@ -1269,9 +1270,18 @@ else { } } + if ((sensor_payload[0] == 'O') && (sensor_payload[1] == 'K')) { + for (count1 = 0; count1 < 17; count1++) { + if (sensor[count1] < sensor_min[count1]) + sensor_min[count1] = sensor[count1]; + if (sensor[count1] > sensor_max[count1]) + sensor_max[count1] = sensor[count1]; + + // printf("Smin %f Smax %f \n", sensor_min[count1], sensor_max[count1]); + } - for (count1 = 0; count1 < 8; count1++) { + for (int count1 = 0; count1 < 8; count1++) { if (voltage[count1] < voltage_min[count1]) voltage_min[count1] = voltage[count1]; if (current[count1] < current_min[count1]) @@ -1285,14 +1295,7 @@ else { // printf("Vmin %f Vmax %f Imin %f Imax %f \n", voltage_min[count1], voltage_max[count1], current_min[count1], current_max[count1]); } - if ((sensor_payload[0] == 'O') && (sensor_payload[1] == 'K')) { - for (count1 = 0; count1 < 17; count1++) { - if (sensor[count1] < sensor_min[count1]) - sensor_min[count1] = sensor[count1]; - if (sensor[count1] > sensor_max[count1]) - sensor_max[count1] = sensor[count1]; - // printf("Smin %f Smax %f \n", sensor_min[count1], sensor_max[count1]); } } From 1271e7b62c370e49255caf5ce47b2a29849490cd Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 26 Dec 2020 16:20:20 -0500 Subject: [PATCH 006/252] Update main.c --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 9d89271d..779fe8f6 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1299,7 +1299,7 @@ else { } } - for (count1 = 0; count1 < 3; count1++) { + for (int count1 = 0; count1 < 3; count1++) { if (other[count1] < other_min[count1]) other_min[count1] = other[count1]; if (other[count1] > other_max[count1]) From 67bda7538bdf324902ad2096d77ff3f1423dd4c1 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 26 Dec 2020 16:21:01 -0500 Subject: [PATCH 007/252] Update main.c --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 779fe8f6..497c981b 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1312,7 +1312,7 @@ else { if (loop % 8 == 0) { printf("Sending MIN frame \n"); frm_type = 0x03; - for (count1 = 0; count1 < 17; count1++) { + for (int count1 = 0; count1 < 17; count1++) { if (count1 < 3) other[count1] = other_min[count1]; if (count1 < 8) { From 82a96e1c5f8c690fad32c18623efea317d47012c Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 26 Dec 2020 16:25:39 -0500 Subject: [PATCH 008/252] turned off payload --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 497c981b..bd697609 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1208,7 +1208,7 @@ else { - if (payload == ON) { + if (payload == -55) { // ON STEMBoardFailure = 0; char c; From 162ecb1b3379ce9e22318770d5d6adea219e2482 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 26 Dec 2020 16:26:21 -0500 Subject: [PATCH 009/252] Update main.c --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index bd697609..04f3e888 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1326,7 +1326,7 @@ else { if ((loop + 4) % 8 == 0) { printf("Sending MAX frame \n"); frm_type = 0x02; - for (count1 = 0; count1 < 17; count1++) { + for (int count1 = 0; count1 < 17; count1++) { if (count1 < 3) other[count1] = other_max[count1]; if (count1 < 8) { From 4ec37242cd462203c2beed71adf23073493ecd20 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 26 Dec 2020 16:33:17 -0500 Subject: [PATCH 010/252] no python sensor read --- afsk/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 04f3e888..2cae01a8 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1050,7 +1050,7 @@ void get_tlm_fox() { // delay for sample period digitalWrite(txLed, txLedOn); #ifdef DEBUG_LOGGING - printf("Tx LED On\n"); +// printf("Tx LED On\n"); #endif /* while ((millis() - sampleTime) < (unsigned int)samplePeriod) @@ -1058,7 +1058,7 @@ void get_tlm_fox() { */ digitalWrite(txLed, txLedOff); #ifdef DEBUG_LOGGING - printf("Tx LED Off\n"); +// printf("Tx LED Off\n"); #endif printf("Sample period: %d\n", millis() - (unsigned int)sampleTime); @@ -1151,12 +1151,12 @@ else { int count1; char * token; char cmdbuffer[1000]; - +/* FILE * file = popen(pythonStr, "r"); fgets(cmdbuffer, 1000, file); // printf("result: %s\n", cmdbuffer); pclose(file); - +*/ const char space[2] = " "; token = strtok(cmdbuffer, space); From 75606058f157ac46b479ee68a7adceaac20de050 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 26 Dec 2020 16:39:29 -0500 Subject: [PATCH 011/252] added 3x sleep(1) --- afsk/main.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 2cae01a8..c1315057 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1160,8 +1160,6 @@ else { const char space[2] = " "; token = strtok(cmdbuffer, space); - - for (count1 = 0; count1 < 8; count1++) { if (token != NULL) { voltage[count1] = (float) atof(token); @@ -1182,7 +1180,10 @@ else { } // printf("\n"); - + + sleep(1); + printf("Sleep over\n"); + batteryVoltage = voltage[map[BAT]]; if (batteryVoltage < 3.5) { NormalModeFailure = 1; @@ -1346,6 +1347,9 @@ else { uptime = (int) uptime_sec; fclose(uptime_file); printf("Reset Count: %d Uptime since Reset: %ld \n", reset_count, uptime); + + sleep(1); + printf("Sleep over\n"); h[0] = (short int) ((h[0] & 0xf8) | (id & 0x07)); // 3 bits // printf("h[0] %x\n", h[0]); @@ -1532,6 +1536,9 @@ else { printf("\n"); */ #endif + + sleep(1); + printf("Sleep over\n"); int ctr2 = 0; memset(data10, 0, sizeof(data10)); From 3cf57030810ed77b4b3bf5bfbfcc74cc24bc5277 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 27 Dec 2020 09:31:53 -0500 Subject: [PATCH 012/252] added sleep(0.6) --- afsk/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index c1315057..bdd2106f 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1066,6 +1066,7 @@ void get_tlm_fox() { } else printf("first time - no sleep\n"); + sleep(0.6); float voltage[9], current[9], sensor[17], other[3]; char sensor_payload[500]; @@ -1181,7 +1182,7 @@ else { // printf("\n"); - sleep(1); + sleep(0.5); printf("Sleep over\n"); batteryVoltage = voltage[map[BAT]]; From 4deeee6e90fb944058d4dd6de9202108d8568c82 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 27 Dec 2020 09:36:51 -0500 Subject: [PATCH 013/252] changed to sleep(2.5) --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index bdd2106f..6f9b53ea 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1066,7 +1066,7 @@ void get_tlm_fox() { } else printf("first time - no sleep\n"); - sleep(0.6); + sleep(2.5); float voltage[9], current[9], sensor[17], other[3]; char sensor_payload[500]; From 47584fd4795fbe52f8f72aad7a028e3dbfce1641 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 27 Dec 2020 09:42:25 -0500 Subject: [PATCH 014/252] consolidated all into a sleep(4.5) --- afsk/main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 6f9b53ea..c845fa66 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1066,7 +1066,7 @@ void get_tlm_fox() { } else printf("first time - no sleep\n"); - sleep(2.5); + sleep(4.5); float voltage[9], current[9], sensor[17], other[3]; char sensor_payload[500]; @@ -1349,8 +1349,8 @@ else { fclose(uptime_file); printf("Reset Count: %d Uptime since Reset: %ld \n", reset_count, uptime); - sleep(1); - printf("Sleep over\n"); + //sleep(1); + //printf("Sleep over\n"); h[0] = (short int) ((h[0] & 0xf8) | (id & 0x07)); // 3 bits // printf("h[0] %x\n", h[0]); @@ -1538,8 +1538,8 @@ else { */ #endif - sleep(1); - printf("Sleep over\n"); + //sleep(1); + //printf("Sleep over\n"); int ctr2 = 0; memset(data10, 0, sizeof(data10)); From dfac052acd9e4eb8073be511e5d7d122cdedb0b7 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 27 Dec 2020 09:50:09 -0500 Subject: [PATCH 015/252] Two sleep(2.5) --- afsk/main.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index c845fa66..8b175f6c 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1066,7 +1066,7 @@ void get_tlm_fox() { } else printf("first time - no sleep\n"); - sleep(4.5); + sleep(2.5); float voltage[9], current[9], sensor[17], other[3]; char sensor_payload[500]; @@ -1679,11 +1679,13 @@ else { if (!error && transmit) { // digitalWrite (0, LOW); - printf("Sending %d buffer bytes over socket after %d ms!\n", ctr, (long unsigned int)millis() - start); + // printf("Sending %d buffer bytes over socket after %d ms!\n", ctr, (long unsigned int)millis() - start); start = millis(); int sock_ret = send(sock, buffer, (unsigned int)(ctr * 2 + 2), 0); printf("Millis5: %d Result of socket send: %d \n", (unsigned int)millis() - start, sock_ret); - + + sleep(2.5); + if (sock_ret < (ctr * 2 + 2)) { printf("Not resending\n"); // sock_ret = send(sock, buffer[sock_ret], ctr * 2 + 2 - sock_ret, 0); From 8befb7cf1422cdd41d7ab140cb45cbe6350ba0b4 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 27 Dec 2020 10:38:56 -0500 Subject: [PATCH 016/252] loop time test --- afsk/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 8b175f6c..d1b1151f 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -537,7 +537,9 @@ int main(int argc, char * argv[]) { while (loop-- != 0) { // frames_sent++; - + + loopTime = millis(); + sleep(2.0); printf("++++ Loop time: %d +++++\n", millis() - loopTime); loopTime = millis(); From bd5312165516daf16f301754108139322c362b7b Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 27 Dec 2020 10:44:05 -0500 Subject: [PATCH 017/252] more testing --- afsk/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index d1b1151f..6573826b 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -539,7 +539,7 @@ int main(int argc, char * argv[]) { // frames_sent++; loopTime = millis(); - sleep(2.0); + sleep(2); printf("++++ Loop time: %d +++++\n", millis() - loopTime); loopTime = millis(); @@ -551,6 +551,7 @@ int main(int argc, char * argv[]) { fprintf(stderr, "Battery voltage too low: %f V - shutting down!\n", batteryVoltage); digitalWrite(txLed, txLedOff); digitalWrite(onLed, onLedOff); + sleep(1); digitalWrite(onLed, onLedOn); sleep(1); From f2e0854b12f40d0cc47c66f30f4e7b601f95c68e Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 27 Dec 2020 10:52:26 -0500 Subject: [PATCH 018/252] all together again one sleep --- afsk/main.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 6573826b..875b41e0 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -538,8 +538,6 @@ int main(int argc, char * argv[]) { while (loop-- != 0) { // frames_sent++; - loopTime = millis(); - sleep(2); printf("++++ Loop time: %d +++++\n", millis() - loopTime); loopTime = millis(); @@ -1059,6 +1057,8 @@ void get_tlm_fox() { while ((millis() - sampleTime) < (unsigned int)samplePeriod) sleep((unsigned int)sleepTime); */ + sleep(3.5); + digitalWrite(txLed, txLedOff); #ifdef DEBUG_LOGGING // printf("Tx LED Off\n"); @@ -1069,7 +1069,7 @@ void get_tlm_fox() { } else printf("first time - no sleep\n"); - sleep(2.5); + float voltage[9], current[9], sensor[17], other[3]; char sensor_payload[500]; @@ -1185,8 +1185,9 @@ else { // printf("\n"); - sleep(0.5); - printf("Sleep over\n"); + +// sleep(0.5); +// printf("Sleep over\n"); batteryVoltage = voltage[map[BAT]]; if (batteryVoltage < 3.5) { @@ -1687,7 +1688,7 @@ else { int sock_ret = send(sock, buffer, (unsigned int)(ctr * 2 + 2), 0); printf("Millis5: %d Result of socket send: %d \n", (unsigned int)millis() - start, sock_ret); - sleep(2.5); +// sleep(2.5); if (sock_ret < (ctr * 2 + 2)) { printf("Not resending\n"); From 3d817f438243588dccb94360defbcb55f81268e5 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 27 Dec 2020 11:02:10 -0500 Subject: [PATCH 019/252] Almost every frame decoded, still buffer filling, try turning off first time --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 875b41e0..652bf6db 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -98,7 +98,7 @@ static int init_rf(); int socket_open = 0; int sock = 0; int loop = -1, loop_count = 0; -int firstTime = ON; +int firstTime = 0; // ON; long start; int testCount = 0; long time_start; From fffdff6b1057fdd13d7b9b5fc12acdb8b400c2ea Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 27 Dec 2020 11:16:10 -0500 Subject: [PATCH 020/252] reduced sleep from 3.5 to 3.2 to avoid buffer overflow --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 652bf6db..8b5d0ef1 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1057,7 +1057,7 @@ void get_tlm_fox() { while ((millis() - sampleTime) < (unsigned int)samplePeriod) sleep((unsigned int)sleepTime); */ - sleep(3.5); + sleep(3.2); digitalWrite(txLed, txLedOff); #ifdef DEBUG_LOGGING From 3ae7a2269125def18a5f3b21b7e4234e45be3f3c Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 27 Dec 2020 11:21:02 -0500 Subject: [PATCH 021/252] reduce to 3.0 --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 8b5d0ef1..1665c890 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1057,7 +1057,7 @@ void get_tlm_fox() { while ((millis() - sampleTime) < (unsigned int)samplePeriod) sleep((unsigned int)sleepTime); */ - sleep(3.2); + sleep(3.0); digitalWrite(txLed, txLedOff); #ifdef DEBUG_LOGGING From 5013b81bc07ea1de8f006a52f7988b37741a3594 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 27 Dec 2020 11:26:57 -0500 Subject: [PATCH 022/252] reduced to 2.5 --- afsk/main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 1665c890..30543d92 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -134,7 +134,8 @@ char call[5]; int bitRate, mode, bufLen, rsFrames, payloads, rsFrameLen, dataLen, headerLen, syncBits, syncWord, parityLen, samples, frameCnt, samplePeriod; float sleepTime; -int sampleTime = 0, frames_sent = 0; +unsigned int sampleTime = 0 +int frames_sent = 0; int cw_id = ON; int vB4 = FALSE, vB5 = FALSE, vB3 = FALSE, ax5043 = FALSE, transmit = FALSE, onLed, onLedOn, onLedOff, txLed, txLedOn, txLedOff, payload = OFF; float batteryThreshold = 3.0, batteryVoltage; @@ -1057,7 +1058,7 @@ void get_tlm_fox() { while ((millis() - sampleTime) < (unsigned int)samplePeriod) sleep((unsigned int)sleepTime); */ - sleep(3.0); + sleep(2.5); digitalWrite(txLed, txLedOff); #ifdef DEBUG_LOGGING @@ -1065,7 +1066,7 @@ void get_tlm_fox() { #endif printf("Sample period: %d\n", millis() - (unsigned int)sampleTime); - sampleTime = (int) millis(); + sampleTime = (unsigned int) millis(); } else printf("first time - no sleep\n"); From 41fe5ffebb7cc88c9ce685eebec9bf8a0ed78c1d Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 27 Dec 2020 11:27:39 -0500 Subject: [PATCH 023/252] typo --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 30543d92..bb926634 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -134,7 +134,7 @@ char call[5]; int bitRate, mode, bufLen, rsFrames, payloads, rsFrameLen, dataLen, headerLen, syncBits, syncWord, parityLen, samples, frameCnt, samplePeriod; float sleepTime; -unsigned int sampleTime = 0 +unsigned int sampleTime = 0; int frames_sent = 0; int cw_id = ON; int vB4 = FALSE, vB5 = FALSE, vB3 = FALSE, ax5043 = FALSE, transmit = FALSE, onLed, onLedOn, onLedOff, txLed, txLedOn, txLedOff, payload = OFF; From 93a1f6da2ea1be4b151cdf80486e4a472e4a3436 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 27 Dec 2020 15:19:44 -0500 Subject: [PATCH 024/252] added CPUQuota=5% --- systemd/cubesatsim.service | 1 + 1 file changed, 1 insertion(+) diff --git a/systemd/cubesatsim.service b/systemd/cubesatsim.service index 633f689d..c724ae7e 100644 --- a/systemd/cubesatsim.service +++ b/systemd/cubesatsim.service @@ -10,6 +10,7 @@ StandardOutput=inherit StandardError=inherit Restart=always User=root +CPUQuota=5% [Install] WantedBy=default.target From 315c8eadf4f3bef5c2195dabd2dae09f427a289f Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 27 Dec 2020 15:23:50 -0500 Subject: [PATCH 025/252] 2.5% --- systemd/cubesatsim.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/systemd/cubesatsim.service b/systemd/cubesatsim.service index c724ae7e..0ecfd02c 100644 --- a/systemd/cubesatsim.service +++ b/systemd/cubesatsim.service @@ -10,7 +10,7 @@ StandardOutput=inherit StandardError=inherit Restart=always User=root -CPUQuota=5% +CPUQuota=2.5% [Install] WantedBy=default.target From 33bdccde3da7a42fd5f8407a9af7d07eb0395039 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 27 Dec 2020 15:32:51 -0500 Subject: [PATCH 026/252] tried CPUQuota 15% --- systemd/rpitx.service | 1 + 1 file changed, 1 insertion(+) diff --git a/systemd/rpitx.service b/systemd/rpitx.service index c58b7bd1..0e628e4a 100644 --- a/systemd/rpitx.service +++ b/systemd/rpitx.service @@ -10,6 +10,7 @@ StandardOutput=inherit StandardError=inherit Restart=always User=root +CPUQuota=15% [Install] WantedBy=default.target From b08449fc9b67c6842eca610ed136b182a5a231d9 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 27 Dec 2020 15:44:06 -0500 Subject: [PATCH 027/252] added CPUAccounting=true --- systemd/cubesatsim.service | 1 + 1 file changed, 1 insertion(+) diff --git a/systemd/cubesatsim.service b/systemd/cubesatsim.service index 0ecfd02c..d43b3cac 100644 --- a/systemd/cubesatsim.service +++ b/systemd/cubesatsim.service @@ -10,6 +10,7 @@ StandardOutput=inherit StandardError=inherit Restart=always User=root +CPUAccounting=true CPUQuota=2.5% [Install] From b44c8defeff19565360cab23bc08e335e32f4d08 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 27 Dec 2020 15:47:00 -0500 Subject: [PATCH 028/252] removed CPU quota --- systemd/rpitx.service | 1 - 1 file changed, 1 deletion(-) diff --git a/systemd/rpitx.service b/systemd/rpitx.service index 0e628e4a..c58b7bd1 100644 --- a/systemd/rpitx.service +++ b/systemd/rpitx.service @@ -10,7 +10,6 @@ StandardOutput=inherit StandardError=inherit Restart=always User=root -CPUQuota=15% [Install] WantedBy=default.target From 739d111da5ab06353ab115a904fcda4381c320a2 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Dec 2020 10:34:49 -0500 Subject: [PATCH 029/252] removed sleep --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index bb926634..5d4fd01d 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1058,7 +1058,7 @@ void get_tlm_fox() { while ((millis() - sampleTime) < (unsigned int)samplePeriod) sleep((unsigned int)sleepTime); */ - sleep(2.5); +// sleep(2.5); digitalWrite(txLed, txLedOff); #ifdef DEBUG_LOGGING From e1ba9661537d824e5e467f553bea292b0d76516d Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Dec 2020 10:42:33 -0500 Subject: [PATCH 030/252] No sleep, buffer always full, almost 100% frames --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 5d4fd01d..5684a4e9 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1058,7 +1058,7 @@ void get_tlm_fox() { while ((millis() - sampleTime) < (unsigned int)samplePeriod) sleep((unsigned int)sleepTime); */ -// sleep(2.5); +// sleep(2.5); // No sleep at all! digitalWrite(txLed, txLedOff); #ifdef DEBUG_LOGGING From 729fe608a0a4db78d639e0fddb6398f8da625e50 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Dec 2020 10:57:08 -0500 Subject: [PATCH 031/252] changed to delay(2.5) --- afsk/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/afsk/main.c b/afsk/main.c index 5684a4e9..abb88b17 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1690,6 +1690,7 @@ else { printf("Millis5: %d Result of socket send: %d \n", (unsigned int)millis() - start, sock_ret); // sleep(2.5); + delsy(2.5); if (sock_ret < (ctr * 2 + 2)) { printf("Not resending\n"); From f081a668e0f6187337e47be7b3905b306baa273e Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Dec 2020 10:59:21 -0500 Subject: [PATCH 032/252] delay --- afsk/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index abb88b17..7c18a475 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -556,7 +556,7 @@ int main(int argc, char * argv[]) { sleep(1); digitalWrite(onLed, onLedOff); sleep(1); - digitalWrite(onLed, onLedOn); + digitalWrite(onLed, onLedOn);slee sleep(1); digitalWrite(onLed, onLedOff); @@ -1059,6 +1059,7 @@ void get_tlm_fox() { sleep((unsigned int)sleepTime); */ // sleep(2.5); // No sleep at all! + delay(2.5); digitalWrite(txLed, txLedOff); #ifdef DEBUG_LOGGING @@ -1690,7 +1691,7 @@ else { printf("Millis5: %d Result of socket send: %d \n", (unsigned int)millis() - start, sock_ret); // sleep(2.5); - delsy(2.5); + if (sock_ret < (ctr * 2 + 2)) { printf("Not resending\n"); From b89ba8c0ce49109de3b8d719ba56aa8c866bcf87 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Dec 2020 11:00:04 -0500 Subject: [PATCH 033/252] Update main.c --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 7c18a475..9fd51a5d 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -556,7 +556,7 @@ int main(int argc, char * argv[]) { sleep(1); digitalWrite(onLed, onLedOff); sleep(1); - digitalWrite(onLed, onLedOn);slee + digitalWrite(onLed, onLedOn); sleep(1); digitalWrite(onLed, onLedOff); From 55fbb3c52b2d8f13f472c5fed134047123a055c6 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Dec 2020 11:04:40 -0500 Subject: [PATCH 034/252] delay(3) --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 9fd51a5d..124d8dec 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1059,7 +1059,7 @@ void get_tlm_fox() { sleep((unsigned int)sleepTime); */ // sleep(2.5); // No sleep at all! - delay(2.5); + delay(3); digitalWrite(txLed, txLedOff); #ifdef DEBUG_LOGGING From 71234ff24f8ee2d09a98e4d00c4aff1a85b76f77 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Dec 2020 11:30:24 -0500 Subject: [PATCH 035/252] back to sleep(2.5) --- afsk/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 124d8dec..e8d12042 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1058,8 +1058,8 @@ void get_tlm_fox() { while ((millis() - sampleTime) < (unsigned int)samplePeriod) sleep((unsigned int)sleepTime); */ -// sleep(2.5); // No sleep at all! - delay(3); + sleep(2.5); // No sleep at all! + digitalWrite(txLed, txLedOff); #ifdef DEBUG_LOGGING From 42f9b0b82f2ff0de1e51e0a7c6280569cfb7fe99 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Dec 2020 16:45:37 -0500 Subject: [PATCH 036/252] added sleep(0.1) --- python/voltcurrent.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index f34e9e52..2794f18b 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -1,12 +1,15 @@ """Sample code and test for adafruit_in219""" # Reads all voltage and current sensors for two I2C buses - +import time import sys +time.sleep(0.1) #import board import busio +time.sleep(0.1) from adafruit_extended_bus import ExtendedI2C as I2C +time.sleep(0.1) from adafruit_ina219 import INA219 - +time.sleep(0.1) if __name__ == "__main__": # print 'Length: ', len(sys.argv) From 6c1b63be40680c04ea5e1f2baeb650c9b608722e Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Dec 2020 16:50:58 -0500 Subject: [PATCH 037/252] sleep 1.5 and python telem --- afsk/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index e8d12042..de9da6e2 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1058,7 +1058,7 @@ void get_tlm_fox() { while ((millis() - sampleTime) < (unsigned int)samplePeriod) sleep((unsigned int)sleepTime); */ - sleep(2.5); // No sleep at all! + sleep(1.5); // No sleep at all! digitalWrite(txLed, txLedOff); @@ -1157,12 +1157,12 @@ else { int count1; char * token; char cmdbuffer[1000]; -/* +/**/ FILE * file = popen(pythonStr, "r"); fgets(cmdbuffer, 1000, file); // printf("result: %s\n", cmdbuffer); pclose(file); -*/ +**/ const char space[2] = " "; token = strtok(cmdbuffer, space); From 40230331b683904a40947aed5a4a38a10d9263e0 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Dec 2020 16:53:07 -0500 Subject: [PATCH 038/252] Update main.c --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index de9da6e2..31037d53 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1162,7 +1162,7 @@ else { fgets(cmdbuffer, 1000, file); // printf("result: %s\n", cmdbuffer); pclose(file); -**/ +/**/ const char space[2] = " "; token = strtok(cmdbuffer, space); From 0ea71118cde160baf5c03a0d30862758ee2e1cac Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Dec 2020 17:14:56 -0500 Subject: [PATCH 039/252] added input test --- python/voltcurrent.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index 2794f18b..c43dbb2c 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -2,14 +2,11 @@ # Reads all voltage and current sensors for two I2C buses import time import sys -time.sleep(0.1) #import board import busio -time.sleep(0.1) from adafruit_extended_bus import ExtendedI2C as I2C -time.sleep(0.1) from adafruit_ina219 import INA219 -time.sleep(0.1) + if __name__ == "__main__": # print 'Length: ', len(sys.argv) @@ -67,3 +64,6 @@ if __name__ == "__main__": print("{:6.3f} ".format(0), "{:6.3f} ".format(0), "{:6.3f} ".format(0), "{:6.3f} ".format(0), "{:6.3f} ".format(0), "{:6.3f} ".format(0), "{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') # pass print(" ") + inp = input("Next?") + print(inp) + From 33cffd9fc4beba8233fc82ae161cdaa94e884f36 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Dec 2020 17:18:37 -0500 Subject: [PATCH 040/252] added while loop --- python/voltcurrent.py | 65 ++++++++++++++++++++++--------------------- 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index c43dbb2c..550552bf 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -26,44 +26,45 @@ if __name__ == "__main__": addresses = [0x40, 0x41, 0x44, 0x45] #INA219 addresses on the bus # print("buses: ", buses, " addr: ", addresses) - for x in buses: - try: - i2c_bus = I2C(x) # Device is /dev/i2c-x - for y in addresses: + while (True): + for x in buses: + try: + i2c_bus = I2C(x) # Device is /dev/i2c-x + for y in addresses: # print(x,y) - try: + try: # Create library object using Extended Bus I2C port # print("bus: ", x, " addr: ", y) - if x == 0 and y == 0x45: -# print("Reading INA219 in MoPower Board") - i2c_bus = I2C(1) - ina219 = INA219(i2c_bus, 0x4a) - else: - ina219 = INA219(i2c_bus, y) + if x == 0 and y == 0x45: +# print("Reading INA219 in MoPower Board") + i2c_bus = I2C(1) + ina219 = INA219(i2c_bus, 0x4a) + else: + ina219 = INA219(i2c_bus, y) -# print("ina219 test") - if config: -# print("Configuring") +# print("ina219 test") + if config: +# print("Configuring") # optional : change configuration to use 32 samples averaging for both bus voltage and shunt voltage - ina219.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S - ina219.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + ina219.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + ina219.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S # optional : change voltage range to 16V - ina219.bus_voltage_range = BusVoltageRange.RANGE_16V + ina219.bus_voltage_range = BusVoltageRange.RANGE_16V - bus_voltage = ina219.bus_voltage # voltage on V- (load side) -# shunt_voltage = ina219.shunt_voltage # voltage between V+ and V- across the shunt - current = ina219.current # current in mA - if x == 0 and y == 0x45: - current = current * 10 + bus_voltage = ina219.bus_voltage # voltage on V- (load side) +# shunt_voltage = ina219.shunt_voltage # voltage between V+ and V- across the shunt + current = ina219.current # current in mA + if x == 0 and y == 0x45: + current = current * 10 # INA219 measure bus voltage on the load side. So PSU voltage = bus_voltage + shunt_voltage -# print("{:6.3f}".format(bus_voltage + shunt_voltage)) - print("{:6.3f} ".format(bus_voltage), "{:6.3f} ".format(current) , end = '') - except: - print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') - except: - print("{:6.3f} ".format(0), "{:6.3f} ".format(0), "{:6.3f} ".format(0), "{:6.3f} ".format(0), "{:6.3f} ".format(0), "{:6.3f} ".format(0), "{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') -# pass - print(" ") - inp = input("Next?") - print(inp) +# print("{:6.3f}".format(bus_voltage + shunt_voltage)) + print("{:6.3f} ".format(bus_voltage), "{:6.3f} ".format(current) , end = '') + except: + print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') + except: + print("{:6.3f} ".format(0), "{:6.3f} ".format(0), "{:6.3f} ".format(0), "{:6.3f} ".format(0), "{:6.3f} ".format(0), "{:6.3f} ".format(0), "{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') +# pass + print(" ") + inp = input() + print(inp) From 97c381bed246534ee646df83bb8a997a2e9aece0 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Dec 2020 17:22:37 -0500 Subject: [PATCH 041/252] removed print --- python/voltcurrent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index 550552bf..e2ecf8af 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -66,5 +66,5 @@ if __name__ == "__main__": # pass print(" ") inp = input() - print(inp) +# print(inp) From d8cedd9f212a308779386b22be9976215bd16144 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Dec 2020 17:29:48 -0500 Subject: [PATCH 042/252] try new python --- afsk/main.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 31037d53..e88a20db 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -346,9 +346,21 @@ int main(int argc, char * argv[]) { FILE * file1 = popen(pythonConfigStr, "r"); char cmdbuffer[1000]; fgets(cmdbuffer, 1000, file1); - // printf("pythonStr result: %s\n", cmdbuffer); - pclose(file1); + printf("pythonStr result: %s\n", cmdbuffer); +// pclose(file1); Try new python + sleep(5); + fputc('\n', file1); + fgets(cmdbuffer, 1000, file1); + printf("pythonStr result2: %s\n", cmdbuffer); + + + sleep(5); + fputc('\n', file1); + fgets(cmdbuffer, 1000, file1); + printf("pythonStr result3: %s\n", cmdbuffer); + + // try connecting to Arduino payload using UART if (!ax5043 && !vB3) // don't test if AX5043 is present From 6b67bf70a69e9f2f433569bdf0ea72b6af2225c8 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Dec 2020 17:52:39 -0500 Subject: [PATCH 043/252] changed popen to rw --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index e88a20db..5291dca9 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -343,7 +343,7 @@ int main(int argc, char * argv[]) { strcat(pythonConfigStr, " c"); // FILE* file1 = popen("python3 /home/pi/CubeSatSim/python/voltcurrent.py 1 11 c", "r"); - FILE * file1 = popen(pythonConfigStr, "r"); + FILE * file1 = popen(pythonConfigStr, "rw"); char cmdbuffer[1000]; fgets(cmdbuffer, 1000, file1); printf("pythonStr result: %s\n", cmdbuffer); From 444ba6992d5b623c209e47243305f130184e7250 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Dec 2020 17:55:57 -0500 Subject: [PATCH 044/252] try r+ --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 5291dca9..7731cf25 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -343,7 +343,7 @@ int main(int argc, char * argv[]) { strcat(pythonConfigStr, " c"); // FILE* file1 = popen("python3 /home/pi/CubeSatSim/python/voltcurrent.py 1 11 c", "r"); - FILE * file1 = popen(pythonConfigStr, "rw"); + FILE * file1 = popen(pythonConfigStr, "r+"); char cmdbuffer[1000]; fgets(cmdbuffer, 1000, file1); printf("pythonStr result: %s\n", cmdbuffer); From a3e34d9ea55e6aa11ae94638d0291f780eb032a9 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Dec 2020 18:16:36 -0500 Subject: [PATCH 045/252] Try start process --- afsk/main.c | 47 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 7731cf25..36cd9e2d 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -126,6 +126,7 @@ int nrd; void write_to_buffer(int i, int symbol, int val); void write_wave(int i, short int * buffer); int uart_fd; +start_subprocess(char *const command[], int *pid, int *infd, int *outfd); int reset_count; float uptime_sec; @@ -343,12 +344,15 @@ int main(int argc, char * argv[]) { strcat(pythonConfigStr, " c"); // FILE* file1 = popen("python3 /home/pi/CubeSatSim/python/voltcurrent.py 1 11 c", "r"); - FILE * file1 = popen(pythonConfigStr, "r+"); + FILE * file1 = popen(pythonConfigStr, "r"); char cmdbuffer[1000]; fgets(cmdbuffer, 1000, file1); printf("pythonStr result: %s\n", cmdbuffer); -// pclose(file1); Try new python + pclose(file1); +int pid, infd, outfd; +printf("Start Process Result: %d %d %d %d \n", start_subprocess(pythonConfigStr, int *pid, int *infd, int *outfd), pid, infd, outfd); +/* sleep(5); fputc('\n', file1); fgets(cmdbuffer, 1000, file1); @@ -359,7 +363,7 @@ int main(int argc, char * argv[]) { fputc('\n', file1); fgets(cmdbuffer, 1000, file1); printf("pythonStr result3: %s\n", cmdbuffer); - +*/ // try connecting to Arduino payload using UART @@ -997,6 +1001,43 @@ void get_tlm(void) { return; } +// code by https://stackoverflow.com/users/2876370/pavel-%c5%a0imerda + +static bool start_subprocess(char *const command[], int *pid, int *infd, int *outfd) +{ + int p1[2], p2[2]; + + if (!pid || !infd || !outfd) + return false; + + if (pipe(p1) == -1) + goto err_pipe1; + if (pipe(p2) == -1) + goto err_pipe2; + if ((*pid = fork()) == -1) + goto err_fork; + + if (*pid) { + /* Parent process. */ + *infd = p1[1]; + *outfd = p2[0]; + close(p1[0]); + close(p2[1]); + return true; + } else { + /* Child process. */ + dup2(p1[0], 0); + dup2(p2[1], 1); + close(p1[0]); + close(p1[1]); + close(p2[0]); + close(p2[1]); + execvp(*command, command); + /* Error occured. */ + fprintf(stderr, "error running %s: %s", *command, strerror(errno)); + abort(); + } + void get_tlm_fox() { // Reading I2C voltage and current sensors From 100aabd8f13dbeb1242cb290da48c42a4082f50d Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Dec 2020 18:17:56 -0500 Subject: [PATCH 046/252] bool to int --- afsk/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 36cd9e2d..bd61438d 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -126,7 +126,7 @@ int nrd; void write_to_buffer(int i, int symbol, int val); void write_wave(int i, short int * buffer); int uart_fd; -start_subprocess(char *const command[], int *pid, int *infd, int *outfd); +int start_subprocess(char *const command[], int *pid, int *infd, int *outfd); int reset_count; float uptime_sec; @@ -1003,7 +1003,7 @@ void get_tlm(void) { // code by https://stackoverflow.com/users/2876370/pavel-%c5%a0imerda -static bool start_subprocess(char *const command[], int *pid, int *infd, int *outfd) +int start_subprocess(char *const command[], int *pid, int *infd, int *outfd) { int p1[2], p2[2]; From b8fe0cef95597f182ce099a7d84e4f483028bd72 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Dec 2020 18:19:43 -0500 Subject: [PATCH 047/252] Update main.c --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index bd61438d..444e96ba 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -351,7 +351,7 @@ int main(int argc, char * argv[]) { pclose(file1); int pid, infd, outfd; -printf("Start Process Result: %d %d %d %d \n", start_subprocess(pythonConfigStr, int *pid, int *infd, int *outfd), pid, infd, outfd); +printf("Start Process Result: %d %d %d %d \n", start_subprocess(pythonConfigStr, &pid, &infd, &outfd), pid, infd, outfd); /* sleep(5); fputc('\n', file1); From 27399f202283dbe0ead6dc956387d5491726df20 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Dec 2020 18:21:01 -0500 Subject: [PATCH 048/252] Update main.c --- afsk/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 444e96ba..a02ad5e7 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1008,7 +1008,7 @@ int start_subprocess(char *const command[], int *pid, int *infd, int *outfd) int p1[2], p2[2]; if (!pid || !infd || !outfd) - return false; + return 0; if (pipe(p1) == -1) goto err_pipe1; @@ -1023,7 +1023,7 @@ int start_subprocess(char *const command[], int *pid, int *infd, int *outfd) *outfd = p2[0]; close(p1[0]); close(p2[1]); - return true; + return 1; } else { /* Child process. */ dup2(p1[0], 0); From 4ee4fe78475bfc49b942c93f7003c0d3d59abb0d Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Dec 2020 18:22:28 -0500 Subject: [PATCH 049/252] Update main.c --- afsk/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/afsk/main.c b/afsk/main.c index a02ad5e7..f04fc010 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1037,6 +1037,7 @@ int start_subprocess(char *const command[], int *pid, int *infd, int *outfd) fprintf(stderr, "error running %s: %s", *command, strerror(errno)); abort(); } +} void get_tlm_fox() { From 203f9cee90bb4044fa795a3d1e2bf62c916d4f37 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Dec 2020 18:24:43 -0500 Subject: [PATCH 050/252] handled errors --- afsk/main.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index f04fc010..74aa5bee 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1010,12 +1010,16 @@ int start_subprocess(char *const command[], int *pid, int *infd, int *outfd) if (!pid || !infd || !outfd) return 0; - if (pipe(p1) == -1) - goto err_pipe1; - if (pipe(p2) == -1) - goto err_pipe2; - if ((*pid = fork()) == -1) - goto err_fork; + if (pipe(p1) == -1) { + printf("Error pipe1\n"); + return 0; + } if (pipe(p2) == -1) { + printf("Error pipe2\n"); + return 0; + } if ((*pid = fork()) == -1) { + printf("Error fork\n"); + return 0; + } if (*pid) { /* Parent process. */ From a6a48b52a69e24d10062c649dba66290fcda4f96 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Dec 2020 18:27:23 -0500 Subject: [PATCH 051/252] Update main.c --- afsk/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 74aa5bee..5e37d96a 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -342,14 +342,14 @@ int main(int argc, char * argv[]) { strcat(pythonStr, busStr); strcat(pythonConfigStr, pythonStr); strcat(pythonConfigStr, " c"); - +/* // FILE* file1 = popen("python3 /home/pi/CubeSatSim/python/voltcurrent.py 1 11 c", "r"); FILE * file1 = popen(pythonConfigStr, "r"); char cmdbuffer[1000]; fgets(cmdbuffer, 1000, file1); printf("pythonStr result: %s\n", cmdbuffer); pclose(file1); - +*/ int pid, infd, outfd; printf("Start Process Result: %d %d %d %d \n", start_subprocess(pythonConfigStr, &pid, &infd, &outfd), pid, infd, outfd); /* From 817e20da8abc30cce6a14e174a124001a133ba0a Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Dec 2020 18:31:20 -0500 Subject: [PATCH 052/252] try in and out --- afsk/main.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 5e37d96a..5b3a8e7e 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -352,17 +352,19 @@ int main(int argc, char * argv[]) { */ int pid, infd, outfd; printf("Start Process Result: %d %d %d %d \n", start_subprocess(pythonConfigStr, &pid, &infd, &outfd), pid, infd, outfd); -/* + fgets(cmdbuffer, 1000, outfd); + printf("pythonStr result: %s\n", cmdbuffer); + sleep(5); - fputc('\n', file1); - fgets(cmdbuffer, 1000, file1); + fputc('\n', infd); + fgets(cmdbuffer, 1000, outfd); printf("pythonStr result2: %s\n", cmdbuffer); sleep(5); - fputc('\n', file1); - fgets(cmdbuffer, 1000, file1); - printf("pythonStr result3: %s\n", cmdbuffer); + fputc('\n', infd); + fgets(cmdbuffer, 1000, outfd); + printf("pythonStr result2: %s\n", cmdbuffer); */ // try connecting to Arduino payload using UART From 1f7aa9b4024625190b20bc6245cfc4af38be48d8 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Dec 2020 18:32:04 -0500 Subject: [PATCH 053/252] Update main.c --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 5b3a8e7e..0964911b 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -365,7 +365,7 @@ printf("Start Process Result: %d %d %d %d \n", start_subprocess(pythonConfigStr, fputc('\n', infd); fgets(cmdbuffer, 1000, outfd); printf("pythonStr result2: %s\n", cmdbuffer); -*/ + // try connecting to Arduino payload using UART From 036a850aae737bb8d76775b05884fd1bd3dc3d9d Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Dec 2020 18:33:49 -0500 Subject: [PATCH 054/252] Update main.c --- afsk/main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 0964911b..4a790333 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -352,18 +352,18 @@ int main(int argc, char * argv[]) { */ int pid, infd, outfd; printf("Start Process Result: %d %d %d %d \n", start_subprocess(pythonConfigStr, &pid, &infd, &outfd), pid, infd, outfd); - fgets(cmdbuffer, 1000, outfd); + fgets(cmdbuffer, 1000, FILE *outfd); printf("pythonStr result: %s\n", cmdbuffer); sleep(5); - fputc('\n', infd); - fgets(cmdbuffer, 1000, outfd); + fputc('\n', FILE *infd); + fgets(cmdbuffer, 1000, FILE *outfd); printf("pythonStr result2: %s\n", cmdbuffer); sleep(5); - fputc('\n', infd); - fgets(cmdbuffer, 1000, outfd); + fputc('\n', FILE*infd); + fgets(cmdbuffer, 1000, FILE *outfd); printf("pythonStr result2: %s\n", cmdbuffer); From 36706a6c81f9997370cdde446855829beeeae556 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Dec 2020 18:35:25 -0500 Subject: [PATCH 055/252] Update main.c --- afsk/main.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 4a790333..20d7a73b 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -342,28 +342,30 @@ int main(int argc, char * argv[]) { strcat(pythonStr, busStr); strcat(pythonConfigStr, pythonStr); strcat(pythonConfigStr, " c"); + + char cmdbuffer[1000]; /* // FILE* file1 = popen("python3 /home/pi/CubeSatSim/python/voltcurrent.py 1 11 c", "r"); FILE * file1 = popen(pythonConfigStr, "r"); - char cmdbuffer[1000]; + fgets(cmdbuffer, 1000, file1); printf("pythonStr result: %s\n", cmdbuffer); pclose(file1); */ int pid, infd, outfd; printf("Start Process Result: %d %d %d %d \n", start_subprocess(pythonConfigStr, &pid, &infd, &outfd), pid, infd, outfd); - fgets(cmdbuffer, 1000, FILE *outfd); + fgets(cmdbuffer, 1000, (FILE *)outfd); printf("pythonStr result: %s\n", cmdbuffer); sleep(5); - fputc('\n', FILE *infd); - fgets(cmdbuffer, 1000, FILE *outfd); + fputc('\n', (FILE *)infd); + fgets(cmdbuffer, 1000, (FILE *)outfd); printf("pythonStr result2: %s\n", cmdbuffer); sleep(5); - fputc('\n', FILE*infd); - fgets(cmdbuffer, 1000, FILE *outfd); + fputc('\n', (FILE *)infd); + fgets(cmdbuffer, 1000, (FILE *)outfd); printf("pythonStr result2: %s\n", cmdbuffer); From 1d2f100c748f36a1151e64916dccef07eeb0245a Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Dec 2020 22:13:22 -0500 Subject: [PATCH 056/252] changed to popen w --- afsk/main.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 20d7a73b..76078551 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -344,28 +344,28 @@ int main(int argc, char * argv[]) { strcat(pythonConfigStr, " c"); char cmdbuffer[1000]; -/* + // FILE* file1 = popen("python3 /home/pi/CubeSatSim/python/voltcurrent.py 1 11 c", "r"); - FILE * file1 = popen(pythonConfigStr, "r"); + FILE * file1 = popen(pythonConfigStr, "w"); fgets(cmdbuffer, 1000, file1); printf("pythonStr result: %s\n", cmdbuffer); - pclose(file1); -*/ -int pid, infd, outfd; -printf("Start Process Result: %d %d %d %d \n", start_subprocess(pythonConfigStr, &pid, &infd, &outfd), pid, infd, outfd); - fgets(cmdbuffer, 1000, (FILE *)outfd); - printf("pythonStr result: %s\n", cmdbuffer); +// pclose(file1); + +// int pid, infd, outfd; +// printf("Start Process Result: %d %d %d %d \n", start_subprocess(pythonConfigStr, &pid, &infd, &outfd), pid, infd, outfd); +// fgets(cmdbuffer, 1000, (FILE *)outfd); + // printf("pythonStr result: %s\n", cmdbuffer); sleep(5); - fputc('\n', (FILE *)infd); - fgets(cmdbuffer, 1000, (FILE *)outfd); + fputc('\n', file1); + fgets(cmdbuffer, 1000, file1); printf("pythonStr result2: %s\n", cmdbuffer); sleep(5); - fputc('\n', (FILE *)infd); - fgets(cmdbuffer, 1000, (FILE *)outfd); + fputc('\n', file1); + fgets(cmdbuffer, 1000, file1); printf("pythonStr result2: %s\n", cmdbuffer); From 1733e4cab7f97adf1dc5d468c28e48e0919317e6 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Dec 2020 22:22:10 -0500 Subject: [PATCH 057/252] made cmdbuffer and file1 globals, keep open --- afsk/main.c | 79 ++++++++++------------------------------------------- 1 file changed, 14 insertions(+), 65 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 76078551..780f0b9e 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -102,7 +102,8 @@ int firstTime = 0; // ON; long start; int testCount = 0; long time_start; - +char cmdbuffer[1000]; +FILE * file1; short int buffer[2336400]; // max size for 10 frames count of BPSK #define S_RATE (48000) // (44100) @@ -126,7 +127,6 @@ int nrd; void write_to_buffer(int i, int symbol, int val); void write_wave(int i, short int * buffer); int uart_fd; -int start_subprocess(char *const command[], int *pid, int *infd, int *outfd); int reset_count; float uptime_sec; @@ -343,32 +343,23 @@ int main(int argc, char * argv[]) { strcat(pythonConfigStr, pythonStr); strcat(pythonConfigStr, " c"); - char cmdbuffer[1000]; - - // FILE* file1 = popen("python3 /home/pi/CubeSatSim/python/voltcurrent.py 1 11 c", "r"); - FILE * file1 = popen(pythonConfigStr, "w"); + file1 = popen(pythonConfigStr, "w"); fgets(cmdbuffer, 1000, file1); - printf("pythonStr result: %s\n", cmdbuffer); + printf("pythonStr result: %s\n", cmdbuffer); // pclose(file1); -// int pid, infd, outfd; -// printf("Start Process Result: %d %d %d %d \n", start_subprocess(pythonConfigStr, &pid, &infd, &outfd), pid, infd, outfd); -// fgets(cmdbuffer, 1000, (FILE *)outfd); - // printf("pythonStr result: %s\n", cmdbuffer); - sleep(5); fputc('\n', file1); fgets(cmdbuffer, 1000, file1); - printf("pythonStr result2: %s\n", cmdbuffer); + printf("pythonStr result2: %s\n", cmdbuffer); sleep(5); fputc('\n', file1); fgets(cmdbuffer, 1000, file1); - printf("pythonStr result2: %s\n", cmdbuffer); + printf("pythonStr result2: %s\n", cmdbuffer); - // try connecting to Arduino payload using UART if (!ax5043 && !vB3) // don't test if AX5043 is present @@ -418,12 +409,12 @@ int main(int argc, char * argv[]) { i2c_bus3 = (test_i2c_bus(3) != -1) ? ON : OFF; // check for camera - char cmdbuffer1[1000]; +// char cmdbuffer1[1000]; FILE * file4 = popen("vcgencmd get_camera", "r"); - fgets(cmdbuffer1, 1000, file4); + fgets(cmdbuffer, 1000, file4); char camera_present[] = "supported=1 detected=1"; // printf("strstr: %s \n", strstr( & cmdbuffer1, camera_present)); - camera = (strstr( (const char *)& cmdbuffer1, camera_present) != NULL) ? ON : OFF; + camera = (strstr( (const char *)& cmdbuffer, camera_present) != NULL) ? ON : OFF; // printf("Camera result:%s camera: %d \n", & cmdbuffer1, camera); pclose(file4); @@ -678,7 +669,7 @@ void get_tlm(void) { int count1; char * token; - char cmdbuffer[1000]; +// char cmdbuffer[1000]; FILE * file = popen(pythonStr, "r"); fgets(cmdbuffer, 1000, file); @@ -1005,48 +996,6 @@ void get_tlm(void) { return; } -// code by https://stackoverflow.com/users/2876370/pavel-%c5%a0imerda - -int start_subprocess(char *const command[], int *pid, int *infd, int *outfd) -{ - int p1[2], p2[2]; - - if (!pid || !infd || !outfd) - return 0; - - if (pipe(p1) == -1) { - printf("Error pipe1\n"); - return 0; - } if (pipe(p2) == -1) { - printf("Error pipe2\n"); - return 0; - } if ((*pid = fork()) == -1) { - printf("Error fork\n"); - return 0; - } - - if (*pid) { - /* Parent process. */ - *infd = p1[1]; - *outfd = p2[0]; - close(p1[0]); - close(p2[1]); - return 1; - } else { - /* Child process. */ - dup2(p1[0], 0); - dup2(p2[1], 1); - close(p1[0]); - close(p1[1]); - close(p2[0]); - close(p2[1]); - execvp(*command, command); - /* Error occured. */ - fprintf(stderr, "error running %s: %s", *command, strerror(errno)); - abort(); - } -} - void get_tlm_fox() { // Reading I2C voltage and current sensors @@ -1218,12 +1167,12 @@ void get_tlm_fox() { else { int count1; char * token; - char cmdbuffer[1000]; +// char cmdbuffer[1000]; /**/ - FILE * file = popen(pythonStr, "r"); - fgets(cmdbuffer, 1000, file); +// FILE * file = popen(pythonStr, "r"); + fgets(cmdbuffer, 1000, file1); // printf("result: %s\n", cmdbuffer); - pclose(file); +// pclose(file); /**/ const char space[2] = " "; token = strtok(cmdbuffer, space); From 211da494be30850bdad8213c467bc435bf87a079 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Dec 2020 22:25:41 -0500 Subject: [PATCH 058/252] sleep(3.5) now with quicker python sensor reads --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 780f0b9e..9a3be624 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1069,7 +1069,7 @@ void get_tlm_fox() { while ((millis() - sampleTime) < (unsigned int)samplePeriod) sleep((unsigned int)sleepTime); */ - sleep(1.5); // No sleep at all! + sleep(3.5); // No sleep at all! digitalWrite(txLed, txLedOff); From 5279c8f36fba5db9e439fecb27408a1265f78e8f Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Dec 2020 22:30:15 -0500 Subject: [PATCH 059/252] working with every frame, fixing telem read --- afsk/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/afsk/main.c b/afsk/main.c index 9a3be624..900ed293 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1170,6 +1170,7 @@ else { // char cmdbuffer[1000]; /**/ // FILE * file = popen(pythonStr, "r"); + fputc('\n', file1); fgets(cmdbuffer, 1000, file1); // printf("result: %s\n", cmdbuffer); // pclose(file); From f655d2f801ae9c693e491da2dc98984d644baf0e Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Dec 2020 22:36:43 -0500 Subject: [PATCH 060/252] printf python read result --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 900ed293..1385a15d 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1172,7 +1172,7 @@ else { // FILE * file = popen(pythonStr, "r"); fputc('\n', file1); fgets(cmdbuffer, 1000, file1); - // printf("result: %s\n", cmdbuffer); + printf("Python read Result: %s\n", cmdbuffer); // pclose(file); /**/ const char space[2] = " "; From bad0056b37d7d9ee196664adb512d1f8f4e4acbd Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Dec 2020 22:40:13 -0500 Subject: [PATCH 061/252] testing python read --- afsk/main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 1385a15d..2d4593da 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -347,13 +347,18 @@ int main(int argc, char * argv[]) { fgets(cmdbuffer, 1000, file1); printf("pythonStr result: %s\n", cmdbuffer); + fgets(cmdbuffer, 1000, file1); + printf("pythonStr resulta: %s\n", cmdbuffer); + fgets(cmdbuffer, 1000, file1); + printf("pythonStr resultb: %s\n", cmdbuffer); // pclose(file1); sleep(5); fputc('\n', file1); fgets(cmdbuffer, 1000, file1); printf("pythonStr result2: %s\n", cmdbuffer); - + fgets(cmdbuffer, 1000, file1); + printf("pythonStr result2a: %s\n", cmdbuffer); sleep(5); fputc('\n', file1); From 2881b595cf0c9eebd6b90d33bb1a8a321eae1b58 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Dec 2020 22:43:58 -0500 Subject: [PATCH 062/252] added stdin --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 2d4593da..52e64973 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -341,7 +341,7 @@ int main(int argc, char * argv[]) { strcpy(pythonStr, pythonCmd); strcat(pythonStr, busStr); strcat(pythonConfigStr, pythonStr); - strcat(pythonConfigStr, " c"); + strcat(pythonConfigStr, " c >sdtin"); // added stdin file1 = popen(pythonConfigStr, "w"); From ee66bfa171ac939d4fddb807d20a5aa656089065 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Dec 2020 22:45:35 -0500 Subject: [PATCH 063/252] typo --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 52e64973..53243729 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -341,7 +341,7 @@ int main(int argc, char * argv[]) { strcpy(pythonStr, pythonCmd); strcat(pythonStr, busStr); strcat(pythonConfigStr, pythonStr); - strcat(pythonConfigStr, " c >sdtin"); // added stdin + strcat(pythonConfigStr, " c >stdin"); // added stdin file1 = popen(pythonConfigStr, "w"); From c209010fe87e19b1b6926db7c8fd55986ad4b0e1 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Dec 2020 22:46:32 -0500 Subject: [PATCH 064/252] stdout --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 53243729..c27d24c0 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -341,7 +341,7 @@ int main(int argc, char * argv[]) { strcpy(pythonStr, pythonCmd); strcat(pythonStr, busStr); strcat(pythonConfigStr, pythonStr); - strcat(pythonConfigStr, " c >stdin"); // added stdin + strcat(pythonConfigStr, " c >stdout"); // added stdin file1 = popen(pythonConfigStr, "w"); From bf44272ed20c98f961eb3051eb4bc507ab5ceb29 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Dec 2020 23:02:32 -0500 Subject: [PATCH 065/252] try new sopen --- afsk/main.c | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index c27d24c0..cf17aa20 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -105,6 +105,7 @@ long time_start; char cmdbuffer[1000]; FILE * file1; short int buffer[2336400]; // max size for 10 frames count of BPSK +FILE *sopen(const char *program); #define S_RATE (48000) // (44100) @@ -341,7 +342,17 @@ int main(int argc, char * argv[]) { strcpy(pythonStr, pythonCmd); strcat(pythonStr, busStr); strcat(pythonConfigStr, pythonStr); - strcat(pythonConfigStr, " c >stdout"); // added stdin + strcat(pythonConfigStr, " c"); + + file1 = sopen(pythonConfigStr); // try new function + fgets(cmdbuffer, 1000, file1); + printf("pythonStr result: %s\n", cmdbuffer); + + sleep(5); + fputc('\n', file1); + fgets(cmdbuffer, 1000, file1); + printf("pythonStr result2: %s\n", cmdbuffer); + file1 = popen(pythonConfigStr, "w"); @@ -1735,6 +1746,35 @@ else { return; } + +// code by https://stackoverflow.com/questions/25161377/open-a-cmd-program-with-full-functionality-i-o/25177958#25177958 + + FILE *sopen(const char *program) + { + int fds[2]; + pid_t pid; + + if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds) < 0) + return NULL; + + switch(pid=vfork()) { + case -1: /* Error */ + close(fds[0]); + close(fds[1]); + return NULL; + case 0: /* child */ + close(fds[0]); + dup2(fds[1], 0); + dup2(fds[1], 1); + close(fds[1]); + execl("/bin/sh", "sh", "-c", program, NULL); + _exit(127); + } + /* parent */ + close(fds[1]); + return fdopen(fds[0], "r+"); + } + /* * TelemEncoding.h * From e4e148ca069851a6cfd6fee1c96706421e84fde0 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Dec 2020 23:08:14 -0500 Subject: [PATCH 066/252] took out old file1 code --- afsk/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index cf17aa20..12a9bb25 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -353,7 +353,7 @@ int main(int argc, char * argv[]) { fgets(cmdbuffer, 1000, file1); printf("pythonStr result2: %s\n", cmdbuffer); - +/* file1 = popen(pythonConfigStr, "w"); fgets(cmdbuffer, 1000, file1); @@ -375,7 +375,7 @@ int main(int argc, char * argv[]) { fputc('\n', file1); fgets(cmdbuffer, 1000, file1); printf("pythonStr result2: %s\n", cmdbuffer); - +*/ // try connecting to Arduino payload using UART if (!ax5043 && !vB3) // don't test if AX5043 is present From 18a2c69b2b37b4b5149e69e07e08673475844f63 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Dec 2020 23:12:14 -0500 Subject: [PATCH 067/252] sleep(2.8) --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 12a9bb25..4e630cb0 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1085,7 +1085,7 @@ void get_tlm_fox() { while ((millis() - sampleTime) < (unsigned int)samplePeriod) sleep((unsigned int)sleepTime); */ - sleep(3.5); // No sleep at all! + sleep(2.8); // No sleep at all! digitalWrite(txLed, txLedOff); From 630c6f2a0f437ff7eb6f52cb161b17ddbf6ffbaa Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 29 Dec 2020 09:06:41 -0500 Subject: [PATCH 068/252] removed python read --- afsk/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 4e630cb0..258098a8 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1184,13 +1184,13 @@ else { int count1; char * token; // char cmdbuffer[1000]; -/**/ +/* // FILE * file = popen(pythonStr, "r"); fputc('\n', file1); fgets(cmdbuffer, 1000, file1); printf("Python read Result: %s\n", cmdbuffer); // pclose(file); -/**/ +*/ const char space[2] = " "; token = strtok(cmdbuffer, space); From 2507048f8f4aaa4133d2f688277d961412962636 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 29 Dec 2020 09:15:40 -0500 Subject: [PATCH 069/252] reduce sleep time --- afsk/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 258098a8..7777d3a1 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1085,7 +1085,7 @@ void get_tlm_fox() { while ((millis() - sampleTime) < (unsigned int)samplePeriod) sleep((unsigned int)sleepTime); */ - sleep(2.8); // No sleep at all! + sleep(2.3); // No sleep at all! digitalWrite(txLed, txLedOff); @@ -1184,13 +1184,13 @@ else { int count1; char * token; // char cmdbuffer[1000]; -/* +/**/ // FILE * file = popen(pythonStr, "r"); fputc('\n', file1); fgets(cmdbuffer, 1000, file1); - printf("Python read Result: %s\n", cmdbuffer); +// printf("Python read Result: %s\n", cmdbuffer); // pclose(file); -*/ +/**/ const char space[2] = " "; token = strtok(cmdbuffer, space); From 53f0c5a9859539fd6169af5c60ce12ab442d1e57 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 29 Dec 2020 09:18:24 -0500 Subject: [PATCH 070/252] added cpulimit & --- demo.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/demo.sh b/demo.sh index de318527..38aa9a74 100755 --- a/demo.sh +++ b/demo.sh @@ -15,8 +15,9 @@ if [[ ("$1" = "a" ) || (("$1" = "c") && ("$(($y %4))" = 3)) ]]; then echo "Mode is continuous AFSK" /home/pi/CubeSatSim/radioafsk afsk elif [[ ("$1" = "b" ) || (("$1" = "c") && ("$(($y %4))" = 1)) ]]; then - echo "Mode is continuous BPSK" - /home/pi/CubeSatSim/radioafsk bpsk + echo "Mode is continuous BPSK" + sudo cpulimit -l 5 -P radioafsk & + /home/pi/CubeSatSim/radioafsk bpsk elif [[ ("$1" = "s" ) || (("$1" = "c") && ("$(($y %4))" = 2)) ]]; then echo "Mode is continuous SSTV" while true; do sleep 5; done From 2a81c4d4a5369093933154deda80186f65c3f5f9 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 29 Dec 2020 09:22:20 -0500 Subject: [PATCH 071/252] take python read out --- afsk/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 7777d3a1..ecd236a5 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1184,13 +1184,13 @@ else { int count1; char * token; // char cmdbuffer[1000]; -/**/ +/* // FILE * file = popen(pythonStr, "r"); fputc('\n', file1); fgets(cmdbuffer, 1000, file1); // printf("Python read Result: %s\n", cmdbuffer); // pclose(file); -/**/ +*/ const char space[2] = " "; token = strtok(cmdbuffer, space); From 115aaeff58b8efe8d57ae0f6a6437d48b8d1379d Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 29 Dec 2020 10:22:29 -0500 Subject: [PATCH 072/252] Update main.c --- afsk/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index ecd236a5..0e2d6ab2 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1086,7 +1086,7 @@ void get_tlm_fox() { sleep((unsigned int)sleepTime); */ sleep(2.3); // No sleep at all! - +// sleep(1.3); digitalWrite(txLed, txLedOff); #ifdef DEBUG_LOGGING @@ -1184,13 +1184,13 @@ else { int count1; char * token; // char cmdbuffer[1000]; -/* +/**/ // FILE * file = popen(pythonStr, "r"); fputc('\n', file1); fgets(cmdbuffer, 1000, file1); // printf("Python read Result: %s\n", cmdbuffer); // pclose(file); -*/ +/**/ const char space[2] = " "; token = strtok(cmdbuffer, space); From ead8ddddca046000b365302004d397516641ab99 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 29 Dec 2020 11:37:26 -0500 Subject: [PATCH 073/252] reogranized without looping --- python/voltcurrent.py | 89 ++++++++++++++++++++++++++----------------- 1 file changed, 53 insertions(+), 36 deletions(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index e2ecf8af..5decd333 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -26,45 +26,62 @@ if __name__ == "__main__": addresses = [0x40, 0x41, 0x44, 0x45] #INA219 addresses on the bus # print("buses: ", buses, " addr: ", addresses) - while (True): - for x in buses: - try: - i2c_bus = I2C(x) # Device is /dev/i2c-x - for y in addresses: + +# config + + for x in buses: + try: + i2c_bus = I2C(x) # Device is /dev/i2c-x + for y in addresses: # print(x,y) - try: + try: # Create library object using Extended Bus I2C port -# print("bus: ", x, " addr: ", y) - if x == 0 and y == 0x45: -# print("Reading INA219 in MoPower Board") - i2c_bus = I2C(1) - ina219 = INA219(i2c_bus, 0x4a) - else: - ina219 = INA219(i2c_bus, y) - -# print("ina219 test") - if config: -# print("Configuring") +# print("bus: ", x, " addr: ", y) + if x == 0 and y == 0x45: +# print("Reading INA219 in MoPower Board") + i2c_bus = I2C(1) + ina219 = INA219(i2c_bus, 0x4a) + else: + ina219 = INA219(i2c_bus, y) +# print("ina219 test") + +# print("Configuring") # optional : change configuration to use 32 samples averaging for both bus voltage and shunt voltage - ina219.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S - ina219.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + ina219.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + ina219.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S # optional : change voltage range to 16V - ina219.bus_voltage_range = BusVoltageRange.RANGE_16V + ina219.bus_voltage_range = BusVoltageRange.RANGE_16V + +# No try checking yet - bus_voltage = ina219.bus_voltage # voltage on V- (load side) -# shunt_voltage = ina219.shunt_voltage # voltage between V+ and V- across the shunt - current = ina219.current # current in mA - if x == 0 and y == 0x45: - current = current * 10 -# INA219 measure bus voltage on the load side. So PSU voltage = bus_voltage + shunt_voltage -# print("{:6.3f}".format(bus_voltage + shunt_voltage)) - print("{:6.3f} ".format(bus_voltage), "{:6.3f} ".format(current) , end = '') - except: - print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') - except: - print("{:6.3f} ".format(0), "{:6.3f} ".format(0), "{:6.3f} ".format(0), "{:6.3f} ".format(0), "{:6.3f} ".format(0), "{:6.3f} ".format(0), "{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') -# pass - print(" ") - inp = input() -# print(inp) + i2c_one = I2C(buses[0]) + i2c_two = I2C(buses[1]) + if (buses[0] == 0) and (addresses[0] == 0x45)): +# print("Reading INA219 in MoPower Board") + ina219_one = INA219(I2C(1), 0x4a) + else + ina219_one = INA219(i2c_one, addresses[0]) + ina219_two = INA219(i2c_one, addresses[1]) + ina219_three = INA219(i2c_one, addresses[2]) + ina219_four= INA219(i2c_one, addresses[3]) + ina219_five= INA219(i2c_two, addresses[4]) + ina219_six = INA219(i2c_two, addresses[5]) + ina219_seven = INA219(i2c_two, addresses[6]) + ina219_eight = INA219(i2c_two, addresses[7]) + + while (True): + + print("{:6.3f} ".format(ina219_one.bus_voltage), "{:6.3f} ".format(ina219_one.current) , end = '') + print("{:6.3f} ".format(ina219_two.bus_voltage), "{:6.3f} ".format(ina219_two.current) , end = '') + print("{:6.3f} ".format(ina219_three.bus_voltage), "{:6.3f} ".format(ina219_three.current) , end = '') + print("{:6.3f} ".format(ina219_four.bus_voltage), "{:6.3f} ".format(ina219_four.current) , end = '') + print("{:6.3f} ".format(ina219_five.bus_voltage), "{:6.3f} ".format(ina219_five.current) , end = '') + print("{:6.3f} ".format(ina219_six.bus_voltage), "{:6.3f} ".format(ina219_six.current) , end = '') + print("{:6.3f} ".format(ina219_seven.bus_voltage), "{:6.3f} ".format(ina219_seven.current) , end = '') + print("{:6.3f} ".format(ina219_eight.bus_voltage), "{:6.3f} ".format(ina219_eight.current) , end = '') + + print(" ") + inp = input() +# print(inp) + From bbdc02163b11e1bba2f2e7efe07712f18bcf9bcf Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 29 Dec 2020 11:39:42 -0500 Subject: [PATCH 074/252] Update voltcurrent.py --- python/voltcurrent.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index 5decd333..a0cec3c9 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -51,7 +51,8 @@ if __name__ == "__main__": ina219.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S # optional : change voltage range to 16V ina219.bus_voltage_range = BusVoltageRange.RANGE_16V - + except: + except: # No try checking yet i2c_one = I2C(buses[0]) From 918961128786be6a0aad487a283d674e624062e3 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 29 Dec 2020 11:41:01 -0500 Subject: [PATCH 075/252] Update voltcurrent.py --- python/voltcurrent.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index a0cec3c9..9b50c02b 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -30,11 +30,11 @@ if __name__ == "__main__": # config for x in buses: - try: +# try: i2c_bus = I2C(x) # Device is /dev/i2c-x for y in addresses: # print(x,y) - try: + # try: # Create library object using Extended Bus I2C port # print("bus: ", x, " addr: ", y) if x == 0 and y == 0x45: @@ -51,8 +51,8 @@ if __name__ == "__main__": ina219.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S # optional : change voltage range to 16V ina219.bus_voltage_range = BusVoltageRange.RANGE_16V - except: - except: +# except: +# except: # No try checking yet i2c_one = I2C(buses[0]) From 60c9192c07d0b63f032f98abec98cbd89841d589 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 29 Dec 2020 11:41:46 -0500 Subject: [PATCH 076/252] Update voltcurrent.py --- python/voltcurrent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index 9b50c02b..3ad89a68 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -58,7 +58,7 @@ if __name__ == "__main__": i2c_one = I2C(buses[0]) i2c_two = I2C(buses[1]) - if (buses[0] == 0) and (addresses[0] == 0x45)): + if buses[0] == 0 and addresses[0] == 0x45: # print("Reading INA219 in MoPower Board") ina219_one = INA219(I2C(1), 0x4a) else From 2f6edf531f385bd47b406ea92afc262e37b0df43 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 29 Dec 2020 11:42:23 -0500 Subject: [PATCH 077/252] Update voltcurrent.py --- python/voltcurrent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index 3ad89a68..a3bd1f29 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -61,7 +61,7 @@ if __name__ == "__main__": if buses[0] == 0 and addresses[0] == 0x45: # print("Reading INA219 in MoPower Board") ina219_one = INA219(I2C(1), 0x4a) - else + else: ina219_one = INA219(i2c_one, addresses[0]) ina219_two = INA219(i2c_one, addresses[1]) ina219_three = INA219(i2c_one, addresses[2]) From 55f501a20292e2cd782bf1b0d6bce3cc1adf9add Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 29 Dec 2020 11:51:19 -0500 Subject: [PATCH 078/252] Update voltcurrent.py --- python/voltcurrent.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index a3bd1f29..fc6acd67 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -72,8 +72,8 @@ if __name__ == "__main__": ina219_eight = INA219(i2c_two, addresses[7]) while (True): - - print("{:6.3f} ".format(ina219_one.bus_voltage), "{:6.3f} ".format(ina219_one.current) , end = '') + print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') +# print("{:6.3f} ".format(ina219_one.bus_voltage), "{:6.3f} ".format(ina219_one.current) , end = '') print("{:6.3f} ".format(ina219_two.bus_voltage), "{:6.3f} ".format(ina219_two.current) , end = '') print("{:6.3f} ".format(ina219_three.bus_voltage), "{:6.3f} ".format(ina219_three.current) , end = '') print("{:6.3f} ".format(ina219_four.bus_voltage), "{:6.3f} ".format(ina219_four.current) , end = '') From 68bdc3061f12a6ccd501ec0d7d6109e95c97926d Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 29 Dec 2020 11:52:19 -0500 Subject: [PATCH 079/252] Update voltcurrent.py --- python/voltcurrent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index fc6acd67..d0865794 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -72,7 +72,7 @@ if __name__ == "__main__": ina219_eight = INA219(i2c_two, addresses[7]) while (True): - print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') + print("{:6.3f} ".format(0), "{:6.3f} ".format(0)) # print("{:6.3f} ".format(ina219_one.bus_voltage), "{:6.3f} ".format(ina219_one.current) , end = '') print("{:6.3f} ".format(ina219_two.bus_voltage), "{:6.3f} ".format(ina219_two.current) , end = '') print("{:6.3f} ".format(ina219_three.bus_voltage), "{:6.3f} ".format(ina219_three.current) , end = '') From 33eb137600911001bf1c460b3574240c3e762d1e Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 29 Dec 2020 11:53:22 -0500 Subject: [PATCH 080/252] Update voltcurrent.py --- python/voltcurrent.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index d0865794..a5c3f50b 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -72,15 +72,15 @@ if __name__ == "__main__": ina219_eight = INA219(i2c_two, addresses[7]) while (True): - print("{:6.3f} ".format(0), "{:6.3f} ".format(0)) -# print("{:6.3f} ".format(ina219_one.bus_voltage), "{:6.3f} ".format(ina219_one.current) , end = '') - print("{:6.3f} ".format(ina219_two.bus_voltage), "{:6.3f} ".format(ina219_two.current) , end = '') - print("{:6.3f} ".format(ina219_three.bus_voltage), "{:6.3f} ".format(ina219_three.current) , end = '') - print("{:6.3f} ".format(ina219_four.bus_voltage), "{:6.3f} ".format(ina219_four.current) , end = '') - print("{:6.3f} ".format(ina219_five.bus_voltage), "{:6.3f} ".format(ina219_five.current) , end = '') - print("{:6.3f} ".format(ina219_six.bus_voltage), "{:6.3f} ".format(ina219_six.current) , end = '') - print("{:6.3f} ".format(ina219_seven.bus_voltage), "{:6.3f} ".format(ina219_seven.current) , end = '') - print("{:6.3f} ".format(ina219_eight.bus_voltage), "{:6.3f} ".format(ina219_eight.current) , end = '') +# print("{:6.3f} ".format(0), "{:6.3f} ".format(0)) + print("{:6.3f} ".format(ina219_one.bus_voltage), "{:6.3f} ".format(ina219_one.current)) # , end = '') + print("{:6.3f} ".format(ina219_two.bus_voltage), "{:6.3f} ".format(ina219_two.current)) # , end = '') + print("{:6.3f} ".format(ina219_three.bus_voltage), "{:6.3f} ".format(ina219_three.current)) # , end = '') + print("{:6.3f} ".format(ina219_four.bus_voltage), "{:6.3f} ".format(ina219_four.current)) # , end = '') + print("{:6.3f} ".format(ina219_five.bus_voltage), "{:6.3f} ".format(ina219_five.current)) # , end = '') + print("{:6.3f} ".format(ina219_six.bus_voltage), "{:6.3f} ".format(ina219_six.current)) # , end = '') + print("{:6.3f} ".format(ina219_seven.bus_voltage), "{:6.3f} ".format(ina219_seven.current)) # , end = '') + print("{:6.3f} ".format(ina219_eight.bus_voltage), "{:6.3f} ".format(ina219_eight.current)) # , end = '') print(" ") inp = input() From db780336dbceaaad0f8cafa0a8f358286f1fca0f Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 29 Dec 2020 11:57:14 -0500 Subject: [PATCH 081/252] Update voltcurrent.py --- python/voltcurrent.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index a5c3f50b..e4e63b93 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -66,10 +66,10 @@ if __name__ == "__main__": ina219_two = INA219(i2c_one, addresses[1]) ina219_three = INA219(i2c_one, addresses[2]) ina219_four= INA219(i2c_one, addresses[3]) - ina219_five= INA219(i2c_two, addresses[4]) - ina219_six = INA219(i2c_two, addresses[5]) - ina219_seven = INA219(i2c_two, addresses[6]) - ina219_eight = INA219(i2c_two, addresses[7]) + ina219_five= INA219(i2c_two, addresses[0]) + ina219_six = INA219(i2c_two, addresses[1]) + ina219_seven = INA219(i2c_two, addresses[2]) + ina219_eight = INA219(i2c_two, addresses[3]) while (True): # print("{:6.3f} ".format(0), "{:6.3f} ".format(0)) From cb7a5af64a8cdec8f9418f9fc0db9b6b817775e0 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 29 Dec 2020 11:58:10 -0500 Subject: [PATCH 082/252] typo --- python/voltcurrent.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index e4e63b93..f73da809 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -73,14 +73,14 @@ if __name__ == "__main__": while (True): # print("{:6.3f} ".format(0), "{:6.3f} ".format(0)) - print("{:6.3f} ".format(ina219_one.bus_voltage), "{:6.3f} ".format(ina219_one.current)) # , end = '') - print("{:6.3f} ".format(ina219_two.bus_voltage), "{:6.3f} ".format(ina219_two.current)) # , end = '') - print("{:6.3f} ".format(ina219_three.bus_voltage), "{:6.3f} ".format(ina219_three.current)) # , end = '') - print("{:6.3f} ".format(ina219_four.bus_voltage), "{:6.3f} ".format(ina219_four.current)) # , end = '') - print("{:6.3f} ".format(ina219_five.bus_voltage), "{:6.3f} ".format(ina219_five.current)) # , end = '') - print("{:6.3f} ".format(ina219_six.bus_voltage), "{:6.3f} ".format(ina219_six.current)) # , end = '') - print("{:6.3f} ".format(ina219_seven.bus_voltage), "{:6.3f} ".format(ina219_seven.current)) # , end = '') - print("{:6.3f} ".format(ina219_eight.bus_voltage), "{:6.3f} ".format(ina219_eight.current)) # , end = '') + print("{:6.3f} ".format(ina219_one.bus_voltage), "{:6.3f} ".format(ina219_one.current) , end = '') + print("{:6.3f} ".format(ina219_two.bus_voltage), "{:6.3f} ".format(ina219_two.current) , end = '') + print("{:6.3f} ".format(ina219_three.bus_voltage), "{:6.3f} ".format(ina219_three.current) , end = '') + print("{:6.3f} ".format(ina219_four.bus_voltage), "{:6.3f} ".format(ina219_four.current) , end = '') + print("{:6.3f} ".format(ina219_five.bus_voltage), "{:6.3f} ".format(ina219_five.current) , end = '') + print("{:6.3f} ".format(ina219_six.bus_voltage), "{:6.3f} ".format(ina219_six.current) , end = '') + print("{:6.3f} ".format(ina219_seven.bus_voltage), "{:6.3f} ".format(ina219_seven.current) , end = '') + print("{:6.3f} ".format(ina219_eight.bus_voltage), "{:6.3f} ".format(ina219_eight.current) , end = '') print(" ") inp = input() From 4f2823b73967f0c04a59b7c3046dd60c9be6bb0a Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 30 Dec 2020 10:13:06 -0500 Subject: [PATCH 083/252] merged in sin_map from dev-faster --- afsk/main.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 0e2d6ab2..c7ce2a53 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -118,6 +118,7 @@ int rpitxStatus = -1; float amplitude; // = ; // 20000; // 32767/(10%amp+5%amp+100%amp) float freq_Hz = 3000; // 1200 +short int sin_samples; int smaller; int flip_ctr = 0; @@ -558,7 +559,15 @@ int main(int argc, char * argv[]) { printf("\n BPSK Mode, bufLen: %d, %d bits per frame, %d bits per second, %d seconds per frame %d ms sample period\n", bufLen, bufLen / (samples * frameCnt), bitRate, bufLen / (samples * frameCnt * bitRate), samplePeriod); - } + + sin_samples = S_RATE/freq_Hz; + printf("Sin map: "); + for (int j = 0; j < sin_samples; j++) { + sin_map[j] = (short int)(amplitude * sin((float)(2 * M_PI * j / sin_samples))); + printf(" %d", sin_map[j]); + } + printf("\n"); + } long int loopTime; loopTime = millis(); @@ -1316,7 +1325,7 @@ else { // printf("Smin %f Smax %f \n", sensor_min[count1], sensor_max[count1]); } - + if (mode == FSK) { for (int count1 = 0; count1 < 8; count1++) { if (voltage[count1] < voltage_min[count1]) voltage_min[count1] = voltage[count1]; @@ -1344,7 +1353,7 @@ else { // printf("Other min %f max %f \n", other_min[count1], other_max[count1]); } - if (mode == FSK) { +// if (mode == FSK) { if (loop % 8 == 0) { printf("Sending MIN frame \n"); frm_type = 0x03; @@ -1975,10 +1984,11 @@ void write_wave(int i, short int *buffer) else { if ((ctr - flip_ctr) < smaller) - buffer[ctr++] = (short int)(amplitude * 0.4 * phase * sin((float)(2*M_PI*i*freq_Hz/S_RATE))); - else - buffer[ctr++] = (short int)(amplitude * phase * sin((float)(2*M_PI*i*freq_Hz/S_RATE))); - } +// buffer[ctr++] = (short int)(amplitude * 0.4 * phase * sin((float)(2*M_PI*i*freq_Hz/S_RATE))); buffer[ctr++] = (short int)(amplitude * 0.4 * phase * sin((float)(2*M_PI*i*freq_Hz/S_RATE))); + buffer[ctr++] = (short int)(phase * sin_map[ctr % sin_samples] / 2); + else +// buffer[ctr++] = (short int)(amplitude * 0.4 * phase * sin((float)(2*M_PI*i*freq_Hz/S_RATE))); buffer[ctr++] = (short int)(amplitude * phase * sin((float)(2*M_PI*i*freq_Hz/S_RATE))); + buffer[ctr++] = (short int)(phase * sin_map[ctr % sin_samples]); } // printf("%d %d \n", i, buffer[ctr - 1]); } From e2d9badab293f9899403fd59cb8c187f7f15f536 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 30 Dec 2020 10:20:09 -0500 Subject: [PATCH 084/252] typo --- afsk/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/afsk/main.c b/afsk/main.c index c7ce2a53..687c6228 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -119,6 +119,7 @@ int rpitxStatus = -1; float amplitude; // = ; // 20000; // 32767/(10%amp+5%amp+100%amp) float freq_Hz = 3000; // 1200 short int sin_samples; +short int sin_map[16]; int smaller; int flip_ctr = 0; From b53d2251c7ab972f74007b0460f4709452ab8825 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 30 Dec 2020 10:25:02 -0500 Subject: [PATCH 085/252] sleep(3.8) --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 687c6228..321bfb16 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1095,7 +1095,7 @@ void get_tlm_fox() { while ((millis() - sampleTime) < (unsigned int)samplePeriod) sleep((unsigned int)sleepTime); */ - sleep(2.3); // No sleep at all! + sleep(3.8); // No sleep at all! // sleep(1.3); digitalWrite(txLed, txLedOff); From f8cf009a956bd14cdc7d7a240369f76471ef5ad6 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 30 Dec 2020 10:41:08 -0500 Subject: [PATCH 086/252] changed MAX MIN --- afsk/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 321bfb16..78199937 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1326,7 +1326,7 @@ else { // printf("Smin %f Smax %f \n", sensor_min[count1], sensor_max[count1]); } - if (mode == FSK) { +// if (mode == FSK) { for (int count1 = 0; count1 < 8; count1++) { if (voltage[count1] < voltage_min[count1]) voltage_min[count1] = voltage[count1]; @@ -1354,7 +1354,7 @@ else { // printf("Other min %f max %f \n", other_min[count1], other_max[count1]); } -// if (mode == FSK) { + if (mode == FSK) { if (loop % 8 == 0) { printf("Sending MIN frame \n"); frm_type = 0x03; From ac36259312bfb18480377617e037ff8ce811b419 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 30 Dec 2020 10:54:00 -0500 Subject: [PATCH 087/252] sleep(3.3) --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 78199937..f0aa1f1a 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1095,7 +1095,7 @@ void get_tlm_fox() { while ((millis() - sampleTime) < (unsigned int)samplePeriod) sleep((unsigned int)sleepTime); */ - sleep(3.8); // No sleep at all! + sleep(3.3); // No sleep at all! // sleep(1.3); digitalWrite(txLed, txLedOff); From 70597757500f883550bb4d8d118a4a5040edf617 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 30 Dec 2020 11:04:14 -0500 Subject: [PATCH 088/252] added back in socket resend --- afsk/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index f0aa1f1a..810c34ef 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1726,15 +1726,15 @@ else { // printf("Sending %d buffer bytes over socket after %d ms!\n", ctr, (long unsigned int)millis() - start); start = millis(); int sock_ret = send(sock, buffer, (unsigned int)(ctr * 2 + 2), 0); - printf("Millis5: %d Result of socket send: %d \n", (unsigned int)millis() - start, sock_ret); + printf("Millis6: %d Result of socket send: %d \n\n", (unsigned int)millis() - start, sock_ret); // sleep(2.5); if (sock_ret < (ctr * 2 + 2)) { - printf("Not resending\n"); - // sock_ret = send(sock, buffer[sock_ret], ctr * 2 + 2 - sock_ret, 0); - // printf("Millis10: %d Result of socket send: %d \n", millis() - start, sock_ret); + // printf("Not resending\n"); + sock_ret = send(sock, buffer[sock_ret], ctr * 2 + 2 - sock_ret, 0); + printf("Millis6: %d Result of socket send: %d \n\n", millis() - start, sock_ret); } if (sock_ret == -1) { From d08054b8c3f5b03256ac5e7af257e936cb3f6a56 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 30 Dec 2020 11:10:27 -0500 Subject: [PATCH 089/252] socket resend not working yet --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 810c34ef..841903f7 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1733,7 +1733,7 @@ else { if (sock_ret < (ctr * 2 + 2)) { // printf("Not resending\n"); - sock_ret = send(sock, buffer[sock_ret], ctr * 2 + 2 - sock_ret, 0); + sock_ret = send(sock, &buffer[sock_ret], (unsigned int)(ctr * 2 + 2 - sock_ret), 0); printf("Millis6: %d Result of socket send: %d \n\n", millis() - start, sock_ret); } From 10de25168321f68dc402b9a95d665ea9739500b0 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 30 Dec 2020 11:21:54 -0500 Subject: [PATCH 090/252] added sleep(0.5) if resending --- afsk/main.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 841903f7..fb9684d7 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1728,13 +1728,11 @@ else { int sock_ret = send(sock, buffer, (unsigned int)(ctr * 2 + 2), 0); printf("Millis6: %d Result of socket send: %d \n\n", (unsigned int)millis() - start, sock_ret); -// sleep(2.5); - - if (sock_ret < (ctr * 2 + 2)) { // printf("Not resending\n"); - sock_ret = send(sock, &buffer[sock_ret], (unsigned int)(ctr * 2 + 2 - sock_ret), 0); - printf("Millis6: %d Result of socket send: %d \n\n", millis() - start, sock_ret); + sleep(0.5); + sock_ret = send(sock, &buffer[sock_ret], (unsigned int)(ctr * 2 + 2 - sock_ret), 0); + printf("Millis6: %d Result of socket send: %d \n\n", millis() - start, sock_ret); } if (sock_ret == -1) { From dad7f9d13988d99e8e13a18522346a60006a6b20 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 30 Dec 2020 11:27:09 -0500 Subject: [PATCH 091/252] Working, turning on payload --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index fb9684d7..3d929bd6 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1254,7 +1254,7 @@ else { - if (payload == -55) { // ON + if (payload == ON) { // -55 STEMBoardFailure = 0; char c; From 2b20f1170e72838ca20dd8d231a4cb7882a5b09e Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 30 Dec 2020 11:33:10 -0500 Subject: [PATCH 092/252] try turning firstTime on again --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 3d929bd6..8616b400 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -98,7 +98,7 @@ static int init_rf(); int socket_open = 0; int sock = 0; int loop = -1, loop_count = 0; -int firstTime = 0; // ON; +int firstTime = ON; // 0; long start; int testCount = 0; long time_start; From b50723f8cf540b807d39b5c258ff7db85328c126 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 30 Dec 2020 11:39:03 -0500 Subject: [PATCH 093/252] removed python test at start --- afsk/main.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 8616b400..b5546611 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -349,13 +349,12 @@ int main(int argc, char * argv[]) { file1 = sopen(pythonConfigStr); // try new function fgets(cmdbuffer, 1000, file1); printf("pythonStr result: %s\n", cmdbuffer); - +/* sleep(5); fputc('\n', file1); fgets(cmdbuffer, 1000, file1); printf("pythonStr result2: %s\n", cmdbuffer); - -/* + file1 = popen(pythonConfigStr, "w"); fgets(cmdbuffer, 1000, file1); @@ -1287,7 +1286,7 @@ else { sensor_payload[i++] = ' '; // sensor_payload[i++] = '\n'; sensor_payload[i] = '\0'; - printf("Payload string: %s \n", sensor_payload); + printf("Payload string: %s", sensor_payload); if ((sensor_payload[0] == 'O') && (sensor_payload[1] == 'K')) // only process if valid payload response { From fd3f41e2ac0002b8a03ef5b35ec055baf8b58923 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 30 Dec 2020 11:44:12 -0500 Subject: [PATCH 094/252] turn payload off --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index b5546611..f1b10ced 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1253,7 +1253,7 @@ else { - if (payload == ON) { // -55 + if (payload == -55) { // ON STEMBoardFailure = 0; char c; From 01067606b8b0354bee8015a1a0a6051c117c4573 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 30 Dec 2020 11:51:25 -0500 Subject: [PATCH 095/252] no cpu limit --- demo.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo.sh b/demo.sh index 38aa9a74..89c96368 100755 --- a/demo.sh +++ b/demo.sh @@ -16,7 +16,7 @@ if [[ ("$1" = "a" ) || (("$1" = "c") && ("$(($y %4))" = 3)) ]]; then /home/pi/CubeSatSim/radioafsk afsk elif [[ ("$1" = "b" ) || (("$1" = "c") && ("$(($y %4))" = 1)) ]]; then echo "Mode is continuous BPSK" - sudo cpulimit -l 5 -P radioafsk & +# sudo cpulimit -l 5 -P radioafsk & /home/pi/CubeSatSim/radioafsk bpsk elif [[ ("$1" = "s" ) || (("$1" = "c") && ("$(($y %4))" = 2)) ]]; then echo "Mode is continuous SSTV" From 5b0394d782749a81d4449eadd0b817b37c7cbb6e Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 30 Dec 2020 11:57:09 -0500 Subject: [PATCH 096/252] Working OK without cpu limit, MAX MIN not correct for FSK --- afsk/main.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index f1b10ced..f16fe055 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -46,7 +46,6 @@ #define B 2 #define C 3 #define D 4 - #define PLUS_X 0 #define PLUS_Y 1 #define BAT 2 @@ -55,7 +54,6 @@ #define MINUS_Y 5 #define PLUS_Z 6 #define MINUS_Z 7 - #define TEMP 2 #define PRES 3 #define ALT 4 From b5099b6cc7a73295c4863a5f2f60191d93e23b26 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 30 Dec 2020 11:57:34 -0500 Subject: [PATCH 097/252] turn on payload --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index f16fe055..ae638efe 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1251,7 +1251,7 @@ else { - if (payload == -55) { // ON + if (payload == ON) { // -55 STEMBoardFailure = 0; char c; From e36e5ff678bb0cc1e9c506e7749c914e3f24b6f1 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 30 Dec 2020 12:13:10 -0500 Subject: [PATCH 098/252] Working pretty well, removed duplicate Sample period printf --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index ae638efe..24329b44 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1100,7 +1100,7 @@ void get_tlm_fox() { // printf("Tx LED Off\n"); #endif - printf("Sample period: %d\n", millis() - (unsigned int)sampleTime); +// printf("Sample period: %d\n", millis() - (unsigned int)sampleTime); sampleTime = (unsigned int) millis(); } else printf("first time - no sleep\n"); From 8697d11071d8e584b37bb797426483d428295572 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 30 Dec 2020 15:05:47 -0500 Subject: [PATCH 099/252] investigate Imax and min --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 24329b44..0663baa7 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1335,7 +1335,7 @@ else { if (current[count1] > current_max[count1]) current_max[count1] = current[count1]; - // printf("Vmin %f Vmax %f Imin %f Imax %f \n", voltage_min[count1], voltage_max[count1], current_min[count1], current_max[count1]); + printf("Vmin %f Vmax %f Imin %f Imax %f \n", voltage_min[count1], voltage_max[count1], current_min[count1], current_max[count1]); } From 1f05cd054ff9bfd3b64d7aafcb13888d341c54a9 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 30 Dec 2020 15:23:55 -0500 Subject: [PATCH 100/252] fix max min --- afsk/main.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 0663baa7..e65bf48a 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -612,7 +612,7 @@ int main(int argc, char * argv[]) { } #ifdef DEBUG_LOGGING - fprintf(stderr, "INFO: Getting ready to send\n"); +// fprintf(stderr, "INFO: Getting ready to send\n"); #endif } @@ -1022,7 +1022,7 @@ void get_tlm(void) { void get_tlm_fox() { // Reading I2C voltage and current sensors - +/* FILE * uptime_file = fopen("/proc/uptime", "r"); fscanf(uptime_file, "%f", & uptime_sec); uptime = (int) uptime_sec; @@ -1030,7 +1030,7 @@ void get_tlm_fox() { printf("Reset Count: %d Uptime since Reset: %ld \n", reset_count, uptime); #endif fclose(uptime_file); - +*/ int i; // long int sync = SYNC_WORD; long int sync = syncWord; @@ -1114,6 +1114,13 @@ void get_tlm_fox() { memset(sensor, 0, sizeof(sensor)); memset(other, 0, sizeof(other)); + FILE * uptime_file = fopen("/proc/uptime", "r"); + fscanf(uptime_file, "%f", & uptime_sec); + uptime = (int) uptime_sec; + #ifdef DEBUG_LOGGING + printf("INFO: Reset Count: %d Uptime since Reset: %ld \n", reset_count, uptime); + #endif + fclose(uptime_file); if (sim_mode) { // simulated telemetry @@ -1319,11 +1326,11 @@ else { sensor_min[count1] = sensor[count1]; if (sensor[count1] > sensor_max[count1]) sensor_max[count1] = sensor[count1]; - + } // just added // printf("Smin %f Smax %f \n", sensor_min[count1], sensor_max[count1]); } -// if (mode == FSK) { + if (mode == FSK) { // just added for (int count1 = 0; count1 < 8; count1++) { if (voltage[count1] < voltage_min[count1]) voltage_min[count1] = voltage[count1]; @@ -1383,13 +1390,13 @@ else { } memset(rs_frame, 0, sizeof(rs_frame)); memset(parities, 0, sizeof(parities)); - +/* FILE * uptime_file = fopen("/proc/uptime", "r"); fscanf(uptime_file, "%f", & uptime_sec); uptime = (int) uptime_sec; fclose(uptime_file); printf("Reset Count: %d Uptime since Reset: %ld \n", reset_count, uptime); - +*/ //sleep(1); //printf("Sleep over\n"); From 52652e5124d822a1ce658d9f48846e529520a140 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 30 Dec 2020 15:30:48 -0500 Subject: [PATCH 101/252] formatting --- afsk/main.c | 41 +++++++++++++++++------------------------ 1 file changed, 17 insertions(+), 24 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index e65bf48a..37442813 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1256,8 +1256,6 @@ else { } fclose(cpuTempSensor); - - if (payload == ON) { // -55 STEMBoardFailure = 0; @@ -1316,38 +1314,33 @@ else { } } printf("\n"); - } - } - if ((sensor_payload[0] == 'O') && (sensor_payload[1] == 'K')) { + if ((sensor_payload[0] == 'O') && (sensor_payload[1] == 'K')) { for (count1 = 0; count1 < 17; count1++) { if (sensor[count1] < sensor_min[count1]) sensor_min[count1] = sensor[count1]; if (sensor[count1] > sensor_max[count1]) sensor_max[count1] = sensor[count1]; - } // just added // printf("Smin %f Smax %f \n", sensor_min[count1], sensor_max[count1]); - - } - if (mode == FSK) { // just added - for (int count1 = 0; count1 < 8; count1++) { - if (voltage[count1] < voltage_min[count1]) - voltage_min[count1] = voltage[count1]; - if (current[count1] < current_min[count1]) - current_min[count1] = current[count1]; - - if (voltage[count1] > voltage_max[count1]) - voltage_max[count1] = voltage[count1]; - if (current[count1] > current_max[count1]) - current_max[count1] = current[count1]; - - printf("Vmin %f Vmax %f Imin %f Imax %f \n", voltage_min[count1], voltage_max[count1], current_min[count1], current_max[count1]); + } // just added } - - - } + if (mode == FSK) { // just added + for (int count1 = 0; count1 < 8; count1++) { + if (voltage[count1] < voltage_min[count1]) + voltage_min[count1] = voltage[count1]; + if (current[count1] < current_min[count1]) + current_min[count1] = current[count1]; + + if (voltage[count1] > voltage_max[count1]) + voltage_max[count1] = voltage[count1]; + if (current[count1] > current_max[count1]) + current_max[count1] = current[count1]; + + printf("Vmin %f Vmax %f Imin %f Imax %f \n", voltage_min[count1], voltage_max[count1], current_min[count1], current_max[count1]); } + } +} for (int count1 = 0; count1 < 3; count1++) { if (other[count1] < other_min[count1]) From f4155d1f0f3ac6190d9857c88977d073b4414cbe Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 30 Dec 2020 15:51:39 -0500 Subject: [PATCH 102/252] trying to fix max and min --- afsk/main.c | 230 +++++++++++++++++++++++++--------------------------- 1 file changed, 110 insertions(+), 120 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 37442813..58380349 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1114,15 +1114,15 @@ void get_tlm_fox() { memset(sensor, 0, sizeof(sensor)); memset(other, 0, sizeof(other)); - FILE * uptime_file = fopen("/proc/uptime", "r"); - fscanf(uptime_file, "%f", & uptime_sec); - uptime = (int) uptime_sec; - #ifdef DEBUG_LOGGING - printf("INFO: Reset Count: %d Uptime since Reset: %ld \n", reset_count, uptime); - #endif - fclose(uptime_file); - if (sim_mode) { - // simulated telemetry + FILE * uptime_file = fopen("/proc/uptime", "r"); + fscanf(uptime_file, "%f", & uptime_sec); + uptime = (int) uptime_sec; + #ifdef DEBUG_LOGGING + printf("INFO: Reset Count: %d Uptime since Reset: %ld \n", reset_count, uptime); + #endif + fclose(uptime_file); + + if (sim_mode) { // simulated telemetry double time = ((long int)millis() - time_start) / 1000.0; @@ -1132,11 +1132,6 @@ void get_tlm_fox() { printf("\n\nSwitching eclipse mode! \n\n"); } - /* - double Xi = eclipse * amps_max[0] * sin(2.0 * 3.14 * time / (46.0 * speed)) * fabs(sin(2.0 * 3.14 * time / (46.0 * speed))) + rnd_float(-2, 2); - double Yi = eclipse * amps_max[1] * sin((2.0 * 3.14 * time / (46.0 * speed)) + (3.14/2.0)) * fabs(sin((2.0 * 3.14 * time / (46.0 * speed)) + (3.14/2.0))) + rnd_float(-2, 2); - double Zi = eclipse * amps_max[2] * sin((2.0 * 3.14 * time / (46.0 * speed)) + 3.14 + angle[2]) * fabs(sin((2.0 * 3.14 * time / (46.0 * speed)) + 3.14 + angle[2])) + rnd_float(-2, 2); - */ double Xi = eclipse * amps_max[0] * (float) sin(2.0 * 3.14 * time / (46.0 * speed)) + rnd_float(-2, 2); double Yi = eclipse * amps_max[1] * (float) sin((2.0 * 3.14 * time / (46.0 * speed)) + (3.14 / 2.0)) + rnd_float(-2, 2); double Zi = eclipse * amps_max[2] * (float) sin((2.0 * 3.14 * time / (46.0 * speed)) + 3.14 + angle[2]) + rnd_float(-2, 2); @@ -1193,139 +1188,137 @@ void get_tlm_fox() { // end of simulated telemetry } - -else { - int count1; - char * token; + else { + int count1; + char * token; // char cmdbuffer[1000]; /**/ // FILE * file = popen(pythonStr, "r"); - fputc('\n', file1); - fgets(cmdbuffer, 1000, file1); + fputc('\n', file1); + fgets(cmdbuffer, 1000, file1); // printf("Python read Result: %s\n", cmdbuffer); // pclose(file); /**/ - const char space[2] = " "; - token = strtok(cmdbuffer, space); + const char space[2] = " "; + token = strtok(cmdbuffer, space); - for (count1 = 0; count1 < 8; count1++) { - if (token != NULL) { - voltage[count1] = (float) atof(token); - #ifdef DEBUG_LOGGING - // printf("voltage: %f ", voltage[count1]); - #endif - token = strtok(NULL, space); + for (count1 = 0; count1 < 8; count1++) { if (token != NULL) { - current[count1] = (float) atof(token); - if ((current[count1] < 0) && (current[count1] > -0.5)) - current[count1] *= (-1.0f); + voltage[count1] = (float) atof(token); #ifdef DEBUG_LOGGING - // printf("current: %f\n", current[count1]); + // printf("voltage: %f ", voltage[count1]); #endif token = strtok(NULL, space); + if (token != NULL) { + current[count1] = (float) atof(token); + if ((current[count1] < 0) && (current[count1] > -0.5)) + current[count1] *= (-1.0f); + #ifdef DEBUG_LOGGING + // printf("current: %f\n", current[count1]); + #endif + token = strtok(NULL, space); + } } } - } - // printf("\n"); - // sleep(0.5); // printf("Sleep over\n"); - batteryVoltage = voltage[map[BAT]]; - if (batteryVoltage < 3.5) { - NormalModeFailure = 1; - printf("Safe Mode!\n"); - } else - NormalModeFailure = 0; + batteryVoltage = voltage[map[BAT]]; + if (batteryVoltage < 3.5) { + NormalModeFailure = 1; + printf("Safe Mode!\n"); + } else + NormalModeFailure = 0; - FILE * cpuTempSensor = fopen("/sys/class/thermal/thermal_zone0/temp", "r"); - if (cpuTempSensor) { - double cpuTemp; - fscanf(cpuTempSensor, "%lf", & cpuTemp); - cpuTemp /= 1000; + FILE * cpuTempSensor = fopen("/sys/class/thermal/thermal_zone0/temp", "r"); + if (cpuTempSensor) { + double cpuTemp; + fscanf(cpuTempSensor, "%lf", & cpuTemp); + cpuTemp /= 1000; - #ifdef DEBUG_LOGGING - printf("CPU Temp Read: %6.1f\n", cpuTemp); - #endif + #ifdef DEBUG_LOGGING + printf("CPU Temp Read: %6.1f\n", cpuTemp); + #endif - other[IHU_TEMP] = (double)cpuTemp; + other[IHU_TEMP] = (double)cpuTemp; - // IHUcpuTemp = (int)((cpuTemp * 10.0) + 0.5); - } - fclose(cpuTempSensor); + // IHUcpuTemp = (int)((cpuTemp * 10.0) + 0.5); + } + fclose(cpuTempSensor); - if (payload == ON) { // -55 - STEMBoardFailure = 0; + if (payload == ON) { // -55 + STEMBoardFailure = 0; - char c; - int charss = (char) serialDataAvail(uart_fd); - if (charss != 0) + char c; + int charss = (char) serialDataAvail(uart_fd); + if (charss != 0) printf("Clearing buffer of %d chars \n", charss); - while ((charss--> 0)) - c = (char) serialGetchar(uart_fd); // clear buffer + while ((charss--> 0)) + c = (char) serialGetchar(uart_fd); // clear buffer - unsigned int waitTime; - int i = 0; - serialPutchar(uart_fd, '?'); - printf("Querying payload with ?\n"); - waitTime = millis() + 500; - int end = FALSE; - // int retry = FALSE; - while ((millis() < waitTime) && !end) { - int chars = (char) serialDataAvail(uart_fd); - while ((chars--> 0) && !end) { - c = (char) serialGetchar(uart_fd); - // printf ("%c", c); - // fflush(stdout); - if (c != '\n') { - sensor_payload[i++] = c; - } else { - end = TRUE; + unsigned int waitTime; + int i = 0; + serialPutchar(uart_fd, '?'); + printf("Querying payload with ?\n"); + waitTime = millis() + 500; + int end = FALSE; + // int retry = FALSE; + while ((millis() < waitTime) && !end) { + int chars = (char) serialDataAvail(uart_fd); + while ((chars--> 0) && !end) { + c = (char) serialGetchar(uart_fd); + // printf ("%c", c); + // fflush(stdout); + if (c != '\n') { + sensor_payload[i++] = c; + } else { + end = TRUE; + } } } - } - sensor_payload[i++] = ' '; - // sensor_payload[i++] = '\n'; - sensor_payload[i] = '\0'; - printf("Payload string: %s", sensor_payload); + sensor_payload[i++] = ' '; + // sensor_payload[i++] = '\n'; + sensor_payload[i] = '\0'; + printf("Payload string: %s", sensor_payload); - if ((sensor_payload[0] == 'O') && (sensor_payload[1] == 'K')) // only process if valid payload response - { - int count1; - char * token; - // char cmdbuffer[1000]; + if ((sensor_payload[0] == 'O') && (sensor_payload[1] == 'K')) // only process if valid payload response + { + int count1; + char * token; + // char cmdbuffer[1000]; // FILE *file = popen("python3 /home/pi/CubeSatSim/python/voltcurrent.py 1 11", "r"); // fgets(cmdbuffer, 1000, file); // printf("result: %s\n", cmdbuffer); // pclose(file); - const char space[2] = " "; - token = strtok(sensor_payload, space); - for (count1 = 0; count1 < 17; count1++) { - if (token != NULL) { - sensor[count1] = (float) atof(token); - #ifdef DEBUG_LOGGING - // printf("sensor: %f ", sensor[count1]); - #endif - token = strtok(NULL, space); + const char space[2] = " "; + token = strtok(sensor_payload, space); + for (count1 = 0; count1 < 17; count1++) { + if (token != NULL) { + sensor[count1] = (float) atof(token); + #ifdef DEBUG_LOGGING + // printf("sensor: %f ", sensor[count1]); + #endif + token = strtok(NULL, space); + } } + printf("\n"); } - printf("\n"); + } + if ((sensor_payload[0] == 'O') && (sensor_payload[1] == 'K')) { + for (count1 = 0; count1 < 17; count1++) { + if (sensor[count1] < sensor_min[count1]) + sensor_min[count1] = sensor[count1]; + if (sensor[count1] > sensor_max[count1]) + sensor_max[count1] = sensor[count1]; + // printf("Smin %f Smax %f \n", sensor_min[count1], sensor_max[count1]); + } } } - if ((sensor_payload[0] == 'O') && (sensor_payload[1] == 'K')) { - for (count1 = 0; count1 < 17; count1++) { - if (sensor[count1] < sensor_min[count1]) - sensor_min[count1] = sensor[count1]; - if (sensor[count1] > sensor_max[count1]) - sensor_max[count1] = sensor[count1]; - // printf("Smin %f Smax %f \n", sensor_min[count1], sensor_max[count1]); - } // just added - } - if (mode == FSK) { // just added + if (mode == FSK) { // just moved for (int count1 = 0; count1 < 8; count1++) { if (voltage[count1] < voltage_min[count1]) voltage_min[count1] = voltage[count1]; @@ -1338,19 +1331,16 @@ else { current_max[count1] = current[count1]; printf("Vmin %f Vmax %f Imin %f Imax %f \n", voltage_min[count1], voltage_max[count1], current_min[count1], current_max[count1]); - } - } -} - - for (int count1 = 0; count1 < 3; count1++) { - if (other[count1] < other_min[count1]) - other_min[count1] = other[count1]; - if (other[count1] > other_max[count1]) - other_max[count1] = other[count1]; - - // printf("Other min %f max %f \n", other_min[count1], other_max[count1]); - } + } + for (int count1 = 0; count1 < 3; count1++) { + if (other[count1] < other_min[count1]) + other_min[count1] = other[count1]; + if (other[count1] > other_max[count1]) + other_max[count1] = other[count1]; + // printf("Other min %f max %f \n", other_min[count1], other_max[count1]); + } + } // just moved again if (mode == FSK) { if (loop % 8 == 0) { printf("Sending MIN frame \n"); From d3ec5b374942da48e978ba34269e9aa2aca27784 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 30 Dec 2020 16:03:36 -0500 Subject: [PATCH 103/252] cleanup --- afsk/main.c | 60 ++++++++++++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 31 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 58380349..7d61af3b 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1340,37 +1340,38 @@ void get_tlm_fox() { // printf("Other min %f max %f \n", other_min[count1], other_max[count1]); } - } // just moved again - if (mode == FSK) { - if (loop % 8 == 0) { - printf("Sending MIN frame \n"); - frm_type = 0x03; - for (int count1 = 0; count1 < 17; count1++) { - if (count1 < 3) - other[count1] = other_min[count1]; - if (count1 < 8) { - voltage[count1] = voltage_min[count1]; - current[count1] = current_min[count1]; + if (loop % 8 == 0) { + printf("Sending MIN frame \n"); + frm_type = 0x03; + for (int count1 = 0; count1 < 17; count1++) { + if (count1 < 3) + other[count1] = other_min[count1]; + if (count1 < 8) { + voltage[count1] = voltage_min[count1]; + current[count1] = current_min[count1]; + } + if (sensor_min[count1] != 1000.0) // make sure values are valid + sensor[count1] = sensor_min[count1]; } - if (sensor_min[count1] != 1000.0) // make sure values are valid - sensor[count1] = sensor_min[count1]; } - } - if ((loop + 4) % 8 == 0) { - printf("Sending MAX frame \n"); - frm_type = 0x02; - for (int count1 = 0; count1 < 17; count1++) { - if (count1 < 3) - other[count1] = other_max[count1]; - if (count1 < 8) { - voltage[count1] = voltage_max[count1]; - current[count1] = current_max[count1]; + if ((loop + 4) % 8 == 0) { + printf("Sending MAX frame \n"); + frm_type = 0x02; + for (int count1 = 0; count1 < 17; count1++) { + if (count1 < 3) + other[count1] = other_max[count1]; + if (count1 < 8) { + voltage[count1] = voltage_max[count1]; + current[count1] = current_max[count1]; + } + if (sensor_max[count1] != -1000.0) // make sure values are valid + sensor[count1] = sensor_max[count1]; } - if (sensor_max[count1] != -1000.0) // make sure values are valid - sensor[count1] = sensor_max[count1]; - } - } - } + } + } + +// if (mode == FSK) { // remove this +// } memset(rs_frame, 0, sizeof(rs_frame)); memset(parities, 0, sizeof(parities)); /* @@ -1424,9 +1425,6 @@ void get_tlm_fox() { if (payload == ON) STEMBoardFailure = 0; - // if (payload == ON) - // STEMBoardFailure = 0; - // read payload sensor if available encodeA(b, 0 + head_offset, batt_a_v); From 07d6e22f370c3573cb47cc14f2bbeb8e5928849f Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 30 Dec 2020 16:04:19 -0500 Subject: [PATCH 104/252] more cleanup --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 7d61af3b..994b4652 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1330,7 +1330,7 @@ void get_tlm_fox() { if (current[count1] > current_max[count1]) current_max[count1] = current[count1]; - printf("Vmin %f Vmax %f Imin %f Imax %f \n", voltage_min[count1], voltage_max[count1], current_min[count1], current_max[count1]); + // printf("Vmin %f Vmax %f Imin %f Imax %f \n", voltage_min[count1], voltage_max[count1], current_min[count1], current_max[count1]); } for (int count1 = 0; count1 < 3; count1++) { if (other[count1] < other_min[count1]) From 06aee250658c105da56e9ab9e70d1a9b972640be Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 30 Dec 2020 16:30:19 -0500 Subject: [PATCH 105/252] removed cpu fields --- systemd/cubesatsim.service | 2 -- 1 file changed, 2 deletions(-) diff --git a/systemd/cubesatsim.service b/systemd/cubesatsim.service index d43b3cac..633f689d 100644 --- a/systemd/cubesatsim.service +++ b/systemd/cubesatsim.service @@ -10,8 +10,6 @@ StandardOutput=inherit StandardError=inherit Restart=always User=root -CPUAccounting=true -CPUQuota=2.5% [Install] WantedBy=default.target From a29d36f9177ec87b8d33ecadd2ed0b02137704e4 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 30 Dec 2020 16:40:42 -0500 Subject: [PATCH 106/252] put CPUquota back in --- systemd/cubesatsim.service | 2 ++ 1 file changed, 2 insertions(+) diff --git a/systemd/cubesatsim.service b/systemd/cubesatsim.service index 633f689d..d43b3cac 100644 --- a/systemd/cubesatsim.service +++ b/systemd/cubesatsim.service @@ -10,6 +10,8 @@ StandardOutput=inherit StandardError=inherit Restart=always User=root +CPUAccounting=true +CPUQuota=2.5% [Install] WantedBy=default.target From 41179de447f8b253196ba5ae228ccadcffa9ebc8 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 1 Jan 2021 12:55:36 -0500 Subject: [PATCH 107/252] added cpulimit for BPSK mode --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0211ae85..75e1b7ae 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ Requires: - pi-power-button - Direwolf - rpitx +- cpulimit See the Wiki Software Install page for more details: https://github.com/alanbjohnston/CubeSatSim/wiki/Software-Install. Runs on a Raspberry Pi 3B, 3B+, or Pi Zero W (Does NOT work on a Pi 4 since rpitx does not work on it yet). The Pi Zero W or Pi Zero are recommended since they are draw the least power and will result in the best performance under battery power. @@ -22,7 +23,7 @@ To begin the software install, after logging in type: `sudo apt update -y && sudo apt dist-upgrade -y` -`sudo apt install -y wiringpi git libasound2-dev i2c-tools` +`sudo apt install -y wiringpi git libasound2-dev i2c-tools cpulimit` If you are installing on a Pi 4B, you will need to install the 2.52 version of wiring pi by following these steps (you can skip these steps for any other Pi version): From a27383dd617fe522be3687d522678e114242db17 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 1 Jan 2021 13:21:16 -0500 Subject: [PATCH 108/252] added missing pinMode for green and blue LEDs --- arduino/Payload_BME280_MPU6050_XS.ino | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arduino/Payload_BME280_MPU6050_XS.ino b/arduino/Payload_BME280_MPU6050_XS.ino index 342150ed..457621b4 100644 --- a/arduino/Payload_BME280_MPU6050_XS.ino +++ b/arduino/Payload_BME280_MPU6050_XS.ino @@ -76,6 +76,8 @@ void setup() { Serial.println(((float)eeprom_word_read(2)) / 100.0, DEC); Serial.println(((float)eeprom_word_read(3)) / 100.0, DEC); } + pinMode(greenLED, OUTPUT); + pinMode(blueLED, OUTPUT); } void loop() { @@ -261,6 +263,6 @@ void blink(int length) #if defined __AVR_ATmega32U4__ digitalWrite(RXLED, HIGH); // set the RX LED OFF - TXLED0; //TX LED is not tied to a normally controlled pin so a macro is needed, turn LED OFF + TXLED0; //TX LED macro to turn LED ON #endif } From 9c8b60fa5d27dbe68ff0ccc661fd6402f1d843bb Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 3 Jan 2021 09:45:55 -0500 Subject: [PATCH 109/252] fixed APRS mode python read --- afsk/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 994b4652..ef34ecc8 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -694,10 +694,11 @@ void get_tlm(void) { char * token; // char cmdbuffer[1000]; - FILE * file = popen(pythonStr, "r"); +// FILE * file = popen(pythonStr, "r"); + fputc('\n', file1); fgets(cmdbuffer, 1000, file); // printf("result: %s\n", cmdbuffer); - pclose(file); +// pclose(file); const char space[2] = " "; token = strtok(cmdbuffer, space); From d4ac2bb073fe7e1941447fec125d0d25c4b3645b Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 3 Jan 2021 09:47:31 -0500 Subject: [PATCH 110/252] typo --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index ef34ecc8..64713fe1 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -696,7 +696,7 @@ void get_tlm(void) { // FILE * file = popen(pythonStr, "r"); fputc('\n', file1); - fgets(cmdbuffer, 1000, file); + fgets(cmdbuffer, 1000, file1); // printf("result: %s\n", cmdbuffer); // pclose(file); From 278e84fcd9ba51b18ec5add173a5cc0249405a0f Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 3 Jan 2021 10:28:20 -0500 Subject: [PATCH 111/252] change sleep(3.3) to 2.3 --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 64713fe1..dbac87ce 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1093,7 +1093,7 @@ void get_tlm_fox() { while ((millis() - sampleTime) < (unsigned int)samplePeriod) sleep((unsigned int)sleepTime); */ - sleep(3.3); // No sleep at all! + sleep(2.3); // No sleep at all! // sleep(1.3); digitalWrite(txLed, txLedOff); From e7c1a4de3682393e06321a5e67191288aa94a863 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 3 Jan 2021 10:28:55 -0500 Subject: [PATCH 112/252] added back in cpulimit --- demo.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo.sh b/demo.sh index 89c96368..38aa9a74 100755 --- a/demo.sh +++ b/demo.sh @@ -16,7 +16,7 @@ if [[ ("$1" = "a" ) || (("$1" = "c") && ("$(($y %4))" = 3)) ]]; then /home/pi/CubeSatSim/radioafsk afsk elif [[ ("$1" = "b" ) || (("$1" = "c") && ("$(($y %4))" = 1)) ]]; then echo "Mode is continuous BPSK" -# sudo cpulimit -l 5 -P radioafsk & + sudo cpulimit -l 5 -P radioafsk & /home/pi/CubeSatSim/radioafsk bpsk elif [[ ("$1" = "s" ) || (("$1" = "c") && ("$(($y %4))" = 2)) ]]; then echo "Mode is continuous SSTV" From a74f6084c03c5c7188eb6e47bd4229d16095a2a3 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 26 May 2021 10:17:57 -0400 Subject: [PATCH 113/252] created script to edit config file --- config.sh | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100755 config.sh diff --git a/config.sh b/config.sh new file mode 100755 index 00000000..adf5bca5 --- /dev/null +++ b/config.sh @@ -0,0 +1,81 @@ +#!/bin/bash + +echo -e "\nConfiguration script for CubeSatSim\n" + +echo -e "Return keeps current value." + +echo -e "Current sim.cfg configuration file: \n" + +value=`cat sim.cfg` + +echo "$value" + +echo + +set -- $value + +#echo $1 $2 $3 $4 + +echo -e "Input callsign (all capitals): " + +read callsign + +if [ -z $callsign ] ; then + + callsign="$1" + echo $callsign +fi + +echo -e "Input reset count (integer): " + +read resets + +if [ -z $resets ] ; then + resets="$2" + echo $resets +fi + +if ! [[ $resets =~ ^[0-9]+$ ]] ; then + echo "Error: not an integer!" + resets="$2" + echo $resets +fi + +echo -e "Input latitude (decimal degrees, positive is north): " + +read lat + +if [ -z $lat ] ; then + + lat="$3" + echo $lat +fi + +if ! [[ $lat =~ ^[+-]?[0-9]+([.][0-9]+)?$ ]] ; then + + echo "Error: not a number!" + lat="$3" +fi + +echo -e "Input longitude (decimal degrees, positive is east): " + +read long + +if [ -z $long ] ; then + + long="$4" + echo $long +fi + +if ! [[ $long =~ ^[+-]?[0-9]+([.][0-9]+)?$ ]] ; then + + echo "Error: not a number!" + long="$4" +fi + +echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n" + +echo $callsign $resets $lat $long + +echo $callsign $resets $lat $long > sim.cfg + From c8c5d7c64e1dcd5718b481f9a12c734ac7f1a22f Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 26 May 2021 10:27:47 -0400 Subject: [PATCH 114/252] added auto reset --- config.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/config.sh b/config.sh index adf5bca5..d786dcf9 100755 --- a/config.sh +++ b/config.sh @@ -23,7 +23,7 @@ read callsign if [ -z $callsign ] ; then callsign="$1" - echo $callsign + echo "Keeping value of" $callsign fi echo -e "Input reset count (integer): " @@ -32,13 +32,13 @@ read resets if [ -z $resets ] ; then resets="$2" - echo $resets + echo "Keeping value of" $resets fi if ! [[ $resets =~ ^[0-9]+$ ]] ; then echo "Error: not an integer!" resets="$2" - echo $resets + echo "Keeping value of" $resets fi echo -e "Input latitude (decimal degrees, positive is north): " @@ -48,13 +48,14 @@ read lat if [ -z $lat ] ; then lat="$3" - echo $lat + echo "Keeping value of" $lat fi if ! [[ $lat =~ ^[+-]?[0-9]+([.][0-9]+)?$ ]] ; then echo "Error: not a number!" lat="$3" + echo "Keeping value of" $lat fi echo -e "Input longitude (decimal degrees, positive is east): " @@ -64,13 +65,14 @@ read long if [ -z $long ] ; then long="$4" - echo $long + echo "Keeping value of" $long fi if ! [[ $long =~ ^[+-]?[0-9]+([.][0-9]+)?$ ]] ; then echo "Error: not a number!" long="$4" + echo "Keeping value of" $long fi echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n" @@ -78,4 +80,8 @@ echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n" echo $callsign $resets $lat $long echo $callsign $resets $lat $long > sim.cfg + +echo "Restarting CubeSatSim with new configuraation file" + +sudo systemctl restart cubesatsim From e7e2fa6b2eec9965a24eab7c68386def52e7434f Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 26 May 2021 10:45:27 -0400 Subject: [PATCH 115/252] adding mode change --- config.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/config.sh b/config.sh index d786dcf9..fad9ba74 100755 --- a/config.sh +++ b/config.sh @@ -1,5 +1,31 @@ #!/bin/bash +if [ "$1" = "r" ]; then + echo "Restarting CubeSatSim" + sudo systemctl restart cubesatsim + exit +elif [ "$1" = "a" ]; then + echo "changing CubeSatSim to AFSK mode" + sudo echo "ARG1=a" >> .mode + sudo systemctl restart cubesatsim + exit +elif [ "$1" = "f" ]; then + echo "changing CubeSatSim to FSK mode" + sudo echo "ARG1=f" >> .mode + sudo systemctl restart cubesatsim + exit +elif [ "$1" = "b" ]; then + echo "changing CubeSatSim to BPSK mode" + sudo echo "ARG1=b" >> .mode + sudo systemctl restart cubesatsim + exit +elif [ "$1" = "s" ]; then + echo "changing CubeSatSim to SSTV mode" + sudo echo "ARG1=s" >> .mode + sudo systemctl restart cubesatsim + exit +fi + echo -e "\nConfiguration script for CubeSatSim\n" echo -e "Return keeps current value." From 20ca2d9b767b50209e3af6ce05e88255c3c50d10 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 26 May 2021 17:35:33 -0400 Subject: [PATCH 116/252] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 36eb3595..7e92e5d3 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ The CubeSat Simulator https://github.com/alanbjohnston/CubeSatSim/wiki is a low There are several hardware versions and software branches to go with them - see below for information. -See the Wiki Software Install page for more details: https://github.com/alanbjohnston/CubeSatSim/wiki/Software-Install. The software runs on any Raspberry Pi including the Raspberry Pi 4B, 3B, 3B+, Pi Zero or Pi Zero W. +See the Wiki Software Install page for more details: https://github.com/alanbjohnston/CubeSatSim/wiki/2.-Software-Install. The software runs on any Raspberry Pi including the Raspberry Pi 4B, 3B, 3B+, Pi Zero or Pi Zero W. There are two ways to get the CubeSatSim software for your Pi. From 05e31d957f0516ec669048a0aeda5b635890d490 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 26 May 2021 17:36:45 -0400 Subject: [PATCH 117/252] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7e92e5d3..e30491a8 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ The other option is to start with any Raspberry Pi OS (Rasbian) image and run th ## Disk Image Option Steps -See the Wiki Software Install page for details: https://github.com/alanbjohnston/CubeSatSim/wiki/Software-Install. +See the Wiki Software Install page for details: https://github.com/alanbjohnston/CubeSatSim/wiki/2.-Software-Install. ## Installation Script Option Steps From 174b89e0ee7f61d65c03c1ef8dab5d6d80217479 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 27 May 2021 12:45:18 -0400 Subject: [PATCH 118/252] added - option --- config.sh | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/config.sh b/config.sh index fad9ba74..c4be04e0 100755 --- a/config.sh +++ b/config.sh @@ -1,29 +1,47 @@ #!/bin/bash -if [ "$1" = "r" ]; then +echo $1 + +if [ "$1" = "-r" ]; then echo "Restarting CubeSatSim" sudo systemctl restart cubesatsim exit -elif [ "$1" = "a" ]; then +elif [ "$1" = -"a" ]; then echo "changing CubeSatSim to AFSK mode" sudo echo "ARG1=a" >> .mode sudo systemctl restart cubesatsim exit -elif [ "$1" = "f" ]; then +elif [ "$1" = "-f" ]; then echo "changing CubeSatSim to FSK mode" sudo echo "ARG1=f" >> .mode sudo systemctl restart cubesatsim exit -elif [ "$1" = "b" ]; then +elif [ "$1" = "-b" ]; then echo "changing CubeSatSim to BPSK mode" sudo echo "ARG1=b" >> .mode sudo systemctl restart cubesatsim exit -elif [ "$1" = "s" ]; then +elif [ "$1" = "-s" ]; then echo "changing CubeSatSim to SSTV mode" sudo echo "ARG1=s" >> .mode sudo systemctl restart cubesatsim exit +elif [ "$1" = "-h" ]; then + echo "./configh.sh [OPTIONS]" + echo + echo "Changes CubeSatSim mode, resets, or modifies configuration file" + echo + echo " -h This help info" + echo " -a Change to AFSK/APRS mode" + echo " -f Change to FSK/DUV mode" + echo " -b Change to BPSK mode" + echo " -s Change to SSTV mode" + echo " -r Restarts CubeSatsim software" + echo + echo "Without any options, modifies configuration file" + echo "sim.cfg. You can change callsign, reset count, or" + echo "latitude and longitude (used for APRS)" + exit fi echo -e "\nConfiguration script for CubeSatSim\n" From b658e58534755f61d150fbbd328786131714857d Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 27 May 2021 13:25:29 -0400 Subject: [PATCH 119/252] require -m to modify sim.cfg file --- config.sh | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/config.sh b/config.sh index c4be04e0..d2ff251a 100755 --- a/config.sh +++ b/config.sh @@ -6,24 +6,24 @@ if [ "$1" = "-r" ]; then echo "Restarting CubeSatSim" sudo systemctl restart cubesatsim exit -elif [ "$1" = -"a" ]; then +elif [ "$1" = "-a" ]; then echo "changing CubeSatSim to AFSK mode" - sudo echo "ARG1=a" >> .mode + sudo echo "ARG1=a" > .mode sudo systemctl restart cubesatsim exit elif [ "$1" = "-f" ]; then echo "changing CubeSatSim to FSK mode" - sudo echo "ARG1=f" >> .mode + sudo echo "ARG1=f" > .mode sudo systemctl restart cubesatsim exit elif [ "$1" = "-b" ]; then echo "changing CubeSatSim to BPSK mode" - sudo echo "ARG1=b" >> .mode + sudo echo "ARG1=b" > .mode sudo systemctl restart cubesatsim exit elif [ "$1" = "-s" ]; then echo "changing CubeSatSim to SSTV mode" - sudo echo "ARG1=s" >> .mode + sudo echo "ARG1=s" > .mode sudo systemctl restart cubesatsim exit elif [ "$1" = "-h" ]; then @@ -37,12 +37,13 @@ elif [ "$1" = "-h" ]; then echo " -b Change to BPSK mode" echo " -s Change to SSTV mode" echo " -r Restarts CubeSatsim software" + echo " -m Modified the configuration file sim.cfg" + echo " You can change callsign, reset count, or" + echo " latitude and longitude (used for APRS)" echo - echo "Without any options, modifies configuration file" - echo "sim.cfg. You can change callsign, reset count, or" - echo "latitude and longitude (used for APRS)" exit -fi + +elif [ "$1" = "-m" ]; then echo -e "\nConfiguration script for CubeSatSim\n" @@ -127,5 +128,7 @@ echo $callsign $resets $lat $long > sim.cfg echo "Restarting CubeSatSim with new configuraation file" +fi + sudo systemctl restart cubesatsim From 863dddbbb55c3939889718bf3f22437baa853817 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 29 May 2021 11:12:21 -0400 Subject: [PATCH 120/252] send frame twice over socket --- afsk/main.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index dbac87ce..cd4a19d8 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1718,7 +1718,17 @@ void get_tlm_fox() { // printf("Not resending\n"); sleep(0.5); sock_ret = send(sock, &buffer[sock_ret], (unsigned int)(ctr * 2 + 2 - sock_ret), 0); - printf("Millis6: %d Result of socket send: %d \n\n", millis() - start, sock_ret); + printf("Millis7: %d Result of socket send: %d \n\n", millis() - start, sock_ret); + } + start = millis(); // send frame a second time + sock_ret = send(sock, buffer, (unsigned int)(ctr * 2 + 2), 0); + printf("Millis8: %d Result of socket send: %d \n\n", (unsigned int)millis() - start, sock_ret); + + if (sock_ret < (ctr * 2 + 2)) { + // printf("Not resending\n"); + sleep(0.5); + sock_ret = send(sock, &buffer[sock_ret], (unsigned int)(ctr * 2 + 2 - sock_ret), 0); + printf("Millis9: %d Result of socket send: %d \n\n", millis() - start, sock_ret); } if (sock_ret == -1) { From fdd5fd0fd9823696193209b556c3c363d79b488d Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 29 May 2021 11:27:23 -0400 Subject: [PATCH 121/252] printout PythonConfigStr --- afsk/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/afsk/main.c b/afsk/main.c index cd4a19d8..3f551058 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -343,6 +343,8 @@ int main(int argc, char * argv[]) { strcat(pythonStr, busStr); strcat(pythonConfigStr, pythonStr); strcat(pythonConfigStr, " c"); + + printf("pythonConfigStr: %s\n", pythonConfigStr); file1 = sopen(pythonConfigStr); // try new function fgets(cmdbuffer, 1000, file1); From b65770fc81c793952b145d2611c576afdfd929d3 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 29 May 2021 11:34:10 -0400 Subject: [PATCH 122/252] changed a printf to fprintf(stderr --- afsk/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 3f551058..15a9a0c6 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -344,11 +344,11 @@ int main(int argc, char * argv[]) { strcat(pythonConfigStr, pythonStr); strcat(pythonConfigStr, " c"); - printf("pythonConfigStr: %s\n", pythonConfigStr); + fprintf(stderr, "pythonConfigStr: %s\n", pythonConfigStr); file1 = sopen(pythonConfigStr); // try new function fgets(cmdbuffer, 1000, file1); - printf("pythonStr result: %s\n", cmdbuffer); + fprintf(stderr, "pythonStr result: %s\n", cmdbuffer); /* sleep(5); fputc('\n', file1); From 79af4adb00d03642dd3c7fde539de14c4e101a43 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 29 May 2021 12:36:41 -0400 Subject: [PATCH 123/252] moved config import to start --- python/voltcurrent.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index f73da809..13b260aa 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -6,6 +6,7 @@ import sys import busio from adafruit_extended_bus import ExtendedI2C as I2C from adafruit_ina219 import INA219 +from adafruit_ina219 import ADCResolution, BusVoltageRange if __name__ == "__main__": # print 'Length: ', len(sys.argv) @@ -14,18 +15,18 @@ if __name__ == "__main__": config = False if (len(sys.argv)) > 1: -# print("There are arguments!") -# if (('a' == sys.argv[1]) or ('afsk' in sys.argv[1])): + print("There are arguments!") + if (('a' == sys.argv[1]) or ('afsk' in sys.argv[1])): buses[0] = int(sys.argv[1], base=10) if (len(sys.argv)) > 2: buses[1] = int(sys.argv[2], base=10) if (len(sys.argv)) > 3: if sys.argv[3] == "c": config = True - from adafruit_ina219 import ADCResolution, BusVoltageRange + addresses = [0x40, 0x41, 0x44, 0x45] #INA219 addresses on the bus -# print("buses: ", buses, " addr: ", addresses) + print("buses: ", buses, " addr: ", addresses) # config From b3951050fb6513d89c8b39803dc22590e92ca9fb Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 29 May 2021 14:46:03 -0400 Subject: [PATCH 124/252] added in try except --- python/voltcurrent.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index 13b260aa..79ac4294 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -31,29 +31,29 @@ if __name__ == "__main__": # config for x in buses: -# try: + try: i2c_bus = I2C(x) # Device is /dev/i2c-x for y in addresses: - # print(x,y) - # try: + print(x,y) + try: # Create library object using Extended Bus I2C port -# print("bus: ", x, " addr: ", y) + print("bus: ", x, " addr: ", y) if x == 0 and y == 0x45: # print("Reading INA219 in MoPower Board") i2c_bus = I2C(1) ina219 = INA219(i2c_bus, 0x4a) else: ina219 = INA219(i2c_bus, y) -# print("ina219 test") + print("ina219 test") -# print("Configuring") + print("Configuring") # optional : change configuration to use 32 samples averaging for both bus voltage and shunt voltage ina219.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S ina219.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S # optional : change voltage range to 16V ina219.bus_voltage_range = BusVoltageRange.RANGE_16V -# except: -# except: + except: + except: # No try checking yet i2c_one = I2C(buses[0]) From 167924c067667bef4673e28b1d1a0610c7051bed Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 29 May 2021 14:48:37 -0400 Subject: [PATCH 125/252] indent typo --- python/voltcurrent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index 79ac4294..3be10e1f 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -34,7 +34,7 @@ if __name__ == "__main__": try: i2c_bus = I2C(x) # Device is /dev/i2c-x for y in addresses: - print(x,y) + print(x,y) try: # Create library object using Extended Bus I2C port print("bus: ", x, " addr: ", y) From 6a43dddb7bccf36d235b79058e4e277e8750bf3e Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 29 May 2021 14:49:46 -0400 Subject: [PATCH 126/252] more indent --- python/voltcurrent.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index 3be10e1f..0831b657 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -37,7 +37,7 @@ if __name__ == "__main__": print(x,y) try: # Create library object using Extended Bus I2C port - print("bus: ", x, " addr: ", y) + print("bus: ", x, " addr: ", y) if x == 0 and y == 0x45: # print("Reading INA219 in MoPower Board") i2c_bus = I2C(1) @@ -53,7 +53,9 @@ if __name__ == "__main__": # optional : change voltage range to 16V ina219.bus_voltage_range = BusVoltageRange.RANGE_16V except: + print("Error 2") except: + print("Error 1") # No try checking yet i2c_one = I2C(buses[0]) From 854536bbce229f730fb6ae54576ae59c267a2f08 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 29 May 2021 14:50:32 -0400 Subject: [PATCH 127/252] and more --- python/voltcurrent.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index 0831b657..be450497 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -44,9 +44,9 @@ if __name__ == "__main__": ina219 = INA219(i2c_bus, 0x4a) else: ina219 = INA219(i2c_bus, y) - print("ina219 test") + print("ina219 test") - print("Configuring") + print("Configuring") # optional : change configuration to use 32 samples averaging for both bus voltage and shunt voltage ina219.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S ina219.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S From b81c1d104dd1ebe40070b538713e5fe5ab52f6d0 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 29 May 2021 15:10:04 -0400 Subject: [PATCH 128/252] added , file=sys.stderr) --- python/voltcurrent.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index be450497..4b4bbce6 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -15,7 +15,7 @@ if __name__ == "__main__": config = False if (len(sys.argv)) > 1: - print("There are arguments!") + print("There are arguments!", file=sys.stderr) if (('a' == sys.argv[1]) or ('afsk' in sys.argv[1])): buses[0] = int(sys.argv[1], base=10) if (len(sys.argv)) > 2: @@ -26,7 +26,7 @@ if __name__ == "__main__": addresses = [0x40, 0x41, 0x44, 0x45] #INA219 addresses on the bus - print("buses: ", buses, " addr: ", addresses) + print("buses: ", buses, " addr: ", addresses, file=sys.stderr) # config @@ -53,9 +53,9 @@ if __name__ == "__main__": # optional : change voltage range to 16V ina219.bus_voltage_range = BusVoltageRange.RANGE_16V except: - print("Error 2") + print("Error 2", file=sys.stderr) except: - print("Error 1") + print("Error 1", file=sys.stderr) # No try checking yet i2c_one = I2C(buses[0]) From b38e528681ddcc19ae4b629c3eaf63075b502785 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 29 May 2021 15:23:17 -0400 Subject: [PATCH 129/252] changed UART to 115200 --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 15a9a0c6..3389f529 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -383,7 +383,7 @@ int main(int argc, char * argv[]) { { payload = OFF; - if ((uart_fd = serialOpen("/dev/ttyAMA0", 9600)) >= 0) { + if ((uart_fd = serialOpen("/dev/ttyAMA0", 115200)) >= 0) { // was 9600 char c; int charss = (char) serialDataAvail(uart_fd); if (charss != 0) From 8f7cc9afe16120f653dfaa08894452165691cc22 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 29 May 2021 15:25:58 -0400 Subject: [PATCH 130/252] more try --- python/voltcurrent.py | 44 +++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index 4b4bbce6..083c5bfb 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -53,9 +53,9 @@ if __name__ == "__main__": # optional : change voltage range to 16V ina219.bus_voltage_range = BusVoltageRange.RANGE_16V except: - print("Error 2", file=sys.stderr) + print("Error 2", file=sys.stderr, flush=True) except: - print("Error 1", file=sys.stderr) + print("Error 1", file=sys.stderr, flush=True) # No try checking yet i2c_one = I2C(buses[0]) @@ -66,25 +66,29 @@ if __name__ == "__main__": ina219_one = INA219(I2C(1), 0x4a) else: ina219_one = INA219(i2c_one, addresses[0]) - ina219_two = INA219(i2c_one, addresses[1]) - ina219_three = INA219(i2c_one, addresses[2]) - ina219_four= INA219(i2c_one, addresses[3]) - ina219_five= INA219(i2c_two, addresses[0]) - ina219_six = INA219(i2c_two, addresses[1]) - ina219_seven = INA219(i2c_two, addresses[2]) - ina219_eight = INA219(i2c_two, addresses[3]) - + try: + ina219_two = INA219(i2c_one, addresses[1]) + ina219_three = INA219(i2c_one, addresses[2]) + ina219_four= INA219(i2c_one, addresses[3]) + ina219_five= INA219(i2c_two, addresses[0]) + ina219_six = INA219(i2c_two, addresses[1]) + ina219_seven = INA219(i2c_two, addresses[2]) + ina219_eight = INA219(i2c_two, addresses[3]) + except: + print("Error 3", file=sys.stderr, flush=True) while (True): -# print("{:6.3f} ".format(0), "{:6.3f} ".format(0)) - print("{:6.3f} ".format(ina219_one.bus_voltage), "{:6.3f} ".format(ina219_one.current) , end = '') - print("{:6.3f} ".format(ina219_two.bus_voltage), "{:6.3f} ".format(ina219_two.current) , end = '') - print("{:6.3f} ".format(ina219_three.bus_voltage), "{:6.3f} ".format(ina219_three.current) , end = '') - print("{:6.3f} ".format(ina219_four.bus_voltage), "{:6.3f} ".format(ina219_four.current) , end = '') - print("{:6.3f} ".format(ina219_five.bus_voltage), "{:6.3f} ".format(ina219_five.current) , end = '') - print("{:6.3f} ".format(ina219_six.bus_voltage), "{:6.3f} ".format(ina219_six.current) , end = '') - print("{:6.3f} ".format(ina219_seven.bus_voltage), "{:6.3f} ".format(ina219_seven.current) , end = '') - print("{:6.3f} ".format(ina219_eight.bus_voltage), "{:6.3f} ".format(ina219_eight.current) , end = '') - + try: +# print("{:6.3f} ".format(0), "{:6.3f} ".format(0)) + print("{:6.3f} ".format(ina219_one.bus_voltage), "{:6.3f} ".format(ina219_one.current) , end = '') + print("{:6.3f} ".format(ina219_two.bus_voltage), "{:6.3f} ".format(ina219_two.current) , end = '') + print("{:6.3f} ".format(ina219_three.bus_voltage), "{:6.3f} ".format(ina219_three.current) , end = '') + print("{:6.3f} ".format(ina219_four.bus_voltage), "{:6.3f} ".format(ina219_four.current) , end = '') + print("{:6.3f} ".format(ina219_five.bus_voltage), "{:6.3f} ".format(ina219_five.current) , end = '') + print("{:6.3f} ".format(ina219_six.bus_voltage), "{:6.3f} ".format(ina219_six.current) , end = '') + print("{:6.3f} ".format(ina219_seven.bus_voltage), "{:6.3f} ".format(ina219_seven.current) , end = '') + print("{:6.3f} ".format(ina219_eight.bus_voltage), "{:6.3f} ".format(ina219_eight.current) , end = '') + except: + print("Error 4", file=sys.stderr, flush=True) print(" ") inp = input() # print(inp) From 41fb0eab3242d042eff9ac340f512d2766e26f75 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 29 May 2021 18:16:40 -0400 Subject: [PATCH 131/252] added test for BPSK mode for 2nd socket send --- afsk/main.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 3389f529..17663030 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1722,15 +1722,19 @@ void get_tlm_fox() { sock_ret = send(sock, &buffer[sock_ret], (unsigned int)(ctr * 2 + 2 - sock_ret), 0); printf("Millis7: %d Result of socket send: %d \n\n", millis() - start, sock_ret); } - start = millis(); // send frame a second time - sock_ret = send(sock, buffer, (unsigned int)(ctr * 2 + 2), 0); - printf("Millis8: %d Result of socket send: %d \n\n", (unsigned int)millis() - start, sock_ret); - if (sock_ret < (ctr * 2 + 2)) { + if (mode == BPSK) + { + start = millis(); // send frame a second time + sock_ret = send(sock, buffer, (unsigned int)(ctr * 2 + 2), 0); + printf("Millis8: %d Result of socket send: %d \n\n", (unsigned int)millis() - start, sock_ret); + + if (sock_ret < (ctr * 2 + 2)) { // printf("Not resending\n"); - sleep(0.5); - sock_ret = send(sock, &buffer[sock_ret], (unsigned int)(ctr * 2 + 2 - sock_ret), 0); - printf("Millis9: %d Result of socket send: %d \n\n", millis() - start, sock_ret); + sleep(0.5); + sock_ret = send(sock, &buffer[sock_ret], (unsigned int)(ctr * 2 + 2 - sock_ret), 0); + printf("Millis9: %d Result of socket send: %d \n\n", millis() - start, sock_ret); + } } if (sock_ret == -1) { From 324ede0095f5c004fb65e903b83844f9ba7828c4 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 29 May 2021 18:47:38 -0400 Subject: [PATCH 132/252] removed MoPower support --- python/voltcurrent.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index 083c5bfb..44be4bc6 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -61,12 +61,13 @@ if __name__ == "__main__": i2c_one = I2C(buses[0]) i2c_two = I2C(buses[1]) - if buses[0] == 0 and addresses[0] == 0x45: +# if buses[0] == 0 and addresses[0] == 0x45: # print("Reading INA219 in MoPower Board") - ina219_one = INA219(I2C(1), 0x4a) - else: +# ina219_one = INA219(I2C(1), 0x4a) +# else: + try: ina219_one = INA219(i2c_one, addresses[0]) - try: +# try: ina219_two = INA219(i2c_one, addresses[1]) ina219_three = INA219(i2c_one, addresses[2]) ina219_four= INA219(i2c_one, addresses[3]) From 882e04f61026cb1b7c0e426249d78565ce946903 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 29 May 2021 18:56:09 -0400 Subject: [PATCH 133/252] commented out prints --- python/voltcurrent.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index 44be4bc6..6da4d182 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -15,7 +15,7 @@ if __name__ == "__main__": config = False if (len(sys.argv)) > 1: - print("There are arguments!", file=sys.stderr) +# print("There are arguments!", file=sys.stderr) if (('a' == sys.argv[1]) or ('afsk' in sys.argv[1])): buses[0] = int(sys.argv[1], base=10) if (len(sys.argv)) > 2: @@ -26,7 +26,7 @@ if __name__ == "__main__": addresses = [0x40, 0x41, 0x44, 0x45] #INA219 addresses on the bus - print("buses: ", buses, " addr: ", addresses, file=sys.stderr) +# print("buses: ", buses, " addr: ", addresses, file=sys.stderr) # config @@ -34,17 +34,17 @@ if __name__ == "__main__": try: i2c_bus = I2C(x) # Device is /dev/i2c-x for y in addresses: - print(x,y) +# print(x,y) try: # Create library object using Extended Bus I2C port - print("bus: ", x, " addr: ", y) +# print("bus: ", x, " addr: ", y) if x == 0 and y == 0x45: # print("Reading INA219 in MoPower Board") i2c_bus = I2C(1) ina219 = INA219(i2c_bus, 0x4a) else: ina219 = INA219(i2c_bus, y) - print("ina219 test") +# print("ina219 test") print("Configuring") # optional : change configuration to use 32 samples averaging for both bus voltage and shunt voltage @@ -93,4 +93,3 @@ if __name__ == "__main__": print(" ") inp = input() # print(inp) - From ee30f44a94923408c6331fbf9edad343e6349b94 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 29 May 2021 18:56:44 -0400 Subject: [PATCH 134/252] removed last print --- python/voltcurrent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index 6da4d182..08105f24 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -46,7 +46,7 @@ if __name__ == "__main__": ina219 = INA219(i2c_bus, y) # print("ina219 test") - print("Configuring") +# print("Configuring") # optional : change configuration to use 32 samples averaging for both bus voltage and shunt voltage ina219.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S ina219.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S From 63335e3e138560fc3ae00e4b8814118f91722940 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 29 May 2021 19:08:15 -0400 Subject: [PATCH 135/252] added Python to error message --- python/voltcurrent.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index 08105f24..68b5da05 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -53,9 +53,9 @@ if __name__ == "__main__": # optional : change voltage range to 16V ina219.bus_voltage_range = BusVoltageRange.RANGE_16V except: - print("Error 2", file=sys.stderr, flush=True) + print("Python Error 2", file=sys.stderr, flush=True) except: - print("Error 1", file=sys.stderr, flush=True) + print("Python Error 1", file=sys.stderr, flush=True) # No try checking yet i2c_one = I2C(buses[0]) @@ -76,7 +76,7 @@ if __name__ == "__main__": ina219_seven = INA219(i2c_two, addresses[2]) ina219_eight = INA219(i2c_two, addresses[3]) except: - print("Error 3", file=sys.stderr, flush=True) + print("Python Error 3", file=sys.stderr, flush=True) while (True): try: # print("{:6.3f} ".format(0), "{:6.3f} ".format(0)) @@ -89,7 +89,7 @@ if __name__ == "__main__": print("{:6.3f} ".format(ina219_seven.bus_voltage), "{:6.3f} ".format(ina219_seven.current) , end = '') print("{:6.3f} ".format(ina219_eight.bus_voltage), "{:6.3f} ".format(ina219_eight.current) , end = '') except: - print("Error 4", file=sys.stderr, flush=True) + print("Python Error 4", file=sys.stderr, flush=True) print(" ") inp = input() # print(inp) From 7ef595e4bbb299115382d0dd8a5d0db64f133386 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 29 May 2021 19:20:20 -0400 Subject: [PATCH 136/252] double clearing buffer --- afsk/main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/afsk/main.c b/afsk/main.c index 17663030..907a0b9d 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1260,6 +1260,12 @@ void get_tlm_fox() { printf("Clearing buffer of %d chars \n", charss); while ((charss--> 0)) c = (char) serialGetchar(uart_fd); // clear buffer + + charss = (char) serialDataAvail(uart_fd); + if (charss != 0) + printf("Clearing buffer of %d chars \n", charss); + while ((charss--> 0)) + c = (char) serialGetchar(uart_fd); // clear buffer unsigned int waitTime; int i = 0; From 421547dd9bf15d8b78c3aa0dd6c8eb4846d0eefa Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 30 May 2021 08:11:33 -0400 Subject: [PATCH 137/252] removed double clearing buffer --- afsk/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 907a0b9d..57664283 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1260,12 +1260,13 @@ void get_tlm_fox() { printf("Clearing buffer of %d chars \n", charss); while ((charss--> 0)) c = (char) serialGetchar(uart_fd); // clear buffer - +/* charss = (char) serialDataAvail(uart_fd); if (charss != 0) printf("Clearing buffer of %d chars \n", charss); while ((charss--> 0)) c = (char) serialGetchar(uart_fd); // clear buffer +*/ unsigned int waitTime; int i = 0; From 2f47c5fb5eccccf84c7e61c881936c04e5bb47e1 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 30 May 2021 08:59:46 -0400 Subject: [PATCH 138/252] Try 5% --- systemd/cubesatsim.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/systemd/cubesatsim.service b/systemd/cubesatsim.service index d43b3cac..e704d5b8 100644 --- a/systemd/cubesatsim.service +++ b/systemd/cubesatsim.service @@ -11,7 +11,7 @@ StandardError=inherit Restart=always User=root CPUAccounting=true -CPUQuota=2.5% +CPUQuota=5% [Install] WantedBy=default.target From c7f6c7dda0fbd76e85deb909d23666b151d429ca Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 30 May 2021 09:16:36 -0400 Subject: [PATCH 139/252] added -m to cpulimit to monitor forks --- demo.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo.sh b/demo.sh index 38aa9a74..7b6214ac 100755 --- a/demo.sh +++ b/demo.sh @@ -16,7 +16,7 @@ if [[ ("$1" = "a" ) || (("$1" = "c") && ("$(($y %4))" = 3)) ]]; then /home/pi/CubeSatSim/radioafsk afsk elif [[ ("$1" = "b" ) || (("$1" = "c") && ("$(($y %4))" = 1)) ]]; then echo "Mode is continuous BPSK" - sudo cpulimit -l 5 -P radioafsk & + sudo cpulimit -l 5 -m -P radioafsk & /home/pi/CubeSatSim/radioafsk bpsk elif [[ ("$1" = "s" ) || (("$1" = "c") && ("$(($y %4))" = 2)) ]]; then echo "Mode is continuous SSTV" From 8b8f2690470a2ffe3bf37bfbf3f5a15312008f57 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 30 May 2021 09:27:57 -0400 Subject: [PATCH 140/252] added -b for background instead of & for cpulimit --- demo.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo.sh b/demo.sh index 7b6214ac..0566a9d5 100755 --- a/demo.sh +++ b/demo.sh @@ -16,7 +16,7 @@ if [[ ("$1" = "a" ) || (("$1" = "c") && ("$(($y %4))" = 3)) ]]; then /home/pi/CubeSatSim/radioafsk afsk elif [[ ("$1" = "b" ) || (("$1" = "c") && ("$(($y %4))" = 1)) ]]; then echo "Mode is continuous BPSK" - sudo cpulimit -l 5 -m -P radioafsk & + sudo cpulimit -l 5 -m -b -P radioafsk /home/pi/CubeSatSim/radioafsk bpsk elif [[ ("$1" = "s" ) || (("$1" = "c") && ("$(($y %4))" = 2)) ]]; then echo "Mode is continuous SSTV" From 62525ae66620ef6d9b09eb9dfa5129931223d631 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 30 May 2021 09:35:31 -0400 Subject: [PATCH 141/252] cpulimit to 10 --- demo.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo.sh b/demo.sh index 0566a9d5..2052a893 100755 --- a/demo.sh +++ b/demo.sh @@ -16,7 +16,7 @@ if [[ ("$1" = "a" ) || (("$1" = "c") && ("$(($y %4))" = 3)) ]]; then /home/pi/CubeSatSim/radioafsk afsk elif [[ ("$1" = "b" ) || (("$1" = "c") && ("$(($y %4))" = 1)) ]]; then echo "Mode is continuous BPSK" - sudo cpulimit -l 5 -m -b -P radioafsk + sudo cpulimit -l 10 -m -b -P radioafsk /home/pi/CubeSatSim/radioafsk bpsk elif [[ ("$1" = "s" ) || (("$1" = "c") && ("$(($y %4))" = 2)) ]]; then echo "Mode is continuous SSTV" From 203dacb7471600f4df72c07da55506c0e6c02166 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 30 May 2021 10:55:38 -0400 Subject: [PATCH 142/252] without -m --- demo.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo.sh b/demo.sh index 2052a893..7b645077 100755 --- a/demo.sh +++ b/demo.sh @@ -16,7 +16,7 @@ if [[ ("$1" = "a" ) || (("$1" = "c") && ("$(($y %4))" = 3)) ]]; then /home/pi/CubeSatSim/radioafsk afsk elif [[ ("$1" = "b" ) || (("$1" = "c") && ("$(($y %4))" = 1)) ]]; then echo "Mode is continuous BPSK" - sudo cpulimit -l 10 -m -b -P radioafsk + sudo cpulimit -l 10 -b -P radioafsk /home/pi/CubeSatSim/radioafsk bpsk elif [[ ("$1" = "s" ) || (("$1" = "c") && ("$(($y %4))" = 2)) ]]; then echo "Mode is continuous SSTV" From d88d0d2cfcf621925469ee71b59854bae35c1e77 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 30 May 2021 12:56:10 -0400 Subject: [PATCH 143/252] changed to 2.5 for 6 frames/min --- demo.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo.sh b/demo.sh index 7b645077..84b71b50 100755 --- a/demo.sh +++ b/demo.sh @@ -16,7 +16,7 @@ if [[ ("$1" = "a" ) || (("$1" = "c") && ("$(($y %4))" = 3)) ]]; then /home/pi/CubeSatSim/radioafsk afsk elif [[ ("$1" = "b" ) || (("$1" = "c") && ("$(($y %4))" = 1)) ]]; then echo "Mode is continuous BPSK" - sudo cpulimit -l 10 -b -P radioafsk + sudo cpulimit -l 2.5 -b -P radioafsk /home/pi/CubeSatSim/radioafsk bpsk elif [[ ("$1" = "s" ) || (("$1" = "c") && ("$(($y %4))" = 2)) ]]; then echo "Mode is continuous SSTV" From 2cdb41f04fc6969cd16f456bf85e4ee85310c113 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 30 May 2021 13:00:45 -0400 Subject: [PATCH 144/252] removed sleep(2.3) --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 57664283..097e183f 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1095,7 +1095,7 @@ void get_tlm_fox() { while ((millis() - sampleTime) < (unsigned int)samplePeriod) sleep((unsigned int)sleepTime); */ - sleep(2.3); // No sleep at all! +// sleep(2.3); // No sleep at all! // sleep(1.3); digitalWrite(txLed, txLedOff); From d836c622a8f4cfc66e5ef96ab10d251c1b2ca95e Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 30 May 2021 13:01:42 -0400 Subject: [PATCH 145/252] Only sleep(2.3) for FSK --- afsk/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 097e183f..96f2c6b2 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1095,7 +1095,8 @@ void get_tlm_fox() { while ((millis() - sampleTime) < (unsigned int)samplePeriod) sleep((unsigned int)sleepTime); */ -// sleep(2.3); // No sleep at all! + if (mode == FSK) // don't sleep for BPSK + sleep(2.3); // No sleep at all! // sleep(1.3); digitalWrite(txLed, txLedOff); From df7e53c0facf0178590f2755ab09def01d1f0934 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 30 May 2021 13:09:13 -0400 Subject: [PATCH 146/252] sleep 4.3 for BPSK --- afsk/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 96f2c6b2..fc135819 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1095,9 +1095,10 @@ void get_tlm_fox() { while ((millis() - sampleTime) < (unsigned int)samplePeriod) sleep((unsigned int)sleepTime); */ - if (mode == FSK) // don't sleep for BPSK + if (mode == FSK) sleep(2.3); // No sleep at all! -// sleep(1.3); + else + sleep(4.3); digitalWrite(txLed, txLedOff); #ifdef DEBUG_LOGGING From b40eee5ca8fcdda74eaf035c8899ffc0f9c0f46e Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 30 May 2021 13:30:10 -0400 Subject: [PATCH 147/252] sleep 1.3 for BPSK --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index fc135819..44d84706 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1098,7 +1098,7 @@ void get_tlm_fox() { if (mode == FSK) sleep(2.3); // No sleep at all! else - sleep(4.3); + sleep(1.3); digitalWrite(txLed, txLedOff); #ifdef DEBUG_LOGGING From fcef731b5e8878903c0441ee87a48672d2612319 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 30 May 2021 13:49:24 -0400 Subject: [PATCH 148/252] back to sleep(2.3) for BPSK and FSK --- afsk/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 44d84706..85e9a01b 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1095,10 +1095,10 @@ void get_tlm_fox() { while ((millis() - sampleTime) < (unsigned int)samplePeriod) sleep((unsigned int)sleepTime); */ - if (mode == FSK) +// if (mode == FSK) sleep(2.3); // No sleep at all! - else - sleep(1.3); +// else +// sleep(1.3); digitalWrite(txLed, txLedOff); #ifdef DEBUG_LOGGING From 7d2131773fb8f9b608fdbe152826abae36705216 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 30 May 2021 14:46:39 -0400 Subject: [PATCH 149/252] added 0.0 printing if error --- python/voltcurrent.py | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index 68b5da05..2ca0d8e1 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -79,17 +79,37 @@ if __name__ == "__main__": print("Python Error 3", file=sys.stderr, flush=True) while (True): try: -# print("{:6.3f} ".format(0), "{:6.3f} ".format(0)) - print("{:6.3f} ".format(ina219_one.bus_voltage), "{:6.3f} ".format(ina219_one.current) , end = '') + print("{:6.3f} ".format(ina219_one.bus_voltage), "{:6.3f} ".format(ina219_one.current) , end = '') + except: + print("{:6.3f} ".format(0), "{:6.3f} ".format(0)) + try: print("{:6.3f} ".format(ina219_two.bus_voltage), "{:6.3f} ".format(ina219_two.current) , end = '') + except: + print("{:6.3f} ".format(0), "{:6.3f} ".format(0)) + try: print("{:6.3f} ".format(ina219_three.bus_voltage), "{:6.3f} ".format(ina219_three.current) , end = '') + except: + print("{:6.3f} ".format(0), "{:6.3f} ".format(0)) + try: print("{:6.3f} ".format(ina219_four.bus_voltage), "{:6.3f} ".format(ina219_four.current) , end = '') + except: + print("{:6.3f} ".format(0), "{:6.3f} ".format(0)) + try: print("{:6.3f} ".format(ina219_five.bus_voltage), "{:6.3f} ".format(ina219_five.current) , end = '') + except: + print("{:6.3f} ".format(0), "{:6.3f} ".format(0)) + try: print("{:6.3f} ".format(ina219_six.bus_voltage), "{:6.3f} ".format(ina219_six.current) , end = '') + except: + print("{:6.3f} ".format(0), "{:6.3f} ".format(0)) + try: print("{:6.3f} ".format(ina219_seven.bus_voltage), "{:6.3f} ".format(ina219_seven.current) , end = '') + except: + print("{:6.3f} ".format(0), "{:6.3f} ".format(0)) + try: print("{:6.3f} ".format(ina219_eight.bus_voltage), "{:6.3f} ".format(ina219_eight.current) , end = '') except: - print("Python Error 4", file=sys.stderr, flush=True) + print("{:6.3f} ".format(0), "{:6.3f} ".format(0)) print(" ") inp = input() # print(inp) From 9608766ef5d709e3281063468ab989d24395a6d4 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 30 May 2021 14:54:16 -0400 Subject: [PATCH 150/252] fixed missing /n --- python/voltcurrent.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index 2ca0d8e1..f1675b21 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -81,35 +81,35 @@ if __name__ == "__main__": try: print("{:6.3f} ".format(ina219_one.bus_voltage), "{:6.3f} ".format(ina219_one.current) , end = '') except: - print("{:6.3f} ".format(0), "{:6.3f} ".format(0)) + print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') try: print("{:6.3f} ".format(ina219_two.bus_voltage), "{:6.3f} ".format(ina219_two.current) , end = '') except: - print("{:6.3f} ".format(0), "{:6.3f} ".format(0)) + print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') try: print("{:6.3f} ".format(ina219_three.bus_voltage), "{:6.3f} ".format(ina219_three.current) , end = '') except: - print("{:6.3f} ".format(0), "{:6.3f} ".format(0)) + print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') try: print("{:6.3f} ".format(ina219_four.bus_voltage), "{:6.3f} ".format(ina219_four.current) , end = '') except: - print("{:6.3f} ".format(0), "{:6.3f} ".format(0)) + print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') try: print("{:6.3f} ".format(ina219_five.bus_voltage), "{:6.3f} ".format(ina219_five.current) , end = '') except: - print("{:6.3f} ".format(0), "{:6.3f} ".format(0)) + print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') try: print("{:6.3f} ".format(ina219_six.bus_voltage), "{:6.3f} ".format(ina219_six.current) , end = '') except: - print("{:6.3f} ".format(0), "{:6.3f} ".format(0)) + print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') try: print("{:6.3f} ".format(ina219_seven.bus_voltage), "{:6.3f} ".format(ina219_seven.current) , end = '') except: - print("{:6.3f} ".format(0), "{:6.3f} ".format(0)) + print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') try: print("{:6.3f} ".format(ina219_eight.bus_voltage), "{:6.3f} ".format(ina219_eight.current) , end = '') except: - print("{:6.3f} ".format(0), "{:6.3f} ".format(0)) + print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') print(" ") inp = input() # print(inp) From 792a2d2dc4ec4424f1c393d8a6f03b1081aea82b Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 30 May 2021 15:01:26 -0400 Subject: [PATCH 151/252] added try for the configuration --- python/voltcurrent.py | 52 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 41 insertions(+), 11 deletions(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index f1675b21..33b9d614 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -58,7 +58,7 @@ if __name__ == "__main__": print("Python Error 1", file=sys.stderr, flush=True) # No try checking yet - i2c_one = I2C(buses[0]) + i2c_two = I2C(buses[1]) # if buses[0] == 0 and addresses[0] == 0x45: @@ -66,17 +66,47 @@ if __name__ == "__main__": # ina219_one = INA219(I2C(1), 0x4a) # else: try: - ina219_one = INA219(i2c_one, addresses[0]) -# try: - ina219_two = INA219(i2c_one, addresses[1]) - ina219_three = INA219(i2c_one, addresses[2]) - ina219_four= INA219(i2c_one, addresses[3]) - ina219_five= INA219(i2c_two, addresses[0]) - ina219_six = INA219(i2c_two, addresses[1]) - ina219_seven = INA219(i2c_two, addresses[2]) - ina219_eight = INA219(i2c_two, addresses[3]) + i2c_one = I2C(buses[0]) + try: + ina219_one = INA219(i2c_one, addresses[0]) + except: + print("Python Error 3", file=sys.stderr, flush=True) + try: + ina219_two = INA219(i2c_one, addresses[1]) + except: + print("Python Error 3", file=sys.stderr, flush=True) + try: + ina219_three = INA219(i2c_one, addresses[2]) + except: + print("Python Error 3", file=sys.stderr, flush=True) + try: + ina219_four= INA219(i2c_one, addresses[3]) + except: + print("Python Error 3", file=sys.stderr, flush=True) + except: + print("Python Error 5", file=sys.stderr, flush=True) + + try: + i2c_one = I2C(buses[1]) + try: + ina219_five= INA219(i2c_two, addresses[0]) + except: + print("Python Error 3", file=sys.stderr, flush=True) + try: + ina219_six = INA219(i2c_two, addresses[1]) + except: + print("Python Error 3", file=sys.stderr, flush=True) + try: + ina219_seven = INA219(i2c_two, addresses[2]) + except: + print("Python Error 3", file=sys.stderr, flush=True) + try: + ina219_eight = INA219(i2c_two, addresses[3]) + except: + print("Python Error 3", file=sys.stderr, flush=True) except: - print("Python Error 3", file=sys.stderr, flush=True) + print("Python Error 5", file=sys.stderr, flush=True) + while (True): try: print("{:6.3f} ".format(ina219_one.bus_voltage), "{:6.3f} ".format(ina219_one.current) , end = '') From 21638654f1937902671ce7ef5c4bbe647aeedfe6 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 30 May 2021 15:30:29 -0400 Subject: [PATCH 152/252] more changes --- python/voltcurrent.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index 33b9d614..6fd591f2 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -57,9 +57,6 @@ if __name__ == "__main__": except: print("Python Error 1", file=sys.stderr, flush=True) # No try checking yet - - - i2c_two = I2C(buses[1]) # if buses[0] == 0 and addresses[0] == 0x45: # print("Reading INA219 in MoPower Board") @@ -68,9 +65,13 @@ if __name__ == "__main__": try: i2c_one = I2C(buses[0]) try: - ina219_one = INA219(i2c_one, addresses[0]) - except: - print("Python Error 3", file=sys.stderr, flush=True) + i2c_one = INA219(i2c_one, addresses[0]) + i2c_one.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + i2c_one.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + i2c_one.bus_voltage_range = BusVoltageRange.RANGE_16V + oneZero = 1 +# except: +# print("Python Error 3", file=sys.stderr, flush=True) try: ina219_two = INA219(i2c_one, addresses[1]) except: @@ -87,7 +88,7 @@ if __name__ == "__main__": print("Python Error 5", file=sys.stderr, flush=True) try: - i2c_one = I2C(buses[1]) + i2c_two = I2C(buses[1]) try: ina219_five= INA219(i2c_two, addresses[0]) except: @@ -108,9 +109,9 @@ if __name__ == "__main__": print("Python Error 5", file=sys.stderr, flush=True) while (True): - try: + if (zeroOne == 1): print("{:6.3f} ".format(ina219_one.bus_voltage), "{:6.3f} ".format(ina219_one.current) , end = '') - except: + else: print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') try: print("{:6.3f} ".format(ina219_two.bus_voltage), "{:6.3f} ".format(ina219_two.current) , end = '') From 03113feb852421ca4d3f97f362daff505f3e87ce Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 30 May 2021 15:32:13 -0400 Subject: [PATCH 153/252] added except --- python/voltcurrent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index 6fd591f2..18c12b02 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -70,7 +70,7 @@ if __name__ == "__main__": i2c_one.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S i2c_one.bus_voltage_range = BusVoltageRange.RANGE_16V oneZero = 1 -# except: + except: # print("Python Error 3", file=sys.stderr, flush=True) try: ina219_two = INA219(i2c_one, addresses[1]) From d0bef1aa2a262ae9683e4b7a6d71d9062c4324f2 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 30 May 2021 15:34:10 -0400 Subject: [PATCH 154/252] Update voltcurrent.py --- python/voltcurrent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index 18c12b02..2eec3510 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -71,7 +71,7 @@ if __name__ == "__main__": i2c_one.bus_voltage_range = BusVoltageRange.RANGE_16V oneZero = 1 except: -# print("Python Error 3", file=sys.stderr, flush=True) + print("Python Error 3", file=sys.stderr, flush=True) try: ina219_two = INA219(i2c_one, addresses[1]) except: From 526439b81328d51b5c76dfef055e694fa02ca8b1 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 30 May 2021 15:46:14 -0400 Subject: [PATCH 155/252] more --- python/voltcurrent.py | 58 ++++++++++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 23 deletions(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index 2eec3510..e8285f0b 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -30,32 +30,32 @@ if __name__ == "__main__": # config - for x in buses: - try: - i2c_bus = I2C(x) # Device is /dev/i2c-x - for y in addresses: +# for x in buses: +# try: +# i2c_bus = I2C(x) # Device is /dev/i2c-x +# for y in addresses: # print(x,y) - try: +# try: # Create library object using Extended Bus I2C port # print("bus: ", x, " addr: ", y) - if x == 0 and y == 0x45: +# if x == 0 and y == 0x45: # print("Reading INA219 in MoPower Board") - i2c_bus = I2C(1) - ina219 = INA219(i2c_bus, 0x4a) - else: - ina219 = INA219(i2c_bus, y) +# i2c_bus = I2C(1) +# ina219 = INA219(i2c_bus, 0x4a) +# else: +# ina219 = INA219(i2c_bus, y) # print("ina219 test") # print("Configuring") # optional : change configuration to use 32 samples averaging for both bus voltage and shunt voltage - ina219.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S - ina219.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S +# ina219.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S +# ina219.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S # optional : change voltage range to 16V - ina219.bus_voltage_range = BusVoltageRange.RANGE_16V - except: - print("Python Error 2", file=sys.stderr, flush=True) - except: - print("Python Error 1", file=sys.stderr, flush=True) +# ina219.bus_voltage_range = BusVoltageRange.RANGE_16V +# except: +# print("Python Error 2", file=sys.stderr, flush=True) +# except: +# print("Python Error 1", file=sys.stderr, flush=True) # No try checking yet # if buses[0] == 0 and addresses[0] == 0x45: @@ -65,23 +65,35 @@ if __name__ == "__main__": try: i2c_one = I2C(buses[0]) try: - i2c_one = INA219(i2c_one, addresses[0]) - i2c_one.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S - i2c_one.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S - i2c_one.bus_voltage_range = BusVoltageRange.RANGE_16V - oneZero = 1 + ina219_one = INA219(i2c_one, addresses[0]) + ina219_one.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + ina219_one.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + ina219_one.bus_voltage_range = BusVoltageRange.RANGE_16V + one = 1 except: print("Python Error 3", file=sys.stderr, flush=True) try: ina219_two = INA219(i2c_one, addresses[1]) + ina219_two.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + ina219_two.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + ina219_two.bus_voltage_range = BusVoltageRange.RANGE_16V + two = 1 except: print("Python Error 3", file=sys.stderr, flush=True) try: ina219_three = INA219(i2c_one, addresses[2]) + ina219_three.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + ina219_three.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + ina219_three.bus_voltage_range = BusVoltageRange.RANGE_16V + three = 1 except: print("Python Error 3", file=sys.stderr, flush=True) try: ina219_four= INA219(i2c_one, addresses[3]) + ina219_four.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + ina219_four.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + ina219_four.bus_voltage_range = BusVoltageRange.RANGE_16V + four = 1 except: print("Python Error 3", file=sys.stderr, flush=True) except: @@ -109,7 +121,7 @@ if __name__ == "__main__": print("Python Error 5", file=sys.stderr, flush=True) while (True): - if (zeroOne == 1): + if (oneZero == 1): print("{:6.3f} ".format(ina219_one.bus_voltage), "{:6.3f} ".format(ina219_one.current) , end = '') else: print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') From e808ae60beec445fb86a91597cd18d4c35c07d90 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 30 May 2021 15:58:27 -0400 Subject: [PATCH 156/252] complete --- python/voltcurrent.py | 50 ++++++++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 17 deletions(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index e8285f0b..2118e321 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -102,56 +102,72 @@ if __name__ == "__main__": try: i2c_two = I2C(buses[1]) try: - ina219_five= INA219(i2c_two, addresses[0]) + ina219_five = INA219(i2c_two, addresses[0]) + ina219_five.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + ina219_five.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + ina219_five.bus_voltage_range = BusVoltageRange.RANGE_16V + five = 1 except: print("Python Error 3", file=sys.stderr, flush=True) try: ina219_six = INA219(i2c_two, addresses[1]) + ina219_six.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + ina219_six.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + ina219_six.bus_voltage_range = BusVoltageRange.RANGE_16V + six = 1 except: print("Python Error 3", file=sys.stderr, flush=True) try: ina219_seven = INA219(i2c_two, addresses[2]) + ina219_seven.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + ina219_seven.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + ina219_seven.bus_voltage_range = BusVoltageRange.RANGE_16V + seven = 1 except: print("Python Error 3", file=sys.stderr, flush=True) try: ina219_eight = INA219(i2c_two, addresses[3]) + ina219_eight.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + ina219_eight.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + ina219_eight.bus_voltage_range = BusVoltageRange.RANGE_16V + eight = 1 except: print("Python Error 3", file=sys.stderr, flush=True) except: print("Python Error 5", file=sys.stderr, flush=True) while (True): - if (oneZero == 1): + if (one == 1): print("{:6.3f} ".format(ina219_one.bus_voltage), "{:6.3f} ".format(ina219_one.current) , end = '') else: print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') - try: + if (two == 1): print("{:6.3f} ".format(ina219_two.bus_voltage), "{:6.3f} ".format(ina219_two.current) , end = '') - except: + else: print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') - try: + if (three == 1): print("{:6.3f} ".format(ina219_three.bus_voltage), "{:6.3f} ".format(ina219_three.current) , end = '') - except: + else: print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') - try: + if (four == 1): print("{:6.3f} ".format(ina219_four.bus_voltage), "{:6.3f} ".format(ina219_four.current) , end = '') - except: + else: print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') - try: + if (five == 1): print("{:6.3f} ".format(ina219_five.bus_voltage), "{:6.3f} ".format(ina219_five.current) , end = '') - except: + else: print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') - try: - print("{:6.3f} ".format(ina219_six.bus_voltage), "{:6.3f} ".format(ina219_six.current) , end = '') - except: + if (six == 1): + print("{:6.3f} ".format(ina219_six.bus_voltage), "{:6.3f} ".format(ina219_six.current) , end = '') + else: print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') - try: + if (seven == 1): print("{:6.3f} ".format(ina219_seven.bus_voltage), "{:6.3f} ".format(ina219_seven.current) , end = '') - except: + else: print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') - try: + if (eight == 1): print("{:6.3f} ".format(ina219_eight.bus_voltage), "{:6.3f} ".format(ina219_eight.current) , end = '') - except: + else: print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') print(" ") inp = input() From 910097540160584824e979e51cf505c2f51b31c6 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 30 May 2021 16:00:18 -0400 Subject: [PATCH 157/252] print it2c_two --- python/voltcurrent.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index 2118e321..6b3476dd 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -101,6 +101,7 @@ if __name__ == "__main__": try: i2c_two = I2C(buses[1]) + print(i2c_two) try: ina219_five = INA219(i2c_two, addresses[0]) ina219_five.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S From 71b14bfc16706ad47af3a07512981bdc0ec7b253 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 30 May 2021 16:01:27 -0400 Subject: [PATCH 158/252] Update voltcurrent.py --- python/voltcurrent.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index 6b3476dd..1b3867cf 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -69,7 +69,7 @@ if __name__ == "__main__": ina219_one.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S ina219_one.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S ina219_one.bus_voltage_range = BusVoltageRange.RANGE_16V - one = 1 + oneF = 1 except: print("Python Error 3", file=sys.stderr, flush=True) try: @@ -138,7 +138,7 @@ if __name__ == "__main__": print("Python Error 5", file=sys.stderr, flush=True) while (True): - if (one == 1): + if (oneF == 1): print("{:6.3f} ".format(ina219_one.bus_voltage), "{:6.3f} ".format(ina219_one.current) , end = '') else: print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') From f84b768d2fefb9b429026c7788f6e38172163aaa Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 30 May 2021 16:03:29 -0400 Subject: [PATCH 159/252] test for -1 --- python/voltcurrent.py | 146 +++++++++++++++++++++--------------------- 1 file changed, 74 insertions(+), 72 deletions(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index 1b3867cf..80202b6d 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -62,81 +62,83 @@ if __name__ == "__main__": # print("Reading INA219 in MoPower Board") # ina219_one = INA219(I2C(1), 0x4a) # else: - try: - i2c_one = I2C(buses[0]) + if (buses[0] != -1): try: - ina219_one = INA219(i2c_one, addresses[0]) - ina219_one.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S - ina219_one.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S - ina219_one.bus_voltage_range = BusVoltageRange.RANGE_16V - oneF = 1 + i2c_one = I2C(buses[0]) + try: + ina219_one = INA219(i2c_one, addresses[0]) + ina219_one.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + ina219_one.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + ina219_one.bus_voltage_range = BusVoltageRange.RANGE_16V + oneF = 1 + except: + print("Python Error 3", file=sys.stderr, flush=True) + try: + ina219_two = INA219(i2c_one, addresses[1]) + ina219_two.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + ina219_two.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + ina219_two.bus_voltage_range = BusVoltageRange.RANGE_16V + two = 1 + except: + print("Python Error 3", file=sys.stderr, flush=True) + try: + ina219_three = INA219(i2c_one, addresses[2]) + ina219_three.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + ina219_three.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + ina219_three.bus_voltage_range = BusVoltageRange.RANGE_16V + three = 1 + except: + print("Python Error 3", file=sys.stderr, flush=True) + try: + ina219_four= INA219(i2c_one, addresses[3]) + ina219_four.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + ina219_four.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + ina219_four.bus_voltage_range = BusVoltageRange.RANGE_16V + four = 1 + except: + print("Python Error 3", file=sys.stderr, flush=True) except: - print("Python Error 3", file=sys.stderr, flush=True) - try: - ina219_two = INA219(i2c_one, addresses[1]) - ina219_two.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S - ina219_two.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S - ina219_two.bus_voltage_range = BusVoltageRange.RANGE_16V - two = 1 - except: - print("Python Error 3", file=sys.stderr, flush=True) - try: - ina219_three = INA219(i2c_one, addresses[2]) - ina219_three.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S - ina219_three.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S - ina219_three.bus_voltage_range = BusVoltageRange.RANGE_16V - three = 1 - except: - print("Python Error 3", file=sys.stderr, flush=True) - try: - ina219_four= INA219(i2c_one, addresses[3]) - ina219_four.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S - ina219_four.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S - ina219_four.bus_voltage_range = BusVoltageRange.RANGE_16V - four = 1 - except: - print("Python Error 3", file=sys.stderr, flush=True) - except: - print("Python Error 5", file=sys.stderr, flush=True) - - try: - i2c_two = I2C(buses[1]) - print(i2c_two) - try: - ina219_five = INA219(i2c_two, addresses[0]) - ina219_five.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S - ina219_five.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S - ina219_five.bus_voltage_range = BusVoltageRange.RANGE_16V - five = 1 - except: - print("Python Error 3", file=sys.stderr, flush=True) - try: - ina219_six = INA219(i2c_two, addresses[1]) - ina219_six.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S - ina219_six.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S - ina219_six.bus_voltage_range = BusVoltageRange.RANGE_16V - six = 1 - except: - print("Python Error 3", file=sys.stderr, flush=True) - try: - ina219_seven = INA219(i2c_two, addresses[2]) - ina219_seven.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S - ina219_seven.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S - ina219_seven.bus_voltage_range = BusVoltageRange.RANGE_16V - seven = 1 - except: - print("Python Error 3", file=sys.stderr, flush=True) - try: - ina219_eight = INA219(i2c_two, addresses[3]) - ina219_eight.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S - ina219_eight.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S - ina219_eight.bus_voltage_range = BusVoltageRange.RANGE_16V - eight = 1 + print("Python Error 5", file=sys.stderr, flush=True) + + if (buses[1] != -1): + try: + i2c_two = I2C(buses[1]) + print(i2c_two) + try: + ina219_five = INA219(i2c_two, addresses[0]) + ina219_five.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + ina219_five.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + ina219_five.bus_voltage_range = BusVoltageRange.RANGE_16V + five = 1 + except: + print("Python Error 3", file=sys.stderr, flush=True) + try: + ina219_six = INA219(i2c_two, addresses[1]) + ina219_six.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + ina219_six.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + ina219_six.bus_voltage_range = BusVoltageRange.RANGE_16V + six = 1 + except: + print("Python Error 3", file=sys.stderr, flush=True) + try: + ina219_seven = INA219(i2c_two, addresses[2]) + ina219_seven.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + ina219_seven.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + ina219_seven.bus_voltage_range = BusVoltageRange.RANGE_16V + seven = 1 + except: + print("Python Error 3", file=sys.stderr, flush=True) + try: + ina219_eight = INA219(i2c_two, addresses[3]) + ina219_eight.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + ina219_eight.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + ina219_eight.bus_voltage_range = BusVoltageRange.RANGE_16V + eight = 1 + except: + print("Python Error 3", file=sys.stderr, flush=True) except: - print("Python Error 3", file=sys.stderr, flush=True) - except: - print("Python Error 5", file=sys.stderr, flush=True) - + print("Python Error 5", file=sys.stderr, flush=True) + while (True): if (oneF == 1): print("{:6.3f} ".format(ina219_one.bus_voltage), "{:6.3f} ".format(ina219_one.current) , end = '') From 396b749fe1fc589aedec40baba89e058efbf9d45 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 30 May 2021 16:04:33 -0400 Subject: [PATCH 160/252] Update voltcurrent.py --- python/voltcurrent.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index 80202b6d..f0c691bd 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -24,6 +24,8 @@ if __name__ == "__main__": if sys.argv[3] == "c": config = True +print(buses[0]) +print(buses[1]) addresses = [0x40, 0x41, 0x44, 0x45] #INA219 addresses on the bus # print("buses: ", buses, " addr: ", addresses, file=sys.stderr) From 7db971490c9a07613a4b926a6748650dd6b544da Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 30 May 2021 16:06:51 -0400 Subject: [PATCH 161/252] Update voltcurrent.py --- python/voltcurrent.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index f0c691bd..59c5d202 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -24,8 +24,8 @@ if __name__ == "__main__": if sys.argv[3] == "c": config = True -print(buses[0]) -print(buses[1]) + print(buses[0]) + print(buses[1]) addresses = [0x40, 0x41, 0x44, 0x45] #INA219 addresses on the bus # print("buses: ", buses, " addr: ", addresses, file=sys.stderr) From 43447b7751c0f0ca96d076654345210217ae84e5 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 30 May 2021 16:08:22 -0400 Subject: [PATCH 162/252] Update voltcurrent.py --- python/voltcurrent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index 59c5d202..402b1765 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -16,7 +16,7 @@ if __name__ == "__main__": if (len(sys.argv)) > 1: # print("There are arguments!", file=sys.stderr) - if (('a' == sys.argv[1]) or ('afsk' in sys.argv[1])): +# if (('a' == sys.argv[1]) or ('afsk' in sys.argv[1])): buses[0] = int(sys.argv[1], base=10) if (len(sys.argv)) > 2: buses[1] = int(sys.argv[2], base=10) From 5142c44931eeb6898b6e074df91d0fc9c8b79119 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 30 May 2021 16:09:55 -0400 Subject: [PATCH 163/252] Update voltcurrent.py --- python/voltcurrent.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index 402b1765..7e9f18fa 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -13,6 +13,7 @@ if __name__ == "__main__": buses = [1, 3] # default I2C buses config = False + one = two = three = four = five = six = seven = eight = 0 if (len(sys.argv)) > 1: # print("There are arguments!", file=sys.stderr) @@ -72,7 +73,7 @@ if __name__ == "__main__": ina219_one.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S ina219_one.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S ina219_one.bus_voltage_range = BusVoltageRange.RANGE_16V - oneF = 1 + one = 1 except: print("Python Error 3", file=sys.stderr, flush=True) try: From f236127414dfc61bf2cff7ab0f758b636773f066 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 30 May 2021 16:10:39 -0400 Subject: [PATCH 164/252] Update voltcurrent.py --- python/voltcurrent.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index 7e9f18fa..7a38f6b1 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -25,8 +25,8 @@ if __name__ == "__main__": if sys.argv[3] == "c": config = True - print(buses[0]) - print(buses[1]) +# print(buses[0]) +# print(buses[1]) addresses = [0x40, 0x41, 0x44, 0x45] #INA219 addresses on the bus # print("buses: ", buses, " addr: ", addresses, file=sys.stderr) @@ -143,7 +143,7 @@ if __name__ == "__main__": print("Python Error 5", file=sys.stderr, flush=True) while (True): - if (oneF == 1): + if (one == 1): print("{:6.3f} ".format(ina219_one.bus_voltage), "{:6.3f} ".format(ina219_one.current) , end = '') else: print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') From 15985a26caf053d72a2195e6975b1640c77103e7 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 30 May 2021 16:19:04 -0400 Subject: [PATCH 165/252] no Error 3 print --- python/voltcurrent.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index 7a38f6b1..468b655e 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -75,7 +75,8 @@ if __name__ == "__main__": ina219_one.bus_voltage_range = BusVoltageRange.RANGE_16V one = 1 except: - print("Python Error 3", file=sys.stderr, flush=True) +# print("Python Error 3", file=sys.stderr, flush=True) + one = 0 try: ina219_two = INA219(i2c_one, addresses[1]) ina219_two.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S @@ -83,7 +84,9 @@ if __name__ == "__main__": ina219_two.bus_voltage_range = BusVoltageRange.RANGE_16V two = 1 except: - print("Python Error 3", file=sys.stderr, flush=True) +# print("Python Error 3", file=sys.stderr, flush=True) + two = 0 + try: ina219_three = INA219(i2c_one, addresses[2]) ina219_three.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S @@ -91,15 +94,18 @@ if __name__ == "__main__": ina219_three.bus_voltage_range = BusVoltageRange.RANGE_16V three = 1 except: - print("Python Error 3", file=sys.stderr, flush=True) - try: +# print("Python Error 3", file=sys.stderr, flush=True) + three = 0 + + try: ina219_four= INA219(i2c_one, addresses[3]) ina219_four.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S ina219_four.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S ina219_four.bus_voltage_range = BusVoltageRange.RANGE_16V four = 1 except: - print("Python Error 3", file=sys.stderr, flush=True) + four = 0 +# print("Python Error 3", file=sys.stderr, flush=True) except: print("Python Error 5", file=sys.stderr, flush=True) From b3de8a2d37bffa96ca4f226997a81ad7e716d97f Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 30 May 2021 16:20:34 -0400 Subject: [PATCH 166/252] Update voltcurrent.py --- python/voltcurrent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index 468b655e..93330375 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -97,7 +97,7 @@ if __name__ == "__main__": # print("Python Error 3", file=sys.stderr, flush=True) three = 0 - try: + try: ina219_four= INA219(i2c_one, addresses[3]) ina219_four.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S ina219_four.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S From ace40acd3d0687a6e2c254628d3c5a0c12e0685a Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 30 May 2021 16:43:15 -0400 Subject: [PATCH 167/252] removed last print --- python/voltcurrent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index 93330375..01ffc0c3 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -112,7 +112,7 @@ if __name__ == "__main__": if (buses[1] != -1): try: i2c_two = I2C(buses[1]) - print(i2c_two) +# print(i2c_two) try: ina219_five = INA219(i2c_two, addresses[0]) ina219_five.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S From c0963fd9511afdcfdcbecb929311d17380f7806d Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 30 May 2021 16:55:03 -0400 Subject: [PATCH 168/252] last of Error 3 --- python/voltcurrent.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index 01ffc0c3..f5d25c40 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -120,7 +120,8 @@ if __name__ == "__main__": ina219_five.bus_voltage_range = BusVoltageRange.RANGE_16V five = 1 except: - print("Python Error 3", file=sys.stderr, flush=True) +# print("Python Error 3", file=sys.stderr, flush=True) + five = 0 try: ina219_six = INA219(i2c_two, addresses[1]) ina219_six.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S @@ -128,7 +129,8 @@ if __name__ == "__main__": ina219_six.bus_voltage_range = BusVoltageRange.RANGE_16V six = 1 except: - print("Python Error 3", file=sys.stderr, flush=True) +# print("Python Error 3", file=sys.stderr, flush=True) + six = 0 try: ina219_seven = INA219(i2c_two, addresses[2]) ina219_seven.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S @@ -136,7 +138,8 @@ if __name__ == "__main__": ina219_seven.bus_voltage_range = BusVoltageRange.RANGE_16V seven = 1 except: - print("Python Error 3", file=sys.stderr, flush=True) +# print("Python Error 3", file=sys.stderr, flush=True) + seven = 0 try: ina219_eight = INA219(i2c_two, addresses[3]) ina219_eight.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S @@ -144,7 +147,8 @@ if __name__ == "__main__": ina219_eight.bus_voltage_range = BusVoltageRange.RANGE_16V eight = 1 except: - print("Python Error 3", file=sys.stderr, flush=True) +# print("Python Error 3", file=sys.stderr, flush=True) + eight = 0 except: print("Python Error 5", file=sys.stderr, flush=True) From b82ce4544233015fd9f8388fdc81ed7f14254f06 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 30 May 2021 16:57:23 -0400 Subject: [PATCH 169/252] added printf for python results --- afsk/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 85e9a01b..56358cda 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -699,7 +699,7 @@ void get_tlm(void) { // FILE * file = popen(pythonStr, "r"); fputc('\n', file1); fgets(cmdbuffer, 1000, file1); - // printf("result: %s\n", cmdbuffer); + printf("Pyton result: %s\n", cmdbuffer); // pclose(file); const char space[2] = " "; @@ -1201,7 +1201,7 @@ void get_tlm_fox() { // FILE * file = popen(pythonStr, "r"); fputc('\n', file1); fgets(cmdbuffer, 1000, file1); -// printf("Python read Result: %s\n", cmdbuffer); + fprintf(stderr, "Python read Result: %s\n", cmdbuffer); // pclose(file); /**/ const char space[2] = " "; From c9fd5e04461e9aa0c62aabdc5c5346d7c345c986 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 30 May 2021 20:37:14 -0400 Subject: [PATCH 170/252] reverted to try except for printing instead of variable one, two, etc. --- python/voltcurrent.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index f5d25c40..38385374 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -153,37 +153,37 @@ if __name__ == "__main__": print("Python Error 5", file=sys.stderr, flush=True) while (True): - if (one == 1): + try: print("{:6.3f} ".format(ina219_one.bus_voltage), "{:6.3f} ".format(ina219_one.current) , end = '') else: print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') - if (two == 1): + try: print("{:6.3f} ".format(ina219_two.bus_voltage), "{:6.3f} ".format(ina219_two.current) , end = '') - else: + except: print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') - if (three == 1): + try: print("{:6.3f} ".format(ina219_three.bus_voltage), "{:6.3f} ".format(ina219_three.current) , end = '') - else: + except: print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') - if (four == 1): + try: print("{:6.3f} ".format(ina219_four.bus_voltage), "{:6.3f} ".format(ina219_four.current) , end = '') - else: + except: print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') - if (five == 1): + try: print("{:6.3f} ".format(ina219_five.bus_voltage), "{:6.3f} ".format(ina219_five.current) , end = '') - else: + except: print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') - if (six == 1): - print("{:6.3f} ".format(ina219_six.bus_voltage), "{:6.3f} ".format(ina219_six.current) , end = '') - else: + try: + print("{:6.3f} ".format(ina219_six.bus_voltage), "{:6.3f} ".format(ina219_six.current) , end = '') + except: print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') - if (seven == 1): + try: print("{:6.3f} ".format(ina219_seven.bus_voltage), "{:6.3f} ".format(ina219_seven.current) , end = '') - else: + except: print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') - if (eight == 1): + try: print("{:6.3f} ".format(ina219_eight.bus_voltage), "{:6.3f} ".format(ina219_eight.current) , end = '') - else: + except: print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') print(" ") inp = input() From 8612116e5f5e4b61225fe88a357b6f91c1decd90 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 30 May 2021 20:40:43 -0400 Subject: [PATCH 171/252] else/except typo --- python/voltcurrent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index 38385374..d6fca650 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -155,7 +155,7 @@ if __name__ == "__main__": while (True): try: print("{:6.3f} ".format(ina219_one.bus_voltage), "{:6.3f} ".format(ina219_one.current) , end = '') - else: + except: print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') try: print("{:6.3f} ".format(ina219_two.bus_voltage), "{:6.3f} ".format(ina219_two.current) , end = '') From 4654fc583c82f3937ed7fad8eaf4e1ec9e61d68d Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 30 May 2021 21:03:10 -0400 Subject: [PATCH 172/252] turned on max and min frames for a test similar to dev-faster --- afsk/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 56358cda..a978435f 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1330,7 +1330,8 @@ void get_tlm_fox() { } } } - if (mode == FSK) { // just moved +// if (mode == FSK) + { // just moved for (int count1 = 0; count1 < 8; count1++) { if (voltage[count1] < voltage_min[count1]) voltage_min[count1] = voltage[count1]; From 35c04331de84a9450e054f4ea16fd20b6cb51db3 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 31 May 2021 06:29:59 -0400 Subject: [PATCH 173/252] BPSK only send MAX MIN frames, just +Xv and +Yv so far --- afsk/main.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index a978435f..8bd7110c 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1042,8 +1042,13 @@ void get_tlm_fox() { // short int b[DATA_LEN]; short int b[dataLen]; + short int b_max[dataLen]; + short int b_min[dataLen]; + memset(b, 0, sizeof(b)); - + memset(b_max, 0, sizeof(b_max)); + memset(b_min, 0, sizeof(b_min)); + // short int h[HEADER_LEN]; short int h[headerLen]; memset(h, 0, sizeof(h)); @@ -1486,6 +1491,13 @@ void get_tlm_fox() { encodeB(b, 25 + head_offset, negXi); encodeA(b, 27 + head_offset, negYi); encodeB(b, 28 + head_offset, negZi); + + encodeA(b_max, 12 + head_offset, (int)(voltage_max[map[PLUS_X]] * 100)); + encodeB(b_max, 13 + head_offset, (int)(voltage_max[map[PLUS_Y]] * 100)); + + encodeA(b_min, 12 + head_offset, (int)(voltage_min[map[PLUS_X]] * 100)); + encodeB(b_min, 13 + head_offset, (int)(voltage_min[map[PLUS_Y]] * 100)); + } encodeA(b, 30 + head_offset, PSUVoltage); @@ -1557,8 +1569,17 @@ void get_tlm_fox() { data8[ctr1++] = rs_frame[j][i]; // printf ("data8[%d] = %x \n", ctr1 - 1, rs_frame[j][i]); } else { - rs_frame[j][i] = b[ctr3 % dataLen]; - update_rs(parities[j], b[ctr3 % dataLen]); + if (mode == FSK) + { + rs_frame[j][i] = b[ctr3 % dataLen]; + update_rs(parities[j], b[ctr3 % dataLen]); + } else // BPSK + rs_frame[j][i] = b_max[ctr3 % dataLen]; + update_rs(parities[j], b_max[ctr3 % dataLen]); + frm_type = 0x02; + { + } + // printf("%d rs_frame[%d][%d] = %x %d \n", // ctr1, j, i, b[ctr3 % DATA_LEN], ctr3 % DATA_LEN); data8[ctr1++] = rs_frame[j][i]; From 71b914cdb26bc0c376b0872b1452014cd157cae5 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 31 May 2021 06:53:23 -0400 Subject: [PATCH 174/252] added payload frame checking for MAX Min --- afsk/main.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 8bd7110c..c0c73f89 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1574,8 +1574,21 @@ void get_tlm_fox() { rs_frame[j][i] = b[ctr3 % dataLen]; update_rs(parities[j], b[ctr3 % dataLen]); } else // BPSK - rs_frame[j][i] = b_max[ctr3 % dataLen]; - update_rs(parities[j], b_max[ctr3 % dataLen]); + if ((int)(ctr3/dataLen) == 4) + { + rs_frame[j][i] = b_max[ctr3 % dataLen]; + update_rs(parities[j], b_max[ctr3 % dataLen]); + } + else if ((int)(ctr3/dataLen) == 5) + { + rs_frame[j][i] = b_min[ctr3 % dataLen]; + update_rs(parities[j], b_min[ctr3 % dataLen]); + } + else + { + rs_frame[j][i] = b[ctr3 % dataLen]; + update_rs(parities[j], b[ctr3 % dataLen]); + } frm_type = 0x02; { } From 1f7e2087760f917299813f8a482fd35dd66a0f37 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 31 May 2021 07:01:38 -0400 Subject: [PATCH 175/252] always send MAX Min frame BPSK --- afsk/main.c | 62 ++++++++++++++++++++++++++++------------------------- 1 file changed, 33 insertions(+), 29 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index c0c73f89..0c158bd8 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1358,34 +1358,39 @@ void get_tlm_fox() { // printf("Other min %f max %f \n", other_min[count1], other_max[count1]); } - if (loop % 8 == 0) { - printf("Sending MIN frame \n"); - frm_type = 0x03; - for (int count1 = 0; count1 < 17; count1++) { - if (count1 < 3) - other[count1] = other_min[count1]; - if (count1 < 8) { - voltage[count1] = voltage_min[count1]; - current[count1] = current_min[count1]; - } - if (sensor_min[count1] != 1000.0) // make sure values are valid - sensor[count1] = sensor_min[count1]; - } - } - if ((loop + 4) % 8 == 0) { - printf("Sending MAX frame \n"); - frm_type = 0x02; - for (int count1 = 0; count1 < 17; count1++) { - if (count1 < 3) - other[count1] = other_max[count1]; - if (count1 < 8) { - voltage[count1] = voltage_max[count1]; - current[count1] = current_max[count1]; - } - if (sensor_max[count1] != -1000.0) // make sure values are valid - sensor[count1] = sensor_max[count1]; - } - } + if (mode == FSK) + { + if (loop % 8 == 0) { + printf("Sending MIN frame \n"); + frm_type = 0x03; + for (int count1 = 0; count1 < 17; count1++) { + if (count1 < 3) + other[count1] = other_min[count1]; + if (count1 < 8) { + voltage[count1] = voltage_min[count1]; + current[count1] = current_min[count1]; + } + if (sensor_min[count1] != 1000.0) // make sure values are valid + sensor[count1] = sensor_min[count1]; + } + } + if ((loop + 4) % 8 == 0) { + printf("Sending MAX frame \n"); + frm_type = 0x02; + for (int count1 = 0; count1 < 17; count1++) { + if (count1 < 3) + other[count1] = other_max[count1]; + if (count1 < 8) { + voltage[count1] = voltage_max[count1]; + current[count1] = current_max[count1]; + } + if (sensor_max[count1] != -1000.0) // make sure values are valid + sensor[count1] = sensor_max[count1]; + } + } + } + else + frm_type = 0x02; // BPSK always send MAX MIN frame } // if (mode == FSK) { // remove this @@ -1589,7 +1594,6 @@ void get_tlm_fox() { rs_frame[j][i] = b[ctr3 % dataLen]; update_rs(parities[j], b[ctr3 % dataLen]); } - frm_type = 0x02; { } From c33ee9a02da2ed4e7b327fc11e827251ca982c3b Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 31 May 2021 07:10:11 -0400 Subject: [PATCH 176/252] fixed payload order --- afsk/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 0c158bd8..e86d4f1a 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1579,12 +1579,12 @@ void get_tlm_fox() { rs_frame[j][i] = b[ctr3 % dataLen]; update_rs(parities[j], b[ctr3 % dataLen]); } else // BPSK - if ((int)(ctr3/dataLen) == 4) + if ((int)(ctr3/dataLen) == 3) { rs_frame[j][i] = b_max[ctr3 % dataLen]; update_rs(parities[j], b_max[ctr3 % dataLen]); } - else if ((int)(ctr3/dataLen) == 5) + else if ((int)(ctr3/dataLen) == 4) { rs_frame[j][i] = b_min[ctr3 % dataLen]; update_rs(parities[j], b_min[ctr3 % dataLen]); From 50cff5a94efc3b74fe152f090bdd40ca3eee581a Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 31 May 2021 07:27:51 -0400 Subject: [PATCH 177/252] rest of battery voltages and currents --- afsk/main.c | 37 +++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index e86d4f1a..3317981b 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1440,7 +1440,6 @@ void get_tlm_fox() { negZv = (int)(voltage[map[MINUS_Z]] * 100); batt_c_v = (int)(voltage[map[BAT]] * 100); - battCurr = (int)(current[map[BAT]] + 0.5) + 2048; PSUVoltage = (int)(voltage[map[BUS]] * 100); PSUCurrent = (int)(current[map[BUS]] + 0.5) + 2048; @@ -1499,12 +1498,42 @@ void get_tlm_fox() { encodeA(b_max, 12 + head_offset, (int)(voltage_max[map[PLUS_X]] * 100)); encodeB(b_max, 13 + head_offset, (int)(voltage_max[map[PLUS_Y]] * 100)); + encodeA(b_max, 15 + head_offset, (int)(voltage_max[map[PLUS_Z]] * 100)); + encodeB(b_max, 16 + head_offset, (int)(voltage_max[map[MINUS_X]] * 100)); + encodeA(b_max, 18 + head_offset, (int)(voltage_max[map[MINUS_Y]] * 100)); + encodeB(b_max, 19 + head_offset, (int)(voltage_max[map[MINUS_Z]] * 100)); + + encodeA(b_max, 21 + head_offset, (int)(current_max[map[PLUS_X]] * 100)); + encodeB(b_max, 22 + head_offset, (int)(current_max[map[PLUS_Y]] * 100)); + encodeA(b_max, 24 + head_offset, (int)(current_max[map[PLUS_Z]] * 100)); + encodeB(b_max, 25 + head_offset, (int)(current_max[map[MINUS_X]] * 100)); + encodeA(b_max, 27 + head_offset, (int)(current_max[map[MINUS_Y]] * 100)); + encodeB(b_max, 28 + head_offset, (int)(current_max[map[MINUS_Z]] * 100)); + + encodeA(b_max, 9 + head_offset, (int)(current_max[map[BAT]] + 0.5) + 2048); + encodeA(b_max, 3 + head_offset, (int)(voltage_max[map[BAT]] * 100)); + encodeA(b_max, 30 + head_offset, (int)(voltage_max[map[BUS]] * 100)); + encodeB(b_max, 46 + head_offset, (int)(current_max[map[BUS]] + 0.5) + 2048); encodeA(b_min, 12 + head_offset, (int)(voltage_min[map[PLUS_X]] * 100)); encodeB(b_min, 13 + head_offset, (int)(voltage_min[map[PLUS_Y]] * 100)); - - } - + encodeA(b_min, 15 + head_offset, (int)(voltage_min[map[PLUS_Z]] * 100)); + encodeB(b_min, 16 + head_offset, (int)(voltage_min[map[MINUS_X]] * 100)); + encodeA(b_min, 18 + head_offset, (int)(voltage_min[map[MINUS_Y]] * 100)); + encodeB(b_min, 19 + head_offset, (int)(voltage_min[map[MINUS_Z]] * 100)); + + encodeA(b_min, 21 + head_offset, (int)(current_min[map[PLUS_X]] * 100)); + encodeB(b_min, 22 + head_offset, (int)(current_min[map[PLUS_Y]] * 100)); + encodeA(b_min, 24 + head_offset, (int)(current_min[map[PLUS_Z]] * 100)); + encodeB(b_min, 25 + head_offset, (int)(current_min[map[MINUS_X]] * 100)); + encodeA(b_min, 27 + head_offset, (int)(current_min[map[MINUS_Y]] * 100)); + encodeB(b_min, 28 + head_offset, (int)(current_min[map[MINUS_Z]] * 100)); + + encodeA(b_min, 9 + head_offset, (int)(current_min[map[BAT]] + 0.5) + 2048); + encodeA(b_min, 3 + head_offset, (int)(voltage_min[map[BAT]] * 100)); + encodeA(b_min, 30 + head_offset, (int)(voltage_min[map[BUS]] * 100)); + encodeB(b_min, 46 + head_offset, (int)(current_min[map[BUS]] + 0.5) + 2048); + encodeA(b, 30 + head_offset, PSUVoltage); // encodeB(b, 31 + head_offset,(spin * 10) + 2048); encodeB(b, 31 + head_offset, ((int)(other[SPIN] * 10)) + 2048); From dda78ebc6f96ff19fab3cfd363c908e5342309ca Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 31 May 2021 07:29:47 -0400 Subject: [PATCH 178/252] missing { --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 3317981b..9f250394 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1533,7 +1533,7 @@ void get_tlm_fox() { encodeA(b_min, 3 + head_offset, (int)(voltage_min[map[BAT]] * 100)); encodeA(b_min, 30 + head_offset, (int)(voltage_min[map[BUS]] * 100)); encodeB(b_min, 46 + head_offset, (int)(current_min[map[BUS]] + 0.5) + 2048); - + } encodeA(b, 30 + head_offset, PSUVoltage); // encodeB(b, 31 + head_offset,(spin * 10) + 2048); encodeB(b, 31 + head_offset, ((int)(other[SPIN] * 10)) + 2048); From c514885daed0a3875adbb40b95de87d2f6f11aba Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 31 May 2021 07:39:38 -0400 Subject: [PATCH 179/252] fixed current conversions --- afsk/main.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 9f250394..cce098f1 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1503,12 +1503,12 @@ void get_tlm_fox() { encodeA(b_max, 18 + head_offset, (int)(voltage_max[map[MINUS_Y]] * 100)); encodeB(b_max, 19 + head_offset, (int)(voltage_max[map[MINUS_Z]] * 100)); - encodeA(b_max, 21 + head_offset, (int)(current_max[map[PLUS_X]] * 100)); - encodeB(b_max, 22 + head_offset, (int)(current_max[map[PLUS_Y]] * 100)); - encodeA(b_max, 24 + head_offset, (int)(current_max[map[PLUS_Z]] * 100)); - encodeB(b_max, 25 + head_offset, (int)(current_max[map[MINUS_X]] * 100)); - encodeA(b_max, 27 + head_offset, (int)(current_max[map[MINUS_Y]] * 100)); - encodeB(b_max, 28 + head_offset, (int)(current_max[map[MINUS_Z]] * 100)); + encodeA(b_max, 21 + head_offset, (int)(current_max[map[PLUS_X]] + 0.5) + 2048); + encodeB(b_max, 22 + head_offset, (int)(current_max[map[PLUS_Y]] + 0.5) + 2048); + encodeA(b_max, 24 + head_offset, (int)(current_max[map[PLUS_Z]] + 0.5) + 2048); + encodeB(b_max, 25 + head_offset, (int)(current_max[map[MINUS_X]] + 0.5) + 2048); + encodeA(b_max, 27 + head_offset, (int)(current_max[map[MINUS_Y]] + 0.5) + 2048); + encodeB(b_max, 28 + head_offset, (int)(current_max[map[MINUS_Z]] + 0.5) + 2048); encodeA(b_max, 9 + head_offset, (int)(current_max[map[BAT]] + 0.5) + 2048); encodeA(b_max, 3 + head_offset, (int)(voltage_max[map[BAT]] * 100)); @@ -1522,12 +1522,12 @@ void get_tlm_fox() { encodeA(b_min, 18 + head_offset, (int)(voltage_min[map[MINUS_Y]] * 100)); encodeB(b_min, 19 + head_offset, (int)(voltage_min[map[MINUS_Z]] * 100)); - encodeA(b_min, 21 + head_offset, (int)(current_min[map[PLUS_X]] * 100)); - encodeB(b_min, 22 + head_offset, (int)(current_min[map[PLUS_Y]] * 100)); - encodeA(b_min, 24 + head_offset, (int)(current_min[map[PLUS_Z]] * 100)); - encodeB(b_min, 25 + head_offset, (int)(current_min[map[MINUS_X]] * 100)); - encodeA(b_min, 27 + head_offset, (int)(current_min[map[MINUS_Y]] * 100)); - encodeB(b_min, 28 + head_offset, (int)(current_min[map[MINUS_Z]] * 100)); + encodeA(b_min, 21 + head_offset, (int)(current_min[map[PLUS_X]] + 0.5) + 2048); + encodeB(b_min, 22 + head_offset, (int)(current_min[map[PLUS_Y]] + 0.5) + 2048); + encodeA(b_min, 24 + head_offset, (int)(current_min[map[PLUS_Z]] + 0.5) + 2048); + encodeB(b_min, 25 + head_offset, (int)(current_min[map[MINUS_X]] + 0.5) + 2048); + encodeA(b_min, 27 + head_offset, (int)(current_min[map[MINUS_Y]] + 0.5) + 2048); + encodeB(b_min, 28 + head_offset, (int)(current_min[map[MINUS_Z]] + 0.5) + 2048); encodeA(b_min, 9 + head_offset, (int)(current_min[map[BAT]] + 0.5) + 2048); encodeA(b_min, 3 + head_offset, (int)(voltage_min[map[BAT]] * 100)); From 0813b39364c9e18a168b4fafde903a57881285b4 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 31 May 2021 07:51:11 -0400 Subject: [PATCH 180/252] Update main.c --- afsk/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index cce098f1..9f065bc9 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1584,8 +1584,8 @@ void get_tlm_fox() { } if (mode == BPSK) { // WOD field experiments - encodeA(b, 63 + head_offset, 0xff); - encodeB(b, 74 + head_offset, 0xff); + encodeA(b, 64 + head_offset, 0xff); // was 63 + encodeB(b, 74 + head_offset, 0xa5; // was ff } short int data10[headerLen + rsFrames * (rsFrameLen + parityLen)]; short int data8[headerLen + rsFrames * (rsFrameLen + parityLen)]; From 6c3421e573ac2ba6d7ae9c4dbd0912b14593f0bf Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 31 May 2021 07:52:16 -0400 Subject: [PATCH 181/252] missing ) typo --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 9f065bc9..ec4ae7fd 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1585,7 +1585,7 @@ void get_tlm_fox() { if (mode == BPSK) { // WOD field experiments encodeA(b, 64 + head_offset, 0xff); // was 63 - encodeB(b, 74 + head_offset, 0xa5; // was ff + encodeB(b, 74 + head_offset, 0xa5); // was ff } short int data10[headerLen + rsFrames * (rsFrameLen + parityLen)]; short int data8[headerLen + rsFrames * (rsFrameLen + parityLen)]; From ccc5955c2fb372599916fdabfe64237fd17bf63c Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 31 May 2021 08:03:47 -0400 Subject: [PATCH 182/252] wow test --- afsk/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index ec4ae7fd..6f20083b 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1348,7 +1348,7 @@ void get_tlm_fox() { if (current[count1] > current_max[count1]) current_max[count1] = current[count1]; - // printf("Vmin %f Vmax %f Imin %f Imax %f \n", voltage_min[count1], voltage_max[count1], current_min[count1], current_max[count1]); + printf("Vmin %4.2f Vmax %4.2f Imin %4.2f Imax %4.2f \n", voltage_min[count1], voltage_max[count1], current_min[count1], current_max[count1]); } for (int count1 = 0; count1 < 3; count1++) { if (other[count1] < other_min[count1]) @@ -1584,7 +1584,7 @@ void get_tlm_fox() { } if (mode == BPSK) { // WOD field experiments - encodeA(b, 64 + head_offset, 0xff); // was 63 + encodeA(b, 64 + head_offset, 0x7f); // was ff -> 1fe was 63 encodeB(b, 74 + head_offset, 0xa5); // was ff } short int data10[headerLen + rsFrames * (rsFrameLen + parityLen)]; From c33b24b1cece5168630ea59bcce591f5c2347344 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 31 May 2021 08:15:21 -0400 Subject: [PATCH 183/252] switching max and min --- afsk/main.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 6f20083b..9e2131f7 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1583,8 +1583,9 @@ void get_tlm_fox() { printf("TX Antenna Deployed!\n"); } - if (mode == BPSK) { // WOD field experiments - encodeA(b, 64 + head_offset, 0x7f); // was ff -> 1fe was 63 + if (mode == BPSK) { // wod field experiments + encodeA(b, 64 + head_offset, 0x7f); // was 7f -> fe, ff -> 1fe was 63 + encodeA(b, 65 + head_offset, 0xff); encodeB(b, 74 + head_offset, 0xa5); // was ff } short int data10[headerLen + rsFrames * (rsFrameLen + parityLen)]; @@ -1608,12 +1609,12 @@ void get_tlm_fox() { rs_frame[j][i] = b[ctr3 % dataLen]; update_rs(parities[j], b[ctr3 % dataLen]); } else // BPSK - if ((int)(ctr3/dataLen) == 3) + if ((int)(ctr3/dataLen) == 4) // was 3 { rs_frame[j][i] = b_max[ctr3 % dataLen]; update_rs(parities[j], b_max[ctr3 % dataLen]); } - else if ((int)(ctr3/dataLen) == 4) + else if ((int)(ctr3/dataLen) == 3) // was 4 { rs_frame[j][i] = b_min[ctr3 % dataLen]; update_rs(parities[j], b_min[ctr3 % dataLen]); From 6c37aadf01b8d4dda2e96c91eba1f707f3aa3b74 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 31 May 2021 08:29:58 -0400 Subject: [PATCH 184/252] added rest of sensors --- afsk/main.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 9e2131f7..3fb52c98 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1515,6 +1515,16 @@ void get_tlm_fox() { encodeA(b_max, 30 + head_offset, (int)(voltage_max[map[BUS]] * 100)); encodeB(b_max, 46 + head_offset, (int)(current_max[map[BUS]] + 0.5) + 2048); + encodeB(b_max, 4 + head_offset, (int)(sensor_max[ACCEL_X] * 100 + 0.5) + 2048); // Xaccel + encodeA(b_max, 6 + head_offset, (int)(sensor_max[ACCEL_Y] * 100 + 0.5) + 2048); // Yaccel + encodeB(b_max, 7 + head_offset, (int)(sensor_max[ACCEL_Z] * 100 + 0.5) + 2048); // Zaccel + + encodeA(b_max, 33 + head_offset, (int)(sensor_max[PRES] + 0.5)); // Pressure + encodeB(b_max, 34 + head_offset, (int)(sensor_max[ALT] * 10.0 + 0.5)); // Altitude + encodeB(b_max, 40 + head_offset, (int)(sensor_max[GYRO_X] + 0.5) + 2048); + encodeA(b_max, 42 + head_offset, (int)(sensor_max[GYRO_Y] + 0.5) + 2048); + encodeB(b_max, 43 + head_offset, (int)(sensor_max[GYRO_Z] + 0.5) + 2048); + encodeA(b_min, 12 + head_offset, (int)(voltage_min[map[PLUS_X]] * 100)); encodeB(b_min, 13 + head_offset, (int)(voltage_min[map[PLUS_Y]] * 100)); encodeA(b_min, 15 + head_offset, (int)(voltage_min[map[PLUS_Z]] * 100)); @@ -1533,6 +1543,17 @@ void get_tlm_fox() { encodeA(b_min, 3 + head_offset, (int)(voltage_min[map[BAT]] * 100)); encodeA(b_min, 30 + head_offset, (int)(voltage_min[map[BUS]] * 100)); encodeB(b_min, 46 + head_offset, (int)(current_min[map[BUS]] + 0.5) + 2048); + + encodeB(b_min, 4 + head_offset, (int)(sensor_min[ACCEL_X] * 100 + 0.5) + 2048); // Xaccel + encodeA(b_min, 6 + head_offset, (int)(sensor_min[ACCEL_Y] * 100 + 0.5) + 2048); // Yaccel + encodeB(b_min, 7 + head_offset, (int)(sensor_min[ACCEL_Z] * 100 + 0.5) + 2048); // Zaccel + + encodeA(b_min, 33 + head_offset, (int)(sensor_min[PRES] + 0.5)); // Pressure + encodeB(b_min, 34 + head_offset, (int)(sensor_min[ALT] * 10.0 + 0.5)); // Altitude + encodeB(b_min, 40 + head_offset, (int)(sensor_min[GYRO_X] + 0.5) + 2048); + encodeA(b_min, 42 + head_offset, (int)(sensor_min[GYRO_Y] + 0.5) + 2048); + encodeB(b_min, 43 + head_offset, (int)(sensor_min[GYRO_Z] + 0.5) + 2048); + } encodeA(b, 30 + head_offset, PSUVoltage); // encodeB(b, 31 + head_offset,(spin * 10) + 2048); @@ -1585,7 +1606,7 @@ void get_tlm_fox() { if (mode == BPSK) { // wod field experiments encodeA(b, 64 + head_offset, 0x7f); // was 7f -> fe, ff -> 1fe was 63 - encodeA(b, 65 + head_offset, 0xff); + encodeA(b, 63 + head_offset, 0xff); // ,65 ff -> fefe encodeB(b, 74 + head_offset, 0xa5); // was ff } short int data10[headerLen + rsFrames * (rsFrameLen + parityLen)]; From 4fc4ff76a91bd4d025cb5fc344b9bda24f805db6 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 31 May 2021 08:38:49 -0400 Subject: [PATCH 185/252] put MAX and MIN back --- afsk/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 3fb52c98..5ee8104b 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1606,7 +1606,7 @@ void get_tlm_fox() { if (mode == BPSK) { // wod field experiments encodeA(b, 64 + head_offset, 0x7f); // was 7f -> fe, ff -> 1fe was 63 - encodeA(b, 63 + head_offset, 0xff); // ,65 ff -> fefe + encodeA(b, 63 + head_offset, 0x1e); // ,65 ff -> fefe, ff -> e1, encodeB(b, 74 + head_offset, 0xa5); // was ff } short int data10[headerLen + rsFrames * (rsFrameLen + parityLen)]; @@ -1630,12 +1630,12 @@ void get_tlm_fox() { rs_frame[j][i] = b[ctr3 % dataLen]; update_rs(parities[j], b[ctr3 % dataLen]); } else // BPSK - if ((int)(ctr3/dataLen) == 4) // was 3 + if ((int)(ctr3/dataLen) == 3) { rs_frame[j][i] = b_max[ctr3 % dataLen]; update_rs(parities[j], b_max[ctr3 % dataLen]); } - else if ((int)(ctr3/dataLen) == 3) // was 4 + else if ((int)(ctr3/dataLen) == 4) { rs_frame[j][i] = b_min[ctr3 % dataLen]; update_rs(parities[j], b_min[ctr3 % dataLen]); From 7488627d62b702791c8f62b07982d564d4b7a81a Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 31 May 2021 08:58:59 -0400 Subject: [PATCH 186/252] more word --- afsk/main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 5ee8104b..a97b75fd 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1605,9 +1605,10 @@ void get_tlm_fox() { } if (mode == BPSK) { // wod field experiments - encodeA(b, 64 + head_offset, 0x7f); // was 7f -> fe, ff -> 1fe was 63 - encodeA(b, 63 + head_offset, 0x1e); // ,65 ff -> fefe, ff -> e1, - encodeB(b, 74 + head_offset, 0xa5); // was ff +// encodeA(b, 64 + head_offset, 0x7f); // was 7f -> fe, ff -> 1fe was 63 +// encodeA(b, 63 + head_offset, 0x1e); // 1e -> 224,65 ff -> fefe, ff -> e1, + encodeA(b, 65 + head_offset, 0x80); // 0x80 is 1000 0000 at 65 + encodeB(b, 74 + head_offset, 0x5a); // was ff } short int data10[headerLen + rsFrames * (rsFrameLen + parityLen)]; short int data8[headerLen + rsFrames * (rsFrameLen + parityLen)]; From 4fc216bc81f796e0b2f4a8a487d542cad05ff839 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 31 May 2021 09:06:03 -0400 Subject: [PATCH 187/252] more wod --- afsk/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index a97b75fd..1b3c8c4f 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1605,10 +1605,10 @@ void get_tlm_fox() { } if (mode == BPSK) { // wod field experiments -// encodeA(b, 64 + head_offset, 0x7f); // was 7f -> fe, ff -> 1fe was 63 + encodeA(b, 64 + head_offset, 0x7f); // was 7f -> fe, ff -> 1fe was 63 // encodeA(b, 63 + head_offset, 0x1e); // 1e -> 224,65 ff -> fefe, ff -> e1, - encodeA(b, 65 + head_offset, 0x80); // 0x80 is 1000 0000 at 65 - encodeB(b, 74 + head_offset, 0x5a); // was ff + encodeA(b, 65 + head_offset, 0xff); // 0x80 is 1000 0000 at 65 + encodeB(b, 74 + head_offset, 0xa5); // was ff } short int data10[headerLen + rsFrames * (rsFrameLen + parityLen)]; short int data8[headerLen + rsFrames * (rsFrameLen + parityLen)]; From 0c6083f0d613a279c1aa17209da9e60f78c4a41b Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 31 May 2021 09:14:18 -0400 Subject: [PATCH 188/252] more word --- afsk/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 1b3c8c4f..8f01ada4 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1607,8 +1607,8 @@ void get_tlm_fox() { if (mode == BPSK) { // wod field experiments encodeA(b, 64 + head_offset, 0x7f); // was 7f -> fe, ff -> 1fe was 63 // encodeA(b, 63 + head_offset, 0x1e); // 1e -> 224,65 ff -> fefe, ff -> e1, - encodeA(b, 65 + head_offset, 0xff); // 0x80 is 1000 0000 at 65 - encodeB(b, 74 + head_offset, 0xa5); // was ff + encodeA(b, 63 + head_offset, 0xff); // 0x80 is 1000 0000 at 65 + encodeB(b, 74 + head_offset, 0xfff); // was ff } short int data10[headerLen + rsFrames * (rsFrameLen + parityLen)]; short int data8[headerLen + rsFrames * (rsFrameLen + parityLen)]; From 343592d81ccd46fa7ffe1a42feca5107592a2b88 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 31 May 2021 09:24:16 -0400 Subject: [PATCH 189/252] Update main.c --- afsk/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 8f01ada4..86bd6485 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1605,9 +1605,9 @@ void get_tlm_fox() { } if (mode == BPSK) { // wod field experiments - encodeA(b, 64 + head_offset, 0x7f); // was 7f -> fe, ff -> 1fe was 63 + encodeA(b, 64 + head_offset, 0xfff); // was 7f -> fe, ff -> 1fe was 63 // encodeA(b, 63 + head_offset, 0x1e); // 1e -> 224,65 ff -> fefe, ff -> e1, - encodeA(b, 63 + head_offset, 0xff); // 0x80 is 1000 0000 at 65 + encodeA(b, 63 + head_offset, 0xfff); // 0x80 is 1000 0000 at 65 encodeB(b, 74 + head_offset, 0xfff); // was ff } short int data10[headerLen + rsFrames * (rsFrameLen + parityLen)]; From 3f009f49aa104a23d4ea74ee172b76d94683c127 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 31 May 2021 09:30:45 -0400 Subject: [PATCH 190/252] more word --- afsk/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/afsk/main.c b/afsk/main.c index 86bd6485..edbe9397 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1608,6 +1608,7 @@ void get_tlm_fox() { encodeA(b, 64 + head_offset, 0xfff); // was 7f -> fe, ff -> 1fe was 63 // encodeA(b, 63 + head_offset, 0x1e); // 1e -> 224,65 ff -> fefe, ff -> e1, encodeA(b, 63 + head_offset, 0xfff); // 0x80 is 1000 0000 at 65 + encodeA(b, 65 + head_offset, 0xfff); encodeB(b, 74 + head_offset, 0xfff); // was ff } short int data10[headerLen + rsFrames * (rsFrameLen + parityLen)]; From e56efcf66295e3e490a9287143ae22afe6546e49 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 31 May 2021 09:37:43 -0400 Subject: [PATCH 191/252] wow test --- afsk/main.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index edbe9397..9cbabf62 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1605,10 +1605,13 @@ void get_tlm_fox() { } if (mode == BPSK) { // wod field experiments - encodeA(b, 64 + head_offset, 0xfff); // was 7f -> fe, ff -> 1fe was 63 -// encodeA(b, 63 + head_offset, 0x1e); // 1e -> 224,65 ff -> fefe, ff -> e1, - encodeA(b, 63 + head_offset, 0xfff); // 0x80 is 1000 0000 at 65 - encodeA(b, 65 + head_offset, 0xfff); + long val = 31234; + encodeA(b, 63 + head_offset, 0xff & val); + encodeA(b, 64 + head_offset, (0xff00 & val) >> 8); + encodeA(b, 65 + head_offset, (0xff0000 & val) >> 16); +// encodeA(b, 64 + head_offset, 0xfff); // was 7f -> fe, ff -> 1fe was 63 +// encodeA(b, 63 + head_offset, 0xfff); // 0x80 is 1000 0000 at 65 +// encodeA(b, 65 + head_offset, 0xfff); encodeB(b, 74 + head_offset, 0xfff); // was ff } short int data10[headerLen + rsFrames * (rsFrameLen + parityLen)]; From ed73add48d0a93d0b394b993fa2e86c483d9bd8e Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 31 May 2021 10:32:48 -0400 Subject: [PATCH 192/252] changed to unsigned int --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 9cbabf62..496ff7bb 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1605,7 +1605,7 @@ void get_tlm_fox() { } if (mode == BPSK) { // wod field experiments - long val = 31234; + unsigned long val = 31234; encodeA(b, 63 + head_offset, 0xff & val); encodeA(b, 64 + head_offset, (0xff00 & val) >> 8); encodeA(b, 65 + head_offset, (0xff0000 & val) >> 16); From 6d0e3db664048195de79236eb7cc0f81968c469b Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 31 May 2021 10:40:14 -0400 Subject: [PATCH 193/252] WOD printf --- afsk/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 496ff7bb..d32f32f3 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1605,7 +1605,8 @@ void get_tlm_fox() { } if (mode == BPSK) { // wod field experiments - unsigned long val = 31234; + unsigned long val = 0xffffff; + printf("WOD: %x %x %x \n", 0xff & val, (0xff00 & val) >> 8, (0xff0000 & val) >> 16); encodeA(b, 63 + head_offset, 0xff & val); encodeA(b, 64 + head_offset, (0xff00 & val) >> 8); encodeA(b, 65 + head_offset, (0xff0000 & val) >> 16); From b93996587c0c142d1854fd3cc9e925887c5863a2 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 31 May 2021 10:46:58 -0400 Subject: [PATCH 194/252] Update main.c --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index d32f32f3..fd640934 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1605,7 +1605,7 @@ void get_tlm_fox() { } if (mode == BPSK) { // wod field experiments - unsigned long val = 0xffffff; + unsigned long val = 0xffff00; printf("WOD: %x %x %x \n", 0xff & val, (0xff00 & val) >> 8, (0xff0000 & val) >> 16); encodeA(b, 63 + head_offset, 0xff & val); encodeA(b, 64 + head_offset, (0xff00 & val) >> 8); From cbbca89a3f14385dc17e6a9804cddb1c3a3799a2 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 31 May 2021 10:49:36 -0400 Subject: [PATCH 195/252] Update main.c --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index fd640934..ca28ad94 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1605,7 +1605,7 @@ void get_tlm_fox() { } if (mode == BPSK) { // wod field experiments - unsigned long val = 0xffff00; + unsigned long val = 0x7ffff70; printf("WOD: %x %x %x \n", 0xff & val, (0xff00 & val) >> 8, (0xff0000 & val) >> 16); encodeA(b, 63 + head_offset, 0xff & val); encodeA(b, 64 + head_offset, (0xff00 & val) >> 8); From 5773a859757025fe489af05ee021b9482567755e Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 31 May 2021 10:53:08 -0400 Subject: [PATCH 196/252] Update main.c --- afsk/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index ca28ad94..cc647f99 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1605,11 +1605,11 @@ void get_tlm_fox() { } if (mode == BPSK) { // wod field experiments - unsigned long val = 0x7ffff70; + unsigned long val = 0x7ffff; printf("WOD: %x %x %x \n", 0xff & val, (0xff00 & val) >> 8, (0xff0000 & val) >> 16); - encodeA(b, 63 + head_offset, 0xff & val); - encodeA(b, 64 + head_offset, (0xff00 & val) >> 8); - encodeA(b, 65 + head_offset, (0xff0000 & val) >> 16); +// encodeA(b, 63 + head_offset, 0xff & val); + encodeA(b, 64 + head_offset, 0xff & val); + encodeA(b, 65 + head_offset, val >> 8); // encodeA(b, 64 + head_offset, 0xfff); // was 7f -> fe, ff -> 1fe was 63 // encodeA(b, 63 + head_offset, 0xfff); // 0x80 is 1000 0000 at 65 // encodeA(b, 65 + head_offset, 0xfff); From 0c9c57b37a5fcf723ac8d580568cc044b282c42a Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 31 May 2021 10:55:18 -0400 Subject: [PATCH 197/252] Update main.c --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index cc647f99..87e03f04 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1605,7 +1605,7 @@ void get_tlm_fox() { } if (mode == BPSK) { // wod field experiments - unsigned long val = 0x7ffff; + unsigned long val = 0x17fffe; printf("WOD: %x %x %x \n", 0xff & val, (0xff00 & val) >> 8, (0xff0000 & val) >> 16); // encodeA(b, 63 + head_offset, 0xff & val); encodeA(b, 64 + head_offset, 0xff & val); From 3dab69630241ac192993af615215c38e1a63f33e Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 31 May 2021 10:57:41 -0400 Subject: [PATCH 198/252] Update main.c --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 87e03f04..f960c723 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1605,7 +1605,7 @@ void get_tlm_fox() { } if (mode == BPSK) { // wod field experiments - unsigned long val = 0x17fffe; + unsigned long val = 0x7fff; printf("WOD: %x %x %x \n", 0xff & val, (0xff00 & val) >> 8, (0xff0000 & val) >> 16); // encodeA(b, 63 + head_offset, 0xff & val); encodeA(b, 64 + head_offset, 0xff & val); From b8a65f40380a6149aa3bf9c164b2e253def1290f Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 31 May 2021 11:00:49 -0400 Subject: [PATCH 199/252] Update main.c --- afsk/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index f960c723..83546b97 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1610,7 +1610,8 @@ void get_tlm_fox() { // encodeA(b, 63 + head_offset, 0xff & val); encodeA(b, 64 + head_offset, 0xff & val); encodeA(b, 65 + head_offset, val >> 8); -// encodeA(b, 64 + head_offset, 0xfff); // was 7f -> fe, ff -> 1fe was 63 + encodeA(b, 66 + head_offset, 1); + // encodeA(b, 64 + head_offset, 0xfff); // was 7f -> fe, ff -> 1fe was 63 // encodeA(b, 63 + head_offset, 0xfff); // 0x80 is 1000 0000 at 65 // encodeA(b, 65 + head_offset, 0xfff); encodeB(b, 74 + head_offset, 0xfff); // was ff From b59c8ec0b9ef66a6488e97170025fac34cf09bae Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 31 May 2021 11:04:11 -0400 Subject: [PATCH 200/252] Update main.c --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 83546b97..d8f74205 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1610,7 +1610,7 @@ void get_tlm_fox() { // encodeA(b, 63 + head_offset, 0xff & val); encodeA(b, 64 + head_offset, 0xff & val); encodeA(b, 65 + head_offset, val >> 8); - encodeA(b, 66 + head_offset, 1); + encodeA(b, 63 + head_offset, 0xff); // encodeA(b, 64 + head_offset, 0xfff); // was 7f -> fe, ff -> 1fe was 63 // encodeA(b, 63 + head_offset, 0xfff); // 0x80 is 1000 0000 at 65 // encodeA(b, 65 + head_offset, 0xfff); From fcd4457cd6ce2e55f5959e6799c318d5de20241f Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 31 May 2021 11:08:22 -0400 Subject: [PATCH 201/252] Update main.c --- afsk/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index d8f74205..27d08b6b 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1605,12 +1605,12 @@ void get_tlm_fox() { } if (mode == BPSK) { // wod field experiments - unsigned long val = 0x7fff; + unsigned long val = 0xffff; printf("WOD: %x %x %x \n", 0xff & val, (0xff00 & val) >> 8, (0xff0000 & val) >> 16); // encodeA(b, 63 + head_offset, 0xff & val); encodeA(b, 64 + head_offset, 0xff & val); encodeA(b, 65 + head_offset, val >> 8); - encodeA(b, 63 + head_offset, 0xff); + encodeA(b, 63 + head_offset, 0x01); // encodeA(b, 64 + head_offset, 0xfff); // was 7f -> fe, ff -> 1fe was 63 // encodeA(b, 63 + head_offset, 0xfff); // 0x80 is 1000 0000 at 65 // encodeA(b, 65 + head_offset, 0xfff); From 06600cfea5de0a339d7770abbfd1d5a957114c8b Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 31 May 2021 11:11:24 -0400 Subject: [PATCH 202/252] Update main.c --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 27d08b6b..dc2aa32c 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1610,7 +1610,7 @@ void get_tlm_fox() { // encodeA(b, 63 + head_offset, 0xff & val); encodeA(b, 64 + head_offset, 0xff & val); encodeA(b, 65 + head_offset, val >> 8); - encodeA(b, 63 + head_offset, 0x01); + encodeA(b, 63 + head_offset, 0x80); // encodeA(b, 64 + head_offset, 0xfff); // was 7f -> fe, ff -> 1fe was 63 // encodeA(b, 63 + head_offset, 0xfff); // 0x80 is 1000 0000 at 65 // encodeA(b, 65 + head_offset, 0xfff); From 4c3a0cc27c431f339d2c3932adbc64b34bcc3684 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 31 May 2021 11:14:44 -0400 Subject: [PATCH 203/252] Update main.c --- afsk/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index dc2aa32c..667f0e86 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1610,7 +1610,8 @@ void get_tlm_fox() { // encodeA(b, 63 + head_offset, 0xff & val); encodeA(b, 64 + head_offset, 0xff & val); encodeA(b, 65 + head_offset, val >> 8); - encodeA(b, 63 + head_offset, 0x80); + encodeA(b, 63 + head_offset, 0x00); + encodeA(b, 62 + head_offset, 0x01); // encodeA(b, 64 + head_offset, 0xfff); // was 7f -> fe, ff -> 1fe was 63 // encodeA(b, 63 + head_offset, 0xfff); // 0x80 is 1000 0000 at 65 // encodeA(b, 65 + head_offset, 0xfff); From 357e73c440cc35005986296230cb561d550f16a8 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 31 May 2021 12:39:19 -0400 Subject: [PATCH 204/252] added time.sleep(0.001) after each config --- python/voltcurrent.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index d6fca650..9994ec80 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -71,8 +71,11 @@ if __name__ == "__main__": try: ina219_one = INA219(i2c_one, addresses[0]) ina219_one.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + time.sleep(0.001) ina219_one.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + time.sleep(0.001) ina219_one.bus_voltage_range = BusVoltageRange.RANGE_16V + time.sleep(0.001) one = 1 except: # print("Python Error 3", file=sys.stderr, flush=True) @@ -80,8 +83,11 @@ if __name__ == "__main__": try: ina219_two = INA219(i2c_one, addresses[1]) ina219_two.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + time.sleep(0.001) ina219_two.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + time.sleep(0.001) ina219_two.bus_voltage_range = BusVoltageRange.RANGE_16V + time.sleep(0.001) two = 1 except: # print("Python Error 3", file=sys.stderr, flush=True) @@ -90,8 +96,11 @@ if __name__ == "__main__": try: ina219_three = INA219(i2c_one, addresses[2]) ina219_three.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + time.sleep(0.001) ina219_three.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + time.sleep(0.001) ina219_three.bus_voltage_range = BusVoltageRange.RANGE_16V + time.sleep(0.001) three = 1 except: # print("Python Error 3", file=sys.stderr, flush=True) @@ -100,8 +109,11 @@ if __name__ == "__main__": try: ina219_four= INA219(i2c_one, addresses[3]) ina219_four.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + time.sleep(0.001) ina219_four.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + time.sleep(0.001) ina219_four.bus_voltage_range = BusVoltageRange.RANGE_16V + time.sleep(0.001) four = 1 except: four = 0 @@ -116,8 +128,11 @@ if __name__ == "__main__": try: ina219_five = INA219(i2c_two, addresses[0]) ina219_five.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + time.sleep(0.001) ina219_five.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + time.sleep(0.001) ina219_five.bus_voltage_range = BusVoltageRange.RANGE_16V + time.sleep(0.001) five = 1 except: # print("Python Error 3", file=sys.stderr, flush=True) @@ -125,8 +140,11 @@ if __name__ == "__main__": try: ina219_six = INA219(i2c_two, addresses[1]) ina219_six.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + time.sleep(0.001) ina219_six.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + time.sleep(0.001) ina219_six.bus_voltage_range = BusVoltageRange.RANGE_16V + time.sleep(0.001) six = 1 except: # print("Python Error 3", file=sys.stderr, flush=True) @@ -134,8 +152,11 @@ if __name__ == "__main__": try: ina219_seven = INA219(i2c_two, addresses[2]) ina219_seven.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + time.sleep(0.001) ina219_seven.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + time.sleep(0.001) ina219_seven.bus_voltage_range = BusVoltageRange.RANGE_16V + time.sleep(0.001) seven = 1 except: # print("Python Error 3", file=sys.stderr, flush=True) @@ -143,8 +164,11 @@ if __name__ == "__main__": try: ina219_eight = INA219(i2c_two, addresses[3]) ina219_eight.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + time.sleep(0.001) ina219_eight.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + time.sleep(0.001) ina219_eight.bus_voltage_range = BusVoltageRange.RANGE_16V + time.sleep(0.001) eight = 1 except: # print("Python Error 3", file=sys.stderr, flush=True) From 9e890c1082e427bfc14ad2a2b0625a48f9214aa9 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 31 May 2021 12:42:13 -0400 Subject: [PATCH 205/252] increased sleep between configs --- python/voltcurrent.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index 9994ec80..d8b1a492 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -75,7 +75,7 @@ if __name__ == "__main__": ina219_one.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S time.sleep(0.001) ina219_one.bus_voltage_range = BusVoltageRange.RANGE_16V - time.sleep(0.001) + time.sleep(0.01) one = 1 except: # print("Python Error 3", file=sys.stderr, flush=True) @@ -87,7 +87,7 @@ if __name__ == "__main__": ina219_two.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S time.sleep(0.001) ina219_two.bus_voltage_range = BusVoltageRange.RANGE_16V - time.sleep(0.001) + time.sleep(0.01) two = 1 except: # print("Python Error 3", file=sys.stderr, flush=True) @@ -100,7 +100,7 @@ if __name__ == "__main__": ina219_three.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S time.sleep(0.001) ina219_three.bus_voltage_range = BusVoltageRange.RANGE_16V - time.sleep(0.001) + time.sleep(0.01) three = 1 except: # print("Python Error 3", file=sys.stderr, flush=True) @@ -113,7 +113,7 @@ if __name__ == "__main__": ina219_four.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S time.sleep(0.001) ina219_four.bus_voltage_range = BusVoltageRange.RANGE_16V - time.sleep(0.001) + time.sleep(0.01) four = 1 except: four = 0 @@ -132,7 +132,7 @@ if __name__ == "__main__": ina219_five.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S time.sleep(0.001) ina219_five.bus_voltage_range = BusVoltageRange.RANGE_16V - time.sleep(0.001) + time.sleep(0.01) five = 1 except: # print("Python Error 3", file=sys.stderr, flush=True) @@ -144,7 +144,7 @@ if __name__ == "__main__": ina219_six.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S time.sleep(0.001) ina219_six.bus_voltage_range = BusVoltageRange.RANGE_16V - time.sleep(0.001) + time.sleep(0.01) six = 1 except: # print("Python Error 3", file=sys.stderr, flush=True) @@ -156,7 +156,7 @@ if __name__ == "__main__": ina219_seven.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S time.sleep(0.001) ina219_seven.bus_voltage_range = BusVoltageRange.RANGE_16V - time.sleep(0.001) + time.sleep(0.01) seven = 1 except: # print("Python Error 3", file=sys.stderr, flush=True) @@ -168,7 +168,7 @@ if __name__ == "__main__": ina219_eight.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S time.sleep(0.001) ina219_eight.bus_voltage_range = BusVoltageRange.RANGE_16V - time.sleep(0.001) + time.sleep(0.01) eight = 1 except: # print("Python Error 3", file=sys.stderr, flush=True) From c5d551b582a73d08d2a0ca915f7a1fb8bcc1db89 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 31 May 2021 12:56:53 -0400 Subject: [PATCH 206/252] added delay between prints of 0.01 --- python/voltcurrent.py | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index d8b1a492..a509ed6b 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -178,37 +178,45 @@ if __name__ == "__main__": while (True): try: + time.sleep(0.01) print("{:6.3f} ".format(ina219_one.bus_voltage), "{:6.3f} ".format(ina219_one.current) , end = '') except: print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') - try: + try: + time.sleep(0.01) print("{:6.3f} ".format(ina219_two.bus_voltage), "{:6.3f} ".format(ina219_two.current) , end = '') except: print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') - try: + try: + time.sleep(0.01) print("{:6.3f} ".format(ina219_three.bus_voltage), "{:6.3f} ".format(ina219_three.current) , end = '') except: print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') - try: + try: + time.sleep(0.01) print("{:6.3f} ".format(ina219_four.bus_voltage), "{:6.3f} ".format(ina219_four.current) , end = '') except: print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') - try: + try: + time.sleep(0.01) print("{:6.3f} ".format(ina219_five.bus_voltage), "{:6.3f} ".format(ina219_five.current) , end = '') except: print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') - try: + try: + time.sleep(0.01) print("{:6.3f} ".format(ina219_six.bus_voltage), "{:6.3f} ".format(ina219_six.current) , end = '') except: print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') - try: + try: + time.sleep(0.01) print("{:6.3f} ".format(ina219_seven.bus_voltage), "{:6.3f} ".format(ina219_seven.current) , end = '') except: print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') - try: - print("{:6.3f} ".format(ina219_eight.bus_voltage), "{:6.3f} ".format(ina219_eight.current) , end = '') + try: + time.sleep(0.01) + print("{:6.3f} ".format(ina219_eight.bus_voltage), "{:6.3f} ".format(ina219_eight.current)) except: - print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') - print(" ") + print("{:6.3f} ".format(0), "{:6.3f} ".format(0)) +# print(" ") inp = input() # print(inp) From d543c1dc150ca06505970b1711bcac7c7876dd4b Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 31 May 2021 15:01:21 -0400 Subject: [PATCH 207/252] added last few sensors max min --- afsk/main.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/afsk/main.c b/afsk/main.c index 667f0e86..db3f6b24 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1525,6 +1525,12 @@ void get_tlm_fox() { encodeA(b_max, 42 + head_offset, (int)(sensor_max[GYRO_Y] + 0.5) + 2048); encodeB(b_max, 43 + head_offset, (int)(sensor_max[GYRO_Z] + 0.5) + 2048); + encodeB(b_max, 31 + head_offset, ((int)(other_max[SPIN] * 10)) + 2048); + encodeB(b_max, 37 + head_offset, (int)(other_max[RSSI] + 0.5) + 2048); + encodeA(b_max, 39 + head_offset, (int)(other_max[IHU_TEMP] * 10 + 0.5)); + encodeA(b_max, 48 + head_offset, (int)(sensor_max[XS2]) + 2048); + encodeB(b_max, 49 + head_offset, (int)(sensor_max[XS3] * 100 + 0.5) + 2048); + encodeA(b_min, 12 + head_offset, (int)(voltage_min[map[PLUS_X]] * 100)); encodeB(b_min, 13 + head_offset, (int)(voltage_min[map[PLUS_Y]] * 100)); encodeA(b_min, 15 + head_offset, (int)(voltage_min[map[PLUS_Z]] * 100)); @@ -1554,6 +1560,12 @@ void get_tlm_fox() { encodeA(b_min, 42 + head_offset, (int)(sensor_min[GYRO_Y] + 0.5) + 2048); encodeB(b_min, 43 + head_offset, (int)(sensor_min[GYRO_Z] + 0.5) + 2048); + encodeB(b_m, 31 + head_offset, ((int)(other_m[SPIN] * 10)) + 2048); + encodeB(b_m, 37 + head_offset, (int)(other_m[RSSI] + 0.5) + 2048); + encodeA(b_m, 39 + head_offset, (int)(other_m[IHU_TEMP] * 10 + 0.5)); + encodeA(b_m, 48 + head_offset, (int)(sensor_m[XS2]) + 2048); + encodeB(b_m, 49 + head_offset, (int)(sensor_m[XS3] * 100 + 0.5) + 2048); + } encodeA(b, 30 + head_offset, PSUVoltage); // encodeB(b, 31 + head_offset,(spin * 10) + 2048); From 8ebf3b830b51e28e72c9b8b17d586c0e12be5c42 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 31 May 2021 15:03:17 -0400 Subject: [PATCH 208/252] rest of sensors max min --- afsk/main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index db3f6b24..7e0c27c3 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1348,7 +1348,7 @@ void get_tlm_fox() { if (current[count1] > current_max[count1]) current_max[count1] = current[count1]; - printf("Vmin %4.2f Vmax %4.2f Imin %4.2f Imax %4.2f \n", voltage_min[count1], voltage_max[count1], current_min[count1], current_max[count1]); +// printf("Vmin %4.2f Vmax %4.2f Imin %4.2f Imax %4.2f \n", voltage_min[count1], voltage_max[count1], current_min[count1], current_max[count1]); } for (int count1 = 0; count1 < 3; count1++) { if (other[count1] < other_min[count1]) @@ -1560,11 +1560,11 @@ void get_tlm_fox() { encodeA(b_min, 42 + head_offset, (int)(sensor_min[GYRO_Y] + 0.5) + 2048); encodeB(b_min, 43 + head_offset, (int)(sensor_min[GYRO_Z] + 0.5) + 2048); - encodeB(b_m, 31 + head_offset, ((int)(other_m[SPIN] * 10)) + 2048); - encodeB(b_m, 37 + head_offset, (int)(other_m[RSSI] + 0.5) + 2048); - encodeA(b_m, 39 + head_offset, (int)(other_m[IHU_TEMP] * 10 + 0.5)); - encodeA(b_m, 48 + head_offset, (int)(sensor_m[XS2]) + 2048); - encodeB(b_m, 49 + head_offset, (int)(sensor_m[XS3] * 100 + 0.5) + 2048); + encodeB(b_min, 31 + head_offset, ((int)(other_min[SPIN] * 10)) + 2048); + encodeB(b_min, 37 + head_offset, (int)(other_min[RSSI] + 0.5) + 2048); + encodeA(b_min, 39 + head_offset, (int)(other_min[IHU_TEMP] * 10 + 0.5)); + encodeA(b_min, 48 + head_offset, (int)(sensor_min[XS2]) + 2048); + encodeB(b_min, 49 + head_offset, (int)(sensor_min[XS3] * 100 + 0.5) + 2048); } encodeA(b, 30 + head_offset, PSUVoltage); From 445330ea5b09e63f30f96c5e9001feebbaaab4fe Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 31 May 2021 15:11:31 -0400 Subject: [PATCH 209/252] added humidity --- afsk/main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 7e0c27c3..15c07f98 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1530,6 +1530,8 @@ void get_tlm_fox() { encodeA(b_max, 39 + head_offset, (int)(other_max[IHU_TEMP] * 10 + 0.5)); encodeA(b_max, 48 + head_offset, (int)(sensor_max[XS2]) + 2048); encodeB(b_max, 49 + head_offset, (int)(sensor_max[XS3] * 100 + 0.5) + 2048); + encodeB(b_max, 10 + head_offset, (int)(sensor_max[TEMP] * 10 + 0.5)); + encodeA(b_max, 45 + head_offset, (int)(sensor_max[HUMI] + 0.5)); encodeA(b_min, 12 + head_offset, (int)(voltage_min[map[PLUS_X]] * 100)); encodeB(b_min, 13 + head_offset, (int)(voltage_min[map[PLUS_Y]] * 100)); @@ -1565,7 +1567,8 @@ void get_tlm_fox() { encodeA(b_min, 39 + head_offset, (int)(other_min[IHU_TEMP] * 10 + 0.5)); encodeA(b_min, 48 + head_offset, (int)(sensor_min[XS2]) + 2048); encodeB(b_min, 49 + head_offset, (int)(sensor_min[XS3] * 100 + 0.5) + 2048); - + encodeB(b_min, 10 + head_offset, (int)(sensor_min[TEMP] * 10 + 0.5)); + encodeA(b_min, 45 + head_offset, (int)(sensor_min[HUMI] + 0.5)); } encodeA(b, 30 + head_offset, PSUVoltage); // encodeB(b, 31 + head_offset,(spin * 10) + 2048); From c93b7006e0125264cd208cf89c869b68f92629a4 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 31 May 2021 17:21:37 -0400 Subject: [PATCH 210/252] added error recovery during print --- python/voltcurrent.py | 138 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 128 insertions(+), 10 deletions(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index a509ed6b..3f52052d 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -177,46 +177,164 @@ if __name__ == "__main__": print("Python Error 5", file=sys.stderr, flush=True) while (True): + error = 0 try: time.sleep(0.01) print("{:6.3f} ".format(ina219_one.bus_voltage), "{:6.3f} ".format(ina219_one.current) , end = '') except: - print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') + + try: + ina219_one = INA219(i2c_one, addresses[0]) + ina219_one.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + time.sleep(0.001) + ina219_one.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + time.sleep(0.001) + ina219_one.bus_voltage_range = BusVoltageRange.RANGE_16V + time.sleep(0.01) + error = 1 + + except: +# print("Python Error 3", file=sys.stderr, flush=True) + print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') + + try: time.sleep(0.01) print("{:6.3f} ".format(ina219_two.bus_voltage), "{:6.3f} ".format(ina219_two.current) , end = '') except: - print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') + + try: + ina219_two = INA219(i2c_one, addresses[1]) + ina219_two.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + time.sleep(0.001) + ina219_two.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + time.sleep(0.001) + ina219_two.bus_voltage_range = BusVoltageRange.RANGE_16V + time.sleep(0.01) + error = 1 + + except: +# print("Python Error 3", file=sys.stderr, flush=True) + print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') + + try: time.sleep(0.01) print("{:6.3f} ".format(ina219_three.bus_voltage), "{:6.3f} ".format(ina219_three.current) , end = '') except: - print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') + + try: + ina219_three = INA219(i2c_one, addresses[2]) + ina219_three.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + time.sleep(0.001) + ina219_three.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + time.sleep(0.001) + ina219_three.bus_voltage_range = BusVoltageRange.RANGE_16V + time.sleep(0.01) + error = 1 + + except: +# print("Python Error 3", file=sys.stderr, flush=True) + print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') + try: time.sleep(0.01) print("{:6.3f} ".format(ina219_four.bus_voltage), "{:6.3f} ".format(ina219_four.current) , end = '') except: - print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') + + try: + ina219_four= INA219(i2c_one, addresses[3]) + ina219_four.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + time.sleep(0.001) + ina219_four.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + time.sleep(0.001) + ina219_four.bus_voltage_range = BusVoltageRange.RANGE_16V + time.sleep(0.01) + error = 1 + + except: + print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') + try: time.sleep(0.01) print("{:6.3f} ".format(ina219_five.bus_voltage), "{:6.3f} ".format(ina219_five.current) , end = '') except: - print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') + + try: + ina219_five = INA219(i2c_two, addresses[0]) + ina219_five.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + time.sleep(0.001) + ina219_five.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + time.sleep(0.001) + ina219_five.bus_voltage_range = BusVoltageRange.RANGE_16V + time.sleep(0.01) + error = 1 + + except: +# print("Python Error 3", file=sys.stderr, flush=True) + print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') + try: time.sleep(0.01) print("{:6.3f} ".format(ina219_six.bus_voltage), "{:6.3f} ".format(ina219_six.current) , end = '') except: - print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') + + try: + ina219_six = INA219(i2c_two, addresses[1]) + ina219_six.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + time.sleep(0.001) + ina219_six.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + time.sleep(0.001) + ina219_six.bus_voltage_range = BusVoltageRange.RANGE_16V + time.sleep(0.01) + error = 1 + + except: +# print("Python Error 3", file=sys.stderr, flush=True) + print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') + try: time.sleep(0.01) print("{:6.3f} ".format(ina219_seven.bus_voltage), "{:6.3f} ".format(ina219_seven.current) , end = '') except: - print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') + + try: + ina219_seven = INA219(i2c_two, addresses[2]) + ina219_seven.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + time.sleep(0.001) + ina219_seven.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + time.sleep(0.001) + ina219_seven.bus_voltage_range = BusVoltageRange.RANGE_16V + time.sleep(0.01) + error = 1 + + except: +# print("Python Error 3", file=sys.stderr, flush=True) + print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') + try: time.sleep(0.01) - print("{:6.3f} ".format(ina219_eight.bus_voltage), "{:6.3f} ".format(ina219_eight.current)) + print("{:6.3f} ".format(ina219_eight.bus_voltage), "{:6.3f} ".format(ina219_eight.current), end = '') except: - print("{:6.3f} ".format(0), "{:6.3f} ".format(0)) -# print(" ") + + try: + ina219_eight = INA219(i2c_two, addresses[3]) + ina219_eight.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + time.sleep(0.001) + ina219_eight.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S # 1S + time.sleep(0.001) + ina219_eight.bus_voltage_range = BusVoltageRange.RANGE_16V + time.sleep(0.01) + error = 1 + + except: +# print("Python Error 3", file=sys.stderr, flush=True) + print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') + + if (error == 0): + print(" ") + else: + print("Python Error Recovered!") + inp = input() # print(inp) From 2383f6d0aea3c1f27c8846b81de0e36d04007561 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 31 May 2021 17:36:14 -0400 Subject: [PATCH 211/252] added print in recovery --- python/voltcurrent.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index 3f52052d..c5d0fce6 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -191,6 +191,7 @@ if __name__ == "__main__": time.sleep(0.001) ina219_one.bus_voltage_range = BusVoltageRange.RANGE_16V time.sleep(0.01) + print("{:6.3f} ".format(ina219_one.bus_voltage), "{:6.3f} ".format(ina219_one.current) , end = '') error = 1 except: @@ -211,6 +212,7 @@ if __name__ == "__main__": time.sleep(0.001) ina219_two.bus_voltage_range = BusVoltageRange.RANGE_16V time.sleep(0.01) + print("{:6.3f} ".format(ina219_two.bus_voltage), "{:6.3f} ".format(ina219_two.current) , end = '') error = 1 except: @@ -231,6 +233,7 @@ if __name__ == "__main__": time.sleep(0.001) ina219_three.bus_voltage_range = BusVoltageRange.RANGE_16V time.sleep(0.01) + print("{:6.3f} ".format(ina219_three.bus_voltage), "{:6.3f} ".format(ina219_three.current) , end = '') error = 1 except: @@ -250,6 +253,7 @@ if __name__ == "__main__": time.sleep(0.001) ina219_four.bus_voltage_range = BusVoltageRange.RANGE_16V time.sleep(0.01) + print("{:6.3f} ".format(ina219_four.bus_voltage), "{:6.3f} ".format(ina219_four.current) , end = '') error = 1 except: @@ -268,6 +272,7 @@ if __name__ == "__main__": time.sleep(0.001) ina219_five.bus_voltage_range = BusVoltageRange.RANGE_16V time.sleep(0.01) + print("{:6.3f} ".format(ina219_five.bus_voltage), "{:6.3f} ".format(ina219_five.current) , end = '') error = 1 except: @@ -287,6 +292,7 @@ if __name__ == "__main__": time.sleep(0.001) ina219_six.bus_voltage_range = BusVoltageRange.RANGE_16V time.sleep(0.01) + print("{:6.3f} ".format(ina219_six.bus_voltage), "{:6.3f} ".format(ina219_six.current) , end = '') error = 1 except: @@ -306,8 +312,9 @@ if __name__ == "__main__": time.sleep(0.001) ina219_seven.bus_voltage_range = BusVoltageRange.RANGE_16V time.sleep(0.01) + print("{:6.3f} ".format(ina219_seven.bus_voltage), "{:6.3f} ".format(ina219_seven.current) , end = '') error = 1 - + except: # print("Python Error 3", file=sys.stderr, flush=True) print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') @@ -325,8 +332,9 @@ if __name__ == "__main__": time.sleep(0.001) ina219_eight.bus_voltage_range = BusVoltageRange.RANGE_16V time.sleep(0.01) + print("{:6.3f} ".format(ina219_eight.bus_voltage), "{:6.3f} ".format(ina219_eight.current), end = '') error = 1 - + except: # print("Python Error 3", file=sys.stderr, flush=True) print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') From bb29bdab7f579b34bdf1ce24e6cba88ab1a23352 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 1 Jun 2021 07:38:09 -0400 Subject: [PATCH 212/252] added flush(stderr) --- afsk/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/afsk/main.c b/afsk/main.c index 15c07f98..aa11a01c 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -573,6 +573,7 @@ int main(int argc, char * argv[]) { loopTime = millis(); while (loop-- != 0) { + fflush(stderr); // frames_sent++; printf("++++ Loop time: %d +++++\n", millis() - loopTime); From 1d275ef56cf1ea9685494801a38218b46ce5fd65 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 1 Jun 2021 07:45:04 -0400 Subject: [PATCH 213/252] added fflush(stdout) --- afsk/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/afsk/main.c b/afsk/main.c index aa11a01c..b319b6b8 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -573,6 +573,7 @@ int main(int argc, char * argv[]) { loopTime = millis(); while (loop-- != 0) { + fflush(stdout); fflush(stderr); // frames_sent++; From 0d15eb274b6e26e2d2a57036a010c2a28d98db37 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 1 Jun 2021 13:48:23 -0400 Subject: [PATCH 214/252] removed bogus max min when no payload present --- afsk/main.c | 69 +++++++++++++++++++++++++++++------------------------ 1 file changed, 38 insertions(+), 31 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index b319b6b8..cb5546e2 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1517,24 +1517,27 @@ void get_tlm_fox() { encodeA(b_max, 30 + head_offset, (int)(voltage_max[map[BUS]] * 100)); encodeB(b_max, 46 + head_offset, (int)(current_max[map[BUS]] + 0.5) + 2048); - encodeB(b_max, 4 + head_offset, (int)(sensor_max[ACCEL_X] * 100 + 0.5) + 2048); // Xaccel - encodeA(b_max, 6 + head_offset, (int)(sensor_max[ACCEL_Y] * 100 + 0.5) + 2048); // Yaccel - encodeB(b_max, 7 + head_offset, (int)(sensor_max[ACCEL_Z] * 100 + 0.5) + 2048); // Zaccel - - encodeA(b_max, 33 + head_offset, (int)(sensor_max[PRES] + 0.5)); // Pressure - encodeB(b_max, 34 + head_offset, (int)(sensor_max[ALT] * 10.0 + 0.5)); // Altitude - encodeB(b_max, 40 + head_offset, (int)(sensor_max[GYRO_X] + 0.5) + 2048); - encodeA(b_max, 42 + head_offset, (int)(sensor_max[GYRO_Y] + 0.5) + 2048); - encodeB(b_max, 43 + head_offset, (int)(sensor_max[GYRO_Z] + 0.5) + 2048); - - encodeB(b_max, 31 + head_offset, ((int)(other_max[SPIN] * 10)) + 2048); encodeB(b_max, 37 + head_offset, (int)(other_max[RSSI] + 0.5) + 2048); encodeA(b_max, 39 + head_offset, (int)(other_max[IHU_TEMP] * 10 + 0.5)); - encodeA(b_max, 48 + head_offset, (int)(sensor_max[XS2]) + 2048); - encodeB(b_max, 49 + head_offset, (int)(sensor_max[XS3] * 100 + 0.5) + 2048); - encodeB(b_max, 10 + head_offset, (int)(sensor_max[TEMP] * 10 + 0.5)); - encodeA(b_max, 45 + head_offset, (int)(sensor_max[HUMI] + 0.5)); + encodeB(b_max, 31 + head_offset, ((int)(other_max[SPIN] * 10)) + 2048); + if (sensor_min[0] != 1000.0) // make sure values are valid + { + encodeB(b_max, 4 + head_offset, (int)(sensor_max[ACCEL_X] * 100 + 0.5) + 2048); // Xaccel + encodeA(b_max, 6 + head_offset, (int)(sensor_max[ACCEL_Y] * 100 + 0.5) + 2048); // Yaccel + encodeB(b_max, 7 + head_offset, (int)(sensor_max[ACCEL_Z] * 100 + 0.5) + 2048); // Zaccel + + encodeA(b_max, 33 + head_offset, (int)(sensor_max[PRES] + 0.5)); // Pressure + encodeB(b_max, 34 + head_offset, (int)(sensor_max[ALT] * 10.0 + 0.5)); // Altitude + encodeB(b_max, 40 + head_offset, (int)(sensor_max[GYRO_X] + 0.5) + 2048); + encodeA(b_max, 42 + head_offset, (int)(sensor_max[GYRO_Y] + 0.5) + 2048); + encodeB(b_max, 43 + head_offset, (int)(sensor_max[GYRO_Z] + 0.5) + 2048); + + encodeA(b_max, 48 + head_offset, (int)(sensor_max[XS2]) + 2048); + encodeB(b_max, 49 + head_offset, (int)(sensor_max[XS3] * 100 + 0.5) + 2048); + encodeB(b_max, 10 + head_offset, (int)(sensor_max[TEMP] * 10 + 0.5)); + encodeA(b_max, 45 + head_offset, (int)(sensor_max[HUMI] + 0.5)); + } encodeA(b_min, 12 + head_offset, (int)(voltage_min[map[PLUS_X]] * 100)); encodeB(b_min, 13 + head_offset, (int)(voltage_min[map[PLUS_Y]] * 100)); encodeA(b_min, 15 + head_offset, (int)(voltage_min[map[PLUS_Z]] * 100)); @@ -1552,25 +1555,29 @@ void get_tlm_fox() { encodeA(b_min, 9 + head_offset, (int)(current_min[map[BAT]] + 0.5) + 2048); encodeA(b_min, 3 + head_offset, (int)(voltage_min[map[BAT]] * 100)); encodeA(b_min, 30 + head_offset, (int)(voltage_min[map[BUS]] * 100)); - encodeB(b_min, 46 + head_offset, (int)(current_min[map[BUS]] + 0.5) + 2048); - - encodeB(b_min, 4 + head_offset, (int)(sensor_min[ACCEL_X] * 100 + 0.5) + 2048); // Xaccel - encodeA(b_min, 6 + head_offset, (int)(sensor_min[ACCEL_Y] * 100 + 0.5) + 2048); // Yaccel - encodeB(b_min, 7 + head_offset, (int)(sensor_min[ACCEL_Z] * 100 + 0.5) + 2048); // Zaccel - - encodeA(b_min, 33 + head_offset, (int)(sensor_min[PRES] + 0.5)); // Pressure - encodeB(b_min, 34 + head_offset, (int)(sensor_min[ALT] * 10.0 + 0.5)); // Altitude - encodeB(b_min, 40 + head_offset, (int)(sensor_min[GYRO_X] + 0.5) + 2048); - encodeA(b_min, 42 + head_offset, (int)(sensor_min[GYRO_Y] + 0.5) + 2048); - encodeB(b_min, 43 + head_offset, (int)(sensor_min[GYRO_Z] + 0.5) + 2048); + encodeB(b_min, 46 + head_offset, (int)(current_min[map[BUS]] + 0.5) + 2048); encodeB(b_min, 31 + head_offset, ((int)(other_min[SPIN] * 10)) + 2048); encodeB(b_min, 37 + head_offset, (int)(other_min[RSSI] + 0.5) + 2048); encodeA(b_min, 39 + head_offset, (int)(other_min[IHU_TEMP] * 10 + 0.5)); - encodeA(b_min, 48 + head_offset, (int)(sensor_min[XS2]) + 2048); - encodeB(b_min, 49 + head_offset, (int)(sensor_min[XS3] * 100 + 0.5) + 2048); - encodeB(b_min, 10 + head_offset, (int)(sensor_min[TEMP] * 10 + 0.5)); - encodeA(b_min, 45 + head_offset, (int)(sensor_min[HUMI] + 0.5)); + + if (sensor_min[0] != 1000.0) // make sure values are valid + { + encodeB(b_min, 4 + head_offset, (int)(sensor_min[ACCEL_X] * 100 + 0.5) + 2048); // Xaccel + encodeA(b_min, 6 + head_offset, (int)(sensor_min[ACCEL_Y] * 100 + 0.5) + 2048); // Yaccel + encodeB(b_min, 7 + head_offset, (int)(sensor_min[ACCEL_Z] * 100 + 0.5) + 2048); // Zaccel + + encodeA(b_min, 33 + head_offset, (int)(sensor_min[PRES] + 0.5)); // Pressure + encodeB(b_min, 34 + head_offset, (int)(sensor_min[ALT] * 10.0 + 0.5)); // Altitude + encodeB(b_min, 40 + head_offset, (int)(sensor_min[GYRO_X] + 0.5) + 2048); + encodeA(b_min, 42 + head_offset, (int)(sensor_min[GYRO_Y] + 0.5) + 2048); + encodeB(b_min, 43 + head_offset, (int)(sensor_min[GYRO_Z] + 0.5) + 2048); + + encodeA(b_min, 48 + head_offset, (int)(sensor_min[XS2]) + 2048); + encodeB(b_min, 49 + head_offset, (int)(sensor_min[XS3] * 100 + 0.5) + 2048); + encodeB(b_min, 10 + head_offset, (int)(sensor_min[TEMP] * 10 + 0.5)); + encodeA(b_min, 45 + head_offset, (int)(sensor_min[HUMI] + 0.5)); + } } encodeA(b, 30 + head_offset, PSUVoltage); // encodeB(b, 31 + head_offset,(spin * 10) + 2048); @@ -2176,7 +2183,7 @@ int test_i2c_bus(int bus) // printf("%s error: %d \n", &command, error); if (error != 0) { - printf("ERROR: %sd bus has a problem \n Check I2C wiring and pullup resistors \n", busDev); + printf("ERROR: %s bus has a problem \n Check I2C wiring and pullup resistors \n", busDev); output = -1; } } else From 869e2da2daee4f54448379e6866507e8e8a4851d Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 1 Jun 2021 14:03:54 -0400 Subject: [PATCH 215/252] added zero values if no max or min --- afsk/main.c | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index cb5546e2..bd4cec5a 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1537,7 +1537,24 @@ void get_tlm_fox() { encodeB(b_max, 49 + head_offset, (int)(sensor_max[XS3] * 100 + 0.5) + 2048); encodeB(b_max, 10 + head_offset, (int)(sensor_max[TEMP] * 10 + 0.5)); encodeA(b_max, 45 + head_offset, (int)(sensor_max[HUMI] + 0.5)); - } + } + else + { + encodeB(b_max, 4 + head_offset, 2048); // 0 + encodeA(b_max, 6 + head_offset, 2048); // 0 + encodeB(b_max, 7 + head_offset, 2048); // 0 + +// encodeA(b_max, 33 + head_offset, (int)(sensor_max[PRES] + 0.5)); // Pressure +// encodeB(b_max, 34 + head_offset, (int)(sensor_max[ALT] * 10.0 + 0.5)); // Altitude + encodeB(b_max, 40 + head_offset, 2048); + encodeA(b_max, 42 + head_offset, 2048); + encodeB(b_max, 43 + head_offset, 2048); + + encodeA(b_max, 48 + head_offset, 2048); + encodeB(b_max, 49 + head_offset, 2048); +// encodeB(b_max, 10 + head_offset, (int)(sensor_max[TEMP] * 10 + 0.5)); +// encodeA(b_max, 45 + head_offset, (int)(sensor_max[HUMI] + 0.5)); + } encodeA(b_min, 12 + head_offset, (int)(voltage_min[map[PLUS_X]] * 100)); encodeB(b_min, 13 + head_offset, (int)(voltage_min[map[PLUS_Y]] * 100)); encodeA(b_min, 15 + head_offset, (int)(voltage_min[map[PLUS_Z]] * 100)); @@ -1578,6 +1595,23 @@ void get_tlm_fox() { encodeB(b_min, 10 + head_offset, (int)(sensor_min[TEMP] * 10 + 0.5)); encodeA(b_min, 45 + head_offset, (int)(sensor_min[HUMI] + 0.5)); } + else + { + encodeB(b_min, 4 + head_offset, 2048); // 0 + encodeA(b_min, 6 + head_offset, 2048); // 0 + encodeB(b_min, 7 + head_offset, 2048); // 0 + +// encodeA(b_min, 33 + head_offset, (int)(sensor_max[PRES] + 0.5)); // Pressure +// encodeB(b_min, 34 + head_offset, (int)(sensor_max[ALT] * 10.0 + 0.5)); // Altitude + encodeB(b_min, 40 + head_offset, 2048); + encodeA(b_min, 42 + head_offset, 2048); + encodeB(b_min, 43 + head_offset, 2048); + + encodeA(b_min, 48 + head_offset, 2048); + encodeB(b_min, 49 + head_offset, 2048); +// encodeB(b_min, 10 + head_offset, (int)(sensor_max[TEMP] * 10 + 0.5)); +// encodeA(b_min, 45 + head_offset, (int)(sensor_max[HUMI] + 0.5)); + } } encodeA(b, 30 + head_offset, PSUVoltage); // encodeB(b, 31 + head_offset,(spin * 10) + 2048); From 606243e601c5f9e87d176acc1d7b8484db267f26 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 1 Jun 2021 14:07:57 -0400 Subject: [PATCH 216/252] simulated mode if i2c bus 3 not present --- afsk/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index bd4cec5a..079a7a0a 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -439,7 +439,8 @@ int main(int argc, char * argv[]) { printf("INFO: I2C bus status 0: %d 1: %d 3: %d camera: %d\n", i2c_bus0, i2c_bus1, i2c_bus3, camera); #endif - if ((i2c_bus1 == OFF) && (i2c_bus3 == OFF)) { +// if ((i2c_bus1 == OFF) && (i2c_bus3 == OFF)) { + if (i2c_bus3 == OFF) { sim_mode = TRUE; From 417360ad838a83d8bb6ba859b79f51d43dfc09e6 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 1 Jun 2021 16:05:59 -0400 Subject: [PATCH 217/252] removed some printfs --- afsk/main.c | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 079a7a0a..18c83de8 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -606,7 +606,7 @@ int main(int argc, char * argv[]) { // sleep(1); // Delay 1 second ctr = 0; #ifdef DEBUG_LOGGING - fprintf(stderr, "INFO: Getting TLM Data\n"); +// fprintf(stderr, "INFO: Getting TLM Data\n"); #endif if ((mode == AFSK) || (mode == CW)) { @@ -742,7 +742,7 @@ void get_tlm(void) { cpuTemp /= 1000; #ifdef DEBUG_LOGGING - printf("CPU Temp Read: %6.1f\n", cpuTemp); +// printf("CPU Temp Read: %6.1f\n", cpuTemp); #endif } @@ -931,7 +931,7 @@ void get_tlm(void) { int i = 0; serialPutchar(uart_fd, '?'); - printf("Querying payload with ?\n"); +// printf("Querying payload with ?\n"); waitTime = millis() + 500; int end = FALSE; while ((millis() < waitTime) && !end) { @@ -949,7 +949,7 @@ void get_tlm(void) { } // sensor_payload[i++] = '\n'; sensor_payload[i] = '\0'; - printf("Payload string: %s", sensor_payload); + printf("Payload string: %s\n", sensor_payload); strcat(str, sensor_payload); // append to telemetry string for transmission } @@ -1118,8 +1118,6 @@ void get_tlm_fox() { } else printf("first time - no sleep\n"); - - float voltage[9], current[9], sensor[17], other[3]; char sensor_payload[500]; memset(voltage, 0, sizeof(voltage)); @@ -1130,9 +1128,9 @@ void get_tlm_fox() { FILE * uptime_file = fopen("/proc/uptime", "r"); fscanf(uptime_file, "%f", & uptime_sec); uptime = (int) uptime_sec; - #ifdef DEBUG_LOGGING - printf("INFO: Reset Count: %d Uptime since Reset: %ld \n", reset_count, uptime); - #endif +// #ifdef DEBUG_LOGGING +// printf("INFO: Reset Count: %d Uptime since Reset: %ld \n", reset_count, uptime); +// #endif fclose(uptime_file); if (sim_mode) { // simulated telemetry @@ -1665,17 +1663,12 @@ void get_tlm_fox() { if (mode == BPSK) { // wod field experiments unsigned long val = 0xffff; - printf("WOD: %x %x %x \n", 0xff & val, (0xff00 & val) >> 8, (0xff0000 & val) >> 16); -// encodeA(b, 63 + head_offset, 0xff & val); encodeA(b, 64 + head_offset, 0xff & val); encodeA(b, 65 + head_offset, val >> 8); encodeA(b, 63 + head_offset, 0x00); encodeA(b, 62 + head_offset, 0x01); - // encodeA(b, 64 + head_offset, 0xfff); // was 7f -> fe, ff -> 1fe was 63 -// encodeA(b, 63 + head_offset, 0xfff); // 0x80 is 1000 0000 at 65 -// encodeA(b, 65 + head_offset, 0xfff); - encodeB(b, 74 + head_offset, 0xfff); // was ff - } + encodeB(b, 74 + head_offset, 0xfff); + } short int data10[headerLen + rsFrames * (rsFrameLen + parityLen)]; short int data8[headerLen + rsFrames * (rsFrameLen + parityLen)]; From 3e4941bf75e8a3a923bf7c0b347c17470b5d2e44 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 1 Jun 2021 16:47:52 -0400 Subject: [PATCH 218/252] updates to get ready for v1 code release --- .../FoxTelem_11a/CubeSatSim_maxtelemetry.csv | 47 +++++++++++++++++++ .../FoxTelem_11a/CubeSatSim_mintelemetry.csv | 47 +++++++++++++++++++ .../FoxTelem_11a/CubeSatSim_rttelemetry.csv | 47 +++++++++++++++++++ 3 files changed, 141 insertions(+) create mode 100644 spacecraft/FoxTelem_11a/CubeSatSim_maxtelemetry.csv create mode 100644 spacecraft/FoxTelem_11a/CubeSatSim_mintelemetry.csv create mode 100644 spacecraft/FoxTelem_11a/CubeSatSim_rttelemetry.csv diff --git a/spacecraft/FoxTelem_11a/CubeSatSim_maxtelemetry.csv b/spacecraft/FoxTelem_11a/CubeSatSim_maxtelemetry.csv new file mode 100644 index 00000000..c42b227d --- /dev/null +++ b/spacecraft/FoxTelem_11a/CubeSatSim_maxtelemetry.csv @@ -0,0 +1,47 @@ +46,TYPE,FIELD,BITS,UNIT,CONVERSION,MODULE,MODULE_NUM,MODULE_LINE,LINE_TYPE,SHOMAX_NAME,DESCRIPTION +0,MAX,BATT_A_V,12,V,cubesatsim_voltage|FLOAT2,NONE,0,0,3,Cell A,Battery A voltage (0-2.5V scale) +1,MAX,BATT_B_V,12,V,cubesatsim_voltage|FLOAT2,NONE,0,0,3,Cell A+B,Battery A+B voltage (0-3.3V scale) +2,MAX,BATT_V,12,V,cubesatsim_voltage|FLOAT2,NONE,4,1,3,Cell A+B+C Voltage,Battery A+B+C voltage (0-5.0V scale) +3,MAX,SatelliteXAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,7,4,3,Acceleration,Acceleration around X Axis +4,MAX,SatelliteYAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,8,4,3,Acceleration,Acceleration around Y Axis +5,MAX,SatelliteZAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,9,4,3,Acceleration,Acceleration around Z Axis +6,MAX,TOTAL_BATT_I,12,mA,cubesatsim_current,NONE,4,2,3,Current,Total Battery DC current +7,MAX,Temperature,12,C,cubesatsim_temperature,NONE,6,2,3,Temperature,STEM Payload Sensor Temperature +8,MAX,PANEL_PLUS_X_V,12,V,cubesatsim_voltage|FLOAT2,NONE,7,1,3,Voltage,+X Panel +9,MAX,PANEL_MINUS_X_V,12,V,cubesatsim_voltage|FLOAT2,NONE,10,1,3,Voltage,-X Panel +10,MAX,PANEL_PLUS_Y_V,12,V,cubesatsim_voltage|FLOAT2,NONE,8,1,3,Voltage,+Y Panel +11,MAX,PANEL_MINUS_Y_V,12,V,cubesatsim_voltage|FLOAT2,NONE,11,1,3,Voltage,-Y Panel +12,MAX,PANEL_PLUS_Z_V,12,V,cubesatsim_voltage|FLOAT2,NONE,9,1,3,Voltage,+Z Panel +13,MAX,PANEL_MINUS_Z_V,12,V,cubesatsim_voltage|FLOAT2,NONE,12,1,3,Voltage,-Z Panel +14,MAX,PANEL_PLUS_X_I,12,mA,cubesatsim_current,NONE,7,2,3,Current,+X Panel +15,MAX,PANEL_MINUS_X_I,12,mA,cubesatsim_current,NONE,10,2,3,Current,-X Panel +16,MAX,PANEL_PLUS_Y_I,12,mA,cubesatsim_current,NONE,8,2,3,Current,+Y Panel +17,MAX,PANEL_MINUS_Y_I,12,mA,cubesatsim_current,NONE,11,2,3,Current,-Y Panel +18,MAX,PANEL_PLUS_Z_I,12,mA,cubesatsim_current,NONE,9,2,3,Current,+Z Panel +19,MAX,PANEL_MINUS_Z_I,12,mA,cubesatsim_current,NONE,12,2,3,Current,-Z Panel +20,MAX,PSUVoltage,12,V,cubesatsim_voltage|FLOAT2,NONE,5,1,3,Voltage,Power Supply Voltage +21,MAX,SPIN,12,rpm,cubesatsim_rpm,NONE,3,1,3,Spacecraft Spin,Calculated spin rate using solar cells +22,MAX,Pressure,12,hPa,cubesatsim_pressure,NONE,6,3,3,Pressure,STEM Payload Sensor Pressure +23,MAX,Altitude,12,m,cubesatsim_altitude,NONE,6,4,3,Altitude,STEM Payload Sensor Altitude +24,MAX,Resets,12,-,12,NONE,3,2,3,Reset Count, Software Reset Count +25,MAX,RSSI,12,dBm,cubesatsim_rssi|INT,NONE,1,1,3,RSSI,Received Signal Strength Indication +26,MAX,IHUTemperature,12,C,cubesatsim_temperature,NONE,2,1,3,Temperature,Internal Temperature of IHU +27,MAX,SatelliteXAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,NONE,7,3,3,Rotation,Angular Veolcity around X Axis +28,MAX,SatelliteYAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,NONE,8,3,3,Rotation,Angular Veolcity around Y Axis +29,MAX,SatelliteZAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,NONE,9,3,3,Rotation,Angular Veolcity around Z Axis +30,MAX,Sensor1,12,raw,cubesatsim_temperature,NONE,6,5,3,Sensor 1,STEM Payload Extra Sensor 1 +31,MAX,PSUCurrent,12,mA,cubesatsim_current,NONE,5,2,3,Current,Power Supply DC Current +32,MAX,Sensor2,12,signed raw,cubesatsim_sensor2|INT,NONE,6,6,3,Sensor 2,STEM Payload Extra Sensor 2 +33,MAX,Sensor3,12,signed scaled,cubesatsim_sensor3|FLOAT2,NONE,6,7,3,Sensor 3,STEM Payload Extra Sensor 3 +34,MAX,STEMPayloadStatus,1,-,17,NONE,6,1,0,STEM Payload Status,STEM Payload Board Status +35,MAX,Nominal Mode,1,-,17,NONE,3,2,0,Nominal Mode, Nominal Mode (Not Safe Mode) +36,MAX,PayloadStatus1,1,-,17,NONE,6,7,0,Exp 2,STEM Payload status 1 failure indicator +37,MAX,PayloadStatus2,1,-,17,NONE,6,8,0,Exp 3,STEM Payload status 2 failure indicator +38,MAX,I2CBus0Failure,1,-,17,NONE,2,2,0,I2C Bus 0,I2C bus 0 failure indicator +39,MAX,I2CBus1Failure,1,-,17,NONE,2,3,0,I2C Bus 1,I2C bus 1 failure indicator +40,MAX,I2CBus3Failure,1,-,17,NONE,2,4,0,I2C Bus 3,I2C bus 3 failure indicator +41,MAX,CameraFailure,1,-,17,NONE,2,5,0,Camera,Camera failure indicator +42,MAX,GroundCommands,4,-,1,NONE,3,3,0,Ground Commands,Number of ground commands received +43,MAX,RXAntenna,1,-,16,NONE,1,3,0,RX Antenna,Receive antenna status +44,MAX,TXAntenna,1,-,16,NONE,1,2,0,TX Antenna,Transmit antenna status +45,MAX,Pad,58,-,0,NONE,0,0,0,NONE,NONE diff --git a/spacecraft/FoxTelem_11a/CubeSatSim_mintelemetry.csv b/spacecraft/FoxTelem_11a/CubeSatSim_mintelemetry.csv new file mode 100644 index 00000000..343a8eb7 --- /dev/null +++ b/spacecraft/FoxTelem_11a/CubeSatSim_mintelemetry.csv @@ -0,0 +1,47 @@ +46,TYPE,FIELD,BITS,UNIT,CONVERSION,MODULE,MODULE_NUM,MODULE_LINE,LINE_TYPE,SHOMIN_NAME,DESCRIPTION +0,MIN,BATT_A_V,12,V,cubesatsim_voltage|FLOAT2,NONE,0,0,3,Cell A,Battery A voltage (0-2.5V scale) +1,MIN,BATT_B_V,12,V,cubesatsim_voltage|FLOAT2,NONE,0,0,3,Cell A+B,Battery A+B voltage (0-3.3V scale) +2,MIN,BATT_V,12,V,cubesatsim_voltage|FLOAT2,NONE,4,1,3,Cell A+B+C Voltage,Battery A+B+C voltage (0-5.0V scale) +3,MIN,SatelliteXAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,7,4,3,Acceleration,Acceleration around X Axis +4,MIN,SatelliteYAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,8,4,3,Acceleration,Acceleration around Y Axis +5,MIN,SatelliteZAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,9,4,3,Acceleration,Acceleration around Z Axis +6,MIN,TOTAL_BATT_I,12,mA,cubesatsim_current,NONE,4,2,3,Current,Total Battery DC current +7,MIN,Temperature,12,C,cubesatsim_temperature,NONE,6,2,3,Temperature,STEM Payload Sensor Temperature +8,MIN,PANEL_PLUS_X_V,12,V,cubesatsim_voltage|FLOAT2,NONE,7,1,3,Voltage,+X Panel +9,MIN,PANEL_MINUS_X_V,12,V,cubesatsim_voltage|FLOAT2,NONE,10,1,3,Voltage,-X Panel +10,MIN,PANEL_PLUS_Y_V,12,V,cubesatsim_voltage|FLOAT2,NONE,8,1,3,Voltage,+Y Panel +11,MIN,PANEL_MINUS_Y_V,12,V,cubesatsim_voltage|FLOAT2,NONE,11,1,3,Voltage,-Y Panel +12,MIN,PANEL_PLUS_Z_V,12,V,cubesatsim_voltage|FLOAT2,NONE,9,1,3,Voltage,+Z Panel +13,MIN,PANEL_MINUS_Z_V,12,V,cubesatsim_voltage|FLOAT2,NONE,12,1,3,Voltage,-Z Panel +14,MIN,PANEL_PLUS_X_I,12,mA,cubesatsim_current,NONE,7,2,3,Current,+X Panel +15,MIN,PANEL_MINUS_X_I,12,mA,cubesatsim_current,NONE,10,2,3,Current,-X Panel +16,MIN,PANEL_PLUS_Y_I,12,mA,cubesatsim_current,NONE,8,2,3,Current,+Y Panel +17,MIN,PANEL_MINUS_Y_I,12,mA,cubesatsim_current,NONE,11,2,3,Current,-Y Panel +18,MIN,PANEL_PLUS_Z_I,12,mA,cubesatsim_current,NONE,9,2,3,Current,+Z Panel +19,MIN,PANEL_MINUS_Z_I,12,mA,cubesatsim_current,NONE,12,2,3,Current,-Z Panel +20,MIN,PSUVoltage,12,V,cubesatsim_voltage|FLOAT2,NONE,5,1,3,Voltage,Power Supply Voltage +21,MIN,SPIN,12,rpm,cubesatsim_rpm,NONE,3,1,3,Spacecraft Spin,Calculated spin rate using solar cells +22,MIN,Pressure,12,bar,cubesatsim_pressure,NONE,6,3,3,Pressure,STEM Payload Sensor Pressure +23,MIN,Altitude,12,m,cubesatsim_altitude,NONE,6,4,3,Altitude,STEM Payload Sensor Altitude +24,MIN,Resets,12,-,12,NONE,3,2,3,Reset Count, Software Reset Count +25,MIN,RSSI,12,dBm,cubesatsim_rssi|INT,NONE,1,1,3,RSSI,Received Signal Strength Indication +26,MIN,IHUTemperature,12,C,cubesatsim_temperature,NONE,2,1,3,Temperature,Internal Temperature of IHU +27,MIN,SatelliteXAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,NONE,7,3,3,Rotation,Angular Veolcity around X Axis +28,MIN,SatelliteYAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,NONE,8,3,3,Rotation,Angular Veolcity around Y Axis +29,MIN,SatelliteZAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,NONE,9,3,3,Rotation,Angular Veolcity around Z Axis +30,MIN,Sensor1,12,raw,cubesatsim_temperature,NONE,6,5,3,Sensor 1,STEM Payload Extra Sensor 1 +31,MIN,PSUCurrent,12,mA,cubesatsim_current,NONE,5,2,3,Current,Power Supply DC Current +32,MIN,Sensor2,12,signed raw,cubesatsim_sensor2|INT,NONE,6,6,3,Sensor 2,STEM Payload Extra Sensor 2 +33,MIN,Sensor3,12,signed scaled,cubesatsim_sensor3|FLOAT2,NONE,6,7,3,Sensor 3,STEM Payload Extra Sensor 3 +34,MIN,STEMPayloadStatus,1,-,17,NONE,6,1,0,STEM Payload Status,STEM Payload Board Status +35,MIN,Nominal Mode,1,-,17,NONE,3,2,0,Nominal Mode, Nominal Mode (Not Safe Mode) +36,MIN,PayloadStatus1,1,-,17,NONE,6,7,0,Exp 2,STEM Payload status 1 failure indicator +37,MIN,PayloadStatus2,1,-,17,NONE,6,8,0,Exp 3,STEM Payload status 2 failure indicator +38,MIN,I2CBus0Failure,1,-,17,NONE,2,2,0,I2C Bus 0,I2C bus 0 failure indicator +39,MIN,I2CBus1Failure,1,-,17,NONE,2,3,0,I2C Bus 1,I2C bus 1 failure indicator +40,MIN,I2CBus3Failure,1,-,17,NONE,2,4,0,I2C Bus 3,I2C bus 3 failure indicator +41,MIN,CameraFailure,1,-,17,NONE,2,5,0,Camera,Camera failure indicator +42,MIN,GroundCommands,4,-,1,NONE,3,3,0,Ground Commands,Number of ground commands received +43,MIN,RXAntenna,1,-,16,NONE,1,3,0,RX Antenna,Receive antenna status +44,MIN,TXAntenna,1,-,16,NONE,1,2,0,TX Antenna,Transmit antenna status +45,MIN,Pad,58,-,0,NONE,0,0,0,NONE,NONE diff --git a/spacecraft/FoxTelem_11a/CubeSatSim_rttelemetry.csv b/spacecraft/FoxTelem_11a/CubeSatSim_rttelemetry.csv new file mode 100644 index 00000000..2e238f2b --- /dev/null +++ b/spacecraft/FoxTelem_11a/CubeSatSim_rttelemetry.csv @@ -0,0 +1,47 @@ +46,TYPE,FIELD,BITS,UNIT,CONVERSION,MODULE,MODULE_NUM,MODULE_LINE,LINE_TYPE,SHORT_NAME,DESCRIPTION +0,RT,BATT_A_V,12,V,cubesatsim_voltage|FLOAT2,NONE,0,0,3,Cell A,Battery A voltage (0-2.5V scale) +1,RT,BATT_B_V,12,V,cubesatsim_voltage|FLOAT2,NONE,0,0,3,Cell A+B,Battery A+B voltage (0-3.3V scale) +2,RT,BATT_V,12,V,cubesatsim_voltage|FLOAT2,Battery,4,1,3,Cell A+B+C Voltage,Battery A+B+C voltage (0-5.0V scale) +3,RT,SatelliteXAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,+X Panel,7,4,3,Acceleration,Acceleration around X Axis +4,RT,SatelliteYAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,+Y Panel,8,4,3,Acceleration,Acceleration around Y Axis +5,RT,SatelliteZAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,+Z Panel,9,4,3,Acceleration,Acceleration around Z Axis +6,RT,TOTAL_BATT_I,12,mA,cubesatsim_current,Battery,4,2,3,Current,Total Battery DC current +7,RT,Temperature,12,C,cubesatsim_temperature,Experiments,6,2,3,Temperature,STEM Payload Sensor Temperature +8,RT,PANEL_PLUS_X_V,12,V,cubesatsim_voltage|FLOAT2,+X Panel,7,1,3,Voltage,+X Panel +9,RT,PANEL_MINUS_X_V,12,V,cubesatsim_voltage|FLOAT2,-X Panel,10,1,3,Voltage,-X Panel +10,RT,PANEL_PLUS_Y_V,12,V,cubesatsim_voltage|FLOAT2,+Y Panel,8,1,3,Voltage,+Y Panel +11,RT,PANEL_MINUS_Y_V,12,V,cubesatsim_voltage|FLOAT2,-Y Panel,11,1,3,Voltage,-Y Panel +12,RT,PANEL_PLUS_Z_V,12,V,cubesatsim_voltage|FLOAT2,+Z Panel,9,1,3,Voltage,+Z Panel +13,RT,PANEL_MINUS_Z_V,12,V,cubesatsim_voltage|FLOAT2,-Z Panel,12,1,3,Voltage,-Z Panel +14,RT,PANEL_PLUS_X_I,12,mA,cubesatsim_current,+X Panel,7,2,3,Current,+X Panel +15,RT,PANEL_MINUS_X_I,12,mA,cubesatsim_current,-X Panel,10,2,3,Current,-X Panel +16,RT,PANEL_PLUS_Y_I,12,mA,cubesatsim_current,+Y Panel,8,2,3,Current,+Y Panel +17,RT,PANEL_MINUS_Y_I,12,mA,cubesatsim_current,-Y Panel,11,2,3,Current,-Y Panel +18,RT,PANEL_PLUS_Z_I,12,mA,cubesatsim_current,+Z Panel,9,2,3,Current,+Z Panel +19,RT,PANEL_MINUS_Z_I,12,mA,cubesatsim_current,-Z Panel,12,2,3,Current,-Z Panel +20,RT,PSUVoltage,12,V,cubesatsim_voltage|FLOAT2,PSU,5,1,3,Voltage,Power Supply Voltage +21,RT,SPIN,12,rpm,cubesatsim_rpm,Computer Software,3,1,3,Spacecraft Spin,Calculated spin rate using solar cells +22,RT,Pressure,12,hPa,cubesatsim_pressure,Experiments,6,3,3,Pressure,STEM Payload Sensor Pressure +23,RT,Altitude,12,m,cubesatsim_altitude,Experiments,6,4,3,Altitude,STEM Payload Sensor Altitude +24,RT,Resets,12,-,12,NONE,3,2,3,Reset Count, Software Reset Count +25,RT,RSSI,12,dBm,cubesatsim_rssi|INT,Radio,1,1,3,RSSI,Received Signal Strength Indication +26,RT,IHUTemperature,12,C,cubesatsim_temperature,Computer Hardware,2,1,3,Temperature,Internal Temperature of IHU +27,RT,SatelliteXAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,+X Panel,7,3,3,Rotation,Angular Veolcity around X Axis +28,RT,SatelliteYAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,+Y Panel,8,3,3,Rotation,Angular Veolcity around Y Axis +29,RT,SatelliteZAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,+Z Panel,9,3,3,Rotation,Angular Veolcity around Z Axis +30,RT,Sensor1,12,%,cubesatsim_temperature,Experiments,6,5,3,Humidity,Humidity +31,RT,PSUCurrent,12,mA,cubesatsim_current,PSU,5,2,3,Current,Power Supply DC Current +32,RT,Sensor2,12,signed raw,cubesatsim_sensor2|INT,Experiments,6,6,3,Sensor 1,STEM Payload Extra Sensor 1 +33,RT,Sensor3,12,signed scaled,cubesatsim_sensor3|FLOAT2,Experiments,6,7,3,Sensor 2,STEM Payload Extra Sensor 2 +34,RT,STEMPayloadStatus,1,-,17,Experiments,6,1,0,STEM Payload,STEM Payload Board Status +35,RT,Nominal Mode,1,-,17,Computer Software,3,2,0,Nominal Mode, Nominal Mode (Not Safe Mode) +36,RT,PayloadStatus1,1,-,17,NONE,6,7,0,Exp 2,STEM Payload status 1 failure indicator +37,RT,PayloadStatus2,1,-,17,NONE,6,8,0,Exp 3,STEM Payload status 2 failure indicator +38,RT,I2CBus0Failure,1,-,17,Computer Hardware,2,2,0,I2C Bus 0,I2C bus 0 failure indicator +39,RT,I2CBus1Failure,1,-,17,Computer Hardware,2,3,0,I2C Bus 1,I2C bus 1 failure indicator +40,RT,I2CBus3Failure,1,-,17,Computer Hardware,2,4,0,I2C Bus 3,I2C bus 3 failure indicator +41,RT,CameraFailure,1,-,17,Computer Hardware,2,5,0,Camera,Camera failure indicator +42,RT,GroundCommands,4,-,1,Computer Software,3,3,0,Ground Commands,Number of ground commands received +43,RT,RXAntenna,1,-,16,Radio,1,3,0,RX Antenna,Receive antenna status +44,RT,TXAntenna,1,-,16,Radio,1,2,0,TX Antenna,Transmit antenna status +45,RT,Pad,58,-,0,NONE,0,0,0,NONE,NONE From 1114b017b97d49f04cb46e7677e0cc641810bd41 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 1 Jun 2021 16:54:32 -0400 Subject: [PATCH 219/252] rename conversion_curves, modify rtt --- .../CubeSatSim_PSK_rttelemetry.csv | 61 +++++++++++++++++++ .../CubeSatSim_conversion_curves.csv | 13 ++++ 2 files changed, 74 insertions(+) create mode 100644 spacecraft/FoxTelem_11a/CubeSatSim_PSK_rttelemetry.csv create mode 100644 spacecraft/FoxTelem_11a/CubeSatSim_conversion_curves.csv diff --git a/spacecraft/FoxTelem_11a/CubeSatSim_PSK_rttelemetry.csv b/spacecraft/FoxTelem_11a/CubeSatSim_PSK_rttelemetry.csv new file mode 100644 index 00000000..518a39ac --- /dev/null +++ b/spacecraft/FoxTelem_11a/CubeSatSim_PSK_rttelemetry.csv @@ -0,0 +1,61 @@ +60,TYPE,FIELD,BITS,UNIT,CONVERSION,MODULE,MODULE_NUM,MODULE_LINE,LINE_TYPE,SHORT_NAME,DESCRIPTION +0,realTime,BATT_A_V,12,V,cubesatsim_voltage|FLOAT2,NONE,4,1,3,Cell A,Battery A voltage (0-2.5V scale) +1,realTime,BATT_B_V,12,V,cubesatsim_voltage|FLOAT2,NONE,4,2,3,Cell A+B,Battery A+B voltage (0-3.3V scale) +2,realTime,BATT_V,12,V,cubesatsim_voltage|FLOAT2,Battery,4,1,3,Cell A+B+C Voltage,Battery A+B+C voltage (0-5.0V scale) +3,realTime,SatelliteXAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,+X Panel,7,4,3,Acceleration,Acceleration around X Axis +4,realTime,SatelliteYAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,+Y Panel,8,4,3,Acceleration,Acceleration around Y Axis +5,realTime,SatelliteZAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,+Z Panel,9,4,3,Acceleration,Acceleration around Z Axis +6,realTime,battCurr,12,mA,cubesatsim_current,Battery,4,2,4,Current,Total Battery DC current +7,realTime,Temperature,12,C,cubesatsim_temperature,Experiments,6,2,3,Temperature,STEM Payload sensor temperature +8,realTime,posXv,12,V,cubesatsim_voltage|FLOAT2,+X Panel,7,1,3,Voltage,+X solar panel voltage +9,realTime,posYv,12,V,cubesatsim_voltage|FLOAT2,+Y Panel,8,1,3,Voltage,+Y solar panel voltage +10,realTime,posZv,12,V,cubesatsim_voltage|FLOAT2,+Z Panel,9,1,3,Voltage,+Z solar panel voltage +11,realTime,negXv,12,V,cubesatsim_voltage|FLOAT2,-X Panel,10,1,3,Voltage,-X solar panel voltage +12,realTime,negYv,12,V,cubesatsim_voltage|FLOAT2,-Y Panel,11,1,3,Voltage,-Y solar panel voltage +13,realTime,negZv,12,V,cubesatsim_voltage|FLOAT2,-Z Panel,12,1,3,Voltage,-Z solar panel voltage +14,realTime,posXi,12,mA,cubesatsim_current,+X Panel,7,2,4,Current,+X solar panel current +15,realTime,posYi,12,mA,cubesatsim_current,+Y Panel,8,2,4,Current,+Y solar panel current +16,realTime,posZi,12,mA,cubesatsim_current,+Z Panel,9,2,4,Current,+Z solar panel current +17,realTime,negXi,12,mA,cubesatsim_current,-X Panel,10,2,4,Current,-X solar panel current +18,realTime,negYi,12,mA,cubesatsim_current,-Y Panel,11,2,4,Current,-Y solar panel current +19,realTime,negZi,12,mA,cubesatsim_current,-Z Panel,12,2,4,Current,-Z solar panel current +20,realTime,PSUVoltage,12,V,cubesatsim_voltage|FLOAT2,PSU,5,1,3,Voltage,Power Supply voltage +21,realTime,spin,12,rpm,cubesatsim_rpm,Computer Software,3,1,3,Spacecraft Spin,Calculated spin rate using solar cells +22,realTime,Pressure,12,bar,cubesatsim_pressure,Experiments,6,3,3,Pressure,STEM Payload sensor pressure +23,realTime,Altitude,12,m,cubesatsim_altitude,Experiments,6,4,3,Altitude,STEM Payload sensor altitude +24,realTime,Resets,12,-,12,NONE,3,2,3,Reset Count, Software Reset Count +25,realTime,rssi,12,dBm,cubesatsim_rssi|INT,Radio,1,1,3,RSSI,Received Signal Strength Indication +26,realTime,IHUcpuTemp,12,C,cubesatsim_temperature,Computer Hardware,2,1,3,Temperature,Internal temperature of IHU from Pi +27,realTime,SatelliteXAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,+X Panel,7,3,3,Rotation,Angular veolcity around X Axis +28,realTime,SatelliteYAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,+Y Panel,8,3,3,Rotation,Angular veolcity around Y Axis +29,realTime,SatelliteZAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,+Z Panel,9,3,3,Rotation,Angular veolcity around Z Axis +30,realTime,Sensor1,12,raw,cubesatsim_sensor1|INT,Experiments,6,5,3,Sensor 1,STEM Payload extra Sensor 1 +31,realTime,PSUCurrent,12,mA,cubesatsim_current,PSU,5,2,3,Current,Power Supply DC Current +32,realTime,Sensor2,12,signed raw,cubesatsim_sensor2|INT,Experiments,6,6,3,Sensor 2,STEM Payload extra Sensor 2 +33,realTime,Sensor3,12,signed scaled,cubesatsim_sensor3|FLOAT2,Experiments,6,7,3,Sensor 3,STEM Payload extra Sensor 3 +34,realTime,STEMPayloadStatus,1,-,17,Experiments,6,1,0,STEM Payload, STEM Payload STEM Payload board failure indicator +35,realTime,Nominal Mode,1,-,17,Computer Software,3,2,0,Nominal Mode, Nominal Mode (Not Safe Mode) +36,realTime,PayloadStatus1,1,-,17,NONE,6,7,0,Exp 2,STEM Payload status 1 failure indicator +37,realTime,PayloadStatus2,1,-,17,NONE,6,8,0,Exp 3,STEM Payload status 2 failure indicator +38,realTime,I2CBus0Failure,1,-,17,Computer Hardware,2,2,0,I2C Bus 0,I2C bus 0 failure indicator +39,realTime,I2CBus1Failure,1,-,17,Computer Hardware,2,3,0,I2C Bus 1,I2C bus 1 failure indicator +40,realTime,I2CBus3Failure,1,-,17,Computer Hardware,2,4,0,I2C Bus 3,I2C bus 3 failure indicator +41,realTime,CameraFailure,1,-,17,Computer Hardware,2,5,0,Camera,Camera failure indicator +42,realTime,GroundCommands,4,-,1,Computer Software,3,3,0,Ground Commands,Number of ground commands received +43,realTime,RxAntenna,1,-,16,Radio,1,3,0,RX Antenna,Receive antenna status +44,realTime,TxAntenna,2,-,16,Radio,1,2,0,TX Antenna,Transmit antenna status +45,realTime,ICR3VProt,12,V,43,NONE,7,2,3,3V Prot,ICR 3V Proteted +46,realTime,ICR2dot5V,12,V,43,NONE,7,3,3,2.5V,ICR 2.5V +47,realTime,ICR2dot5VProt,12,V,43,NONE,7,4,3,2.5V Prot,ICR 2.5V Protected +48,realTime,rf6,12,-,0,NONE,0,0,0,None,None +49,realTime,rf7,12,-,0,NONE,0,0,0,None,None +50,realTime,MuxTest,12,V,43,NONE,7,5,3,Sensor Power,Sensor Power Voltage at the ICR +51,realTime,LtVGACtl,12,V,42,NONE,1,4,3,VGA Control,Control Voltage to the Variable Gain Amplifier (VGA) +52,realTime,pad,4,-,34,NONE,0,0,0,None,Unused +53,realTime,IHUdiagData,32,-,18,NONE,3,2,0,Diagnostic Info,Diagnostic Data on IHU Performance +54,realTime,pad1,1,-,0,NONE,0,0,0,NONE,Filler +55,realTime,wodSize,8,000s,36,NONE,3,3,0,WOD Stored,Number of WOD data payloads kept for each of Science and Housekeeping. In hundreds +56,realTime,swCmds,32,-,35,NONE,7,6,0,Diagnostic,ICR Diagnostic information +57,realTime,hwCmdCnt,6,-,1,NONE,7,7,0,HW Command Count,Number of hardware commands since last reset +58,realTime,swCmdCnt,6,-,1,NONE,7,8,0,SW Command Count,Number of software commands since last reset +59,realTime,pad2,28,-,0,NONE,0,0,0,NONE,Filler diff --git a/spacecraft/FoxTelem_11a/CubeSatSim_conversion_curves.csv b/spacecraft/FoxTelem_11a/CubeSatSim_conversion_curves.csv new file mode 100644 index 00000000..30f05985 --- /dev/null +++ b/spacecraft/FoxTelem_11a/CubeSatSim_conversion_curves.csv @@ -0,0 +1,13 @@ +CurveName,a,bx,cx^2,dx^3,ex^4,fx^5,Description +cubesatsim_voltage,0,0.01,0,0,0,0,Converts voltages read from the INA219 sensors +cubesatsim_current,-2048,1,0,0,0,0,Converts positive and negative currents read from the INA219 sensors +cubesatsim_temperature,0,0.1,0,0,0,0,Converts temperature of Pi +cubesatsim_rotation,-2048,1,0,0,0,0,Converts positive and negative dps rotation +cubesatsim_acceleration,-20.48,0.01,0,0,0,0,Converts positive and negative g acceleration +cubesatsim_altitude,0,0.1,0,0,0,0,Converts altitude +cubesatsim_pressure,0,1,0,0,0,0,Converts pressure +cubesatsim_sensor1,0,1,0,0,0,0,Conversion of Sensor 1 +cubesatsim_sensor2,-2048,1,0,0,0,0,Conversion of Sensor 2 +cubesatsim_sensor3,-20.48,0.01,0,0,0,0,Conversion of Sensor 3 +cubesatsim_rpm,-204.8,0.1,0,0,0,0,Conversion of calculated RPM +cubesatsim_rssi,-2048,1,0,0,0,0,Conversion of Received Signal Strength From 82f6334c1436148a3f4f02226cce0caafa70cf4e Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 1 Jun 2021 17:00:26 -0400 Subject: [PATCH 220/252] changed 4 to 3 to fix max min swapping of currents --- .../FoxTelem_11a/CubeSatSim_PSK_rttelemetry.csv | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/spacecraft/FoxTelem_11a/CubeSatSim_PSK_rttelemetry.csv b/spacecraft/FoxTelem_11a/CubeSatSim_PSK_rttelemetry.csv index 518a39ac..b948cca2 100644 --- a/spacecraft/FoxTelem_11a/CubeSatSim_PSK_rttelemetry.csv +++ b/spacecraft/FoxTelem_11a/CubeSatSim_PSK_rttelemetry.csv @@ -5,7 +5,7 @@ 3,realTime,SatelliteXAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,+X Panel,7,4,3,Acceleration,Acceleration around X Axis 4,realTime,SatelliteYAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,+Y Panel,8,4,3,Acceleration,Acceleration around Y Axis 5,realTime,SatelliteZAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,+Z Panel,9,4,3,Acceleration,Acceleration around Z Axis -6,realTime,battCurr,12,mA,cubesatsim_current,Battery,4,2,4,Current,Total Battery DC current +6,realTime,battCurr,12,mA,cubesatsim_current,Battery,4,2,3,Current,Total Battery DC current 7,realTime,Temperature,12,C,cubesatsim_temperature,Experiments,6,2,3,Temperature,STEM Payload sensor temperature 8,realTime,posXv,12,V,cubesatsim_voltage|FLOAT2,+X Panel,7,1,3,Voltage,+X solar panel voltage 9,realTime,posYv,12,V,cubesatsim_voltage|FLOAT2,+Y Panel,8,1,3,Voltage,+Y solar panel voltage @@ -13,12 +13,12 @@ 11,realTime,negXv,12,V,cubesatsim_voltage|FLOAT2,-X Panel,10,1,3,Voltage,-X solar panel voltage 12,realTime,negYv,12,V,cubesatsim_voltage|FLOAT2,-Y Panel,11,1,3,Voltage,-Y solar panel voltage 13,realTime,negZv,12,V,cubesatsim_voltage|FLOAT2,-Z Panel,12,1,3,Voltage,-Z solar panel voltage -14,realTime,posXi,12,mA,cubesatsim_current,+X Panel,7,2,4,Current,+X solar panel current -15,realTime,posYi,12,mA,cubesatsim_current,+Y Panel,8,2,4,Current,+Y solar panel current -16,realTime,posZi,12,mA,cubesatsim_current,+Z Panel,9,2,4,Current,+Z solar panel current -17,realTime,negXi,12,mA,cubesatsim_current,-X Panel,10,2,4,Current,-X solar panel current -18,realTime,negYi,12,mA,cubesatsim_current,-Y Panel,11,2,4,Current,-Y solar panel current -19,realTime,negZi,12,mA,cubesatsim_current,-Z Panel,12,2,4,Current,-Z solar panel current +14,realTime,posXi,12,mA,cubesatsim_current,+X Panel,7,2,3,Current,+X solar panel current +15,realTime,posYi,12,mA,cubesatsim_current,+Y Panel,8,2,3,Current,+Y solar panel current +16,realTime,posZi,12,mA,cubesatsim_current,+Z Panel,9,2,3,Current,+Z solar panel current +17,realTime,negXi,12,mA,cubesatsim_current,-X Panel,10,2,3,Current,-X solar panel current +18,realTime,negYi,12,mA,cubesatsim_current,-Y Panel,11,2,3,Current,-Y solar panel current +19,realTime,negZi,12,mA,cubesatsim_current,-Z Panel,12,2,3,Current,-Z solar panel current 20,realTime,PSUVoltage,12,V,cubesatsim_voltage|FLOAT2,PSU,5,1,3,Voltage,Power Supply voltage 21,realTime,spin,12,rpm,cubesatsim_rpm,Computer Software,3,1,3,Spacecraft Spin,Calculated spin rate using solar cells 22,realTime,Pressure,12,bar,cubesatsim_pressure,Experiments,6,3,3,Pressure,STEM Payload sensor pressure From 9451ce05e036127d8d22e4925efb80962cf2587a Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 1 Jun 2021 17:02:24 -0400 Subject: [PATCH 221/252] changed Sensor 1 to Humidity --- spacecraft/FoxTelem_11a/CubeSatSim_PSK_rttelemetry.csv | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spacecraft/FoxTelem_11a/CubeSatSim_PSK_rttelemetry.csv b/spacecraft/FoxTelem_11a/CubeSatSim_PSK_rttelemetry.csv index b948cca2..00dd00ff 100644 --- a/spacecraft/FoxTelem_11a/CubeSatSim_PSK_rttelemetry.csv +++ b/spacecraft/FoxTelem_11a/CubeSatSim_PSK_rttelemetry.csv @@ -29,10 +29,10 @@ 27,realTime,SatelliteXAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,+X Panel,7,3,3,Rotation,Angular veolcity around X Axis 28,realTime,SatelliteYAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,+Y Panel,8,3,3,Rotation,Angular veolcity around Y Axis 29,realTime,SatelliteZAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,+Z Panel,9,3,3,Rotation,Angular veolcity around Z Axis -30,realTime,Sensor1,12,raw,cubesatsim_sensor1|INT,Experiments,6,5,3,Sensor 1,STEM Payload extra Sensor 1 +30,realTime,Humidity,12,%,cubesatsim_sensor1|INT,Experiments,6,5,3,Humidity,Humidity 31,realTime,PSUCurrent,12,mA,cubesatsim_current,PSU,5,2,3,Current,Power Supply DC Current -32,realTime,Sensor2,12,signed raw,cubesatsim_sensor2|INT,Experiments,6,6,3,Sensor 2,STEM Payload extra Sensor 2 -33,realTime,Sensor3,12,signed scaled,cubesatsim_sensor3|FLOAT2,Experiments,6,7,3,Sensor 3,STEM Payload extra Sensor 3 +32,realTime,Sensor1,12,signed raw,cubesatsim_sensor2|INT,Experiments,6,6,3,Sensor 1,STEM Payload extra Sensor 1 +33,realTime,Sensor2,12,signed scaled,cubesatsim_sensor3|FLOAT2,Experiments,6,7,3,Sensor 2,STEM Payload extra Sensor 2 34,realTime,STEMPayloadStatus,1,-,17,Experiments,6,1,0,STEM Payload, STEM Payload STEM Payload board failure indicator 35,realTime,Nominal Mode,1,-,17,Computer Software,3,2,0,Nominal Mode, Nominal Mode (Not Safe Mode) 36,realTime,PayloadStatus1,1,-,17,NONE,6,7,0,Exp 2,STEM Payload status 1 failure indicator From 07795d0f0ee88ea31df0d640c0016eec7effade5 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 1 Jun 2021 17:05:28 -0400 Subject: [PATCH 222/252] changed sensor names --- .../FoxTelem_11a/CubeSatSim_rttelemetry.csv | 141 ++++++++++++------ 1 file changed, 94 insertions(+), 47 deletions(-) diff --git a/spacecraft/FoxTelem_11a/CubeSatSim_rttelemetry.csv b/spacecraft/FoxTelem_11a/CubeSatSim_rttelemetry.csv index 2e238f2b..1db3c20c 100644 --- a/spacecraft/FoxTelem_11a/CubeSatSim_rttelemetry.csv +++ b/spacecraft/FoxTelem_11a/CubeSatSim_rttelemetry.csv @@ -1,47 +1,94 @@ -46,TYPE,FIELD,BITS,UNIT,CONVERSION,MODULE,MODULE_NUM,MODULE_LINE,LINE_TYPE,SHORT_NAME,DESCRIPTION -0,RT,BATT_A_V,12,V,cubesatsim_voltage|FLOAT2,NONE,0,0,3,Cell A,Battery A voltage (0-2.5V scale) -1,RT,BATT_B_V,12,V,cubesatsim_voltage|FLOAT2,NONE,0,0,3,Cell A+B,Battery A+B voltage (0-3.3V scale) -2,RT,BATT_V,12,V,cubesatsim_voltage|FLOAT2,Battery,4,1,3,Cell A+B+C Voltage,Battery A+B+C voltage (0-5.0V scale) -3,RT,SatelliteXAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,+X Panel,7,4,3,Acceleration,Acceleration around X Axis -4,RT,SatelliteYAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,+Y Panel,8,4,3,Acceleration,Acceleration around Y Axis -5,RT,SatelliteZAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,+Z Panel,9,4,3,Acceleration,Acceleration around Z Axis -6,RT,TOTAL_BATT_I,12,mA,cubesatsim_current,Battery,4,2,3,Current,Total Battery DC current -7,RT,Temperature,12,C,cubesatsim_temperature,Experiments,6,2,3,Temperature,STEM Payload Sensor Temperature -8,RT,PANEL_PLUS_X_V,12,V,cubesatsim_voltage|FLOAT2,+X Panel,7,1,3,Voltage,+X Panel -9,RT,PANEL_MINUS_X_V,12,V,cubesatsim_voltage|FLOAT2,-X Panel,10,1,3,Voltage,-X Panel -10,RT,PANEL_PLUS_Y_V,12,V,cubesatsim_voltage|FLOAT2,+Y Panel,8,1,3,Voltage,+Y Panel -11,RT,PANEL_MINUS_Y_V,12,V,cubesatsim_voltage|FLOAT2,-Y Panel,11,1,3,Voltage,-Y Panel -12,RT,PANEL_PLUS_Z_V,12,V,cubesatsim_voltage|FLOAT2,+Z Panel,9,1,3,Voltage,+Z Panel -13,RT,PANEL_MINUS_Z_V,12,V,cubesatsim_voltage|FLOAT2,-Z Panel,12,1,3,Voltage,-Z Panel -14,RT,PANEL_PLUS_X_I,12,mA,cubesatsim_current,+X Panel,7,2,3,Current,+X Panel -15,RT,PANEL_MINUS_X_I,12,mA,cubesatsim_current,-X Panel,10,2,3,Current,-X Panel -16,RT,PANEL_PLUS_Y_I,12,mA,cubesatsim_current,+Y Panel,8,2,3,Current,+Y Panel -17,RT,PANEL_MINUS_Y_I,12,mA,cubesatsim_current,-Y Panel,11,2,3,Current,-Y Panel -18,RT,PANEL_PLUS_Z_I,12,mA,cubesatsim_current,+Z Panel,9,2,3,Current,+Z Panel -19,RT,PANEL_MINUS_Z_I,12,mA,cubesatsim_current,-Z Panel,12,2,3,Current,-Z Panel -20,RT,PSUVoltage,12,V,cubesatsim_voltage|FLOAT2,PSU,5,1,3,Voltage,Power Supply Voltage -21,RT,SPIN,12,rpm,cubesatsim_rpm,Computer Software,3,1,3,Spacecraft Spin,Calculated spin rate using solar cells -22,RT,Pressure,12,hPa,cubesatsim_pressure,Experiments,6,3,3,Pressure,STEM Payload Sensor Pressure -23,RT,Altitude,12,m,cubesatsim_altitude,Experiments,6,4,3,Altitude,STEM Payload Sensor Altitude -24,RT,Resets,12,-,12,NONE,3,2,3,Reset Count, Software Reset Count -25,RT,RSSI,12,dBm,cubesatsim_rssi|INT,Radio,1,1,3,RSSI,Received Signal Strength Indication -26,RT,IHUTemperature,12,C,cubesatsim_temperature,Computer Hardware,2,1,3,Temperature,Internal Temperature of IHU -27,RT,SatelliteXAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,+X Panel,7,3,3,Rotation,Angular Veolcity around X Axis -28,RT,SatelliteYAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,+Y Panel,8,3,3,Rotation,Angular Veolcity around Y Axis -29,RT,SatelliteZAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,+Z Panel,9,3,3,Rotation,Angular Veolcity around Z Axis -30,RT,Sensor1,12,%,cubesatsim_temperature,Experiments,6,5,3,Humidity,Humidity -31,RT,PSUCurrent,12,mA,cubesatsim_current,PSU,5,2,3,Current,Power Supply DC Current -32,RT,Sensor2,12,signed raw,cubesatsim_sensor2|INT,Experiments,6,6,3,Sensor 1,STEM Payload Extra Sensor 1 -33,RT,Sensor3,12,signed scaled,cubesatsim_sensor3|FLOAT2,Experiments,6,7,3,Sensor 2,STEM Payload Extra Sensor 2 -34,RT,STEMPayloadStatus,1,-,17,Experiments,6,1,0,STEM Payload,STEM Payload Board Status -35,RT,Nominal Mode,1,-,17,Computer Software,3,2,0,Nominal Mode, Nominal Mode (Not Safe Mode) -36,RT,PayloadStatus1,1,-,17,NONE,6,7,0,Exp 2,STEM Payload status 1 failure indicator -37,RT,PayloadStatus2,1,-,17,NONE,6,8,0,Exp 3,STEM Payload status 2 failure indicator -38,RT,I2CBus0Failure,1,-,17,Computer Hardware,2,2,0,I2C Bus 0,I2C bus 0 failure indicator -39,RT,I2CBus1Failure,1,-,17,Computer Hardware,2,3,0,I2C Bus 1,I2C bus 1 failure indicator -40,RT,I2CBus3Failure,1,-,17,Computer Hardware,2,4,0,I2C Bus 3,I2C bus 3 failure indicator -41,RT,CameraFailure,1,-,17,Computer Hardware,2,5,0,Camera,Camera failure indicator -42,RT,GroundCommands,4,-,1,Computer Software,3,3,0,Ground Commands,Number of ground commands received -43,RT,RXAntenna,1,-,16,Radio,1,3,0,RX Antenna,Receive antenna status -44,RT,TXAntenna,1,-,16,Radio,1,2,0,TX Antenna,Transmit antenna status -45,RT,Pad,58,-,0,NONE,0,0,0,NONE,NONE +46,TYPE,FIELD,BITS,UNIT,CONVERSION,MODULE,MODULE_NUM,MODULE_LINE,LINE_TYPE,SHORT_NAME,DESCRIPTION + +0,RT,BATT_A_V,12,V,cubesatsim_voltage|FLOAT2,NONE,0,0,3,Cell A,Battery A voltage (0-2.5V scale) + +1,RT,BATT_B_V,12,V,cubesatsim_voltage|FLOAT2,NONE,0,0,3,Cell A+B,Battery A+B voltage (0-3.3V scale) + +2,RT,BATT_V,12,V,cubesatsim_voltage|FLOAT2,Battery,4,1,3,Cell A+B+C Voltage,Battery A+B+C voltage (0-5.0V scale) + +3,RT,SatelliteXAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,+X Panel,7,4,3,Acceleration,Acceleration around X Axis + +4,RT,SatelliteYAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,+Y Panel,8,4,3,Acceleration,Acceleration around Y Axis + +5,RT,SatelliteZAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,+Z Panel,9,4,3,Acceleration,Acceleration around Z Axis + +6,RT,TOTAL_BATT_I,12,mA,cubesatsim_current,Battery,4,2,3,Current,Total Battery DC current + +7,RT,Temperature,12,C,cubesatsim_temperature,Experiments,6,2,3,Temperature,STEM Payload Sensor Temperature + +8,RT,PANEL_PLUS_X_V,12,V,cubesatsim_voltage|FLOAT2,+X Panel,7,1,3,Voltage,+X Panel + +9,RT,PANEL_MINUS_X_V,12,V,cubesatsim_voltage|FLOAT2,-X Panel,10,1,3,Voltage,-X Panel + +10,RT,PANEL_PLUS_Y_V,12,V,cubesatsim_voltage|FLOAT2,+Y Panel,8,1,3,Voltage,+Y Panel + +11,RT,PANEL_MINUS_Y_V,12,V,cubesatsim_voltage|FLOAT2,-Y Panel,11,1,3,Voltage,-Y Panel + +12,RT,PANEL_PLUS_Z_V,12,V,cubesatsim_voltage|FLOAT2,+Z Panel,9,1,3,Voltage,+Z Panel + +13,RT,PANEL_MINUS_Z_V,12,V,cubesatsim_voltage|FLOAT2,-Z Panel,12,1,3,Voltage,-Z Panel + +14,RT,PANEL_PLUS_X_I,12,mA,cubesatsim_current,+X Panel,7,2,3,Current,+X Panel + +15,RT,PANEL_MINUS_X_I,12,mA,cubesatsim_current,-X Panel,10,2,3,Current,-X Panel + +16,RT,PANEL_PLUS_Y_I,12,mA,cubesatsim_current,+Y Panel,8,2,3,Current,+Y Panel + +17,RT,PANEL_MINUS_Y_I,12,mA,cubesatsim_current,-Y Panel,11,2,3,Current,-Y Panel + +18,RT,PANEL_PLUS_Z_I,12,mA,cubesatsim_current,+Z Panel,9,2,3,Current,+Z Panel + +19,RT,PANEL_MINUS_Z_I,12,mA,cubesatsim_current,-Z Panel,12,2,3,Current,-Z Panel + +20,RT,PSUVoltage,12,V,cubesatsim_voltage|FLOAT2,PSU,5,1,3,Voltage,Power Supply Voltage + +21,RT,SPIN,12,rpm,cubesatsim_rpm,Computer Software,3,1,3,Spacecraft Spin,Calculated spin rate using solar cells + +22,RT,Pressure,12,hPa,cubesatsim_pressure,Experiments,6,3,3,Pressure,STEM Payload Sensor Pressure + +23,RT,Altitude,12,m,cubesatsim_altitude,Experiments,6,4,3,Altitude,STEM Payload Sensor Altitude + +24,RT,Resets,12,-,12,NONE,3,2,3,Reset Count, Software Reset Count + +25,RT,RSSI,12,dBm,cubesatsim_rssi|INT,Radio,1,1,3,RSSI,Received Signal Strength Indication + +26,RT,IHUTemperature,12,C,cubesatsim_temperature,Computer Hardware,2,1,3,Temperature,Internal Temperature of IHU + +27,RT,SatelliteXAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,+X Panel,7,3,3,Rotation,Angular Veolcity around X Axis + +28,RT,SatelliteYAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,+Y Panel,8,3,3,Rotation,Angular Veolcity around Y Axis + +29,RT,SatelliteZAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,+Z Panel,9,3,3,Rotation,Angular Veolcity around Z Axis + +30,RT,Humidity,12,%,cubesatsim_temperature,Experiments,6,5,3,Humidity,Humidity + +31,RT,PSUCurrent,12,mA,cubesatsim_current,PSU,5,2,3,Current,Power Supply DC Current + +32,RT,Sensor1,12,signed raw,cubesatsim_sensor2|INT,Experiments,6,6,3,Sensor 1,STEM Payload Extra Sensor 1 + +33,RT,Sensor2,12,signed scaled,cubesatsim_sensor3|FLOAT2,Experiments,6,7,3,Sensor 2,STEM Payload Extra Sensor 2 + +34,RT,STEMPayloadStatus,1,-,17,Experiments,6,1,0,STEM Payload,STEM Payload Board Status + +35,RT,Nominal Mode,1,-,17,Computer Software,3,2,0,Nominal Mode, Nominal Mode (Not Safe Mode) + +36,RT,PayloadStatus1,1,-,17,NONE,6,7,0,Exp 2,STEM Payload status 1 failure indicator + +37,RT,PayloadStatus2,1,-,17,NONE,6,8,0,Exp 3,STEM Payload status 2 failure indicator + +38,RT,I2CBus0Failure,1,-,17,Computer Hardware,2,2,0,I2C Bus 0,I2C bus 0 failure indicator + +39,RT,I2CBus1Failure,1,-,17,Computer Hardware,2,3,0,I2C Bus 1,I2C bus 1 failure indicator + +40,RT,I2CBus3Failure,1,-,17,Computer Hardware,2,4,0,I2C Bus 3,I2C bus 3 failure indicator + +41,RT,CameraFailure,1,-,17,Computer Hardware,2,5,0,Camera,Camera failure indicator + +42,RT,GroundCommands,4,-,1,Computer Software,3,3,0,Ground Commands,Number of ground commands received + +43,RT,RXAntenna,1,-,16,Radio,1,3,0,RX Antenna,Receive antenna status + +44,RT,TXAntenna,1,-,16,Radio,1,2,0,TX Antenna,Transmit antenna status + +45,RT,Pad,58,-,0,NONE,0,0,0,NONE,NONE + From 269a1d7fbaefb9c7e2ca8e76600e09e01933b3ef Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 1 Jun 2021 17:17:50 -0400 Subject: [PATCH 223/252] back to 11a original --- .../FoxTelem_11a/CubeSatSim_maxtelemetry.csv | 94 +++++++++---------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/spacecraft/FoxTelem_11a/CubeSatSim_maxtelemetry.csv b/spacecraft/FoxTelem_11a/CubeSatSim_maxtelemetry.csv index c42b227d..b8440ecd 100644 --- a/spacecraft/FoxTelem_11a/CubeSatSim_maxtelemetry.csv +++ b/spacecraft/FoxTelem_11a/CubeSatSim_maxtelemetry.csv @@ -1,47 +1,47 @@ -46,TYPE,FIELD,BITS,UNIT,CONVERSION,MODULE,MODULE_NUM,MODULE_LINE,LINE_TYPE,SHOMAX_NAME,DESCRIPTION -0,MAX,BATT_A_V,12,V,cubesatsim_voltage|FLOAT2,NONE,0,0,3,Cell A,Battery A voltage (0-2.5V scale) -1,MAX,BATT_B_V,12,V,cubesatsim_voltage|FLOAT2,NONE,0,0,3,Cell A+B,Battery A+B voltage (0-3.3V scale) -2,MAX,BATT_V,12,V,cubesatsim_voltage|FLOAT2,NONE,4,1,3,Cell A+B+C Voltage,Battery A+B+C voltage (0-5.0V scale) -3,MAX,SatelliteXAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,7,4,3,Acceleration,Acceleration around X Axis -4,MAX,SatelliteYAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,8,4,3,Acceleration,Acceleration around Y Axis -5,MAX,SatelliteZAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,9,4,3,Acceleration,Acceleration around Z Axis -6,MAX,TOTAL_BATT_I,12,mA,cubesatsim_current,NONE,4,2,3,Current,Total Battery DC current -7,MAX,Temperature,12,C,cubesatsim_temperature,NONE,6,2,3,Temperature,STEM Payload Sensor Temperature -8,MAX,PANEL_PLUS_X_V,12,V,cubesatsim_voltage|FLOAT2,NONE,7,1,3,Voltage,+X Panel -9,MAX,PANEL_MINUS_X_V,12,V,cubesatsim_voltage|FLOAT2,NONE,10,1,3,Voltage,-X Panel -10,MAX,PANEL_PLUS_Y_V,12,V,cubesatsim_voltage|FLOAT2,NONE,8,1,3,Voltage,+Y Panel -11,MAX,PANEL_MINUS_Y_V,12,V,cubesatsim_voltage|FLOAT2,NONE,11,1,3,Voltage,-Y Panel -12,MAX,PANEL_PLUS_Z_V,12,V,cubesatsim_voltage|FLOAT2,NONE,9,1,3,Voltage,+Z Panel -13,MAX,PANEL_MINUS_Z_V,12,V,cubesatsim_voltage|FLOAT2,NONE,12,1,3,Voltage,-Z Panel -14,MAX,PANEL_PLUS_X_I,12,mA,cubesatsim_current,NONE,7,2,3,Current,+X Panel -15,MAX,PANEL_MINUS_X_I,12,mA,cubesatsim_current,NONE,10,2,3,Current,-X Panel -16,MAX,PANEL_PLUS_Y_I,12,mA,cubesatsim_current,NONE,8,2,3,Current,+Y Panel -17,MAX,PANEL_MINUS_Y_I,12,mA,cubesatsim_current,NONE,11,2,3,Current,-Y Panel -18,MAX,PANEL_PLUS_Z_I,12,mA,cubesatsim_current,NONE,9,2,3,Current,+Z Panel -19,MAX,PANEL_MINUS_Z_I,12,mA,cubesatsim_current,NONE,12,2,3,Current,-Z Panel -20,MAX,PSUVoltage,12,V,cubesatsim_voltage|FLOAT2,NONE,5,1,3,Voltage,Power Supply Voltage -21,MAX,SPIN,12,rpm,cubesatsim_rpm,NONE,3,1,3,Spacecraft Spin,Calculated spin rate using solar cells -22,MAX,Pressure,12,hPa,cubesatsim_pressure,NONE,6,3,3,Pressure,STEM Payload Sensor Pressure -23,MAX,Altitude,12,m,cubesatsim_altitude,NONE,6,4,3,Altitude,STEM Payload Sensor Altitude -24,MAX,Resets,12,-,12,NONE,3,2,3,Reset Count, Software Reset Count -25,MAX,RSSI,12,dBm,cubesatsim_rssi|INT,NONE,1,1,3,RSSI,Received Signal Strength Indication -26,MAX,IHUTemperature,12,C,cubesatsim_temperature,NONE,2,1,3,Temperature,Internal Temperature of IHU -27,MAX,SatelliteXAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,NONE,7,3,3,Rotation,Angular Veolcity around X Axis -28,MAX,SatelliteYAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,NONE,8,3,3,Rotation,Angular Veolcity around Y Axis -29,MAX,SatelliteZAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,NONE,9,3,3,Rotation,Angular Veolcity around Z Axis -30,MAX,Sensor1,12,raw,cubesatsim_temperature,NONE,6,5,3,Sensor 1,STEM Payload Extra Sensor 1 -31,MAX,PSUCurrent,12,mA,cubesatsim_current,NONE,5,2,3,Current,Power Supply DC Current -32,MAX,Sensor2,12,signed raw,cubesatsim_sensor2|INT,NONE,6,6,3,Sensor 2,STEM Payload Extra Sensor 2 -33,MAX,Sensor3,12,signed scaled,cubesatsim_sensor3|FLOAT2,NONE,6,7,3,Sensor 3,STEM Payload Extra Sensor 3 -34,MAX,STEMPayloadStatus,1,-,17,NONE,6,1,0,STEM Payload Status,STEM Payload Board Status -35,MAX,Nominal Mode,1,-,17,NONE,3,2,0,Nominal Mode, Nominal Mode (Not Safe Mode) -36,MAX,PayloadStatus1,1,-,17,NONE,6,7,0,Exp 2,STEM Payload status 1 failure indicator -37,MAX,PayloadStatus2,1,-,17,NONE,6,8,0,Exp 3,STEM Payload status 2 failure indicator -38,MAX,I2CBus0Failure,1,-,17,NONE,2,2,0,I2C Bus 0,I2C bus 0 failure indicator -39,MAX,I2CBus1Failure,1,-,17,NONE,2,3,0,I2C Bus 1,I2C bus 1 failure indicator -40,MAX,I2CBus3Failure,1,-,17,NONE,2,4,0,I2C Bus 3,I2C bus 3 failure indicator -41,MAX,CameraFailure,1,-,17,NONE,2,5,0,Camera,Camera failure indicator -42,MAX,GroundCommands,4,-,1,NONE,3,3,0,Ground Commands,Number of ground commands received -43,MAX,RXAntenna,1,-,16,NONE,1,3,0,RX Antenna,Receive antenna status -44,MAX,TXAntenna,1,-,16,NONE,1,2,0,TX Antenna,Transmit antenna status -45,MAX,Pad,58,-,0,NONE,0,0,0,NONE,NONE +46,TYPE,FIELD,BITS,UNIT,CONVERSION,MODULE,MODULE_NUM,MODULE_LINE,LINE_TYPE,SHOMAX_NAME,DESCRIPTION +0,MAX,BATT_A_V,12,V,cubesatsim_voltage|FLOAT2,NONE,0,0,3,Cell A,Battery A voltage (0-2.5V scale) +1,MAX,BATT_B_V,12,V,cubesatsim_voltage|FLOAT2,NONE,0,0,3,Cell A+B,Battery A+B voltage (0-3.3V scale) +2,MAX,BATT_V,12,V,cubesatsim_voltage|FLOAT2,NONE,4,1,3,Cell A+B+C Voltage,Battery A+B+C voltage (0-5.0V scale) +3,MAX,SatelliteXAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,7,4,3,Acceleration,Acceleration around X Axis +4,MAX,SatelliteYAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,8,4,3,Acceleration,Acceleration around Y Axis +5,MAX,SatelliteZAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,9,4,3,Acceleration,Acceleration around Z Axis +6,MAX,TOTAL_BATT_I,12,mA,cubesatsim_current,NONE,4,2,3,Current,Total Battery DC current +7,MAX,Temperature,12,C,cubesatsim_temperature,NONE,6,2,3,Temperature,STEM Payload Sensor Temperature +8,MAX,PANEL_PLUS_X_V,12,V,cubesatsim_voltage|FLOAT2,NONE,7,1,3,Voltage,+X Panel +9,MAX,PANEL_MINUS_X_V,12,V,cubesatsim_voltage|FLOAT2,NONE,10,1,3,Voltage,-X Panel +10,MAX,PANEL_PLUS_Y_V,12,V,cubesatsim_voltage|FLOAT2,NONE,8,1,3,Voltage,+Y Panel +11,MAX,PANEL_MINUS_Y_V,12,V,cubesatsim_voltage|FLOAT2,NONE,11,1,3,Voltage,-Y Panel +12,MAX,PANEL_PLUS_Z_V,12,V,cubesatsim_voltage|FLOAT2,NONE,9,1,3,Voltage,+Z Panel +13,MAX,PANEL_MINUS_Z_V,12,V,cubesatsim_voltage|FLOAT2,NONE,12,1,3,Voltage,-Z Panel +14,MAX,PANEL_PLUS_X_I,12,mA,cubesatsim_current,NONE,7,2,3,Current,+X Panel +15,MAX,PANEL_MINUS_X_I,12,mA,cubesatsim_current,NONE,10,2,3,Current,-X Panel +16,MAX,PANEL_PLUS_Y_I,12,mA,cubesatsim_current,NONE,8,2,3,Current,+Y Panel +17,MAX,PANEL_MINUS_Y_I,12,mA,cubesatsim_current,NONE,11,2,3,Current,-Y Panel +18,MAX,PANEL_PLUS_Z_I,12,mA,cubesatsim_current,NONE,9,2,3,Current,+Z Panel +19,MAX,PANEL_MINUS_Z_I,12,mA,cubesatsim_current,NONE,12,2,3,Current,-Z Panel +20,MAX,PSUVoltage,12,V,cubesatsim_voltage|FLOAT2,NONE,5,1,3,Voltage,Power Supply Voltage +21,MAX,SPIN,12,rpm,cubesatsim_rpm,NONE,3,1,3,Spacecraft Spin,Calculated spin rate using solar cells +22,MAX,Pressure,12,bar,cubesatsim_pressure,NONE,6,3,3,Pressure,STEM Payload Sensor Pressure +23,MAX,Altitude,12,m,cubesatsim_altitude,NONE,6,4,3,Altitude,STEM Payload Sensor Altitude +24,MAX,Resets,12,-,12,NONE,3,2,3,Reset Count, Software Reset Count +25,MAX,RSSI,12,dBm,cubesatsim_rssi|INT,NONE,1,1,3,RSSI,Received Signal Strength Indication +26,MAX,IHUTemperature,12,C,cubesatsim_temperature,NONE,2,1,3,Temperature,Internal Temperature of IHU +27,MAX,SatelliteXAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,NONE,7,3,3,Rotation,Angular Veolcity around X Axis +28,MAX,SatelliteYAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,NONE,8,3,3,Rotation,Angular Veolcity around Y Axis +29,MAX,SatelliteZAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,NONE,9,3,3,Rotation,Angular Veolcity around Z Axis +30,MAX,Sensor1,12,raw,cubesatsim_sensor1|INT,NONE,6,5,3,Sensor 1,STEM Payload Extra Sensor 1 +31,MAX,PSUCurrent,12,mA,cubesatsim_current,NONE,5,2,3,Current,Power Supply DC Current +32,MAX,Sensor2,12,signed raw,cubesatsim_sensor2|INT,NONE,6,6,3,Sensor 2,STEM Payload Extra Sensor 2 +33,MAX,Sensor3,12,signed scaled,cubesatsim_sensor3|FLOAT2,NONE,6,7,3,Sensor 3,STEM Payload Extra Sensor 3 +34,MAX,STEMPayloadStatus,1,-,17,NONE,6,1,0,STEM Payload Status,STEM Payload Board Status +35,MAX,Nominal Mode,1,-,17,NONE,3,2,0,Nominal Mode, Nominal Mode (Not Safe Mode) +36,MAX,PayloadStatus1,1,-,17,NONE,6,7,0,Exp 2,STEM Payload status 1 failure indicator +37,MAX,PayloadStatus2,1,-,17,NONE,6,8,0,Exp 3,STEM Payload status 2 failure indicator +38,MAX,I2CBus0Failure,1,-,17,NONE,2,2,0,I2C Bus 0,I2C bus 0 failure indicator +39,MAX,I2CBus1Failure,1,-,17,NONE,2,3,0,I2C Bus 1,I2C bus 1 failure indicator +40,MAX,I2CBus3Failure,1,-,17,NONE,2,4,0,I2C Bus 3,I2C bus 3 failure indicator +41,MAX,CameraFailure,1,-,17,NONE,2,5,0,Camera,Camera failure indicator +42,MAX,GroundCommands,4,-,1,NONE,3,3,0,Ground Commands,Number of ground commands received +43,MAX,RXAntenna,1,-,16,NONE,1,3,0,RX Antenna,Receive antenna status +44,MAX,TXAntenna,1,-,16,NONE,1,2,0,TX Antenna,Transmit antenna status +45,MAX,Pad,58,-,0,NONE,0,0,0,NONE,NONE From 84517246d219c771538a8a347b124f9d6a180767 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 1 Jun 2021 17:20:49 -0400 Subject: [PATCH 224/252] back to 11a original --- .../FoxTelem_11a/CubeSatSim_mintelemetry.csv | 94 +++++++++---------- .../FoxTelem_11a/CubeSatSim_rttelemetry.csv | 55 +---------- 2 files changed, 51 insertions(+), 98 deletions(-) diff --git a/spacecraft/FoxTelem_11a/CubeSatSim_mintelemetry.csv b/spacecraft/FoxTelem_11a/CubeSatSim_mintelemetry.csv index 343a8eb7..f09e5349 100644 --- a/spacecraft/FoxTelem_11a/CubeSatSim_mintelemetry.csv +++ b/spacecraft/FoxTelem_11a/CubeSatSim_mintelemetry.csv @@ -1,47 +1,47 @@ -46,TYPE,FIELD,BITS,UNIT,CONVERSION,MODULE,MODULE_NUM,MODULE_LINE,LINE_TYPE,SHOMIN_NAME,DESCRIPTION -0,MIN,BATT_A_V,12,V,cubesatsim_voltage|FLOAT2,NONE,0,0,3,Cell A,Battery A voltage (0-2.5V scale) -1,MIN,BATT_B_V,12,V,cubesatsim_voltage|FLOAT2,NONE,0,0,3,Cell A+B,Battery A+B voltage (0-3.3V scale) -2,MIN,BATT_V,12,V,cubesatsim_voltage|FLOAT2,NONE,4,1,3,Cell A+B+C Voltage,Battery A+B+C voltage (0-5.0V scale) -3,MIN,SatelliteXAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,7,4,3,Acceleration,Acceleration around X Axis -4,MIN,SatelliteYAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,8,4,3,Acceleration,Acceleration around Y Axis -5,MIN,SatelliteZAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,9,4,3,Acceleration,Acceleration around Z Axis -6,MIN,TOTAL_BATT_I,12,mA,cubesatsim_current,NONE,4,2,3,Current,Total Battery DC current -7,MIN,Temperature,12,C,cubesatsim_temperature,NONE,6,2,3,Temperature,STEM Payload Sensor Temperature -8,MIN,PANEL_PLUS_X_V,12,V,cubesatsim_voltage|FLOAT2,NONE,7,1,3,Voltage,+X Panel -9,MIN,PANEL_MINUS_X_V,12,V,cubesatsim_voltage|FLOAT2,NONE,10,1,3,Voltage,-X Panel -10,MIN,PANEL_PLUS_Y_V,12,V,cubesatsim_voltage|FLOAT2,NONE,8,1,3,Voltage,+Y Panel -11,MIN,PANEL_MINUS_Y_V,12,V,cubesatsim_voltage|FLOAT2,NONE,11,1,3,Voltage,-Y Panel -12,MIN,PANEL_PLUS_Z_V,12,V,cubesatsim_voltage|FLOAT2,NONE,9,1,3,Voltage,+Z Panel -13,MIN,PANEL_MINUS_Z_V,12,V,cubesatsim_voltage|FLOAT2,NONE,12,1,3,Voltage,-Z Panel -14,MIN,PANEL_PLUS_X_I,12,mA,cubesatsim_current,NONE,7,2,3,Current,+X Panel -15,MIN,PANEL_MINUS_X_I,12,mA,cubesatsim_current,NONE,10,2,3,Current,-X Panel -16,MIN,PANEL_PLUS_Y_I,12,mA,cubesatsim_current,NONE,8,2,3,Current,+Y Panel -17,MIN,PANEL_MINUS_Y_I,12,mA,cubesatsim_current,NONE,11,2,3,Current,-Y Panel -18,MIN,PANEL_PLUS_Z_I,12,mA,cubesatsim_current,NONE,9,2,3,Current,+Z Panel -19,MIN,PANEL_MINUS_Z_I,12,mA,cubesatsim_current,NONE,12,2,3,Current,-Z Panel -20,MIN,PSUVoltage,12,V,cubesatsim_voltage|FLOAT2,NONE,5,1,3,Voltage,Power Supply Voltage -21,MIN,SPIN,12,rpm,cubesatsim_rpm,NONE,3,1,3,Spacecraft Spin,Calculated spin rate using solar cells -22,MIN,Pressure,12,bar,cubesatsim_pressure,NONE,6,3,3,Pressure,STEM Payload Sensor Pressure -23,MIN,Altitude,12,m,cubesatsim_altitude,NONE,6,4,3,Altitude,STEM Payload Sensor Altitude -24,MIN,Resets,12,-,12,NONE,3,2,3,Reset Count, Software Reset Count -25,MIN,RSSI,12,dBm,cubesatsim_rssi|INT,NONE,1,1,3,RSSI,Received Signal Strength Indication -26,MIN,IHUTemperature,12,C,cubesatsim_temperature,NONE,2,1,3,Temperature,Internal Temperature of IHU -27,MIN,SatelliteXAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,NONE,7,3,3,Rotation,Angular Veolcity around X Axis -28,MIN,SatelliteYAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,NONE,8,3,3,Rotation,Angular Veolcity around Y Axis -29,MIN,SatelliteZAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,NONE,9,3,3,Rotation,Angular Veolcity around Z Axis -30,MIN,Sensor1,12,raw,cubesatsim_temperature,NONE,6,5,3,Sensor 1,STEM Payload Extra Sensor 1 -31,MIN,PSUCurrent,12,mA,cubesatsim_current,NONE,5,2,3,Current,Power Supply DC Current -32,MIN,Sensor2,12,signed raw,cubesatsim_sensor2|INT,NONE,6,6,3,Sensor 2,STEM Payload Extra Sensor 2 -33,MIN,Sensor3,12,signed scaled,cubesatsim_sensor3|FLOAT2,NONE,6,7,3,Sensor 3,STEM Payload Extra Sensor 3 -34,MIN,STEMPayloadStatus,1,-,17,NONE,6,1,0,STEM Payload Status,STEM Payload Board Status -35,MIN,Nominal Mode,1,-,17,NONE,3,2,0,Nominal Mode, Nominal Mode (Not Safe Mode) -36,MIN,PayloadStatus1,1,-,17,NONE,6,7,0,Exp 2,STEM Payload status 1 failure indicator -37,MIN,PayloadStatus2,1,-,17,NONE,6,8,0,Exp 3,STEM Payload status 2 failure indicator -38,MIN,I2CBus0Failure,1,-,17,NONE,2,2,0,I2C Bus 0,I2C bus 0 failure indicator -39,MIN,I2CBus1Failure,1,-,17,NONE,2,3,0,I2C Bus 1,I2C bus 1 failure indicator -40,MIN,I2CBus3Failure,1,-,17,NONE,2,4,0,I2C Bus 3,I2C bus 3 failure indicator -41,MIN,CameraFailure,1,-,17,NONE,2,5,0,Camera,Camera failure indicator -42,MIN,GroundCommands,4,-,1,NONE,3,3,0,Ground Commands,Number of ground commands received -43,MIN,RXAntenna,1,-,16,NONE,1,3,0,RX Antenna,Receive antenna status -44,MIN,TXAntenna,1,-,16,NONE,1,2,0,TX Antenna,Transmit antenna status -45,MIN,Pad,58,-,0,NONE,0,0,0,NONE,NONE +46,TYPE,FIELD,BITS,UNIT,CONVERSION,MODULE,MODULE_NUM,MODULE_LINE,LINE_TYPE,SHOMIN_NAME,DESCRIPTION +0,MIN,BATT_A_V,12,V,cubesatsim_voltage|FLOAT2,NONE,0,0,3,Cell A,Battery A voltage (0-2.5V scale) +1,MIN,BATT_B_V,12,V,cubesatsim_voltage|FLOAT2,NONE,0,0,3,Cell A+B,Battery A+B voltage (0-3.3V scale) +2,MIN,BATT_V,12,V,cubesatsim_voltage|FLOAT2,NONE,4,1,3,Cell A+B+C Voltage,Battery A+B+C voltage (0-5.0V scale) +3,MIN,SatelliteXAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,7,4,3,Acceleration,Acceleration around X Axis +4,MIN,SatelliteYAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,8,4,3,Acceleration,Acceleration around Y Axis +5,MIN,SatelliteZAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,9,4,3,Acceleration,Acceleration around Z Axis +6,MIN,TOTAL_BATT_I,12,mA,cubesatsim_current,NONE,4,2,3,Current,Total Battery DC current +7,MIN,Temperature,12,C,cubesatsim_temperature,NONE,6,2,3,Temperature,STEM Payload Sensor Temperature +8,MIN,PANEL_PLUS_X_V,12,V,cubesatsim_voltage|FLOAT2,NONE,7,1,3,Voltage,+X Panel +9,MIN,PANEL_MINUS_X_V,12,V,cubesatsim_voltage|FLOAT2,NONE,10,1,3,Voltage,-X Panel +10,MIN,PANEL_PLUS_Y_V,12,V,cubesatsim_voltage|FLOAT2,NONE,8,1,3,Voltage,+Y Panel +11,MIN,PANEL_MINUS_Y_V,12,V,cubesatsim_voltage|FLOAT2,NONE,11,1,3,Voltage,-Y Panel +12,MIN,PANEL_PLUS_Z_V,12,V,cubesatsim_voltage|FLOAT2,NONE,9,1,3,Voltage,+Z Panel +13,MIN,PANEL_MINUS_Z_V,12,V,cubesatsim_voltage|FLOAT2,NONE,12,1,3,Voltage,-Z Panel +14,MIN,PANEL_PLUS_X_I,12,mA,cubesatsim_current,NONE,7,2,3,Current,+X Panel +15,MIN,PANEL_MINUS_X_I,12,mA,cubesatsim_current,NONE,10,2,3,Current,-X Panel +16,MIN,PANEL_PLUS_Y_I,12,mA,cubesatsim_current,NONE,8,2,3,Current,+Y Panel +17,MIN,PANEL_MINUS_Y_I,12,mA,cubesatsim_current,NONE,11,2,3,Current,-Y Panel +18,MIN,PANEL_PLUS_Z_I,12,mA,cubesatsim_current,NONE,9,2,3,Current,+Z Panel +19,MIN,PANEL_MINUS_Z_I,12,mA,cubesatsim_current,NONE,12,2,3,Current,-Z Panel +20,MIN,PSUVoltage,12,V,cubesatsim_voltage|FLOAT2,NONE,5,1,3,Voltage,Power Supply Voltage +21,MIN,SPIN,12,rpm,cubesatsim_rpm,NONE,3,1,3,Spacecraft Spin,Calculated spin rate using solar cells +22,MIN,Pressure,12,bar,cubesatsim_pressure,NONE,6,3,3,Pressure,STEM Payload Sensor Pressure +23,MIN,Altitude,12,m,cubesatsim_altitude,NONE,6,4,3,Altitude,STEM Payload Sensor Altitude +24,MIN,Resets,12,-,12,NONE,3,2,3,Reset Count, Software Reset Count +25,MIN,RSSI,12,dBm,cubesatsim_rssi|INT,NONE,1,1,3,RSSI,Received Signal Strength Indication +26,MIN,IHUTemperature,12,C,cubesatsim_temperature,NONE,2,1,3,Temperature,Internal Temperature of IHU +27,MIN,SatelliteXAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,NONE,7,3,3,Rotation,Angular Veolcity around X Axis +28,MIN,SatelliteYAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,NONE,8,3,3,Rotation,Angular Veolcity around Y Axis +29,MIN,SatelliteZAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,NONE,9,3,3,Rotation,Angular Veolcity around Z Axis +30,MIN,Sensor1,12,raw,cubesatsim_sensor1|INT,NONE,6,5,3,Sensor 1,STEM Payload Extra Sensor 1 +31,MIN,PSUCurrent,12,mA,cubesatsim_current,NONE,5,2,3,Current,Power Supply DC Current +32,MIN,Sensor2,12,signed raw,cubesatsim_sensor2|INT,NONE,6,6,3,Sensor 2,STEM Payload Extra Sensor 2 +33,MIN,Sensor3,12,signed scaled,cubesatsim_sensor3|FLOAT2,NONE,6,7,3,Sensor 3,STEM Payload Extra Sensor 3 +34,MIN,STEMPayloadStatus,1,-,17,NONE,6,1,0,STEM Payload Status,STEM Payload Board Status +35,MIN,Nominal Mode,1,-,17,NONE,3,2,0,Nominal Mode, Nominal Mode (Not Safe Mode) +36,MIN,PayloadStatus1,1,-,17,NONE,6,7,0,Exp 2,STEM Payload status 1 failure indicator +37,MIN,PayloadStatus2,1,-,17,NONE,6,8,0,Exp 3,STEM Payload status 2 failure indicator +38,MIN,I2CBus0Failure,1,-,17,NONE,2,2,0,I2C Bus 0,I2C bus 0 failure indicator +39,MIN,I2CBus1Failure,1,-,17,NONE,2,3,0,I2C Bus 1,I2C bus 1 failure indicator +40,MIN,I2CBus3Failure,1,-,17,NONE,2,4,0,I2C Bus 3,I2C bus 3 failure indicator +41,MIN,CameraFailure,1,-,17,NONE,2,5,0,Camera,Camera failure indicator +42,MIN,GroundCommands,4,-,1,NONE,3,3,0,Ground Commands,Number of ground commands received +43,MIN,RXAntenna,1,-,16,NONE,1,3,0,RX Antenna,Receive antenna status +44,MIN,TXAntenna,1,-,16,NONE,1,2,0,TX Antenna,Transmit antenna status +45,MIN,Pad,58,-,0,NONE,0,0,0,NONE,NONE diff --git a/spacecraft/FoxTelem_11a/CubeSatSim_rttelemetry.csv b/spacecraft/FoxTelem_11a/CubeSatSim_rttelemetry.csv index 1db3c20c..129c5153 100644 --- a/spacecraft/FoxTelem_11a/CubeSatSim_rttelemetry.csv +++ b/spacecraft/FoxTelem_11a/CubeSatSim_rttelemetry.csv @@ -1,94 +1,47 @@ 46,TYPE,FIELD,BITS,UNIT,CONVERSION,MODULE,MODULE_NUM,MODULE_LINE,LINE_TYPE,SHORT_NAME,DESCRIPTION - 0,RT,BATT_A_V,12,V,cubesatsim_voltage|FLOAT2,NONE,0,0,3,Cell A,Battery A voltage (0-2.5V scale) - 1,RT,BATT_B_V,12,V,cubesatsim_voltage|FLOAT2,NONE,0,0,3,Cell A+B,Battery A+B voltage (0-3.3V scale) - 2,RT,BATT_V,12,V,cubesatsim_voltage|FLOAT2,Battery,4,1,3,Cell A+B+C Voltage,Battery A+B+C voltage (0-5.0V scale) - 3,RT,SatelliteXAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,+X Panel,7,4,3,Acceleration,Acceleration around X Axis - 4,RT,SatelliteYAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,+Y Panel,8,4,3,Acceleration,Acceleration around Y Axis - 5,RT,SatelliteZAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,+Z Panel,9,4,3,Acceleration,Acceleration around Z Axis - 6,RT,TOTAL_BATT_I,12,mA,cubesatsim_current,Battery,4,2,3,Current,Total Battery DC current - 7,RT,Temperature,12,C,cubesatsim_temperature,Experiments,6,2,3,Temperature,STEM Payload Sensor Temperature - 8,RT,PANEL_PLUS_X_V,12,V,cubesatsim_voltage|FLOAT2,+X Panel,7,1,3,Voltage,+X Panel - 9,RT,PANEL_MINUS_X_V,12,V,cubesatsim_voltage|FLOAT2,-X Panel,10,1,3,Voltage,-X Panel - 10,RT,PANEL_PLUS_Y_V,12,V,cubesatsim_voltage|FLOAT2,+Y Panel,8,1,3,Voltage,+Y Panel - 11,RT,PANEL_MINUS_Y_V,12,V,cubesatsim_voltage|FLOAT2,-Y Panel,11,1,3,Voltage,-Y Panel - 12,RT,PANEL_PLUS_Z_V,12,V,cubesatsim_voltage|FLOAT2,+Z Panel,9,1,3,Voltage,+Z Panel - 13,RT,PANEL_MINUS_Z_V,12,V,cubesatsim_voltage|FLOAT2,-Z Panel,12,1,3,Voltage,-Z Panel - 14,RT,PANEL_PLUS_X_I,12,mA,cubesatsim_current,+X Panel,7,2,3,Current,+X Panel - 15,RT,PANEL_MINUS_X_I,12,mA,cubesatsim_current,-X Panel,10,2,3,Current,-X Panel - 16,RT,PANEL_PLUS_Y_I,12,mA,cubesatsim_current,+Y Panel,8,2,3,Current,+Y Panel - 17,RT,PANEL_MINUS_Y_I,12,mA,cubesatsim_current,-Y Panel,11,2,3,Current,-Y Panel - 18,RT,PANEL_PLUS_Z_I,12,mA,cubesatsim_current,+Z Panel,9,2,3,Current,+Z Panel - 19,RT,PANEL_MINUS_Z_I,12,mA,cubesatsim_current,-Z Panel,12,2,3,Current,-Z Panel - 20,RT,PSUVoltage,12,V,cubesatsim_voltage|FLOAT2,PSU,5,1,3,Voltage,Power Supply Voltage - 21,RT,SPIN,12,rpm,cubesatsim_rpm,Computer Software,3,1,3,Spacecraft Spin,Calculated spin rate using solar cells - -22,RT,Pressure,12,hPa,cubesatsim_pressure,Experiments,6,3,3,Pressure,STEM Payload Sensor Pressure - +22,RT,Pressure,12,bar,cubesatsim_pressure,Experiments,6,3,3,Pressure,STEM Payload Sensor Pressure 23,RT,Altitude,12,m,cubesatsim_altitude,Experiments,6,4,3,Altitude,STEM Payload Sensor Altitude - 24,RT,Resets,12,-,12,NONE,3,2,3,Reset Count, Software Reset Count - 25,RT,RSSI,12,dBm,cubesatsim_rssi|INT,Radio,1,1,3,RSSI,Received Signal Strength Indication - 26,RT,IHUTemperature,12,C,cubesatsim_temperature,Computer Hardware,2,1,3,Temperature,Internal Temperature of IHU - 27,RT,SatelliteXAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,+X Panel,7,3,3,Rotation,Angular Veolcity around X Axis - 28,RT,SatelliteYAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,+Y Panel,8,3,3,Rotation,Angular Veolcity around Y Axis - 29,RT,SatelliteZAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,+Z Panel,9,3,3,Rotation,Angular Veolcity around Z Axis - -30,RT,Humidity,12,%,cubesatsim_temperature,Experiments,6,5,3,Humidity,Humidity - +30,RT,Sensor1,12,raw,cubesatsim_sensor1|INT,Experiments,6,5,3,Sensor 1,STEM Payload Extra Sensor 1 31,RT,PSUCurrent,12,mA,cubesatsim_current,PSU,5,2,3,Current,Power Supply DC Current - -32,RT,Sensor1,12,signed raw,cubesatsim_sensor2|INT,Experiments,6,6,3,Sensor 1,STEM Payload Extra Sensor 1 - -33,RT,Sensor2,12,signed scaled,cubesatsim_sensor3|FLOAT2,Experiments,6,7,3,Sensor 2,STEM Payload Extra Sensor 2 - +32,RT,Sensor2,12,signed raw,cubesatsim_sensor2|INT,Experiments,6,6,3,Sensor 2,STEM Payload Extra Sensor 2 +33,RT,Sensor3,12,signed scaled,cubesatsim_sensor3|FLOAT2,Experiments,6,7,3,Sensor 3,STEM Payload Extra Sensor 3 34,RT,STEMPayloadStatus,1,-,17,Experiments,6,1,0,STEM Payload,STEM Payload Board Status - 35,RT,Nominal Mode,1,-,17,Computer Software,3,2,0,Nominal Mode, Nominal Mode (Not Safe Mode) - 36,RT,PayloadStatus1,1,-,17,NONE,6,7,0,Exp 2,STEM Payload status 1 failure indicator - 37,RT,PayloadStatus2,1,-,17,NONE,6,8,0,Exp 3,STEM Payload status 2 failure indicator - 38,RT,I2CBus0Failure,1,-,17,Computer Hardware,2,2,0,I2C Bus 0,I2C bus 0 failure indicator - 39,RT,I2CBus1Failure,1,-,17,Computer Hardware,2,3,0,I2C Bus 1,I2C bus 1 failure indicator - 40,RT,I2CBus3Failure,1,-,17,Computer Hardware,2,4,0,I2C Bus 3,I2C bus 3 failure indicator - 41,RT,CameraFailure,1,-,17,Computer Hardware,2,5,0,Camera,Camera failure indicator - 42,RT,GroundCommands,4,-,1,Computer Software,3,3,0,Ground Commands,Number of ground commands received - 43,RT,RXAntenna,1,-,16,Radio,1,3,0,RX Antenna,Receive antenna status - 44,RT,TXAntenna,1,-,16,Radio,1,2,0,TX Antenna,Transmit antenna status - 45,RT,Pad,58,-,0,NONE,0,0,0,NONE,NONE - From 54d8656e6f52837be9fe4d37852039bde3977bdc Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 1 Jun 2021 17:22:26 -0400 Subject: [PATCH 225/252] changed Humidity and Sensor 1 and 2 --- spacecraft/FoxTelem_11a/CubeSatSim_rttelemetry.csv | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spacecraft/FoxTelem_11a/CubeSatSim_rttelemetry.csv b/spacecraft/FoxTelem_11a/CubeSatSim_rttelemetry.csv index 129c5153..ba967900 100644 --- a/spacecraft/FoxTelem_11a/CubeSatSim_rttelemetry.csv +++ b/spacecraft/FoxTelem_11a/CubeSatSim_rttelemetry.csv @@ -29,10 +29,10 @@ 27,RT,SatelliteXAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,+X Panel,7,3,3,Rotation,Angular Veolcity around X Axis 28,RT,SatelliteYAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,+Y Panel,8,3,3,Rotation,Angular Veolcity around Y Axis 29,RT,SatelliteZAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,+Z Panel,9,3,3,Rotation,Angular Veolcity around Z Axis -30,RT,Sensor1,12,raw,cubesatsim_sensor1|INT,Experiments,6,5,3,Sensor 1,STEM Payload Extra Sensor 1 +30,RT,Humidity,12,%,cubesatsim_sensor1|INT,Experiments,6,5,3,Humidity,Humidity 31,RT,PSUCurrent,12,mA,cubesatsim_current,PSU,5,2,3,Current,Power Supply DC Current -32,RT,Sensor2,12,signed raw,cubesatsim_sensor2|INT,Experiments,6,6,3,Sensor 2,STEM Payload Extra Sensor 2 -33,RT,Sensor3,12,signed scaled,cubesatsim_sensor3|FLOAT2,Experiments,6,7,3,Sensor 3,STEM Payload Extra Sensor 3 +32,RT,Sensor1,12,signed raw,cubesatsim_sensor2|INT,Experiments,6,6,3,Sensor 1,STEM Payload Extra Sensor 1 +33,RT,Sensor2,12,signed scaled,cubesatsim_sensor3|FLOAT2,Experiments,6,7,3,Sensor 2,STEM Payload Extra Sensor 2 34,RT,STEMPayloadStatus,1,-,17,Experiments,6,1,0,STEM Payload,STEM Payload Board Status 35,RT,Nominal Mode,1,-,17,Computer Software,3,2,0,Nominal Mode, Nominal Mode (Not Safe Mode) 36,RT,PayloadStatus1,1,-,17,NONE,6,7,0,Exp 2,STEM Payload status 1 failure indicator From e5fdf52c674b5e732052dc5be418de8ff837bfd3 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 1 Jun 2021 17:27:01 -0400 Subject: [PATCH 226/252] original 11a files --- .../CubeSatSim_PSK_maxtelemetry.csv | 61 +++++++++++++++++++ .../CubeSatSim_PSK_mintelemetry.csv | 61 +++++++++++++++++++ 2 files changed, 122 insertions(+) create mode 100644 spacecraft/FoxTelem_11a/CubeSatSim_PSK_maxtelemetry.csv create mode 100644 spacecraft/FoxTelem_11a/CubeSatSim_PSK_mintelemetry.csv diff --git a/spacecraft/FoxTelem_11a/CubeSatSim_PSK_maxtelemetry.csv b/spacecraft/FoxTelem_11a/CubeSatSim_PSK_maxtelemetry.csv new file mode 100644 index 00000000..3b7d4c90 --- /dev/null +++ b/spacecraft/FoxTelem_11a/CubeSatSim_PSK_maxtelemetry.csv @@ -0,0 +1,61 @@ +60,TYPE,FIELD,BITS,UNIT,CONVERSION,MODULE,MODULE_NUM,MODULE_LINE,LINE_TYPE,SHORT_NAME,DESCRIPTION +0,MAX,BATT_A_V,12,V,4,NONE,4,1,3,Cell A,Battery pair A voltage (0-2.5V scale) +1,MAX,BATT_B_V,12,V,4,NONE,4,2,3,Cell A + B,Battery pairs A+B voltage (0-3.3V scale) +2,MAX,BATT_V,12,V,cubesatsim_voltage|FLOAT2,NONE,4,1,3,Cell A+B+C Voltage,Battery A+B+C voltage (0-5.0V scale) +3,MAX,SatelliteXAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,7,4,3,Acceleration,Acceleration around X Axis +4,MAX,SatelliteYAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,8,4,3,Acceleration,Acceleration around Y Axis +5,MAX,SatelliteZAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,9,4,3,Acceleration,Acceleration around Z Axis +6,MAX,battCurr,12,mA,cubesatsim_current,NONE,4,2,4,Current,Total Battery DC current +7,MAX,Temperature,12,C,cubesatsim_temperature,NONE,6,2,3,Temp,STEM Payload Sensor Temperature +8,MAX,posXv,12,V,cubesatsim_voltage|FLOAT2,NONE,7,1,3,Voltage,+X solar Panel voltage +9,MAX,posYv,12,V,cubesatsim_voltage|FLOAT2,NONE,8,1,3,Voltage,+Y solar Panel voltage +10,MAX,posZv,12,V,cubesatsim_voltage|FLOAT2,NONE,9,1,3,Voltage,+Z solar Panel voltage +11,MAX,negXv,12,V,cubesatsim_voltage|FLOAT2,NONE,10,1,3,Voltage,-X solar Panel voltage +12,MAX,negYv,12,V,cubesatsim_voltage|FLOAT2,NONE,11,1,3,Voltage,-Y solar Panel voltage +13,MAX,negZv,12,V,cubesatsim_voltage|FLOAT2,NONE,12,1,3,Voltage,-Z solar Panel voltage +14,MAX,posXi,12,mA,cubesatsim_current,NONE,7,2,4,Current,+X solar Panel current +15,MAX,posYi,12,mA,cubesatsim_current,NONE,8,2,4,Current,+Y solar Panel current +16,MAX,posZi,12,mA,cubesatsim_current,NONE,9,2,4,Current,+Z solar Panel current +17,MAX,negXi,12,mA,cubesatsim_current,NONE,10,2,4,Current,-X solar Panel current +18,MAX,negYi,12,mA,cubesatsim_current,NONE,11,2,4,Current,-Y solar Panel current +19,MAX,negZi,12,mA,cubesatsim_current,NONE,12,2,4,Current,-Z solar Panel current +20,MAX,PSUVoltage,12,V,cubesatsim_voltage|FLOAT2,NONE,5,1,3,Board Voltage,Power Supply Voltage +21,MAX,spin,12,rpm,cubesatsim_rpm,NONE,3,1,3,Spacecraft Spin,Calculated spin rate using solar cells +22,MAX,Pressure,12,bar,cubesatsim_pressure,NONE,6,3,3,Pressure,STEM Payload Sensor Pressure +23,MAX,Altitude,12,m,cubesatsim_altitude,NONE,6,4,3,Altitude,STEM Payload Sensor Altitude +24,MAX,Resets,12,-,12,NONE,3,2,3,Reset Count, Software Reset Count +25,MAX,rssi,12,dBm,cubesatsim_rssi|INT,NONE,1,1,3,RSSI,Received Signal Strength Indication +26,MAX,IHUcpuTemp,12,C,cubesatsim_temperature,NONE,2,1,3,Temperature,Internal Temperature of IHU +27,MAX,SatelliteXAxisAngularVelocity,12,dps,cubesatsim_rotation,NONE,7,3,3,Rotation,Angular Veolcity around X Axis +28,MAX,SatelliteYAxisAngularVelocity,12,dps,cubesatsim_rotation,NONE,8,3,3,Rotation,Angular Veolcity around Y Axis +29,MAX,SatelliteZAxisAngularVelocity,12,dps,cubesatsim_rotation,NONE,9,3,3,Rotation,Angular Veolcity around Z Axis +30,MAX,Sensor1,12,raw,cubesatsim_sensor1|INT,NONE,6,5,3,Sensor 1,STEM Payload Extra Sensor 1 +31,MAX,PSUCurrent,12,mA,cubesatsim_current,NONE,5,2,3,Current,Power Supply DC Current +32,MAX,Sensor2,12,signed raw,cubesatsim_sensor2|INT,NONE,6,6,3,Sensor 2,STEM Payload Extra Sensor 2 +33,MAX,Sensor3,12,signed raw,cubesatsim_sensor3|FLOAT2,NONE,6,7,3,Sensor 3,STEM Payload Extra Sensor 3 +34,MAX,ICR3VProt,12,V,43,NONE,7,2,3,3V Prot,ICR 3V Proteted +35,MAX,ICR2dot5V,12,V,43,NONE,7,3,3,2.5V,ICR 2.5V +36,MAX,ICR2dot5VProt,12,V,43,NONE,7,4,3,2.5V Prot,ICR 2.5V Protected +37,MAX,rf6,12,-,0,NONE,0,0,0,None,None +38,MAX,rf7,12,-,0,NONE,0,0,0,None,None +39,MAX,MuxTest,12,V,43,NONE,7,5,3,Sensor Power,Sensor Power Voltage at the ICR +40,MAX,LtVGACtl,12,V,42,NONE,1,4,3,VGA Control,Control Voltage to the Variable Gain Amplifier (VGA) +41,MAX,pad,4,-,34,NONE,0,0,0,None,Unused +42,MAX,IHUdiagData,32,-,18,NONE,3,2,0,Diagnostic Info,Diagnostic Data on IHU Performance +43,MAX,STEMPayloadStatus,1,-,17,NONE,6,1,0,STEM Payload Status, STEM Payload STEM Payload Board Failure Indicator +44,MAX,Nominal Mode,1,-,17,NONE,3,2,0,Nominal Mode, Nominal Mode (Not Safe Mode) +45,MAX,expFailure2,1,-,17,NONE,6,7,0,Exp 2,Experiment 2 Failure Indicator +46,MAX,expFailure3,1,-,17,NONE,6,8,0,Exp 3,Experiment 3 Failure Indicator +47,MAX,I2CfailureBatt,1,-,17,NONE,2,2,0,Battery I2C,Battery I2C Bus failure indicator +48,MAX,I2CfailurePSU1,1,-,17,NONE,2,3,0,PSU1 I2C,PSU2 I2C Bus failure indicator +49,MAX,I2CfailurePSU2,1,-,17,NONE,2,4,0,PSU2 I2C,PSU2 I2C Bus failure indicator +50,MAX,TLMresets,4,-,1,NONE,2,6,0,Ground Resets,Number of times command stations reset stored telemetry +51,MAX,RxAntDeploy,1,-,16,NONE,1,3,0,RX Antenna,2m Antenna status +52,MAX,TxAntDeploy,2,-,16,NONE,1,2,0,TX Antenna,70cm Antenna status +53,MAX,I2CfailureRF,1,-,17,NONE,2,5,0,RF I2C,RF I2C Bus failure indicator +54,MAX,pad1,1,-,0,NONE,0,0,0,NONE,Filler +55,MAX,wodSize,8,000s,36,NONE,3,3,0,WOD Stored,Number of WOD data payloads kept for each of Science and Housekeeping. In hundreds +56,MAX,swCmds,32,-,35,NONE,7,6,0,Diagnostic,ICR Diagnostic information +57,MAX,hwCmdCnt,6,-,1,NONE,7,7,0,HW Command Count,Number of hardware commands since last reset +58,MAX,swCmdCnt,6,-,1,NONE,7,8,0,SW Command Count,Number of software commands since last reset +59,MAX,pad2,28,-,0,NONE,0,0,0,NONE,Filler diff --git a/spacecraft/FoxTelem_11a/CubeSatSim_PSK_mintelemetry.csv b/spacecraft/FoxTelem_11a/CubeSatSim_PSK_mintelemetry.csv new file mode 100644 index 00000000..174cb667 --- /dev/null +++ b/spacecraft/FoxTelem_11a/CubeSatSim_PSK_mintelemetry.csv @@ -0,0 +1,61 @@ +60,TYPE,FIELD,BITS,UNIT,CONVERSION,MODULE,MODULE_NUM,MODULE_LINE,LINE_TYPE,SHORT_NAME,DESCRIPTION +0,MIN,BATT_A_V,12,V,4,NONE,4,1,3,Cell A,Battery pair A voltage (0-2.5V scale) +1,MIN,BATT_B_V,12,V,4,NONE,4,2,3,Cell A + B,Battery pairs A+B voltage (0-3.3V scale) +2,MIN,BATT_V,12,V,cubesatsim_voltage|FLOAT2,NONE,4,1,3,Cell A+B+C Voltage,Battery A+B+C voltage (0-5.0V scale) +3,MIN,SatelliteXAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,7,4,3,Acceleration,Acceleration around X Axis +4,MIN,SatelliteYAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,8,4,3,Acceleration,Acceleration around Y Axis +5,MIN,SatelliteZAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,9,4,3,Acceleration,Acceleration around Z Axis +6,MIN,battCurr,12,mA,cubesatsim_current,NONE,4,2,4,Current,Total Battery DC current +7,MIN,Temperature,12,C,cubesatsim_temperature,NONE,6,2,3,Temp,STEM Payload Sensor Temperature +8,MIN,posXv,12,V,cubesatsim_voltage|FLOAT2,NONE,7,1,3,Voltage,+X solar Panel voltage +9,MIN,posYv,12,V,cubesatsim_voltage|FLOAT2,NONE,8,1,3,Voltage,+Y solar Panel voltage +10,MIN,posZv,12,V,cubesatsim_voltage|FLOAT2,NONE,9,1,3,Voltage,+Z solar Panel voltage +11,MIN,negXv,12,V,cubesatsim_voltage|FLOAT2,NONE,10,1,3,Voltage,-X solar Panel voltage +12,MIN,negYv,12,V,cubesatsim_voltage|FLOAT2,NONE,11,1,3,Voltage,-Y solar Panel voltage +13,MIN,negZv,12,V,cubesatsim_voltage|FLOAT2,NONE,12,1,3,Voltage,-Z solar Panel voltage +14,MIN,posXi,12,mA,cubesatsim_current,NONE,7,2,4,Current,+X solar Panel current +15,MIN,posYi,12,mA,cubesatsim_current,NONE,8,2,4,Current,+Y solar Panel current +16,MIN,posZi,12,mA,cubesatsim_current,NONE,9,2,4,Current,+Z solar Panel current +17,MIN,negXi,12,mA,cubesatsim_current,NONE,10,2,4,Current,-X solar Panel current +18,MIN,negYi,12,mA,cubesatsim_current,NONE,11,2,4,Current,-Y solar Panel current +19,MIN,negZi,12,mA,cubesatsim_current,NONE,12,2,4,Current,-Z solar Panel current +20,MIN,PSUVoltage,12,V,cubesatsim_voltage|FLOAT2,NONE,5,1,3,Board Voltage,Power Supply Voltage +21,MIN,spin,12,rpm,cubesatsim_rpm,NONE,3,1,3,Spacecraft Spin,Calculated spin rate using solar cells +22,MIN,Pressure,12,bar,cubesatsim_pressure,NONE,6,3,3,Pressure,STEM Payload Sensor Pressure +23,MIN,Altitude,12,m,cubesatsim_altitude,NONE,6,4,3,Altitude,STEM Payload Sensor Altitude +24,MIN,Resets,12,-,12,NONE,3,2,3,Reset Count, Software Reset Count +25,MIN,rssi,12,dBm,cubesatsim_rssi|INT,NONE,1,1,3,RSSI,Received Signal Strength Indication +26,MIN,IHUcpuTemp,12,C,cubesatsim_temperature,NONE,2,1,3,Temperature,Internal Temperature of IHU +27,MIN,SatelliteXAxisAngularVelocity,12,dps,cubesatsim_rotation,NONE,7,3,3,Rotation,Angular Veolcity around X Axis +28,MIN,SatelliteYAxisAngularVelocity,12,dps,cubesatsim_rotation,NONE,8,3,3,Rotation,Angular Veolcity around Y Axis +29,MIN,SatelliteZAxisAngularVelocity,12,dps,cubesatsim_rotation,NONE,9,3,3,Rotation,Angular Veolcity around Z Axis +30,MIN,Sensor1,12,raw,cubesatsim_sensor1|INT,NONE,6,5,3,Sensor 1,STEM Payload Extra Sensor 1 +31,MIN,PSUCurrent,12,mA,cubesatsim_current,NONE,5,2,3,Current,Power Supply DC Current +32,MIN,Sensor2,12,signed raw,cubesatsim_sensor2|INT,NONE,6,6,3,Sensor 2,STEM Payload Extra Sensor 2 +33,MIN,Sensor3,12,signed raw,cubesatsim_sensor3|FLOAT2,NONE,6,7,3,Sensor 3,STEM Payload Extra Sensor 3 +34,MIN,ICR3VProt,12,V,43,NONE,7,2,3,3V Prot,ICR 3V Proteted +35,MIN,ICR2dot5V,12,V,43,NONE,7,3,3,2.5V,ICR 2.5V +36,MIN,ICR2dot5VProt,12,V,43,NONE,7,4,3,2.5V Prot,ICR 2.5V Protected +37,MIN,rf6,12,-,0,NONE,0,0,0,None,None +38,MIN,rf7,12,-,0,NONE,0,0,0,None,None +39,MIN,MuxTest,12,V,43,NONE,7,5,3,Sensor Power,Sensor Power Voltage at the ICR +40,MIN,LtVGACtl,12,V,42,NONE,1,4,3,VGA Control,Control Voltage to the Variable Gain Amplifier (VGA) +41,MIN,pad,4,-,34,NONE,0,0,0,None,Unused +42,MIN,IHUdiagData,32,-,18,NONE,3,2,0,Diagnostic Info,Diagnostic Data on IHU Performance +43,MIN,STEMPayloadStatus,1,-,17,NONE,6,1,0,STEM Payload Status, STEM Payload STEM Payload Board Failure Indicator +44,MIN,Nominal Mode,1,-,17,NONE,3,2,0,Nominal Mode, Nominal Mode (Not Safe Mode) +45,MIN,expFailure2,1,-,17,NONE,6,7,0,Exp 2,Experiment 2 Failure Indicator +46,MIN,expFailure3,1,-,17,NONE,6,8,0,Exp 3,Experiment 3 Failure Indicator +47,MIN,I2CfailureBatt,1,-,17,NONE,2,2,0,Battery I2C,Battery I2C Bus failure indicator +48,MIN,I2CfailurePSU1,1,-,17,NONE,2,3,0,PSU1 I2C,PSU2 I2C Bus failure indicator +49,MIN,I2CfailurePSU2,1,-,17,NONE,2,4,0,PSU2 I2C,PSU2 I2C Bus failure indicator +50,MIN,TLMresets,4,-,1,NONE,2,6,0,Ground Resets,Number of times command stations reset stored telemetry +51,MIN,RxAntDeploy,1,-,16,NONE,1,3,0,RX Antenna,2m Antenna status +52,MIN,TxAntDeploy,2,-,16,NONE,1,2,0,TX Antenna,70cm Antenna status +53,MIN,I2CfailureRF,1,-,17,NONE,2,5,0,RF I2C,RF I2C Bus failure indicator +54,MIN,pad1,1,-,0,NONE,0,0,0,NONE,Filler +55,MIN,wodSize,8,000s,36,NONE,3,3,0,WOD Stored,Number of WOD data payloads kept for each of Science and Housekeeping. In hundreds +56,MIN,swCmds,32,-,35,NONE,7,6,0,Diagnostic,ICR Diagnostic information +57,MIN,hwCmdCnt,6,-,1,NONE,7,7,0,HW Command Count,Number of hardware commands since last reset +58,MIN,swCmdCnt,6,-,1,NONE,7,8,0,SW Command Count,Number of software commands since last reset +59,MIN,pad2,28,-,0,NONE,0,0,0,NONE,Filler \ No newline at end of file From 3137cac7f04c79e53fdd15ddeb7567a6e4a03e96 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 1 Jun 2021 17:30:43 -0400 Subject: [PATCH 227/252] changed humidity to 1 decimal place like temperature --- spacecraft/FoxTelem_11a/CubeSatSim_PSK_rttelemetry.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacecraft/FoxTelem_11a/CubeSatSim_PSK_rttelemetry.csv b/spacecraft/FoxTelem_11a/CubeSatSim_PSK_rttelemetry.csv index 00dd00ff..0700b355 100644 --- a/spacecraft/FoxTelem_11a/CubeSatSim_PSK_rttelemetry.csv +++ b/spacecraft/FoxTelem_11a/CubeSatSim_PSK_rttelemetry.csv @@ -29,7 +29,7 @@ 27,realTime,SatelliteXAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,+X Panel,7,3,3,Rotation,Angular veolcity around X Axis 28,realTime,SatelliteYAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,+Y Panel,8,3,3,Rotation,Angular veolcity around Y Axis 29,realTime,SatelliteZAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,+Z Panel,9,3,3,Rotation,Angular veolcity around Z Axis -30,realTime,Humidity,12,%,cubesatsim_sensor1|INT,Experiments,6,5,3,Humidity,Humidity +30,realTime,Humidity,12,%,cubesatsim_temperature,Experiments,6,5,3,Humidity,Humidity 31,realTime,PSUCurrent,12,mA,cubesatsim_current,PSU,5,2,3,Current,Power Supply DC Current 32,realTime,Sensor1,12,signed raw,cubesatsim_sensor2|INT,Experiments,6,6,3,Sensor 1,STEM Payload extra Sensor 1 33,realTime,Sensor2,12,signed scaled,cubesatsim_sensor3|FLOAT2,Experiments,6,7,3,Sensor 2,STEM Payload extra Sensor 2 From 73b69dfccbf362e58054f94fc914b88b2f9664cb Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 1 Jun 2021 17:34:46 -0400 Subject: [PATCH 228/252] 4 to 3, Humidity, Sensor 1 & 2 --- .../CubeSatSim_PSK_maxtelemetry.csv | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/spacecraft/FoxTelem_11a/CubeSatSim_PSK_maxtelemetry.csv b/spacecraft/FoxTelem_11a/CubeSatSim_PSK_maxtelemetry.csv index 3b7d4c90..ed08d88b 100644 --- a/spacecraft/FoxTelem_11a/CubeSatSim_PSK_maxtelemetry.csv +++ b/spacecraft/FoxTelem_11a/CubeSatSim_PSK_maxtelemetry.csv @@ -5,7 +5,7 @@ 3,MAX,SatelliteXAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,7,4,3,Acceleration,Acceleration around X Axis 4,MAX,SatelliteYAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,8,4,3,Acceleration,Acceleration around Y Axis 5,MAX,SatelliteZAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,9,4,3,Acceleration,Acceleration around Z Axis -6,MAX,battCurr,12,mA,cubesatsim_current,NONE,4,2,4,Current,Total Battery DC current +6,MAX,battCurr,12,mA,cubesatsim_current,NONE,4,2,3,Current,Total Battery DC current 7,MAX,Temperature,12,C,cubesatsim_temperature,NONE,6,2,3,Temp,STEM Payload Sensor Temperature 8,MAX,posXv,12,V,cubesatsim_voltage|FLOAT2,NONE,7,1,3,Voltage,+X solar Panel voltage 9,MAX,posYv,12,V,cubesatsim_voltage|FLOAT2,NONE,8,1,3,Voltage,+Y solar Panel voltage @@ -13,15 +13,15 @@ 11,MAX,negXv,12,V,cubesatsim_voltage|FLOAT2,NONE,10,1,3,Voltage,-X solar Panel voltage 12,MAX,negYv,12,V,cubesatsim_voltage|FLOAT2,NONE,11,1,3,Voltage,-Y solar Panel voltage 13,MAX,negZv,12,V,cubesatsim_voltage|FLOAT2,NONE,12,1,3,Voltage,-Z solar Panel voltage -14,MAX,posXi,12,mA,cubesatsim_current,NONE,7,2,4,Current,+X solar Panel current -15,MAX,posYi,12,mA,cubesatsim_current,NONE,8,2,4,Current,+Y solar Panel current -16,MAX,posZi,12,mA,cubesatsim_current,NONE,9,2,4,Current,+Z solar Panel current -17,MAX,negXi,12,mA,cubesatsim_current,NONE,10,2,4,Current,-X solar Panel current -18,MAX,negYi,12,mA,cubesatsim_current,NONE,11,2,4,Current,-Y solar Panel current -19,MAX,negZi,12,mA,cubesatsim_current,NONE,12,2,4,Current,-Z solar Panel current +14,MAX,posXi,12,mA,cubesatsim_current,NONE,7,2,3,Current,+X solar Panel current +15,MAX,posYi,12,mA,cubesatsim_current,NONE,8,2,3,Current,+Y solar Panel current +16,MAX,posZi,12,mA,cubesatsim_current,NONE,9,2,3,Current,+Z solar Panel current +17,MAX,negXi,12,mA,cubesatsim_current,NONE,10,2,3,Current,-X solar Panel current +18,MAX,negYi,12,mA,cubesatsim_current,NONE,11,2,3,Current,-Y solar Panel current +19,MAX,negZi,12,mA,cubesatsim_current,NONE,12,2,3,Current,-Z solar Panel current 20,MAX,PSUVoltage,12,V,cubesatsim_voltage|FLOAT2,NONE,5,1,3,Board Voltage,Power Supply Voltage 21,MAX,spin,12,rpm,cubesatsim_rpm,NONE,3,1,3,Spacecraft Spin,Calculated spin rate using solar cells -22,MAX,Pressure,12,bar,cubesatsim_pressure,NONE,6,3,3,Pressure,STEM Payload Sensor Pressure +22,MAX,Pressure,12,hPa,cubesatsim_pressure,NONE,6,3,3,Pressure,STEM Payload Sensor Pressure 23,MAX,Altitude,12,m,cubesatsim_altitude,NONE,6,4,3,Altitude,STEM Payload Sensor Altitude 24,MAX,Resets,12,-,12,NONE,3,2,3,Reset Count, Software Reset Count 25,MAX,rssi,12,dBm,cubesatsim_rssi|INT,NONE,1,1,3,RSSI,Received Signal Strength Indication @@ -29,10 +29,10 @@ 27,MAX,SatelliteXAxisAngularVelocity,12,dps,cubesatsim_rotation,NONE,7,3,3,Rotation,Angular Veolcity around X Axis 28,MAX,SatelliteYAxisAngularVelocity,12,dps,cubesatsim_rotation,NONE,8,3,3,Rotation,Angular Veolcity around Y Axis 29,MAX,SatelliteZAxisAngularVelocity,12,dps,cubesatsim_rotation,NONE,9,3,3,Rotation,Angular Veolcity around Z Axis -30,MAX,Sensor1,12,raw,cubesatsim_sensor1|INT,NONE,6,5,3,Sensor 1,STEM Payload Extra Sensor 1 +30,MAX,12,%,cubesatsim_temperature,Experiments,6,5,3,Humidity,Humidity 31,MAX,PSUCurrent,12,mA,cubesatsim_current,NONE,5,2,3,Current,Power Supply DC Current -32,MAX,Sensor2,12,signed raw,cubesatsim_sensor2|INT,NONE,6,6,3,Sensor 2,STEM Payload Extra Sensor 2 -33,MAX,Sensor3,12,signed raw,cubesatsim_sensor3|FLOAT2,NONE,6,7,3,Sensor 3,STEM Payload Extra Sensor 3 +32,MAX,Sensor1,12,signed raw,cubesatsim_sensor2|INT,NONE,6,6,3,Sensor 1,STEM Payload Extra Sensor 1 +33,MAX,Sensor2,12,signed raw,cubesatsim_sensor3|FLOAT2,NONE,6,7,3,Sensor 2,STEM Payload Extra Sensor 2 34,MAX,ICR3VProt,12,V,43,NONE,7,2,3,3V Prot,ICR 3V Proteted 35,MAX,ICR2dot5V,12,V,43,NONE,7,3,3,2.5V,ICR 2.5V 36,MAX,ICR2dot5VProt,12,V,43,NONE,7,4,3,2.5V Prot,ICR 2.5V Protected From ba197760d3351b5d0d9d40d4ef924c0bf945d73a Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 1 Jun 2021 17:34:54 -0400 Subject: [PATCH 229/252] 4 to 3, Humidity, Sensor 1 & 2 --- .../CubeSatSim_PSK_mintelemetry.csv | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/spacecraft/FoxTelem_11a/CubeSatSim_PSK_mintelemetry.csv b/spacecraft/FoxTelem_11a/CubeSatSim_PSK_mintelemetry.csv index 174cb667..8cf981d3 100644 --- a/spacecraft/FoxTelem_11a/CubeSatSim_PSK_mintelemetry.csv +++ b/spacecraft/FoxTelem_11a/CubeSatSim_PSK_mintelemetry.csv @@ -5,7 +5,7 @@ 3,MIN,SatelliteXAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,7,4,3,Acceleration,Acceleration around X Axis 4,MIN,SatelliteYAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,8,4,3,Acceleration,Acceleration around Y Axis 5,MIN,SatelliteZAxisAcceleration,12,g,cubesatsim_acceleration|FLOAT2,NONE,9,4,3,Acceleration,Acceleration around Z Axis -6,MIN,battCurr,12,mA,cubesatsim_current,NONE,4,2,4,Current,Total Battery DC current +6,MIN,battCurr,12,mA,cubesatsim_current,NONE,4,2,3,Current,Total Battery DC current 7,MIN,Temperature,12,C,cubesatsim_temperature,NONE,6,2,3,Temp,STEM Payload Sensor Temperature 8,MIN,posXv,12,V,cubesatsim_voltage|FLOAT2,NONE,7,1,3,Voltage,+X solar Panel voltage 9,MIN,posYv,12,V,cubesatsim_voltage|FLOAT2,NONE,8,1,3,Voltage,+Y solar Panel voltage @@ -13,15 +13,15 @@ 11,MIN,negXv,12,V,cubesatsim_voltage|FLOAT2,NONE,10,1,3,Voltage,-X solar Panel voltage 12,MIN,negYv,12,V,cubesatsim_voltage|FLOAT2,NONE,11,1,3,Voltage,-Y solar Panel voltage 13,MIN,negZv,12,V,cubesatsim_voltage|FLOAT2,NONE,12,1,3,Voltage,-Z solar Panel voltage -14,MIN,posXi,12,mA,cubesatsim_current,NONE,7,2,4,Current,+X solar Panel current -15,MIN,posYi,12,mA,cubesatsim_current,NONE,8,2,4,Current,+Y solar Panel current -16,MIN,posZi,12,mA,cubesatsim_current,NONE,9,2,4,Current,+Z solar Panel current -17,MIN,negXi,12,mA,cubesatsim_current,NONE,10,2,4,Current,-X solar Panel current -18,MIN,negYi,12,mA,cubesatsim_current,NONE,11,2,4,Current,-Y solar Panel current -19,MIN,negZi,12,mA,cubesatsim_current,NONE,12,2,4,Current,-Z solar Panel current +14,MIN,posXi,12,mA,cubesatsim_current,NONE,7,2,3,Current,+X solar Panel current +15,MIN,posYi,12,mA,cubesatsim_current,NONE,8,2,3,Current,+Y solar Panel current +16,MIN,posZi,12,mA,cubesatsim_current,NONE,9,2,3,Current,+Z solar Panel current +17,MIN,negXi,12,mA,cubesatsim_current,NONE,10,2,3,Current,-X solar Panel current +18,MIN,negYi,12,mA,cubesatsim_current,NONE,11,2,3,Current,-Y solar Panel current +19,MIN,negZi,12,mA,cubesatsim_current,NONE,12,2,3,Current,-Z solar Panel current 20,MIN,PSUVoltage,12,V,cubesatsim_voltage|FLOAT2,NONE,5,1,3,Board Voltage,Power Supply Voltage 21,MIN,spin,12,rpm,cubesatsim_rpm,NONE,3,1,3,Spacecraft Spin,Calculated spin rate using solar cells -22,MIN,Pressure,12,bar,cubesatsim_pressure,NONE,6,3,3,Pressure,STEM Payload Sensor Pressure +22,MIN,Pressure,12,hPa,cubesatsim_pressure,NONE,6,3,3,Pressure,STEM Payload Sensor Pressure 23,MIN,Altitude,12,m,cubesatsim_altitude,NONE,6,4,3,Altitude,STEM Payload Sensor Altitude 24,MIN,Resets,12,-,12,NONE,3,2,3,Reset Count, Software Reset Count 25,MIN,rssi,12,dBm,cubesatsim_rssi|INT,NONE,1,1,3,RSSI,Received Signal Strength Indication @@ -29,10 +29,10 @@ 27,MIN,SatelliteXAxisAngularVelocity,12,dps,cubesatsim_rotation,NONE,7,3,3,Rotation,Angular Veolcity around X Axis 28,MIN,SatelliteYAxisAngularVelocity,12,dps,cubesatsim_rotation,NONE,8,3,3,Rotation,Angular Veolcity around Y Axis 29,MIN,SatelliteZAxisAngularVelocity,12,dps,cubesatsim_rotation,NONE,9,3,3,Rotation,Angular Veolcity around Z Axis -30,MIN,Sensor1,12,raw,cubesatsim_sensor1|INT,NONE,6,5,3,Sensor 1,STEM Payload Extra Sensor 1 +30,MIN,12,%,cubesatsim_temperature,Experiments,6,5,3,Humidity,Humidity 31,MIN,PSUCurrent,12,mA,cubesatsim_current,NONE,5,2,3,Current,Power Supply DC Current -32,MIN,Sensor2,12,signed raw,cubesatsim_sensor2|INT,NONE,6,6,3,Sensor 2,STEM Payload Extra Sensor 2 -33,MIN,Sensor3,12,signed raw,cubesatsim_sensor3|FLOAT2,NONE,6,7,3,Sensor 3,STEM Payload Extra Sensor 3 +32,MIN,Sensor1,12,signed raw,cubesatsim_sensor2|INT,NONE,6,6,3,Sensor 1,STEM Payload Extra Sensor 1 +33,MIN,Sensor2,12,signed raw,cubesatsim_sensor3|FLOAT2,NONE,6,7,3,Sensor 2,STEM Payload Extra Sensor 2 34,MIN,ICR3VProt,12,V,43,NONE,7,2,3,3V Prot,ICR 3V Proteted 35,MIN,ICR2dot5V,12,V,43,NONE,7,3,3,2.5V,ICR 2.5V 36,MIN,ICR2dot5VProt,12,V,43,NONE,7,4,3,2.5V Prot,ICR 2.5V Protected @@ -58,4 +58,4 @@ 56,MIN,swCmds,32,-,35,NONE,7,6,0,Diagnostic,ICR Diagnostic information 57,MIN,hwCmdCnt,6,-,1,NONE,7,7,0,HW Command Count,Number of hardware commands since last reset 58,MIN,swCmdCnt,6,-,1,NONE,7,8,0,SW Command Count,Number of software commands since last reset -59,MIN,pad2,28,-,0,NONE,0,0,0,NONE,Filler \ No newline at end of file +59,MIN,pad2,28,-,0,NONE,0,0,0,NONE,Filler From 67e5aa7dc47bfa26fbde7208c6e655cf4f701509 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 1 Jun 2021 17:35:17 -0400 Subject: [PATCH 230/252] Pressure in hPa --- spacecraft/FoxTelem_11a/CubeSatSim_PSK_rttelemetry.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacecraft/FoxTelem_11a/CubeSatSim_PSK_rttelemetry.csv b/spacecraft/FoxTelem_11a/CubeSatSim_PSK_rttelemetry.csv index 0700b355..ec06db4f 100644 --- a/spacecraft/FoxTelem_11a/CubeSatSim_PSK_rttelemetry.csv +++ b/spacecraft/FoxTelem_11a/CubeSatSim_PSK_rttelemetry.csv @@ -21,7 +21,7 @@ 19,realTime,negZi,12,mA,cubesatsim_current,-Z Panel,12,2,3,Current,-Z solar panel current 20,realTime,PSUVoltage,12,V,cubesatsim_voltage|FLOAT2,PSU,5,1,3,Voltage,Power Supply voltage 21,realTime,spin,12,rpm,cubesatsim_rpm,Computer Software,3,1,3,Spacecraft Spin,Calculated spin rate using solar cells -22,realTime,Pressure,12,bar,cubesatsim_pressure,Experiments,6,3,3,Pressure,STEM Payload sensor pressure +22,realTime,Pressure,12,hPa,cubesatsim_pressure,Experiments,6,3,3,Pressure,STEM Payload sensor pressure 23,realTime,Altitude,12,m,cubesatsim_altitude,Experiments,6,4,3,Altitude,STEM Payload sensor altitude 24,realTime,Resets,12,-,12,NONE,3,2,3,Reset Count, Software Reset Count 25,realTime,rssi,12,dBm,cubesatsim_rssi|INT,Radio,1,1,3,RSSI,Received Signal Strength Indication From a31333bc1a8a0e70618bfbe92bc097759ad5bd33 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 1 Jun 2021 17:37:48 -0400 Subject: [PATCH 231/252] added missing field --- spacecraft/FoxTelem_11a/CubeSatSim_PSK_maxtelemetry.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacecraft/FoxTelem_11a/CubeSatSim_PSK_maxtelemetry.csv b/spacecraft/FoxTelem_11a/CubeSatSim_PSK_maxtelemetry.csv index ed08d88b..fc9e4599 100644 --- a/spacecraft/FoxTelem_11a/CubeSatSim_PSK_maxtelemetry.csv +++ b/spacecraft/FoxTelem_11a/CubeSatSim_PSK_maxtelemetry.csv @@ -29,7 +29,7 @@ 27,MAX,SatelliteXAxisAngularVelocity,12,dps,cubesatsim_rotation,NONE,7,3,3,Rotation,Angular Veolcity around X Axis 28,MAX,SatelliteYAxisAngularVelocity,12,dps,cubesatsim_rotation,NONE,8,3,3,Rotation,Angular Veolcity around Y Axis 29,MAX,SatelliteZAxisAngularVelocity,12,dps,cubesatsim_rotation,NONE,9,3,3,Rotation,Angular Veolcity around Z Axis -30,MAX,12,%,cubesatsim_temperature,Experiments,6,5,3,Humidity,Humidity +30,MAX,Humidity,12,%,cubesatsim_temperature,Experiments,6,5,3,Humidity,Humidity 31,MAX,PSUCurrent,12,mA,cubesatsim_current,NONE,5,2,3,Current,Power Supply DC Current 32,MAX,Sensor1,12,signed raw,cubesatsim_sensor2|INT,NONE,6,6,3,Sensor 1,STEM Payload Extra Sensor 1 33,MAX,Sensor2,12,signed raw,cubesatsim_sensor3|FLOAT2,NONE,6,7,3,Sensor 2,STEM Payload Extra Sensor 2 From 1d20a6275ae585a66d45b30c7bc75aeda91e9d78 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 1 Jun 2021 17:39:13 -0400 Subject: [PATCH 232/252] added missing field --- spacecraft/FoxTelem_11a/CubeSatSim_PSK_mintelemetry.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacecraft/FoxTelem_11a/CubeSatSim_PSK_mintelemetry.csv b/spacecraft/FoxTelem_11a/CubeSatSim_PSK_mintelemetry.csv index 8cf981d3..53a75ac6 100644 --- a/spacecraft/FoxTelem_11a/CubeSatSim_PSK_mintelemetry.csv +++ b/spacecraft/FoxTelem_11a/CubeSatSim_PSK_mintelemetry.csv @@ -29,7 +29,7 @@ 27,MIN,SatelliteXAxisAngularVelocity,12,dps,cubesatsim_rotation,NONE,7,3,3,Rotation,Angular Veolcity around X Axis 28,MIN,SatelliteYAxisAngularVelocity,12,dps,cubesatsim_rotation,NONE,8,3,3,Rotation,Angular Veolcity around Y Axis 29,MIN,SatelliteZAxisAngularVelocity,12,dps,cubesatsim_rotation,NONE,9,3,3,Rotation,Angular Veolcity around Z Axis -30,MIN,12,%,cubesatsim_temperature,Experiments,6,5,3,Humidity,Humidity +30,MIN,Humidity,12,%,cubesatsim_temperature,Experiments,6,5,3,Humidity,Humidity 31,MIN,PSUCurrent,12,mA,cubesatsim_current,NONE,5,2,3,Current,Power Supply DC Current 32,MIN,Sensor1,12,signed raw,cubesatsim_sensor2|INT,NONE,6,6,3,Sensor 1,STEM Payload Extra Sensor 1 33,MIN,Sensor2,12,signed raw,cubesatsim_sensor3|FLOAT2,NONE,6,7,3,Sensor 2,STEM Payload Extra Sensor 2 From 93b2e55b4014037bd02265c2dbc4bd84dd405806 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 1 Jun 2021 17:46:18 -0400 Subject: [PATCH 233/252] changed Experiments to NONE --- spacecraft/FoxTelem_11a/CubeSatSim_PSK_maxtelemetry.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacecraft/FoxTelem_11a/CubeSatSim_PSK_maxtelemetry.csv b/spacecraft/FoxTelem_11a/CubeSatSim_PSK_maxtelemetry.csv index fc9e4599..c55ada57 100644 --- a/spacecraft/FoxTelem_11a/CubeSatSim_PSK_maxtelemetry.csv +++ b/spacecraft/FoxTelem_11a/CubeSatSim_PSK_maxtelemetry.csv @@ -29,7 +29,7 @@ 27,MAX,SatelliteXAxisAngularVelocity,12,dps,cubesatsim_rotation,NONE,7,3,3,Rotation,Angular Veolcity around X Axis 28,MAX,SatelliteYAxisAngularVelocity,12,dps,cubesatsim_rotation,NONE,8,3,3,Rotation,Angular Veolcity around Y Axis 29,MAX,SatelliteZAxisAngularVelocity,12,dps,cubesatsim_rotation,NONE,9,3,3,Rotation,Angular Veolcity around Z Axis -30,MAX,Humidity,12,%,cubesatsim_temperature,Experiments,6,5,3,Humidity,Humidity +30,MAX,Humidity,12,%,cubesatsim_temperature,NONE,6,5,3,Humidity,Humidity 31,MAX,PSUCurrent,12,mA,cubesatsim_current,NONE,5,2,3,Current,Power Supply DC Current 32,MAX,Sensor1,12,signed raw,cubesatsim_sensor2|INT,NONE,6,6,3,Sensor 1,STEM Payload Extra Sensor 1 33,MAX,Sensor2,12,signed raw,cubesatsim_sensor3|FLOAT2,NONE,6,7,3,Sensor 2,STEM Payload Extra Sensor 2 From 19b0d72ab67d22fdd7f195ba85c4866b833adc88 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 1 Jun 2021 17:46:45 -0400 Subject: [PATCH 234/252] Changed Experiments to NONE --- spacecraft/FoxTelem_11a/CubeSatSim_PSK_mintelemetry.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacecraft/FoxTelem_11a/CubeSatSim_PSK_mintelemetry.csv b/spacecraft/FoxTelem_11a/CubeSatSim_PSK_mintelemetry.csv index 53a75ac6..690b9da2 100644 --- a/spacecraft/FoxTelem_11a/CubeSatSim_PSK_mintelemetry.csv +++ b/spacecraft/FoxTelem_11a/CubeSatSim_PSK_mintelemetry.csv @@ -29,7 +29,7 @@ 27,MIN,SatelliteXAxisAngularVelocity,12,dps,cubesatsim_rotation,NONE,7,3,3,Rotation,Angular Veolcity around X Axis 28,MIN,SatelliteYAxisAngularVelocity,12,dps,cubesatsim_rotation,NONE,8,3,3,Rotation,Angular Veolcity around Y Axis 29,MIN,SatelliteZAxisAngularVelocity,12,dps,cubesatsim_rotation,NONE,9,3,3,Rotation,Angular Veolcity around Z Axis -30,MIN,Humidity,12,%,cubesatsim_temperature,Experiments,6,5,3,Humidity,Humidity +30,MIN,Humidity,12,%,cubesatsim_temperature,NONE,6,5,3,Humidity,Humidity 31,MIN,PSUCurrent,12,mA,cubesatsim_current,NONE,5,2,3,Current,Power Supply DC Current 32,MIN,Sensor1,12,signed raw,cubesatsim_sensor2|INT,NONE,6,6,3,Sensor 1,STEM Payload Extra Sensor 1 33,MIN,Sensor2,12,signed raw,cubesatsim_sensor3|FLOAT2,NONE,6,7,3,Sensor 2,STEM Payload Extra Sensor 2 From 056546da9f0f56627b25fe0de309a232f9124d37 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 1 Jun 2021 20:04:57 -0400 Subject: [PATCH 235/252] changed humidity to 1 decimal, same as temperature --- spacecraft/FoxTelem_11a/CubeSatSim_rttelemetry.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacecraft/FoxTelem_11a/CubeSatSim_rttelemetry.csv b/spacecraft/FoxTelem_11a/CubeSatSim_rttelemetry.csv index ba967900..4d466a3a 100644 --- a/spacecraft/FoxTelem_11a/CubeSatSim_rttelemetry.csv +++ b/spacecraft/FoxTelem_11a/CubeSatSim_rttelemetry.csv @@ -29,7 +29,7 @@ 27,RT,SatelliteXAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,+X Panel,7,3,3,Rotation,Angular Veolcity around X Axis 28,RT,SatelliteYAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,+Y Panel,8,3,3,Rotation,Angular Veolcity around Y Axis 29,RT,SatelliteZAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,+Z Panel,9,3,3,Rotation,Angular Veolcity around Z Axis -30,RT,Humidity,12,%,cubesatsim_sensor1|INT,Experiments,6,5,3,Humidity,Humidity +30,RT,Humidity,12,%,cubesatsim_temperature,Experiments,6,5,3,Humidity,STEM Payload Sensor Humidity 31,RT,PSUCurrent,12,mA,cubesatsim_current,PSU,5,2,3,Current,Power Supply DC Current 32,RT,Sensor1,12,signed raw,cubesatsim_sensor2|INT,Experiments,6,6,3,Sensor 1,STEM Payload Extra Sensor 1 33,RT,Sensor2,12,signed scaled,cubesatsim_sensor3|FLOAT2,Experiments,6,7,3,Sensor 2,STEM Payload Extra Sensor 2 From 0daadf8e1cb65c9ce4b692f38d4375c7af4f64bc Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 1 Jun 2021 20:07:24 -0400 Subject: [PATCH 236/252] updated Humidity and Sensor 1 & 2 --- spacecraft/FoxTelem_11a/CubeSatSim_mintelemetry.csv | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spacecraft/FoxTelem_11a/CubeSatSim_mintelemetry.csv b/spacecraft/FoxTelem_11a/CubeSatSim_mintelemetry.csv index f09e5349..006ab3ef 100644 --- a/spacecraft/FoxTelem_11a/CubeSatSim_mintelemetry.csv +++ b/spacecraft/FoxTelem_11a/CubeSatSim_mintelemetry.csv @@ -29,10 +29,10 @@ 27,MIN,SatelliteXAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,NONE,7,3,3,Rotation,Angular Veolcity around X Axis 28,MIN,SatelliteYAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,NONE,8,3,3,Rotation,Angular Veolcity around Y Axis 29,MIN,SatelliteZAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,NONE,9,3,3,Rotation,Angular Veolcity around Z Axis -30,MIN,Sensor1,12,raw,cubesatsim_sensor1|INT,NONE,6,5,3,Sensor 1,STEM Payload Extra Sensor 1 +30,MIN,Humidity,12,%,cubesatsim_temperature,NONE,6,5,3,Humidity,STEM Payload Sensor Humidity 31,MIN,PSUCurrent,12,mA,cubesatsim_current,NONE,5,2,3,Current,Power Supply DC Current -32,MIN,Sensor2,12,signed raw,cubesatsim_sensor2|INT,NONE,6,6,3,Sensor 2,STEM Payload Extra Sensor 2 -33,MIN,Sensor3,12,signed scaled,cubesatsim_sensor3|FLOAT2,NONE,6,7,3,Sensor 3,STEM Payload Extra Sensor 3 +32,MIN,Sensor1,12,signed raw,cubesatsim_sensor2|INT,NONE,6,6,3,Sensor 1,STEM Payload Extra Sensor 1 +33,MIN,Sensor2,12,signed scaled,cubesatsim_sensor3|FLOAT2,NONE,6,7,3,Sensor 2,STEM Payload Extra Sensor 2 34,MIN,STEMPayloadStatus,1,-,17,NONE,6,1,0,STEM Payload Status,STEM Payload Board Status 35,MIN,Nominal Mode,1,-,17,NONE,3,2,0,Nominal Mode, Nominal Mode (Not Safe Mode) 36,MIN,PayloadStatus1,1,-,17,NONE,6,7,0,Exp 2,STEM Payload status 1 failure indicator From 3ac7b8d294b9b9f13b156908e6ebee086896f152 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 1 Jun 2021 20:13:15 -0400 Subject: [PATCH 237/252] updated for Humidity --- spacecraft/FoxTelem_11a/CubeSatSim_maxtelemetry.csv | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spacecraft/FoxTelem_11a/CubeSatSim_maxtelemetry.csv b/spacecraft/FoxTelem_11a/CubeSatSim_maxtelemetry.csv index b8440ecd..57fe1706 100644 --- a/spacecraft/FoxTelem_11a/CubeSatSim_maxtelemetry.csv +++ b/spacecraft/FoxTelem_11a/CubeSatSim_maxtelemetry.csv @@ -29,10 +29,10 @@ 27,MAX,SatelliteXAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,NONE,7,3,3,Rotation,Angular Veolcity around X Axis 28,MAX,SatelliteYAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,NONE,8,3,3,Rotation,Angular Veolcity around Y Axis 29,MAX,SatelliteZAxisAngularVelocity,12,dps,cubesatsim_rotation|INT,NONE,9,3,3,Rotation,Angular Veolcity around Z Axis -30,MAX,Sensor1,12,raw,cubesatsim_sensor1|INT,NONE,6,5,3,Sensor 1,STEM Payload Extra Sensor 1 +30,MAX,Humidity,12,%,cubesatsim_temperature,NONE,6,5,3,Sensor 1,STEM Payload Sensor Humidity 31,MAX,PSUCurrent,12,mA,cubesatsim_current,NONE,5,2,3,Current,Power Supply DC Current -32,MAX,Sensor2,12,signed raw,cubesatsim_sensor2|INT,NONE,6,6,3,Sensor 2,STEM Payload Extra Sensor 2 -33,MAX,Sensor3,12,signed scaled,cubesatsim_sensor3|FLOAT2,NONE,6,7,3,Sensor 3,STEM Payload Extra Sensor 3 +32,MAX,Sensor1,12,signed raw,cubesatsim_sensor2|INT,NONE,6,6,3,Sensor 1,STEM Payload Extra Sensor 1 +33,MAX,Sensor2,12,signed scaled,cubesatsim_sensor3|FLOAT2,NONE,6,7,3,Sensor 2,STEM Payload Extra Sensor 2 34,MAX,STEMPayloadStatus,1,-,17,NONE,6,1,0,STEM Payload Status,STEM Payload Board Status 35,MAX,Nominal Mode,1,-,17,NONE,3,2,0,Nominal Mode, Nominal Mode (Not Safe Mode) 36,MAX,PayloadStatus1,1,-,17,NONE,6,7,0,Exp 2,STEM Payload status 1 failure indicator From e82022c45ec61444a8f35241cfe64d94551a0e74 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 1 Jun 2021 20:53:42 -0400 Subject: [PATCH 238/252] added 10x for Humidity --- afsk/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 47d8a3e3..75775176 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1535,7 +1535,7 @@ void get_tlm_fox() { encodeA(b_max, 48 + head_offset, (int)(sensor_max[XS2]) + 2048); encodeB(b_max, 49 + head_offset, (int)(sensor_max[XS3] * 100 + 0.5) + 2048); encodeB(b_max, 10 + head_offset, (int)(sensor_max[TEMP] * 10 + 0.5)); - encodeA(b_max, 45 + head_offset, (int)(sensor_max[HUMI] + 0.5)); + encodeA(b_max, 45 + head_offset, (int)(sensor_max[HUMI] * 10 + 0.5)); } else { @@ -1592,7 +1592,7 @@ void get_tlm_fox() { encodeA(b_min, 48 + head_offset, (int)(sensor_min[XS2]) + 2048); encodeB(b_min, 49 + head_offset, (int)(sensor_min[XS3] * 100 + 0.5) + 2048); encodeB(b_min, 10 + head_offset, (int)(sensor_min[TEMP] * 10 + 0.5)); - encodeA(b_min, 45 + head_offset, (int)(sensor_min[HUMI] + 0.5)); + encodeA(b_min, 45 + head_offset, (int)(sensor_min[HUMI] * 10 + 0.5)); } else { From bea0f92bb38e6ee1c6b5f1923d9fa7880576cce1 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 2 Jun 2021 08:17:49 -0400 Subject: [PATCH 239/252] more log cleanup --- afsk/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 75775176..3ddf0fd0 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1250,7 +1250,7 @@ void get_tlm_fox() { cpuTemp /= 1000; #ifdef DEBUG_LOGGING - printf("CPU Temp Read: %6.1f\n", cpuTemp); +// printf("CPU Temp Read: %6.1f\n", cpuTemp); #endif other[IHU_TEMP] = (double)cpuTemp; @@ -1279,7 +1279,7 @@ void get_tlm_fox() { unsigned int waitTime; int i = 0; serialPutchar(uart_fd, '?'); - printf("Querying payload with ?\n"); +// printf("Querying payload with ?\n"); waitTime = millis() + 500; int end = FALSE; // int retry = FALSE; From 06dea5d9e022fdb6116bd9218df77ba71cd5c001 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 2 Jun 2021 08:23:02 -0400 Subject: [PATCH 240/252] Initial log file script --- log | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 log diff --git a/log b/log new file mode 100755 index 00000000..f551c284 --- /dev/null +++ b/log @@ -0,0 +1,9 @@ +#!/bin/bash + +echo -e "\nLog file script for CubeSatSim\n" + +sudo journalctl -u cubesatsim > log.txt +cat log.txt + +echo -e "\nLog file also saved as /home/pi/CubeSatSim/log.txt" + From 869be3c52459e728806c542d2846804bac5d1e61 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 2 Jun 2021 08:47:13 -0400 Subject: [PATCH 241/252] Update and rename config.sh to config --- config.sh => config | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) rename config.sh => config (95%) diff --git a/config.sh b/config similarity index 95% rename from config.sh rename to config index d2ff251a..61375544 100755 --- a/config.sh +++ b/config @@ -1,6 +1,12 @@ #!/bin/bash -echo $1 +# echo $1 + +if [ "$1" = "" ]; then + echo "Include a configuration option:" + echo + set -- "-h" +fi if [ "$1" = "-r" ]; then echo "Restarting CubeSatSim" @@ -27,7 +33,7 @@ elif [ "$1" = "-s" ]; then sudo systemctl restart cubesatsim exit elif [ "$1" = "-h" ]; then - echo "./configh.sh [OPTIONS]" + echo "config OPTION" echo echo "Changes CubeSatSim mode, resets, or modifies configuration file" echo @@ -131,4 +137,3 @@ echo "Restarting CubeSatSim with new configuraation file" fi sudo systemctl restart cubesatsim - From b5376bfaf06f9427d0341dad7c7b51b6307805c3 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 2 Jun 2021 08:55:30 -0400 Subject: [PATCH 242/252] added -c for change callsign --- config | 120 +++++++++++++++++++++++++++++++-------------------------- 1 file changed, 66 insertions(+), 54 deletions(-) diff --git a/config b/config index 61375544..62507131 100755 --- a/config +++ b/config @@ -49,90 +49,102 @@ elif [ "$1" = "-h" ]; then echo exit -elif [ "$1" = "-m" ]; then +elif [ "$1" = "-c" ]; then -echo -e "\nConfiguration script for CubeSatSim\n" - -echo -e "Return keeps current value." + echo + + echo "Editing the CALLSIGN in the" + + echo "configuration file for CubeSatSim" + + echo -echo -e "Current sim.cfg configuration file: \n" + echo "Return keeps current value." -value=`cat sim.cfg` +# echo -e "Current sim.cfg configuration file:" + +# echo + + value=`cat sim.cfg` -echo "$value" + echo "$value" > /dev/null -echo + set -- $value -set -- $value + echo "Current value of CALLSIGN is" + + echo $1 -#echo $1 $2 $3 $4 + echo + +# echo $1 $2 $3 $4 -echo -e "Input callsign (all capitals): " + echo -e "Enter callsign in all capitals: " -read callsign + read callsign -if [ -z $callsign ] ; then + if [ -z $callsign ] ; then - callsign="$1" - echo "Keeping value of" $callsign -fi + callsign="$1" + echo "Keeping value of" $callsign + fi -echo -e "Input reset count (integer): " + echo -e "Input reset count (integer): " -read resets + read resets -if [ -z $resets ] ; then - resets="$2" - echo "Keeping value of" $resets -fi + if [ -z $resets ] ; then + resets="$2" + echo "Keeping value of" $resets + fi -if ! [[ $resets =~ ^[0-9]+$ ]] ; then - echo "Error: not an integer!" - resets="$2" - echo "Keeping value of" $resets -fi + if ! [[ $resets =~ ^[0-9]+$ ]] ; then + echo "Error: not an integer!" + resets="$2" + echo "Keeping value of" $resets + fi -echo -e "Input latitude (decimal degrees, positive is north): " + echo -e "Input latitude (decimal degrees, positive is north): " -read lat + read lat -if [ -z $lat ] ; then + if [ -z $lat ] ; then - lat="$3" - echo "Keeping value of" $lat -fi + lat="$3" + echo "Keeping value of" $lat + fi -if ! [[ $lat =~ ^[+-]?[0-9]+([.][0-9]+)?$ ]] ; then + if ! [[ $lat =~ ^[+-]?[0-9]+([.][0-9]+)?$ ]] ; then - echo "Error: not a number!" - lat="$3" - echo "Keeping value of" $lat -fi + echo "Error: not a number!" + lat="$3" + echo "Keeping value of" $lat + fi -echo -e "Input longitude (decimal degrees, positive is east): " + echo -e "Input longitude (decimal degrees, positive is east): " -read long + read long -if [ -z $long ] ; then + if [ -z $long ] ; then - long="$4" - echo "Keeping value of" $long -fi + long="$4" + echo "Keeping value of" $long + fi + + if ! [[ $long =~ ^[+-]?[0-9]+([.][0-9]+)?$ ]] ; then -if ! [[ $long =~ ^[+-]?[0-9]+([.][0-9]+)?$ ]] ; then + echo "Error: not a number!" + long="$4" + echo "Keeping value of" $long + fi - echo "Error: not a number!" - long="$4" - echo "Keeping value of" $long -fi + echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n" -echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n" + echo $callsign $resets $lat $long -echo $callsign $resets $lat $long + echo $callsign $resets $lat $long > sim.cfg -echo $callsign $resets $lat $long > sim.cfg - -echo "Restarting CubeSatSim with new configuraation file" + echo "Restarting CubeSatSim with new configuraation file" fi From f48330a317646b585df182666f958dc63a522803 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 2 Jun 2021 09:04:29 -0400 Subject: [PATCH 243/252] added -r for Reset Count and -l for Lat and Long configuration --- config | 97 +++++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 76 insertions(+), 21 deletions(-) diff --git a/config b/config index 62507131..fbe56f5f 100755 --- a/config +++ b/config @@ -51,36 +51,25 @@ elif [ "$1" = "-h" ]; then elif [ "$1" = "-c" ]; then - echo - + echo echo "Editing the CALLSIGN in the" - - echo "configuration file for CubeSatSim" - + echo "configuration file for CubeSatSim" echo - echo "Return keeps current value." - -# echo -e "Current sim.cfg configuration file:" - +# echo -e "Current sim.cfg configuration file:" # echo value=`cat sim.cfg` - echo "$value" > /dev/null - set -- $value - echo "Current value of CALLSIGN is" - + echo "Current value of CALLSIGN is" echo $1 - echo # echo $1 $2 $3 $4 - echo -e "Enter callsign in all capitals: " - + echo "Enter callsign in all capitals: " read callsign if [ -z $callsign ] ; then @@ -88,8 +77,38 @@ elif [ "$1" = "-c" ]; then callsign="$1" echo "Keeping value of" $callsign fi + + echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n" + + echo $callsign $2 $3 $4 - echo -e "Input reset count (integer): " + echo $callsign $2 $3 $4 > sim.cfg + + echo "Restarting CubeSatSim with new configuraation file" + + sudo systemctl restart cubesatsim + +elif [ "$1" = "-r" ]; then + + echo + echo "Editing the Reset Cou t in the" + echo "configuration file for CubeSatSim" + echo + echo "Return keeps current value." +# echo -e "Current sim.cfg configuration file:" +# echo + + value=`cat sim.cfg` + echo "$value" > /dev/null + set -- $value + + echo "Current value of Reset Count is" + echo $2 + echo + +# echo $1 $2 $3 $4 + + echo -e "Enter Reset Count (integer): " read resets @@ -104,7 +123,38 @@ elif [ "$1" = "-c" ]; then echo "Keeping value of" $resets fi - echo -e "Input latitude (decimal degrees, positive is north): " + echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n" + + echo $1 $resets $3 $4 + + echo $1 $resets $3 $4 > sim.cfg + + echo "Restarting CubeSatSim with new configuraation file" + + sudo systemctl restart cubesatsim + +elif [ "$1" = "-l" ]; then + + echo + echo "Editing latitude and longitude in the" + echo "configuration file for CubeSatSim" + echo "(Only used for APRS telemetry) + echo + echo "Return keeps current value." +# echo -e "Current sim.cfg configuration file:" +# echo + + value=`cat sim.cfg` + echo "$value" > /dev/null + set -- $value + + echo "Current value of latitude is" + echo $3 + echo + +# echo $1 $2 $3 $4 + + echo -e "Enter latitude (decimal degrees, positive is north): " read lat @@ -120,8 +170,12 @@ elif [ "$1" = "-c" ]; then lat="$3" echo "Keeping value of" $lat fi + + echo "Current value of longitude is" + echo $4 + echo - echo -e "Input longitude (decimal degrees, positive is east): " + echo -e "Enter longitude (decimal degrees, positive is east): " read long @@ -140,12 +194,13 @@ elif [ "$1" = "-c" ]; then echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n" - echo $callsign $resets $lat $long + echo $1 $2 $lat $long - echo $callsign $resets $lat $long > sim.cfg + echo $1 $2 $lat $long > sim.cfg echo "Restarting CubeSatSim with new configuraation file" + sudo systemctl restart cubesatsim fi sudo systemctl restart cubesatsim From 11995efefa50a27342d8d183c291841d34652c53 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 2 Jun 2021 09:07:05 -0400 Subject: [PATCH 244/252] missing " --- config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config b/config index fbe56f5f..738e9106 100755 --- a/config +++ b/config @@ -138,7 +138,7 @@ elif [ "$1" = "-l" ]; then echo echo "Editing latitude and longitude in the" echo "configuration file for CubeSatSim" - echo "(Only used for APRS telemetry) + echo "(Only used for APRS telemetry)" echo echo "Return keeps current value." # echo -e "Current sim.cfg configuration file:" From c75b7dcf486e8d75858cff058d56d0da49a6ae8d Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 2 Jun 2021 09:08:41 -0400 Subject: [PATCH 245/252] removed extra restart --- config | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/config b/config index 738e9106..84104868 100755 --- a/config +++ b/config @@ -81,10 +81,9 @@ elif [ "$1" = "-c" ]; then echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n" echo $callsign $2 $3 $4 - echo $callsign $2 $3 $4 > sim.cfg - echo "Restarting CubeSatSim with new configuraation file" + echo sudo systemctl restart cubesatsim @@ -126,11 +125,10 @@ elif [ "$1" = "-r" ]; then echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n" echo $1 $resets $3 $4 - echo $1 $resets $3 $4 > sim.cfg - echo "Restarting CubeSatSim with new configuraation file" - + echo + sudo systemctl restart cubesatsim elif [ "$1" = "-l" ]; then @@ -193,14 +191,12 @@ elif [ "$1" = "-l" ]; then fi echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n" - echo $1 $2 $lat $long - echo $1 $2 $lat $long > sim.cfg - echo "Restarting CubeSatSim with new configuraation file" - + echo + sudo systemctl restart cubesatsim fi -sudo systemctl restart cubesatsim +# sudo systemctl restart cubesatsim From 801b1fc06607d37162977e982f98f260567c15be Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 2 Jun 2021 09:09:49 -0400 Subject: [PATCH 246/252] extra blank lines added --- config | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config b/config index 84104868..d6c1f3a9 100755 --- a/config +++ b/config @@ -82,6 +82,7 @@ elif [ "$1" = "-c" ]; then echo $callsign $2 $3 $4 echo $callsign $2 $3 $4 > sim.cfg + echo echo "Restarting CubeSatSim with new configuraation file" echo @@ -126,6 +127,7 @@ elif [ "$1" = "-r" ]; then echo $1 $resets $3 $4 echo $1 $resets $3 $4 > sim.cfg + echo echo "Restarting CubeSatSim with new configuraation file" echo @@ -193,6 +195,7 @@ elif [ "$1" = "-l" ]; then echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n" echo $1 $2 $lat $long echo $1 $2 $lat $long > sim.cfg + echo echo "Restarting CubeSatSim with new configuraation file" echo From 872df72d8f278e7539aeb286fa57b07a239588ad Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 2 Jun 2021 09:13:44 -0400 Subject: [PATCH 247/252] typos --- config | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/config b/config index d6c1f3a9..96551454 100755 --- a/config +++ b/config @@ -8,7 +8,7 @@ if [ "$1" = "" ]; then set -- "-h" fi -if [ "$1" = "-r" ]; then +if [ "$1" = "-i" ]; then echo "Restarting CubeSatSim" sudo systemctl restart cubesatsim exit @@ -42,10 +42,11 @@ elif [ "$1" = "-h" ]; then echo " -f Change to FSK/DUV mode" echo " -b Change to BPSK mode" echo " -s Change to SSTV mode" - echo " -r Restarts CubeSatsim software" - echo " -m Modified the configuration file sim.cfg" - echo " You can change callsign, reset count, or" - echo " latitude and longitude (used for APRS)" + echo " -i Restarts CubeSatsim software" + echo " -c Change the CALLSIGN in the configuration file sim.cfg" + echo " -r Change the Resets Count in the configuration file sim.cfg" + echo " -l Change the Latitude and Longitude in the configuration file sim.cfg" + echo " Only used for APRS telemetry" echo exit @@ -91,7 +92,7 @@ elif [ "$1" = "-c" ]; then elif [ "$1" = "-r" ]; then echo - echo "Editing the Reset Cou t in the" + echo "Editing the Reset Count in the" echo "configuration file for CubeSatSim" echo echo "Return keeps current value." @@ -101,7 +102,8 @@ elif [ "$1" = "-r" ]; then value=`cat sim.cfg` echo "$value" > /dev/null set -- $value - + + echo echo "Current value of Reset Count is" echo $2 echo @@ -148,6 +150,7 @@ elif [ "$1" = "-l" ]; then echo "$value" > /dev/null set -- $value + echo echo "Current value of latitude is" echo $3 echo @@ -171,6 +174,7 @@ elif [ "$1" = "-l" ]; then echo "Keeping value of" $lat fi + echo echo "Current value of longitude is" echo $4 echo From 9ec1fe77a186448b7d79c71312bee01e1369dd7a Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 2 Jun 2021 10:45:44 -0400 Subject: [PATCH 248/252] added full path of config file --- config | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/config b/config index 96551454..d881c326 100755 --- a/config +++ b/config @@ -60,7 +60,7 @@ elif [ "$1" = "-c" ]; then # echo -e "Current sim.cfg configuration file:" # echo - value=`cat sim.cfg` + value=`cat /home/pi/CubeSatSim/sim.cfg` echo "$value" > /dev/null set -- $value @@ -82,7 +82,7 @@ elif [ "$1" = "-c" ]; then echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n" echo $callsign $2 $3 $4 - echo $callsign $2 $3 $4 > sim.cfg + echo $callsign $2 $3 $4 > /home/pi/CubeSatSim/sim.cfg echo echo "Restarting CubeSatSim with new configuraation file" echo @@ -99,7 +99,7 @@ elif [ "$1" = "-r" ]; then # echo -e "Current sim.cfg configuration file:" # echo - value=`cat sim.cfg` + value=`cat /home/pi/CubeSatSim/sim.cfg` echo "$value" > /dev/null set -- $value @@ -128,7 +128,7 @@ elif [ "$1" = "-r" ]; then echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n" echo $1 $resets $3 $4 - echo $1 $resets $3 $4 > sim.cfg + echo $1 $resets $3 $4 > /home/pi/CubeSatSim/sim.cfg echo echo "Restarting CubeSatSim with new configuraation file" echo @@ -146,7 +146,7 @@ elif [ "$1" = "-l" ]; then # echo -e "Current sim.cfg configuration file:" # echo - value=`cat sim.cfg` + value=`cat /home/pi/CubeSatSim/sim.cfg` echo "$value" > /dev/null set -- $value @@ -198,7 +198,7 @@ elif [ "$1" = "-l" ]; then echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n" echo $1 $2 $lat $long - echo $1 $2 $lat $long > sim.cfg + echo $1 $2 $lat $long > /home/pi/CubeSatSim/sim.cfg echo echo "Restarting CubeSatSim with new configuraation file" echo From 5cf7779b447d7926d94b3c96e4be14a7c8722fb7 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 2 Jun 2021 10:52:27 -0400 Subject: [PATCH 249/252] minor edits --- afsk/main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 3ddf0fd0..ae573d4b 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -686,6 +686,10 @@ void get_tlm(void) { FILE * txResult; for (int j = 0; j < frameCnt; j++) { + + fflush(stdout); + fflush(stderr); + digitalWrite(txLed, txLedOn); #ifdef DEBUG_LOGGING printf("Tx LED On\n"); @@ -702,7 +706,7 @@ void get_tlm(void) { // FILE * file = popen(pythonStr, "r"); fputc('\n', file1); fgets(cmdbuffer, 1000, file1); - printf("Pyton result: %s\n", cmdbuffer); + printf("Python result: %s\n", cmdbuffer); // pclose(file); const char space[2] = " "; From d51546ca2a318efa5a2817d69853c948645b312b Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 2 Jun 2021 13:08:41 -0400 Subject: [PATCH 250/252] replaced rpitx with touch ready to signal rpitx.py --- afsk/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index ae573d4b..913e9899 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -869,7 +869,8 @@ void get_tlm(void) { char header_long[10]; char header_str4[] = "hi hi "; char footer_str1[] = "\' > t.txt && echo \'"; - char footer_str[] = ">CQ:010101/hi hi ' >> t.txt && gen_packets -o telem.wav t.txt -r 48000 > /dev/null 2>&1 && cat telem.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.9e3 > /dev/null 2>&1"; +// char footer_str[] = ">CQ:010101/hi hi ' >> t.txt && gen_packets -o telem.wav t.txt -r 48000 > /dev/null 2>&1 && cat telem.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.9e3 > /dev/null 2>&1"; + char footer_str[] = ">CQ:010101/hi hi ' >> t.txt && touch ready"; // transmit is done by rpitx.py if (ax5043) { strcpy(str, header_str); From 91a09ab758c81ce7f519d77ff0bf66e0264b0fd0 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 2 Jun 2021 13:12:00 -0400 Subject: [PATCH 251/252] added APRS rpitx based on file ready --- rpitx.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index 1db4dbb2..86a628e7 100644 --- a/rpitx.py +++ b/rpitx.py @@ -48,7 +48,13 @@ if __name__ == "__main__": if (('a' == sys.argv[1]) or ('afsk' in sys.argv[1])): print("AFSK") while True: - time.sleep(5) + try: + f = open("ready") + os.system("gen_packets -o telem.wav t.txt -r 48000 > /dev/null 2>&1 && cat telem.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.9e3 > /dev/null 2>&1") + os.system("rm ready") + time.sleep(0.5) + except: + time.sleep(0.5) elif (('s' == sys.argv[1]) or ('sstv' in sys.argv[1])): print("SSTV") GPIO.output(txLed, txLedOn); From 646f0457d7335f6d619c5dba464635a55bc8dea1 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 2 Jun 2021 13:45:42 -0400 Subject: [PATCH 252/252] added sleep(2) in place of rpitx --- afsk/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/afsk/main.c b/afsk/main.c index 913e9899..e9acbc31 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1005,6 +1005,7 @@ void get_tlm(void) { if (transmit) { FILE * file2 = popen(str, "r"); pclose(file2); + sleep(2); } else { fprintf(stderr, "\nNo CubeSatSim Band Pass Filter detected. No transmissions after the CW ID.\n"); fprintf(stderr, " See http://cubesatsim.org/wiki for info about building a CubeSatSim\n\n");