From 6da1423650e903497907c6476fddd2c08c3086f6 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 26 Dec 2020 16:02:03 -0500 Subject: [PATCH 001/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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/415] 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 26be125a780356f2c1efb4debd8fd967263c2836 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 14 May 2021 20:56:48 -0400 Subject: [PATCH 113/415] try background SSTV --- rpitx.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/rpitx.py b/rpitx.py index 1db4dbb2..bd433eea 100644 --- a/rpitx.py +++ b/rpitx.py @@ -5,6 +5,7 @@ import subprocess import time import os import sys +from picamera import PiCamera GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) @@ -52,13 +53,14 @@ if __name__ == "__main__": elif (('s' == sys.argv[1]) or ('sstv' in sys.argv[1])): print("SSTV") GPIO.output(txLed, txLedOn); - os.system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") -# while True: -# GPIO.output(txLed, txLedOff); -# print("Sleeping") -# time.sleep(10) -# print("Transmitting SSTV") -# GPIO.output(txLed, txLedOn); +# os.system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") + os.system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3 &") + while True: + GPIO.output(txLed, txLedOff); + print("Sleeping") + time.sleep(10) + print("Transmitting SSTV") + GPIO.output(txLed, txLedOn); # os.system("cat /home/pi/CubeSatSim/wav/sstv.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") elif (('b' == sys.argv[1]) or ('bpsk' in sys.argv[1])): print("BPSK") From 54d79f90264a2dc4c07ce19d4c1d7958711285d8 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 14 May 2021 21:01:04 -0400 Subject: [PATCH 114/415] Update rpitx.py --- rpitx.py | 1 + 1 file changed, 1 insertion(+) diff --git a/rpitx.py b/rpitx.py index bd433eea..cc183112 100644 --- a/rpitx.py +++ b/rpitx.py @@ -25,6 +25,7 @@ else: txLedOff = False GPIO.setup(txLed, GPIO.OUT) +print(txLed) print(transmit) From 1837ecb168de01414b0abb97c9462d61798e2b4f Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 14 May 2021 21:14:26 -0400 Subject: [PATCH 115/415] fixed GPIO22 sensing --- rpitx.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rpitx.py b/rpitx.py index cc183112..340793ed 100644 --- a/rpitx.py +++ b/rpitx.py @@ -9,14 +9,14 @@ from picamera import PiCamera GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) -GPIO.setup(27, GPIO.IN, pull_up_down=GPIO.PUD_UP) +GPIO.setup(22, GPIO.IN, pull_up_down=GPIO.PUD_UP) GPIO.setup(12, GPIO.IN, pull_up_down=GPIO.PUD_UP) transmit = False if GPIO.input(12) == False: transmit = True -if GPIO.input(27) == False: +if GPIO.input(22) == False: transmit = True - txLed = 22 + txLed = 27 txLedOn = False txLedOff = True else: @@ -25,7 +25,7 @@ else: txLedOff = False GPIO.setup(txLed, GPIO.OUT) -print(txLed) +print(txLedOn) print(transmit) From c431e65e7590c59a285a9671e3a10a30c1d3ed29 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 14 May 2021 21:36:39 -0400 Subject: [PATCH 116/415] worknig tx LED python --- rpitx.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/rpitx.py b/rpitx.py index 340793ed..5096c821 100644 --- a/rpitx.py +++ b/rpitx.py @@ -17,15 +17,18 @@ if GPIO.input(12) == False: if GPIO.input(22) == False: transmit = True txLed = 27 - txLedOn = False - txLedOff = True + txLedOn = 0 + txLedOff = 1 else: txLed = 27 - txLedOn = True - txLedOff = False + txLedOn = 1 + txLedOff = 0 GPIO.setup(txLed, GPIO.OUT) print(txLedOn) +print(txLed) +GPIO.setup(27, GPIO.OUT) +GPIO.output(27, 0) print(transmit) @@ -33,8 +36,10 @@ file = open("/home/pi/CubeSatSim/sim.cfg") callsign = file.readline().split(" ")[0] print(callsign) +#GPIO.output(27, 1); GPIO.output(txLed, txLedOn); os.system("echo 'de " + callsign + "' > id.txt && gen_packets -M 20 id.txt -o morse.wav -r 48000 > /dev/null 2>&1 && cat morse.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") +#GPIO.output(27, 0); GPIO.output(txLed, txLedOff); time.sleep(2) @@ -57,11 +62,15 @@ if __name__ == "__main__": # os.system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") os.system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3 &") while True: - GPIO.output(txLed, txLedOff); + GPIO.output(txLed, txLedOn); + # GPIO.output(27, 0); print("Sleeping") time.sleep(10) print("Transmitting SSTV") - GPIO.output(txLed, txLedOn); + GPIO.output(txLed, txLedOff); +# GPIO.output(27, 1); + time.sleep(10) + # os.system("cat /home/pi/CubeSatSim/wav/sstv.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") elif (('b' == sys.argv[1]) or ('bpsk' in sys.argv[1])): print("BPSK") From 8df166c9088cc8e38692760b7e98bb936399aa52 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 14 May 2021 21:40:28 -0400 Subject: [PATCH 117/415] added camera capture --- rpitx.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/rpitx.py b/rpitx.py index 5096c821..5399e751 100644 --- a/rpitx.py +++ b/rpitx.py @@ -62,6 +62,15 @@ if __name__ == "__main__": # os.system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") os.system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3 &") while True: + try: + camera = PiCamera() + camera.resolution = (640, 496) + camera.start_preview() + # Camera warm-up time + sleep(2) + camera.capture('sstv_image.jpg') + catch: + GPIO.output(txLed, txLedOn); # GPIO.output(27, 0); print("Sleeping") From aeb3b4d24d98dd730b4fc8583ebb096f937837aa Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 14 May 2021 21:43:26 -0400 Subject: [PATCH 118/415] Update rpitx.py --- rpitx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index 5399e751..a89a49f9 100644 --- a/rpitx.py +++ b/rpitx.py @@ -69,7 +69,7 @@ if __name__ == "__main__": # Camera warm-up time sleep(2) camera.capture('sstv_image.jpg') - catch: + except: GPIO.output(txLed, txLedOn); # GPIO.output(27, 0); From ed316c9a79052d1fb604fe6c8afa489f994c4ba3 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 14 May 2021 21:44:59 -0400 Subject: [PATCH 119/415] Update rpitx.py --- rpitx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index a89a49f9..81bfe9fc 100644 --- a/rpitx.py +++ b/rpitx.py @@ -69,7 +69,7 @@ if __name__ == "__main__": # Camera warm-up time sleep(2) camera.capture('sstv_image.jpg') - except: +# except: GPIO.output(txLed, txLedOn); # GPIO.output(27, 0); From 8e654509e3abc8ce73e3087a1b3beb639ef44332 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 14 May 2021 21:49:27 -0400 Subject: [PATCH 120/415] Update rpitx.py --- rpitx.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/rpitx.py b/rpitx.py index 81bfe9fc..05968761 100644 --- a/rpitx.py +++ b/rpitx.py @@ -69,16 +69,15 @@ if __name__ == "__main__": # Camera warm-up time sleep(2) camera.capture('sstv_image.jpg') -# except: - - GPIO.output(txLed, txLedOn); + finally: + GPIO.output(txLed, txLedOn); # GPIO.output(27, 0); - print("Sleeping") - time.sleep(10) - print("Transmitting SSTV") - GPIO.output(txLed, txLedOff); + print("Sleeping") + time.sleep(10) + print("Transmitting SSTV") + GPIO.output(txLed, txLedOff); # GPIO.output(27, 1); - time.sleep(10) + time.sleep(10) # os.system("cat /home/pi/CubeSatSim/wav/sstv.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") elif (('b' == sys.argv[1]) or ('bpsk' in sys.argv[1])): From 7b42cc9e78c8fa8553dca9f5183fb93da6746300 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 15 May 2021 06:31:04 -0400 Subject: [PATCH 121/415] Update rpitx.py --- rpitx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index 05968761..4815427c 100644 --- a/rpitx.py +++ b/rpitx.py @@ -67,7 +67,7 @@ if __name__ == "__main__": camera.resolution = (640, 496) camera.start_preview() # Camera warm-up time - sleep(2) + time.sleep(2) camera.capture('sstv_image.jpg') finally: GPIO.output(txLed, txLedOn); From 067aab822f1b4b480612a922df26697207c2ebd5 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 15 May 2021 08:08:11 -0400 Subject: [PATCH 122/415] Update rpitx.py --- rpitx.py | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/rpitx.py b/rpitx.py index 4815427c..76b4ee79 100644 --- a/rpitx.py +++ b/rpitx.py @@ -5,7 +5,7 @@ import subprocess import time import os import sys -from picamera import PiCamera +# from picamera import PiCamera GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) @@ -62,22 +62,26 @@ if __name__ == "__main__": # os.system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") os.system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3 &") while True: - try: - camera = PiCamera() - camera.resolution = (640, 496) - camera.start_preview() + os.system("raspistill -o ~/camera_out.jpg -w 640 -h 496 > /dev/null 2>&1") + os.system("python3 -m pysstv --mode PD120 ~/camera_out.jpg sstv_camera.wav > /dev/null 2>&1") + os.system("cat sstv_camera.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3 > /dev/null 2>&1") + +# try: +# camera = PiCamera() +# camera.resolution = (640, 496) +# camera.start_preview() # Camera warm-up time - time.sleep(2) - camera.capture('sstv_image.jpg') - finally: - GPIO.output(txLed, txLedOn); +# time.sleep(2) +# camera.capture('sstv_image.jpg') +# finally: + GPIO.output(txLed, txLedOn); # GPIO.output(27, 0); - print("Sleeping") - time.sleep(10) - print("Transmitting SSTV") - GPIO.output(txLed, txLedOff); + print("Sleeping") + time.sleep(10) + print("Transmitting SSTV") + GPIO.output(txLed, txLedOff); # GPIO.output(27, 1); - time.sleep(10) + time.sleep(10) # os.system("cat /home/pi/CubeSatSim/wav/sstv.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") elif (('b' == sys.argv[1]) or ('bpsk' in sys.argv[1])): From 4afcc04ff1f2ecac124749b7972b5213280922f3 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 15 May 2021 08:15:11 -0400 Subject: [PATCH 123/415] Update rpitx.py --- rpitx.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rpitx.py b/rpitx.py index 76b4ee79..8844e335 100644 --- a/rpitx.py +++ b/rpitx.py @@ -62,9 +62,9 @@ if __name__ == "__main__": # os.system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") os.system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3 &") while True: - os.system("raspistill -o ~/camera_out.jpg -w 640 -h 496 > /dev/null 2>&1") - os.system("python3 -m pysstv --mode PD120 ~/camera_out.jpg sstv_camera.wav > /dev/null 2>&1") - os.system("cat sstv_camera.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3 > /dev/null 2>&1") + os.system("raspistill -o ~/camera_out.jpg -w 640 -h 496 > /dev/null") # 2>&1") + os.system("python3 -m pysstv --mode PD120 ~/camera_out.jpg sstv_camera.wav") # > /dev/null 2>&1") + os.system("cat sstv_camera.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") # > /dev/null 2>&1") # try: # camera = PiCamera() From 7327afe8be8209ecb5fe5645d321f0795a74134b Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 15 May 2021 08:19:15 -0400 Subject: [PATCH 124/415] Update rpitx.py --- rpitx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index 8844e335..e59c8a47 100644 --- a/rpitx.py +++ b/rpitx.py @@ -62,7 +62,7 @@ if __name__ == "__main__": # os.system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") os.system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3 &") while True: - os.system("raspistill -o ~/camera_out.jpg -w 640 -h 496 > /dev/null") # 2>&1") + os.system("raspistill -o ~/camera_out.jpg -w 640 -h 496") # > /dev/null 2>&1") os.system("python3 -m pysstv --mode PD120 ~/camera_out.jpg sstv_camera.wav") # > /dev/null 2>&1") os.system("cat sstv_camera.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") # > /dev/null 2>&1") From 5ee89b9dc2c2e8b7917ba589c9d3f858b46236a7 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 15 May 2021 08:38:26 -0400 Subject: [PATCH 125/415] Update rpitx.py --- rpitx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index e59c8a47..7688f3e4 100644 --- a/rpitx.py +++ b/rpitx.py @@ -63,7 +63,7 @@ if __name__ == "__main__": os.system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3 &") while True: os.system("raspistill -o ~/camera_out.jpg -w 640 -h 496") # > /dev/null 2>&1") - os.system("python3 -m pysstv --mode PD120 ~/camera_out.jpg sstv_camera.wav") # > /dev/null 2>&1") + os.system("sudo python3 -m pysstv --mode PD120 ~/camera_out.jpg sstv_camera.wav") # > /dev/null 2>&1") os.system("cat sstv_camera.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") # > /dev/null 2>&1") # try: From 25d8a35827fe77a9e90126b68d4534054d3b13ea Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 15 May 2021 09:18:56 -0400 Subject: [PATCH 126/415] Update rpitx.py --- rpitx.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index 7688f3e4..35642bfa 100644 --- a/rpitx.py +++ b/rpitx.py @@ -62,8 +62,11 @@ if __name__ == "__main__": # os.system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") os.system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3 &") while True: + GPIO.output(txLed, txLedOn); os.system("raspistill -o ~/camera_out.jpg -w 640 -h 496") # > /dev/null 2>&1") + print("Picture taken") os.system("sudo python3 -m pysstv --mode PD120 ~/camera_out.jpg sstv_camera.wav") # > /dev/null 2>&1") + print ("Sending picture") os.system("cat sstv_camera.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") # > /dev/null 2>&1") # try: @@ -74,7 +77,7 @@ if __name__ == "__main__": # time.sleep(2) # camera.capture('sstv_image.jpg') # finally: - GPIO.output(txLed, txLedOn); + # GPIO.output(27, 0); print("Sleeping") time.sleep(10) From e40054d496e2bd4af95166df7fbe3a6f192f0096 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 15 May 2021 09:21:35 -0400 Subject: [PATCH 127/415] Update rpitx.py --- rpitx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index 35642bfa..029daa01 100644 --- a/rpitx.py +++ b/rpitx.py @@ -65,7 +65,7 @@ if __name__ == "__main__": GPIO.output(txLed, txLedOn); os.system("raspistill -o ~/camera_out.jpg -w 640 -h 496") # > /dev/null 2>&1") print("Picture taken") - os.system("sudo python3 -m pysstv --mode PD120 ~/camera_out.jpg sstv_camera.wav") # > /dev/null 2>&1") + os.system("sudo python3 -m pysstv --mode PD120 ~/camera_out.jpg ~/sstv_camera.wav") # > /dev/null 2>&1") print ("Sending picture") os.system("cat sstv_camera.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") # > /dev/null 2>&1") From 3cfd6f2d05be5755fae2b285f9f727c8f2f66ccc Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 15 May 2021 09:50:28 -0400 Subject: [PATCH 128/415] Update rpitx.py --- rpitx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index 029daa01..e6d538ad 100644 --- a/rpitx.py +++ b/rpitx.py @@ -60,7 +60,7 @@ if __name__ == "__main__": print("SSTV") GPIO.output(txLed, txLedOn); # os.system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") - os.system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3 &") +# os.system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3 &") while True: GPIO.output(txLed, txLedOn); os.system("raspistill -o ~/camera_out.jpg -w 640 -h 496") # > /dev/null 2>&1") From d47c82b0ca509b25385206e907c4111b91cc48b5 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 15 May 2021 13:27:25 -0400 Subject: [PATCH 129/415] Update rpitx.py --- rpitx.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rpitx.py b/rpitx.py index e6d538ad..123fb599 100644 --- a/rpitx.py +++ b/rpitx.py @@ -63,11 +63,11 @@ if __name__ == "__main__": # os.system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3 &") while True: GPIO.output(txLed, txLedOn); - os.system("raspistill -o ~/camera_out.jpg -w 640 -h 496") # > /dev/null 2>&1") + os.system("raspistill -o /home/pi/camera_out.jpg -w 640 -h 496") # > /dev/null 2>&1") print("Picture taken") - os.system("sudo python3 -m pysstv --mode PD120 ~/camera_out.jpg ~/sstv_camera.wav") # > /dev/null 2>&1") + os.system("sudo python3 -m pysstv --mode PD120 /home/pi/camera_out.jpg /home/pi/sstv_camera.wav") # > /dev/null 2>&1") print ("Sending picture") - os.system("cat sstv_camera.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") # > /dev/null 2>&1") + os.system("cat /home/pi/sstv_camera.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") # > /dev/null 2>&1") # try: # camera = PiCamera() From 0cd59038cfaa2ed39084c61e255f25b357ea0e2c Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 15 May 2021 13:34:47 -0400 Subject: [PATCH 130/415] Update rpitx.py --- rpitx.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/rpitx.py b/rpitx.py index 123fb599..23db145e 100644 --- a/rpitx.py +++ b/rpitx.py @@ -3,9 +3,10 @@ import RPi.GPIO as GPIO import subprocess import time -import os +#import os import sys # from picamera import PiCamera +from os import system GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) @@ -38,7 +39,7 @@ print(callsign) #GPIO.output(27, 1); GPIO.output(txLed, txLedOn); -os.system("echo 'de " + callsign + "' > id.txt && gen_packets -M 20 id.txt -o morse.wav -r 48000 > /dev/null 2>&1 && cat morse.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") +system("echo 'de " + callsign + "' > id.txt && gen_packets -M 20 id.txt -o morse.wav -r 48000 > /dev/null 2>&1 && cat morse.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") #GPIO.output(27, 0); GPIO.output(txLed, txLedOff); @@ -60,14 +61,15 @@ if __name__ == "__main__": print("SSTV") GPIO.output(txLed, txLedOn); # os.system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") -# os.system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3 &") + system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3 &") while True: GPIO.output(txLed, txLedOn); - os.system("raspistill -o /home/pi/camera_out.jpg -w 640 -h 496") # > /dev/null 2>&1") + system("raspistill -o /home/pi/camera_out.jpg -w 640 -h 496") # > /dev/null 2>&1") print("Picture taken") - os.system("sudo python3 -m pysstv --mode PD120 /home/pi/camera_out.jpg /home/pi/sstv_camera.wav") # > /dev/null 2>&1") + system("sudo python3 -m pysstv --mode PD120 /home/pi/camera_out.jpg /home/pi/sstv_camera.wav") # > /dev/null 2>&1") print ("Sending picture") - os.system("cat /home/pi/sstv_camera.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") # > /dev/null 2>&1") + system("sudo killall -9 rpitx > /dev/null 2>&1") + system("cat /home/pi/sstv_camera.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") # > /dev/null 2>&1") # try: # camera = PiCamera() From a459bfa8cdd97e8537e8db1d2f558853a8eed000 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 15 May 2021 13:39:34 -0400 Subject: [PATCH 131/415] Update rpitx.py --- rpitx.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/rpitx.py b/rpitx.py index 23db145e..fe5ef966 100644 --- a/rpitx.py +++ b/rpitx.py @@ -62,13 +62,14 @@ if __name__ == "__main__": GPIO.output(txLed, txLedOn); # os.system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3 &") - while True: - GPIO.output(txLed, txLedOn); + while 1: + GPIO.output(txLed, txLedOff); system("raspistill -o /home/pi/camera_out.jpg -w 640 -h 496") # > /dev/null 2>&1") - print("Picture taken") + print("Photo taken") system("sudo python3 -m pysstv --mode PD120 /home/pi/camera_out.jpg /home/pi/sstv_camera.wav") # > /dev/null 2>&1") - print ("Sending picture") + print ("Sending SSTV photo") system("sudo killall -9 rpitx > /dev/null 2>&1") + GPIO.output(txLed, txLedOn); system("cat /home/pi/sstv_camera.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") # > /dev/null 2>&1") # try: @@ -81,12 +82,12 @@ if __name__ == "__main__": # finally: # GPIO.output(27, 0); - print("Sleeping") - time.sleep(10) - print("Transmitting SSTV") - GPIO.output(txLed, txLedOff); +# print("Sleeping") +# time.sleep(10) +# print("Transmitting SSTV") +# GPIO.output(txLed, txLedOff); # GPIO.output(27, 1); - time.sleep(10) +# time.sleep(10) # os.system("cat /home/pi/CubeSatSim/wav/sstv.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") elif (('b' == sys.argv[1]) or ('bpsk' in sys.argv[1])): From 6319886344ed31ac3c56341aee2170577a49c4df Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 15 May 2021 13:56:35 -0400 Subject: [PATCH 132/415] Update rpitx.py --- rpitx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index fe5ef966..e9288768 100644 --- a/rpitx.py +++ b/rpitx.py @@ -61,8 +61,8 @@ if __name__ == "__main__": print("SSTV") GPIO.output(txLed, txLedOn); # os.system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") - system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3 &") while 1: + system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3 &") GPIO.output(txLed, txLedOff); system("raspistill -o /home/pi/camera_out.jpg -w 640 -h 496") # > /dev/null 2>&1") print("Photo taken") From 7af9e6520132329e30e42e8319ead4ba02196887 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 15 May 2021 14:01:43 -0400 Subject: [PATCH 133/415] Update rpitx.py --- rpitx.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rpitx.py b/rpitx.py index e9288768..1a453ee1 100644 --- a/rpitx.py +++ b/rpitx.py @@ -59,15 +59,18 @@ if __name__ == "__main__": time.sleep(5) elif (('s' == sys.argv[1]) or ('sstv' in sys.argv[1])): print("SSTV") - GPIO.output(txLed, txLedOn); + GPIO.output(txLed, txLedOn) # os.system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") while 1: system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3 &") - GPIO.output(txLed, txLedOff); + GPIO.output(txLed, txLedOff) system("raspistill -o /home/pi/camera_out.jpg -w 640 -h 496") # > /dev/null 2>&1") print("Photo taken") + GPIO.output(txLed, txLedOn) system("sudo python3 -m pysstv --mode PD120 /home/pi/camera_out.jpg /home/pi/sstv_camera.wav") # > /dev/null 2>&1") + GPIO.output(txLed, txLedOff) print ("Sending SSTV photo") + time.sleep(1) system("sudo killall -9 rpitx > /dev/null 2>&1") GPIO.output(txLed, txLedOn); system("cat /home/pi/sstv_camera.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") # > /dev/null 2>&1") From dcad81e7e0f7be706d533df29e0fb83fa06e3066 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 15 May 2021 14:27:24 -0400 Subject: [PATCH 134/415] Update rpitx.py --- rpitx.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index 1a453ee1..c6df0b35 100644 --- a/rpitx.py +++ b/rpitx.py @@ -59,7 +59,7 @@ if __name__ == "__main__": time.sleep(5) elif (('s' == sys.argv[1]) or ('sstv' in sys.argv[1])): print("SSTV") - GPIO.output(txLed, txLedOn) +# GPIO.output(txLed, txLedOn) # os.system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") while 1: system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3 &") @@ -72,6 +72,7 @@ if __name__ == "__main__": print ("Sending SSTV photo") time.sleep(1) system("sudo killall -9 rpitx > /dev/null 2>&1") + system("sudo killall -9 csdr > /dev/null 2>&1") GPIO.output(txLed, txLedOn); system("cat /home/pi/sstv_camera.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") # > /dev/null 2>&1") From bc026ab9664dbe562ebb560636328efb56767e53 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 15 May 2021 14:54:58 -0400 Subject: [PATCH 135/415] Update rpitx.py --- rpitx.py | 1 + 1 file changed, 1 insertion(+) diff --git a/rpitx.py b/rpitx.py index c6df0b35..49c24bc2 100644 --- a/rpitx.py +++ b/rpitx.py @@ -73,6 +73,7 @@ if __name__ == "__main__": time.sleep(1) system("sudo killall -9 rpitx > /dev/null 2>&1") system("sudo killall -9 csdr > /dev/null 2>&1") + system("sudo killall -9 cat > /dev/null 2>&1") GPIO.output(txLed, txLedOn); system("cat /home/pi/sstv_camera.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") # > /dev/null 2>&1") From 6d9f0c79cf60e8f72e3fae6f08b24fec6df7b2c4 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 15 May 2021 15:28:16 -0400 Subject: [PATCH 136/415] trying camera test --- rpitx.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/rpitx.py b/rpitx.py index 49c24bc2..8672a210 100644 --- a/rpitx.py +++ b/rpitx.py @@ -4,8 +4,8 @@ import RPi.GPIO as GPIO import subprocess import time #import os -import sys -# from picamera import PiCamera +import system +from picamera import PiCamera from os import system GPIO.setmode(GPIO.BCM) @@ -59,6 +59,13 @@ if __name__ == "__main__": time.sleep(5) elif (('s' == sys.argv[1]) or ('sstv' in sys.argv[1])): print("SSTV") + try: + camera = PiCamera() + print("Camera present") + except: + print("No camera") + finally: + print("Continuing") # GPIO.output(txLed, txLedOn) # os.system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") while 1: From bbc726cb8cb52aa0870f84fba92dfef60a40348e Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 15 May 2021 15:29:54 -0400 Subject: [PATCH 137/415] Update rpitx.py --- rpitx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index 8672a210..fee5501a 100644 --- a/rpitx.py +++ b/rpitx.py @@ -4,7 +4,7 @@ import RPi.GPIO as GPIO import subprocess import time #import os -import system +import sys from picamera import PiCamera from os import system From ba5e62dc96029f1e06d712d8900fefe09169777f Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 15 May 2021 15:44:26 -0400 Subject: [PATCH 138/415] added camera conditional for sstv --- rpitx.py | 42 +++++++++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/rpitx.py b/rpitx.py index fee5501a..70ba8a2f 100644 --- a/rpitx.py +++ b/rpitx.py @@ -8,6 +8,16 @@ import sys from picamera import PiCamera from os import system +try: + camera = PiCamera() + print("Camera present") + camera_present = 1 +except: + print("No camera") + camera_present = 0 +finally: + print("Continuing") + GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) GPIO.setup(22, GPIO.IN, pull_up_down=GPIO.PUD_UP) @@ -71,19 +81,25 @@ if __name__ == "__main__": while 1: system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3 &") GPIO.output(txLed, txLedOff) - system("raspistill -o /home/pi/camera_out.jpg -w 640 -h 496") # > /dev/null 2>&1") - print("Photo taken") - GPIO.output(txLed, txLedOn) - system("sudo python3 -m pysstv --mode PD120 /home/pi/camera_out.jpg /home/pi/sstv_camera.wav") # > /dev/null 2>&1") - GPIO.output(txLed, txLedOff) - print ("Sending SSTV photo") - time.sleep(1) - system("sudo killall -9 rpitx > /dev/null 2>&1") - system("sudo killall -9 csdr > /dev/null 2>&1") - system("sudo killall -9 cat > /dev/null 2>&1") - GPIO.output(txLed, txLedOn); - system("cat /home/pi/sstv_camera.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") # > /dev/null 2>&1") - + if (camera_present == 1): + system("raspistill -o /home/pi/camera_out.jpg -w 640 -h 496") # > /dev/null 2>&1") + print("Photo taken") + GPIO.output(txLed, txLedOn) + system("sudo python3 -m pysstv --mode PD120 /home/pi/camera_out.jpg /home/pi/sstv_camera.wav") # > /dev/null 2>&1") + GPIO.output(txLed, txLedOff) + print ("Sending SSTV photo") + time.sleep(1) + system("sudo killall -9 rpitx > /dev/null 2>&1") + system("sudo killall -9 csdr > /dev/null 2>&1") + system("sudo killall -9 cat > /dev/null 2>&1") + GPIO.output(txLed, txLedOn); + system("cat /home/pi/sstv_camera.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") # > /dev/null 2>&1") + else: + while 1: + GPIO.output(txLed, txLedOn) + time.sleep(60) + GPIO.output(txLed, txLedOff) + time.sleep(1) # try: # camera = PiCamera() # camera.resolution = (640, 496) From 1f5a799194010754b1fe8feb969a383e3841c0cc Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 15 May 2021 15:52:08 -0400 Subject: [PATCH 139/415] Update rpitx.py --- rpitx.py | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/rpitx.py b/rpitx.py index 70ba8a2f..9d27ef3b 100644 --- a/rpitx.py +++ b/rpitx.py @@ -8,16 +8,6 @@ import sys from picamera import PiCamera from os import system -try: - camera = PiCamera() - print("Camera present") - camera_present = 1 -except: - print("No camera") - camera_present = 0 -finally: - print("Continuing") - GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) GPIO.setup(22, GPIO.IN, pull_up_down=GPIO.PUD_UP) @@ -40,6 +30,16 @@ print(txLedOn) print(txLed) GPIO.setup(27, GPIO.OUT) GPIO.output(27, 0) + +try: + camera = PiCamera() + print("Camera present") + camera_present = 1 +except: + print("No camera") + camera_present = 0 +finally: + print("Continuing") print(transmit) @@ -69,13 +69,13 @@ if __name__ == "__main__": time.sleep(5) elif (('s' == sys.argv[1]) or ('sstv' in sys.argv[1])): print("SSTV") - try: - camera = PiCamera() - print("Camera present") - except: - print("No camera") - finally: - print("Continuing") +# try: +# camera = PiCamera() +# print("Camera present") +# except: +# print("No camera") +# finally: +# print("Continuing") # GPIO.output(txLed, txLedOn) # os.system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") while 1: From 62cc17d55bd2ca93b092a96c3d1f3cef3a168d21 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 15 May 2021 16:06:04 -0400 Subject: [PATCH 140/415] added camera close --- rpitx.py | 1 + 1 file changed, 1 insertion(+) diff --git a/rpitx.py b/rpitx.py index 9d27ef3b..f49039b1 100644 --- a/rpitx.py +++ b/rpitx.py @@ -35,6 +35,7 @@ try: camera = PiCamera() print("Camera present") camera_present = 1 + camera.close() except: print("No camera") camera_present = 0 From 68869934733213cd974796ef0757d8739b5105e5 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 15 May 2021 16:22:09 -0400 Subject: [PATCH 141/415] no finally --- rpitx.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/rpitx.py b/rpitx.py index f49039b1..6ff032a7 100644 --- a/rpitx.py +++ b/rpitx.py @@ -31,17 +31,6 @@ print(txLed) GPIO.setup(27, GPIO.OUT) GPIO.output(27, 0) -try: - camera = PiCamera() - print("Camera present") - camera_present = 1 - camera.close() -except: - print("No camera") - camera_present = 0 -finally: - print("Continuing") - print(transmit) file = open("/home/pi/CubeSatSim/sim.cfg") @@ -70,6 +59,18 @@ if __name__ == "__main__": time.sleep(5) elif (('s' == sys.argv[1]) or ('sstv' in sys.argv[1])): print("SSTV") + try: + camera = PiCamera() + print("Camera present") + camera_present = 1 + camera.close() + except: + print("No camera") + camera_present = 0 +# finally: +# print("Continuing") + + # try: # camera = PiCamera() # print("Camera present") From 8ed01c55d58d454f37b42bb2cec025d66117f704 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 15 May 2021 16:57:54 -0400 Subject: [PATCH 142/415] cleanup with working auto detect camera SSTV mode --- rpitx.py | 39 +++++---------------------------------- 1 file changed, 5 insertions(+), 34 deletions(-) diff --git a/rpitx.py b/rpitx.py index 6ff032a7..61b0f77d 100644 --- a/rpitx.py +++ b/rpitx.py @@ -67,20 +67,8 @@ if __name__ == "__main__": except: print("No camera") camera_present = 0 -# finally: -# print("Continuing") - - -# try: -# camera = PiCamera() -# print("Camera present") -# except: -# print("No camera") -# finally: -# print("Continuing") -# GPIO.output(txLed, txLedOn) -# os.system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") - while 1: + + while 1: system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3 &") GPIO.output(txLed, txLedOff) if (camera_present == 1): @@ -102,33 +90,16 @@ if __name__ == "__main__": time.sleep(60) GPIO.output(txLed, txLedOff) time.sleep(1) -# try: -# camera = PiCamera() -# camera.resolution = (640, 496) -# camera.start_preview() - # Camera warm-up time -# time.sleep(2) -# camera.capture('sstv_image.jpg') -# finally: - - # GPIO.output(27, 0); -# print("Sleeping") -# time.sleep(10) -# print("Transmitting SSTV") -# GPIO.output(txLed, txLedOff); -# GPIO.output(27, 1); -# time.sleep(10) -# os.system("cat /home/pi/CubeSatSim/wav/sstv.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") elif (('b' == sys.argv[1]) or ('bpsk' in sys.argv[1])): print("BPSK") - os.system("sudo nc -l 8080 | csdr convert_i16_f | csdr fir_interpolate_cc 2 | csdr dsb_fc | csdr bandpass_fir_fft_cc 0.002 0.06 0.01 | csdr fastagc_ff | sudo /home/pi/rpitx/sendiq -i /dev/stdin -s 96000 -f 434.9e6 -t float") + system("sudo nc -l 8080 | csdr convert_i16_f | csdr fir_interpolate_cc 2 | csdr dsb_fc | csdr bandpass_fir_fft_cc 0.002 0.06 0.01 | csdr fastagc_ff | sudo /home/pi/rpitx/sendiq -i /dev/stdin -s 96000 -f 434.9e6 -t float") else: print("FSK") - os.system("sudo nc -l 8080 | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.9e3") + system("sudo nc -l 8080 | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.9e3") else: print("FSK") - os.system("sudo nc -l 8080 | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.9e3") + system("sudo nc -l 8080 | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.9e3") else: print("No Band Pass Filter so no telemetry transmit. See http://cubesatsim.org/wiki for instructions on how to build the BPF.") while True: From 03c3047080990183a52271ced05bac02c3f3418b Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 15 May 2021 17:05:33 -0400 Subject: [PATCH 143/415] Update rpitx.py --- rpitx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index 61b0f77d..eea82cd9 100644 --- a/rpitx.py +++ b/rpitx.py @@ -68,7 +68,7 @@ if __name__ == "__main__": print("No camera") camera_present = 0 - while 1: + while 1: system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3 &") GPIO.output(txLed, txLedOff) if (camera_present == 1): From 363f250e21bddcdb5c40fc4ffff77dc3d15a66b0 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 15 May 2021 18:52:30 -0400 Subject: [PATCH 144/415] try moving picamera import --- rpitx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index eea82cd9..30c9446c 100644 --- a/rpitx.py +++ b/rpitx.py @@ -5,7 +5,6 @@ import subprocess import time #import os import sys -from picamera import PiCamera from os import system GPIO.setmode(GPIO.BCM) @@ -60,6 +59,7 @@ if __name__ == "__main__": elif (('s' == sys.argv[1]) or ('sstv' in sys.argv[1])): print("SSTV") try: + from picamera import PiCamera camera = PiCamera() print("Camera present") camera_present = 1 From 08f8ed4a89a19334d2bc30c16a168b065cae114a Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 15 May 2021 21:04:01 -0400 Subject: [PATCH 145/415] added PySSTV import test --- rpitx.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index 30c9446c..d81499db 100644 --- a/rpitx.py +++ b/rpitx.py @@ -59,7 +59,8 @@ if __name__ == "__main__": elif (('s' == sys.argv[1]) or ('sstv' in sys.argv[1])): print("SSTV") try: - from picamera import PiCamera + from picamera import PiCamera + from pysstv.sstv import SSTV camera = PiCamera() print("Camera present") camera_present = 1 From 89d58d1f17b060d0827d74ec079be72f90fa8550 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 15 May 2021 21:20:29 -0400 Subject: [PATCH 146/415] fixed tabs --- rpitx.py | 112 +++++++++++++++++++++++++++---------------------------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/rpitx.py b/rpitx.py index d81499db..3ab03f1f 100644 --- a/rpitx.py +++ b/rpitx.py @@ -18,11 +18,11 @@ if GPIO.input(22) == False: transmit = True txLed = 27 txLedOn = 0 - txLedOff = 1 + txLedOff = 1 else: txLed = 27 txLedOn = 1 - txLedOff = 0 + txLedOff = 0 GPIO.setup(txLed, GPIO.OUT) print(txLedOn) @@ -46,62 +46,62 @@ time.sleep(2) if __name__ == "__main__": - if (transmit): + if (transmit): - print 'Length: ', len(sys.argv) + print 'Length: ', len(sys.argv) - if (len(sys.argv)) > 1: -# print("There are arguments!") - if (('a' == sys.argv[1]) or ('afsk' in sys.argv[1])): - print("AFSK") - while True: - time.sleep(5) - elif (('s' == sys.argv[1]) or ('sstv' in sys.argv[1])): - print("SSTV") - try: - from picamera import PiCamera - from pysstv.sstv import SSTV - camera = PiCamera() - print("Camera present") - camera_present = 1 - camera.close() - except: - print("No camera") - camera_present = 0 + if (len(sys.argv)) > 1: +# print("There are arguments!") + if (('a' == sys.argv[1]) or ('afsk' in sys.argv[1])): + print("AFSK") + while True: + time.sleep(5) + elif (('s' == sys.argv[1]) or ('sstv' in sys.argv[1])): + print("SSTV") + try: + from picamera import PiCamera + from pysstv.sstv import SSTV + camera = PiCamera() + print("Camera present") + camera_present = 1 + camera.close() + except: + print("No camera") + camera_present = 0 - while 1: - system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3 &") - GPIO.output(txLed, txLedOff) - if (camera_present == 1): - system("raspistill -o /home/pi/camera_out.jpg -w 640 -h 496") # > /dev/null 2>&1") - print("Photo taken") - GPIO.output(txLed, txLedOn) - system("sudo python3 -m pysstv --mode PD120 /home/pi/camera_out.jpg /home/pi/sstv_camera.wav") # > /dev/null 2>&1") - GPIO.output(txLed, txLedOff) - print ("Sending SSTV photo") - time.sleep(1) - system("sudo killall -9 rpitx > /dev/null 2>&1") - system("sudo killall -9 csdr > /dev/null 2>&1") - system("sudo killall -9 cat > /dev/null 2>&1") - GPIO.output(txLed, txLedOn); - system("cat /home/pi/sstv_camera.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") # > /dev/null 2>&1") - else: - while 1: - GPIO.output(txLed, txLedOn) - time.sleep(60) - GPIO.output(txLed, txLedOff) - time.sleep(1) + while 1: + system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3 &") + GPIO.output(txLed, txLedOff) + if (camera_present == 1): + system("raspistill -o /home/pi/camera_out.jpg -w 640 -h 496") # > /dev/null 2>&1") + print("Photo taken") + GPIO.output(txLed, txLedOn) + system("sudo python3 -m pysstv --mode PD120 /home/pi/camera_out.jpg /home/pi/sstv_camera.wav") # > /dev/null 2>&1") + GPIO.output(txLed, txLedOff) + print ("Sending SSTV photo") + time.sleep(1) + system("sudo killall -9 rpitx > /dev/null 2>&1") + system("sudo killall -9 csdr > /dev/null 2>&1") + system("sudo killall -9 cat > /dev/null 2>&1") + GPIO.output(txLed, txLedOn); + system("cat /home/pi/sstv_camera.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") # > /dev/null 2>&1") + else: + while 1: + GPIO.output(txLed, txLedOn) + time.sleep(60) + GPIO.output(txLed, txLedOff) + time.sleep(1) - elif (('b' == sys.argv[1]) or ('bpsk' in sys.argv[1])): - print("BPSK") - system("sudo nc -l 8080 | csdr convert_i16_f | csdr fir_interpolate_cc 2 | csdr dsb_fc | csdr bandpass_fir_fft_cc 0.002 0.06 0.01 | csdr fastagc_ff | sudo /home/pi/rpitx/sendiq -i /dev/stdin -s 96000 -f 434.9e6 -t float") + elif (('b' == sys.argv[1]) or ('bpsk' in sys.argv[1])): + print("BPSK") + system("sudo nc -l 8080 | csdr convert_i16_f | csdr fir_interpolate_cc 2 | csdr dsb_fc | csdr bandpass_fir_fft_cc 0.002 0.06 0.01 | csdr fastagc_ff | sudo /home/pi/rpitx/sendiq -i /dev/stdin -s 96000 -f 434.9e6 -t float") + else: + print("FSK") + system("sudo nc -l 8080 | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.9e3") + else: + print("FSK") + system("sudo nc -l 8080 | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.9e3") else: - print("FSK") - system("sudo nc -l 8080 | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.9e3") - else: - print("FSK") - system("sudo nc -l 8080 | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.9e3") - else: - print("No Band Pass Filter so no telemetry transmit. See http://cubesatsim.org/wiki for instructions on how to build the BPF.") - while True: - time.sleep(5) + print("No Band Pass Filter so no telemetry transmit. See http://cubesatsim.org/wiki for instructions on how to build the BPF.") + while True: + time.sleep(5) From 8b6bd7bbc5a555e1ee56b3706fbb8d4ab70910f7 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 15 May 2021 21:22:10 -0400 Subject: [PATCH 147/415] removed length print --- rpitx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index 3ab03f1f..97d41b5e 100644 --- a/rpitx.py +++ b/rpitx.py @@ -48,7 +48,7 @@ if __name__ == "__main__": if (transmit): - print 'Length: ', len(sys.argv) +# print 'Length: ', len(sys.argv) if (len(sys.argv)) > 1: # print("There are arguments!") From 6b37a1bdc3bc4e691bcff53620c37164acb167b4 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 15 May 2021 21:24:10 -0400 Subject: [PATCH 148/415] Update rpitx.py --- rpitx.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpitx.py b/rpitx.py index 97d41b5e..d7520168 100644 --- a/rpitx.py +++ b/rpitx.py @@ -99,9 +99,9 @@ if __name__ == "__main__": print("FSK") system("sudo nc -l 8080 | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.9e3") else: - print("FSK") + print("FSK") system("sudo nc -l 8080 | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.9e3") else: - print("No Band Pass Filter so no telemetry transmit. See http://cubesatsim.org/wiki for instructions on how to build the BPF.") + print("No Band Pass Filter so no telemetry transmit. See http://cubesatsim.org/wiki for instructions on how to build the BPF.") while True: time.sleep(5) From 492e9343cf19a1815d9789be0e9fbc46fb77505a Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 15 May 2021 21:24:52 -0400 Subject: [PATCH 149/415] Update rpitx.py --- rpitx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index d7520168..528ca6e1 100644 --- a/rpitx.py +++ b/rpitx.py @@ -103,5 +103,5 @@ if __name__ == "__main__": system("sudo nc -l 8080 | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.9e3") else: print("No Band Pass Filter so no telemetry transmit. See http://cubesatsim.org/wiki for instructions on how to build the BPF.") - while True: + while 1: time.sleep(5) From 2a1a5cfcc09deba6ddae7ee48b630c8fae2bd69c Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 15 May 2021 21:25:43 -0400 Subject: [PATCH 150/415] Update rpitx.py --- rpitx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index 528ca6e1..52be6541 100644 --- a/rpitx.py +++ b/rpitx.py @@ -103,5 +103,5 @@ if __name__ == "__main__": system("sudo nc -l 8080 | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.9e3") else: print("No Band Pass Filter so no telemetry transmit. See http://cubesatsim.org/wiki for instructions on how to build the BPF.") - while 1: + while 1: time.sleep(5) From 6cd52b5ac3ef392fcc0327580dbb9524d1316257 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 15 May 2021 21:26:33 -0400 Subject: [PATCH 151/415] Update rpitx.py --- rpitx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index 52be6541..e3730d11 100644 --- a/rpitx.py +++ b/rpitx.py @@ -102,6 +102,6 @@ if __name__ == "__main__": print("FSK") system("sudo nc -l 8080 | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.9e3") else: - print("No Band Pass Filter so no telemetry transmit. See http://cubesatsim.org/wiki for instructions on how to build the BPF.") + print("No Band Pass Filter so no telemetry transmit. See http://cubesatsim.org/wiki for instructions on how to build the BPF.") while 1: time.sleep(5) From f6f932251fa5191e66024d3f6791037f54ca00d0 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 15 May 2021 21:27:23 -0400 Subject: [PATCH 152/415] Update rpitx.py --- rpitx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index e3730d11..2a5f9a90 100644 --- a/rpitx.py +++ b/rpitx.py @@ -102,6 +102,6 @@ if __name__ == "__main__": print("FSK") system("sudo nc -l 8080 | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo /home/pi/rpitx/rpitx -i- -m RF -f 434.9e3") else: - print("No Band Pass Filter so no telemetry transmit. See http://cubesatsim.org/wiki for instructions on how to build the BPF.") + print("No Band Pass Filter so no telemetry transmit. See http://cubesatsim.org/wiki for instructions on how to build the BPF.") while 1: time.sleep(5) From 0fd9db98120da6abc1d9f080312340ea36e4e9df Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 15 May 2021 21:37:29 -0400 Subject: [PATCH 153/415] changed from python to python3 --- rpitx.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rpitx.sh b/rpitx.sh index 409f9caf..afc736a2 100755 --- a/rpitx.sh +++ b/rpitx.sh @@ -8,18 +8,18 @@ if [ "$1" = "c" ]; then echo $y if [ $(($y % 4)) = 3 ]; then echo "Mode is continuous AFSK" - python -u /home/pi/CubeSatSim/rpitx.py a + python3 -u /home/pi/CubeSatSim/rpitx.py a elif [ $(($y % 4)) = 1 ]; then echo "Mode is continuous BPSK" - python -u /home/pi/CubeSatSim/rpitx.py b + python3 -u /home/pi/CubeSatSim/rpitx.py b elif [ $(($y % 4)) = 2 ]; then echo "Mode is continuous SSTV" - python -u /home/pi/CubeSatSim/rpitx.py s + python3 -u /home/pi/CubeSatSim/rpitx.py s else echo "Mode is continuous FSK" - python -u /home/pi/CubeSatSim/rpitx.py f + python3 -u /home/pi/CubeSatSim/rpitx.py f fi else - python -u /home/pi/CubeSatSim/rpitx.py $1 + python3 -u /home/pi/CubeSatSim/rpitx.py $1 fi From bc57f1f03e224ca280e3629a983873c111a9b703 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 27 May 2021 12:54:17 -0400 Subject: [PATCH 154/415] changed to use PiSSTVpp for faster conversion --- rpitx.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/rpitx.py b/rpitx.py index 2a5f9a90..5fa9a149 100644 --- a/rpitx.py +++ b/rpitx.py @@ -70,13 +70,14 @@ if __name__ == "__main__": camera_present = 0 while 1: - system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3 &") +# system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3 &") GPIO.output(txLed, txLedOff) if (camera_present == 1): - system("raspistill -o /home/pi/camera_out.jpg -w 640 -h 496") # > /dev/null 2>&1") + system("raspistill -o /home/pi/camera_out.jpg -w 320 -h 256") # > /dev/null 2>&1") print("Photo taken") GPIO.output(txLed, txLedOn) - system("sudo python3 -m pysstv --mode PD120 /home/pi/camera_out.jpg /home/pi/sstv_camera.wav") # > /dev/null 2>&1") +# system("sudo python3 -m pysstv --mode PD120 /home/pi/camera_out.jpg /home/pi/sstv_camera.wav") # > /dev/null 2>&1") + system("/home/pi/PiSSTVpp/pisstvpp -r 48000 -p s2 /home/pi/camera_out.jpg") # > /dev/null 2>&1") GPIO.output(txLed, txLedOff) print ("Sending SSTV photo") time.sleep(1) @@ -84,8 +85,9 @@ if __name__ == "__main__": system("sudo killall -9 csdr > /dev/null 2>&1") system("sudo killall -9 cat > /dev/null 2>&1") GPIO.output(txLed, txLedOn); - system("cat /home/pi/sstv_camera.wav | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") # > /dev/null 2>&1") + system("cat /home/pi/camera_out.jpg.wav | csdr convert_i16_f | csdr gain_ff 14000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") # > /dev/null 2>&1") else: + system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3 &") while 1: GPIO.output(txLed, txLedOn) time.sleep(60) From 22d03f1334451c0cfe64fb3bd34738e1dc8d4fd8 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 27 May 2021 13:47:07 -0400 Subject: [PATCH 155/415] removed pysstv test --- rpitx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index 5fa9a149..3b3fe8b2 100644 --- a/rpitx.py +++ b/rpitx.py @@ -60,7 +60,7 @@ if __name__ == "__main__": print("SSTV") try: from picamera import PiCamera - from pysstv.sstv import SSTV +# from pysstv.sstv import SSTV camera = PiCamera() print("Camera present") camera_present = 1 From 863dddbbb55c3939889718bf3f22437baa853817 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 29 May 2021 11:12:21 -0400 Subject: [PATCH 156/415] 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 157/415] 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 158/415] 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 159/415] 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 160/415] 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 161/415] 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 162/415] 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 163/415] 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 164/415] 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 165/415] 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 166/415] 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 167/415] 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 168/415] 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 169/415] 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 170/415] 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 171/415] 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 172/415] 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 173/415] 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 174/415] 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 175/415] 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 176/415] 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 177/415] 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 178/415] 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 179/415] 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 180/415] 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 181/415] 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 182/415] 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 183/415] 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 184/415] 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 185/415] 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 186/415] 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 187/415] 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 188/415] 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 189/415] 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 190/415] 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 191/415] 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 192/415] 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 193/415] 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 194/415] 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 195/415] 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 196/415] 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 197/415] 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 198/415] 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 199/415] 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 200/415] 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 201/415] 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 202/415] 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 203/415] 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 204/415] 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 205/415] 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 206/415] 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 207/415] 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 208/415] 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 209/415] 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 210/415] 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 211/415] 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 212/415] 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 213/415] 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 214/415] 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 215/415] 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 216/415] 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 217/415] 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 218/415] 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 219/415] 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 220/415] 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 221/415] 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 222/415] 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 223/415] 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 224/415] 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 225/415] 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 226/415] 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 227/415] 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 228/415] 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 229/415] 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 230/415] 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 231/415] 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 232/415] 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 233/415] 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 234/415] 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 235/415] 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 236/415] 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 237/415] 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 238/415] 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 239/415] 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 240/415] 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 241/415] 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 242/415] 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 243/415] 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 244/415] 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 245/415] 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 246/415] 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 247/415] 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 248/415] 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 249/415] 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 250/415] 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 251/415] 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 252/415] 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 253/415] 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 254/415] 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 255/415] 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 256/415] 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 257/415] 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 258/415] 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 259/415] 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 260/415] 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 261/415] 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 262/415] 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 263/415] 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 264/415] 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 265/415] 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 266/415] 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 267/415] 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 268/415] 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 269/415] 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 270/415] 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 271/415] 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 272/415] 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 273/415] 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 274/415] 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 275/415] 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 276/415] 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 277/415] 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 278/415] 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 279/415] 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 280/415] 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 281/415] 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 282/415] 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 283/415] 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 284/415] 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 285/415] 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 286/415] 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 287/415] 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 288/415] 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"); From a97e0e3d98d5626190645739d5275cc141ae818d Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 2 Jun 2021 17:21:22 -0400 Subject: [PATCH 289/415] put APRS changes from dev into this branch for merge --- rpitx.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index 3b3fe8b2..7bfc90d9 100644 --- a/rpitx.py +++ b/rpitx.py @@ -55,7 +55,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") try: From 5fe0a28055755bc12aef088503ff6017b1f361d7 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 2 Jun 2021 21:01:32 -0400 Subject: [PATCH 290/415] added -m Simulated Mode setting and display of mode --- config | 135 ++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 125 insertions(+), 10 deletions(-) diff --git a/config b/config index d881c326..8d752dd7 100755 --- a/config +++ b/config @@ -3,7 +3,40 @@ # echo $1 if [ "$1" = "" ]; then - echo "Include a configuration option:" + value=`cat /home/pi/CubeSatSim/.mode` + echo "$value" > /dev/null + set -- $value + + if [ "$1" = "ARG1=a" ]; then + echo "APRS mode set" + elif [ "$1" = "ARG1=f" ]; then + echo "FSK mode set" + elif [ "$1" = "ARG1=b" ]; then + echo "BPSK mode set" + elif [ "$1" = "ARG1=s" ]; then + echo "SSTV mode set" + else + echo + fi + echo + echo -e "Current sim.cfg configuration file:" + echo + + value=`cat /home/pi/CubeSatSim/sim.cfg` + echo "$value" > /dev/null + set -- $value + + echo $1 $2 $3 $4 $5 + + if [ $sim = "y" ] ; then + $sim = "yes" + echo "Simulated Telemetry is ON" + else + $sim = "no" + echo "Simulated Telemetry is OFF" + fi + + echo "To change, include an OPTION" echo set -- "-h" fi @@ -50,6 +83,51 @@ elif [ "$1" = "-h" ]; then echo exit +elif [ "$1" = "-m" ]; then + + echo + echo "Editing the Simulated Telemetry setting in" + echo "the configuration file for CubeSatSim" + echo + echo "Return keeps current value." +# echo -e "Current sim.cfg configuration file:" +# echo + + value=`cat /home/pi/CubeSatSim/sim.cfg` + echo "$value" > /dev/null + set -- $value + + if ( [ "$5" = "yes" ]; then + echo "Simualted Telemetry is ON" + else + echo "Simualted Telemetry is OFF" + fi + + echo + +# echo $1 $2 $3 $4 + + echo "Do you want Simulated Telemetry ON (y/n) " + read sim + + if [ $sim = "y" ] ; then + $sim = "yes" + echo "Simulated Telemetry is ON" + else + $sim = "no" + echo "Simulated Telemetry is OFF" + fi + + echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n" + + echo $callsign $2 $3 $4 $sim + echo $callsign $2 $3 $4 $sim > /home/pi/CubeSatSim/sim.cfg + echo + echo "Restarting CubeSatSim with new configuraation file" + echo + + sudo systemctl restart cubesatsim + elif [ "$1" = "-c" ]; then echo @@ -68,7 +146,7 @@ elif [ "$1" = "-c" ]; then echo $1 echo -# echo $1 $2 $3 $4 +# echo $1 $2 $3 $4 $5 echo "Enter callsign in all capitals: " read callsign @@ -81,8 +159,45 @@ elif [ "$1" = "-c" ]; then echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n" - echo $callsign $2 $3 $4 - echo $callsign $2 $3 $4 > /home/pi/CubeSatSim/sim.cfg + echo $callsign $2 $3 $4 $5 + echo $callsign $2 $3 $4 $5 > /home/pi/CubeSatSim/sim.cfg + echo + echo "Restarting CubeSatSim with new configuraation file" + echo + + sudo systemctl restart cubesatsimelif [ "$1" = "-c" ]; then + + echo + echo "Editing the CALLSIGN in the" + echo "configuration file for CubeSatSim" + echo + echo "Return keeps current value." +# echo -e "Current sim.cfg configuration file:" +# echo + + value=`cat /home/pi/CubeSatSim/sim.cfg` + echo "$value" > /dev/null + set -- $value + + echo "Current value of CALLSIGN is" + echo $1 + echo + +# echo $1 $2 $3 $4 $5 + + echo "Enter callsign in all capitals: " + read callsign + + if [ -z $callsign ] ; then + + callsign="$1" + echo "Keeping value of" $callsign + fi + + echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n" + + echo $callsign $2 $3 $4 $5 + echo $callsign $2 $3 $4 $5 > /home/pi/CubeSatSim/sim.cfg echo echo "Restarting CubeSatSim with new configuraation file" echo @@ -108,7 +223,7 @@ elif [ "$1" = "-r" ]; then echo $2 echo -# echo $1 $2 $3 $4 +# echo $1 $2 $3 $4 $5 echo -e "Enter Reset Count (integer): " @@ -127,8 +242,8 @@ elif [ "$1" = "-r" ]; then echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n" - echo $1 $resets $3 $4 - echo $1 $resets $3 $4 > /home/pi/CubeSatSim/sim.cfg + echo $1 $resets $3 $4 $5 + echo $1 $resets $3 $4 $5 > /home/pi/CubeSatSim/sim.cfg echo echo "Restarting CubeSatSim with new configuraation file" echo @@ -155,7 +270,7 @@ elif [ "$1" = "-l" ]; then echo $3 echo -# echo $1 $2 $3 $4 +# echo $1 $2 $3 $4 $5 echo -e "Enter latitude (decimal degrees, positive is north): " @@ -197,8 +312,8 @@ 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 > /home/pi/CubeSatSim/sim.cfg + echo $1 $2 $lat $long $5 + echo $1 $2 $lat $long $5 > /home/pi/CubeSatSim/sim.cfg echo echo "Restarting CubeSatSim with new configuraation file" echo From 7867db15950e9d0790d0ba3f78b87786cfda0a08 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 2 Jun 2021 21:03:39 -0400 Subject: [PATCH 291/415] typo --- config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config b/config index 8d752dd7..08e8a82d 100755 --- a/config +++ b/config @@ -28,7 +28,7 @@ if [ "$1" = "" ]; then echo $1 $2 $3 $4 $5 - if [ $sim = "y" ] ; then + if [ "$sim" = "y" ] ; then $sim = "yes" echo "Simulated Telemetry is ON" else @@ -110,7 +110,7 @@ elif [ "$1" = "-m" ]; then echo "Do you want Simulated Telemetry ON (y/n) " read sim - if [ $sim = "y" ] ; then + if [ "$sim" = "y" ] ; then $sim = "yes" echo "Simulated Telemetry is ON" else From aa8e2be2970576b9012d346ee96bcf473aed758e Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 2 Jun 2021 21:05:39 -0400 Subject: [PATCH 292/415] typos --- config | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config b/config index 08e8a82d..93b9a695 100755 --- a/config +++ b/config @@ -29,10 +29,10 @@ if [ "$1" = "" ]; then echo $1 $2 $3 $4 $5 if [ "$sim" = "y" ] ; then - $sim = "yes" + sim="yes" echo "Simulated Telemetry is ON" else - $sim = "no" + sim="no" echo "Simulated Telemetry is OFF" fi @@ -97,7 +97,7 @@ elif [ "$1" = "-m" ]; then echo "$value" > /dev/null set -- $value - if ( [ "$5" = "yes" ]; then + if [ "$5" = "yes" ]; then echo "Simualted Telemetry is ON" else echo "Simualted Telemetry is OFF" From 0bb766afb8b574da2cdf4004486b370c24a85659 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 2 Jun 2021 21:06:47 -0400 Subject: [PATCH 293/415] typos --- config | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/config b/config index 93b9a695..0f5c8c78 100755 --- a/config +++ b/config @@ -27,6 +27,7 @@ if [ "$1" = "" ]; then set -- $value echo $1 $2 $3 $4 $5 + echo if [ "$sim" = "y" ] ; then sim="yes" @@ -165,7 +166,9 @@ elif [ "$1" = "-c" ]; then echo "Restarting CubeSatSim with new configuraation file" echo - sudo systemctl restart cubesatsimelif [ "$1" = "-c" ]; then + sudo systemctl restart cubesatsim + +elif [ "$1" = "-c" ]; then echo echo "Editing the CALLSIGN in the" From 668b4a8e582f4ae9a7b5112a422b71655a56212b Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 2 Jun 2021 21:07:17 -0400 Subject: [PATCH 294/415] spacing --- config | 1 + 1 file changed, 1 insertion(+) diff --git a/config b/config index 0f5c8c78..6cd8cdf7 100755 --- a/config +++ b/config @@ -37,6 +37,7 @@ if [ "$1" = "" ]; then echo "Simulated Telemetry is OFF" fi + echo echo "To change, include an OPTION" echo set -- "-h" From 97c0976195a702eb2a4a72f0a86e7e50afb9d273 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 2 Jun 2021 21:09:48 -0400 Subject: [PATCH 295/415] typos --- config | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/config b/config index 6cd8cdf7..bdeec16e 100755 --- a/config +++ b/config @@ -91,9 +91,6 @@ elif [ "$1" = "-m" ]; then echo "Editing the Simulated Telemetry setting in" echo "the configuration file for CubeSatSim" echo - echo "Return keeps current value." -# echo -e "Current sim.cfg configuration file:" -# echo value=`cat /home/pi/CubeSatSim/sim.cfg` echo "$value" > /dev/null @@ -111,17 +108,19 @@ elif [ "$1" = "-m" ]; then echo "Do you want Simulated Telemetry ON (y/n) " read sim - + echo + if [ "$sim" = "y" ] ; then - $sim = "yes" + sim="yes" echo "Simulated Telemetry is ON" else - $sim = "no" + sim="no" echo "Simulated Telemetry is OFF" fi + echo echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n" - + echo echo $callsign $2 $3 $4 $sim echo $callsign $2 $3 $4 $sim > /home/pi/CubeSatSim/sim.cfg echo From 83d1725a52fd548467867e8eb82a1f4bc0c712e2 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 2 Jun 2021 21:11:26 -0400 Subject: [PATCH 296/415] typos --- config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config b/config index bdeec16e..2f180dda 100755 --- a/config +++ b/config @@ -121,8 +121,8 @@ elif [ "$1" = "-m" ]; then echo echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n" echo - echo $callsign $2 $3 $4 $sim - echo $callsign $2 $3 $4 $sim > /home/pi/CubeSatSim/sim.cfg + echo $1 $2 $3 $4 $sim + echo $1 $2 $3 $4 $sim > /home/pi/CubeSatSim/sim.cfg echo echo "Restarting CubeSatSim with new configuraation file" echo From a115f8b24cea2df0cafa08eebe8453f8620b9787 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 2 Jun 2021 21:16:15 -0400 Subject: [PATCH 297/415] Update config --- config | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config b/config index 2f180dda..6da16ad4 100755 --- a/config +++ b/config @@ -8,13 +8,13 @@ if [ "$1" = "" ]; then set -- $value if [ "$1" = "ARG1=a" ]; then - echo "APRS mode set" + echo "APRS mode is set" elif [ "$1" = "ARG1=f" ]; then - echo "FSK mode set" + echo "FSK mode is set" elif [ "$1" = "ARG1=b" ]; then - echo "BPSK mode set" + echo "BPSK mode is set" elif [ "$1" = "ARG1=s" ]; then - echo "SSTV mode set" + echo "SSTV mode is set" else echo fi From d53db7a0a3de071b87aa735d39c03e1b101d2f33 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 2 Jun 2021 21:18:02 -0400 Subject: [PATCH 298/415] Update config --- config | 1 + 1 file changed, 1 insertion(+) diff --git a/config b/config index 6da16ad4..fa79d5c6 100755 --- a/config +++ b/config @@ -79,6 +79,7 @@ elif [ "$1" = "-h" ]; then echo " -s Change to SSTV mode" echo " -i Restarts CubeSatsim software" echo " -c Change the CALLSIGN in the configuration file sim.cfg" + echo " -m Change the Simulated Telemetry setting in 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" From 66eccc997d270d23c63c9ffac27b2e2b657eb6d7 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 05:53:40 -0400 Subject: [PATCH 299/415] added sim_mode setting by sim.cfg --- afsk/main.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index e9acbc31..613a0e4d 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -203,9 +203,10 @@ int main(int argc, char * argv[]) { } // char * cfg_buf[100]; - fscanf(config_file, "%s %d %f %f", call, & reset_count, & lat_file, & long_file); + char *sim_yes[10]; + fscanf(config_file, "%s %d %f %f", call, & reset_count, & lat_file, & long_file, & sim_yes); fclose(config_file); - printf("Config file /home/pi/CubeSatSim/sim.cfg contains %s %d %f %f\n", call, reset_count, lat_file, long_file); + printf("Config file /home/pi/CubeSatSim/sim.cfg contains %s %d %f %f %s\n", call, reset_count, lat_file, long_file, sim_yes); reset_count = (reset_count + 1) % 0xffff; if ((fabs(lat_file) > 0) && (fabs(lat_file) < 90.0) && (fabs(long_file) > 0) && (fabs(long_file) < 180.0)) { @@ -213,6 +214,8 @@ int main(int argc, char * argv[]) { latitude = lat_file; longitude = long_file; } + if (sim_yes[0] == "y") + sim_mode = TRUE; wiringPiSetup(); // Check for SPI and AX-5043 Digital Transceiver Board @@ -311,7 +314,7 @@ int main(int argc, char * argv[]) { #endif config_file = fopen("sim.cfg", "w"); - fprintf(config_file, "%s %d %8.4f %8.4f", call, reset_count, lat_file, long_file); + fprintf(config_file, "%s %d %8.4f %8.4f", call, reset_count, lat_file, long_file, sim_yes); // fprintf(config_file, "%s %d", call, reset_count); fclose(config_file); config_file = fopen("sim.cfg", "r"); @@ -440,7 +443,7 @@ 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_bus3 == OFF) { + if ((i2c_bus3 == OFF) || (sim_mode == TRUE)) { sim_mode = TRUE; From aed9cadb16a7600337e70cb9225c22170ca01a62 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 05:58:09 -0400 Subject: [PATCH 300/415] typo --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 613a0e4d..a05b16fc 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -206,7 +206,7 @@ int main(int argc, char * argv[]) { char *sim_yes[10]; fscanf(config_file, "%s %d %f %f", call, & reset_count, & lat_file, & long_file, & sim_yes); fclose(config_file); - printf("Config file /home/pi/CubeSatSim/sim.cfg contains %s %d %f %f %s\n", call, reset_count, lat_file, long_file, sim_yes); + printf("Config file /home/pi/CubeSatSim/sim.cfg contains %s %d %f %f %s\n", call, reset_count, lat_file, long_file, *sim_yes); reset_count = (reset_count + 1) % 0xffff; if ((fabs(lat_file) > 0) && (fabs(lat_file) < 90.0) && (fabs(long_file) > 0) && (fabs(long_file) < 180.0)) { From 6e43b79a08052aaa8f01b39910bf4de419f7a109 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 06:02:11 -0400 Subject: [PATCH 301/415] typos --- afsk/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index a05b16fc..09af7fd2 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -203,10 +203,10 @@ int main(int argc, char * argv[]) { } // char * cfg_buf[100]; - char *sim_yes[10]; - fscanf(config_file, "%s %d %f %f", call, & reset_count, & lat_file, & long_file, & sim_yes); + char sim_yes[10]; + fscanf(config_file, "%s %d %f %f", call, & reset_count, & lat_file, & long_file, sim_yes); fclose(config_file); - printf("Config file /home/pi/CubeSatSim/sim.cfg contains %s %d %f %f %s\n", call, reset_count, lat_file, long_file, *sim_yes); + printf("Config file /home/pi/CubeSatSim/sim.cfg contains %s %d %f %f %s\n", call, reset_count, lat_file, long_file, sim_yes); reset_count = (reset_count + 1) % 0xffff; if ((fabs(lat_file) > 0) && (fabs(lat_file) < 90.0) && (fabs(long_file) > 0) && (fabs(long_file) < 180.0)) { From b7f6b0dbffa7fe3df60ce2d9fe5ff30d108a4cd9 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 06:04:26 -0400 Subject: [PATCH 302/415] added sim_yes to sim.cfg file --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 09af7fd2..fad71022 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -204,7 +204,7 @@ int main(int argc, char * argv[]) { // char * cfg_buf[100]; char sim_yes[10]; - fscanf(config_file, "%s %d %f %f", call, & reset_count, & lat_file, & long_file, sim_yes); + fscanf(config_file, "%s %d %f %f %s", call, & reset_count, & lat_file, & long_file, sim_yes); fclose(config_file); printf("Config file /home/pi/CubeSatSim/sim.cfg contains %s %d %f %f %s\n", call, reset_count, lat_file, long_file, sim_yes); reset_count = (reset_count + 1) % 0xffff; From 503e91c7f34f42dfbf635759ce831ad1c5ec4bb4 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 06:06:46 -0400 Subject: [PATCH 303/415] fixed sim_yes comparison --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index fad71022..85530da7 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -214,7 +214,7 @@ int main(int argc, char * argv[]) { latitude = lat_file; longitude = long_file; } - if (sim_yes[0] == "y") + if (*sim_yes[0] == "y") sim_mode = TRUE; wiringPiSetup(); From 2512a1259fc913c73bf42110db9e4ae1070cd286 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 06:11:10 -0400 Subject: [PATCH 304/415] used strcmp --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 85530da7..eed5d351 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -214,7 +214,7 @@ int main(int argc, char * argv[]) { latitude = lat_file; longitude = long_file; } - if (*sim_yes[0] == "y") + if (strcmp(sim_yes, "yes") == 0) sim_mode = TRUE; wiringPiSetup(); From 958279e2c674f6e45a36da132951e131669482be Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 06:14:17 -0400 Subject: [PATCH 305/415] fixed writing sim.cfg --- afsk/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index eed5d351..6aea79c0 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -133,6 +133,7 @@ int reset_count; float uptime_sec; long int uptime; char call[5]; +char sim_yes[10]; int bitRate, mode, bufLen, rsFrames, payloads, rsFrameLen, dataLen, headerLen, syncBits, syncWord, parityLen, samples, frameCnt, samplePeriod; float sleepTime; @@ -203,7 +204,7 @@ int main(int argc, char * argv[]) { } // char * cfg_buf[100]; - char sim_yes[10]; + fscanf(config_file, "%s %d %f %f %s", call, & reset_count, & lat_file, & long_file, sim_yes); fclose(config_file); printf("Config file /home/pi/CubeSatSim/sim.cfg contains %s %d %f %f %s\n", call, reset_count, lat_file, long_file, sim_yes); From bb6593c7d5b2affaa7de2317be85460d0169c575 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 06:17:33 -0400 Subject: [PATCH 306/415] sim.cfg file with yes for Simulated mode --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 6aea79c0..b8eea47f 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -315,7 +315,7 @@ int main(int argc, char * argv[]) { #endif config_file = fopen("sim.cfg", "w"); - fprintf(config_file, "%s %d %8.4f %8.4f", call, reset_count, lat_file, long_file, sim_yes); + fprintf(config_file, "%s %d %8.4f %8.4f %s", call, reset_count, lat_file, long_file, sim_yes); // fprintf(config_file, "%s %d", call, reset_count); fclose(config_file); config_file = fopen("sim.cfg", "r"); From 56c3452f60ec72f7573b78508c03958bda798a12 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 06:20:53 -0400 Subject: [PATCH 307/415] set bus 3 off when simulated telemetry mode --- afsk/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index b8eea47f..274c8b12 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -447,7 +447,8 @@ int main(int argc, char * argv[]) { if ((i2c_bus3 == OFF) || (sim_mode == TRUE)) { sim_mode = TRUE; - + i2c_bus3 = OFF; + printf("Simulated telemetry mode!\n"); srand((unsigned int)time(0)); From 24502b720136c6ba50c766b9653a9bcd05d3ab27 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 06:33:34 -0400 Subject: [PATCH 308/415] SSTV transmit last picture before taking photo --- rpitx.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/rpitx.py b/rpitx.py index bbb87c06..f464b8e6 100644 --- a/rpitx.py +++ b/rpitx.py @@ -76,13 +76,9 @@ if __name__ == "__main__": camera_present = 0 while 1: -# system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3 &") GPIO.output(txLed, txLedOff) if (camera_present == 1): - system("raspistill -o /home/pi/camera_out.jpg -w 320 -h 256") # > /dev/null 2>&1") - print("Photo taken") GPIO.output(txLed, txLedOn) -# system("sudo python3 -m pysstv --mode PD120 /home/pi/camera_out.jpg /home/pi/sstv_camera.wav") # > /dev/null 2>&1") system("/home/pi/PiSSTVpp/pisstvpp -r 48000 -p s2 /home/pi/camera_out.jpg") # > /dev/null 2>&1") GPIO.output(txLed, txLedOff) print ("Sending SSTV photo") @@ -92,6 +88,8 @@ if __name__ == "__main__": system("sudo killall -9 cat > /dev/null 2>&1") GPIO.output(txLed, txLedOn); system("cat /home/pi/camera_out.jpg.wav | csdr convert_i16_f | csdr gain_ff 14000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") # > /dev/null 2>&1") + system("raspistill -o /home/pi/camera_out.jpg -w 320 -h 256") # > /dev/null 2>&1") + print("Photo taken") else: system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3 &") while 1: From 11b838395cefb030378a557163e33afaef708e45 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 06:43:59 -0400 Subject: [PATCH 309/415] changed PayloadStatus1 to SimulatedTelemetry --- spacecraft/FoxTelem_11a/CubeSatSim_PSK_rttelemetry.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spacecraft/FoxTelem_11a/CubeSatSim_PSK_rttelemetry.csv b/spacecraft/FoxTelem_11a/CubeSatSim_PSK_rttelemetry.csv index ec06db4f..98b1f107 100644 --- a/spacecraft/FoxTelem_11a/CubeSatSim_PSK_rttelemetry.csv +++ b/spacecraft/FoxTelem_11a/CubeSatSim_PSK_rttelemetry.csv @@ -35,8 +35,8 @@ 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 -37,realTime,PayloadStatus2,1,-,17,NONE,6,8,0,Exp 3,STEM Payload status 2 failure indicator +36,realTime,SimulatedTelemetry,1,-,17,Computer Software,3,4,0,Simulated Telemetry,Simulated Telemetry indicator +37,realTime,PayloadStatus1,1,-,17,NONE,6,8,0,Exp 3,STEM Payload status 1 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 From fc5789d2e245296ae863b6f95d41e9c1719d3e3e Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 06:48:02 -0400 Subject: [PATCH 310/415] added Simulated Telemetry --- spacecraft/FoxTelem_11a/CubeSatSim_rttelemetry.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spacecraft/FoxTelem_11a/CubeSatSim_rttelemetry.csv b/spacecraft/FoxTelem_11a/CubeSatSim_rttelemetry.csv index 4d466a3a..36a08855 100644 --- a/spacecraft/FoxTelem_11a/CubeSatSim_rttelemetry.csv +++ b/spacecraft/FoxTelem_11a/CubeSatSim_rttelemetry.csv @@ -35,8 +35,8 @@ 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 +36,RT,SimulatedTelemetry,1,-,17,Computer Software,3,4,0,Exp 2,Simulated Telemetry, Simulated Telemetry indicator +37,RT,PayloadStatus1,1,-,17,NONE,6,8,0,Exp 3,STEM Payload status 1 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 From 97992313d44bbefcc7ca1d9bd5fcf2da4ed7f4c7 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 06:49:56 -0400 Subject: [PATCH 311/415] Update CubeSatSim_rttelemetry.csv --- 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 36a08855..a74fe830 100644 --- a/spacecraft/FoxTelem_11a/CubeSatSim_rttelemetry.csv +++ b/spacecraft/FoxTelem_11a/CubeSatSim_rttelemetry.csv @@ -35,7 +35,7 @@ 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,SimulatedTelemetry,1,-,17,Computer Software,3,4,0,Exp 2,Simulated Telemetry, Simulated Telemetry indicator +36,RT,SimulatedTelemetry,1,-,17,Computer Software,3,4,0,Simulated Telemetry, Simulated Telemetry indicator 37,RT,PayloadStatus1,1,-,17,NONE,6,8,0,Exp 3,STEM Payload status 1 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 From 70392ccb9eb6a1786c18c7af1e507ee7a51eccda Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 06:57:53 -0400 Subject: [PATCH 312/415] added sim_mode to Simulated Telemetry flag --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 274c8b12..43c9de99 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1660,7 +1660,7 @@ void get_tlm_fox() { // camera = ON; - int status = STEMBoardFailure + NormalModeFailure * 2 + PayloadFailure1 * 4 + PayloadFailure2 * 8 + + int status = STEMBoardFailure + NormalModeFailure * 2 + !sim_mode * 4 + PayloadFailure1 * 8 + (i2c_bus0 == OFF) * 16 + (i2c_bus1 == OFF) * 32 + (i2c_bus3 == OFF) * 64 + (camera == OFF) * 128 + groundCommandCount * 256; encodeA(b, 51 + head_offset, status); From cc1ff5d1126ff61f924cc16af896ce6571f62e43 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 07:00:07 -0400 Subject: [PATCH 313/415] removed setting bus 3 off for sim mode --- afsk/main.c | 1 - 1 file changed, 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 43c9de99..7ae12d92 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -447,7 +447,6 @@ int main(int argc, char * argv[]) { if ((i2c_bus3 == OFF) || (sim_mode == TRUE)) { sim_mode = TRUE; - i2c_bus3 = OFF; printf("Simulated telemetry mode!\n"); From 09e53d0c2a923566f7e74fcd28f64f1e6146bcd7 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 07:15:18 -0400 Subject: [PATCH 314/415] updated for new python --- afsk/telem.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/afsk/telem.c b/afsk/telem.c index c6f00ad6..266482f4 100644 --- a/afsk/telem.c +++ b/afsk/telem.c @@ -226,20 +226,23 @@ int main(int argc, char *argv[]) { strcat(pythonStr, busStr); strcat(pythonConfigStr, pythonStr); strcat(pythonConfigStr, " c"); - - FILE* file1 = popen(pythonConfigStr, "r"); - char cmdbuffer[1000]; - fgets(cmdbuffer, 1000, file1); + + file1 = sopen(pythonConfigStr); // try new function + fgets(cmdbuffer, 1000, file1); + fprintf(stderr, "pythonStr result: %s\n", cmdbuffer); +// FILE* file1 = popen(pythonConfigStr, "r"); +// char cmdbuffer[1000]; +// fgets(cmdbuffer, 1000, file1); // printf("pythonStr result: %s\n", cmdbuffer); - pclose(file1); + sclose(file1); int count1; char *token; - FILE* file = popen(pythonStr, "r"); - fgets(cmdbuffer, 1000, file); +// FILE* file = popen(pythonStr, "r"); +// fgets(cmdbuffer, 1000, file); // printf("result: %s\n", cmdbuffer); - pclose(file); +// pclose(file); const char space[2] = " "; token = strtok(cmdbuffer, space); From da3a2becd4ce115b8d7a30ef96ac65ba7da04301 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 07:16:21 -0400 Subject: [PATCH 315/415] typo --- afsk/telem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/telem.c b/afsk/telem.c index 266482f4..2f026d9d 100644 --- a/afsk/telem.c +++ b/afsk/telem.c @@ -227,7 +227,7 @@ int main(int argc, char *argv[]) { strcat(pythonConfigStr, pythonStr); strcat(pythonConfigStr, " c"); - file1 = sopen(pythonConfigStr); // try new function + FILE *file1 = sopen(pythonConfigStr); // try new function fgets(cmdbuffer, 1000, file1); fprintf(stderr, "pythonStr result: %s\n", cmdbuffer); // FILE* file1 = popen(pythonConfigStr, "r"); From e9e21a29a50b1fa6a4d4d19a2decefdf8427c935 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 07:21:55 -0400 Subject: [PATCH 316/415] Update telem.c --- afsk/telem.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/afsk/telem.c b/afsk/telem.c index 2f026d9d..923adc6f 100644 --- a/afsk/telem.c +++ b/afsk/telem.c @@ -10,6 +10,11 @@ #include #include #include +#include +#include +#include +#include +#include #define PLUS_X 0 #define PLUS_Y 1 From e7a86fc64bc07768e47fc0349b6f411b7fa8b8e1 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 07:22:24 -0400 Subject: [PATCH 317/415] added .h --- afsk/telem.c | 1 - 1 file changed, 1 deletion(-) diff --git a/afsk/telem.c b/afsk/telem.c index 923adc6f..33492aac 100644 --- a/afsk/telem.c +++ b/afsk/telem.c @@ -14,7 +14,6 @@ #include #include #include -#include #define PLUS_X 0 #define PLUS_Y 1 From 2d63c00370f07ac26943d035fa02d1571e730cef Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 07:23:45 -0400 Subject: [PATCH 318/415] Update telem.c --- afsk/telem.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/afsk/telem.c b/afsk/telem.c index 33492aac..e54ce593 100644 --- a/afsk/telem.c +++ b/afsk/telem.c @@ -15,6 +15,23 @@ #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #define PLUS_X 0 #define PLUS_Y 1 #define BAT 2 From fc192df7c6a6303e4630c893cc8171f88a5a08e2 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 07:26:00 -0400 Subject: [PATCH 319/415] added open code from main.c --- afsk/telem.c | 46 +++++++++++++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/afsk/telem.c b/afsk/telem.c index e54ce593..dab520b7 100644 --- a/afsk/telem.c +++ b/afsk/telem.c @@ -15,23 +15,6 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #define PLUS_X 0 #define PLUS_Y 1 #define BAT 2 @@ -48,6 +31,7 @@ int test_i2c_bus(int bus); const char pythonCmd[] = "python3 /home/pi/CubeSatSim/python/voltcurrent.py "; char pythonStr[100], pythonConfigStr[100], busStr[10]; int map[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; +FILE *sopen(const char *program); int main(int argc, char *argv[]) { @@ -344,3 +328,31 @@ int test_i2c_bus(int bus) } return(output); // return bus number or -1 if there is a problem with the bus } + +// 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+"); + } From b46215d6147080fc94fc96cafd7b9d9fcde5d8a2 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 07:28:02 -0400 Subject: [PATCH 320/415] added .h --- afsk/telem.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/afsk/telem.c b/afsk/telem.c index dab520b7..21970a01 100644 --- a/afsk/telem.c +++ b/afsk/telem.c @@ -14,6 +14,7 @@ #include #include #include +#include #define PLUS_X 0 #define PLUS_Y 1 @@ -232,14 +233,14 @@ int main(int argc, char *argv[]) { strcat(pythonConfigStr, pythonStr); strcat(pythonConfigStr, " c"); - FILE *file1 = sopen(pythonConfigStr); // try new function - fgets(cmdbuffer, 1000, file1); - fprintf(stderr, "pythonStr result: %s\n", cmdbuffer); + char cmdbuffer[1000]; + FILE *file1 = sopen(pythonConfigStr); // try new function + fgets(cmdbuffer, 1000, file1); + fprintf(stderr, "pythonStr result: %s\n", cmdbuffer); // FILE* file1 = popen(pythonConfigStr, "r"); -// char cmdbuffer[1000]; // fgets(cmdbuffer, 1000, file1); // printf("pythonStr result: %s\n", cmdbuffer); - sclose(file1); +// sclose(file1); int count1; char *token; From a8de8a1054ea366d3f63c0dbbf44f018ca36c5d5 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 08:23:25 -0400 Subject: [PATCH 321/415] added s parameter for single read of python sensor code --- afsk/telem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/telem.c b/afsk/telem.c index 21970a01..ca36f685 100644 --- a/afsk/telem.c +++ b/afsk/telem.c @@ -231,7 +231,7 @@ int main(int argc, char *argv[]) { strcpy(pythonStr, pythonCmd); strcat(pythonStr, busStr); strcat(pythonConfigStr, pythonStr); - strcat(pythonConfigStr, " c"); + strcat(pythonConfigStr, " s"); char cmdbuffer[1000]; FILE *file1 = sopen(pythonConfigStr); // try new function From 1273a01e85130ce95dfc634bbc76905a42f8234b Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 08:31:39 -0400 Subject: [PATCH 322/415] added single variable set by s that only loops once --- python/voltcurrent.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index c5d0fce6..3f16e34a 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -12,7 +12,7 @@ if __name__ == "__main__": # print 'Length: ', len(sys.argv) buses = [1, 3] # default I2C buses - config = False + single = False one = two = three = four = five = six = seven = eight = 0 if (len(sys.argv)) > 1: @@ -23,7 +23,7 @@ if __name__ == "__main__": buses[1] = int(sys.argv[2], base=10) if (len(sys.argv)) > 3: if sys.argv[3] == "c": - config = True + single = True # print(buses[0]) # print(buses[1]) @@ -176,7 +176,7 @@ if __name__ == "__main__": except: print("Python Error 5", file=sys.stderr, flush=True) - while (True): + while !single: error = 0 try: time.sleep(0.01) @@ -344,5 +344,7 @@ if __name__ == "__main__": else: print("Python Error Recovered!") - inp = input() + if single != TRUE: + inp = input() + # print(inp) From c8e95847c0367300ecf3649008bd83c4addfc241 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 08:33:09 -0400 Subject: [PATCH 323/415] changed to not --- python/voltcurrent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index 3f16e34a..2a90c6ed 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -176,7 +176,7 @@ if __name__ == "__main__": except: print("Python Error 5", file=sys.stderr, flush=True) - while !single: + while not single: error = 0 try: time.sleep(0.01) From 1018be5a8886349cb4f643c9e4d4282455ed1cd8 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 08:34:39 -0400 Subject: [PATCH 324/415] changed to not --- python/voltcurrent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index 2a90c6ed..88c8a1dd 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -344,7 +344,7 @@ if __name__ == "__main__": else: print("Python Error Recovered!") - if single != TRUE: + if not single: inp = input() # print(inp) From 02e365390c08bf1f91fdd3421d8a16fa1e538f87 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 08:39:12 -0400 Subject: [PATCH 325/415] added break --- python/voltcurrent.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index 88c8a1dd..964b435c 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -22,7 +22,7 @@ if __name__ == "__main__": if (len(sys.argv)) > 2: buses[1] = int(sys.argv[2], base=10) if (len(sys.argv)) > 3: - if sys.argv[3] == "c": + if sys.argv[3] == "s": single = True # print(buses[0]) @@ -176,7 +176,7 @@ if __name__ == "__main__": except: print("Python Error 5", file=sys.stderr, flush=True) - while not single: + while True: error = 0 try: time.sleep(0.01) @@ -346,5 +346,7 @@ if __name__ == "__main__": if not single: inp = input() +# print(inp) else: + break() + -# print(inp) From 06ffd5b42dfde2279927c9b84b0548d939a0d0c1 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 08:39:48 -0400 Subject: [PATCH 326/415] typo in break --- python/voltcurrent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index 964b435c..5406944b 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -347,6 +347,6 @@ if __name__ == "__main__": if not single: inp = input() # print(inp) else: - break() + break From d6ba03e5cd1942da187c7427b17cf3fdc0a22854 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 08:42:55 -0400 Subject: [PATCH 327/415] else typo --- python/voltcurrent.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index 5406944b..49a3550b 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -346,7 +346,8 @@ if __name__ == "__main__": if not single: inp = input() -# print(inp) else: +# print(inp) + else: break From db5b2df604c16becef58dcb2e49847a8775c58ce Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 08:47:24 -0400 Subject: [PATCH 328/415] fix Payload string printout --- afsk/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 7ae12d92..50344a10 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -958,7 +958,7 @@ void get_tlm(void) { } // sensor_payload[i++] = '\n'; sensor_payload[i] = '\0'; - printf("Payload string: %s\n", sensor_payload); + printf(" Payload string: %s\n", sensor_payload); strcat(str, sensor_payload); // append to telemetry string for transmission } @@ -1309,7 +1309,7 @@ void get_tlm_fox() { sensor_payload[i++] = ' '; // sensor_payload[i++] = '\n'; sensor_payload[i] = '\0'; - printf("Payload string: %s", sensor_payload); + printf(" Payload string: %s", sensor_payload); if ((sensor_payload[0] == 'O') && (sensor_payload[1] == 'K')) // only process if valid payload response { From be7d5b487cf5f748c22d25cbb2b524de7b9ea150 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 08:57:29 -0400 Subject: [PATCH 329/415] added debug or d parameter to print extra info --- afsk/telem.c | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/afsk/telem.c b/afsk/telem.c index ca36f685..486d7aa0 100644 --- a/afsk/telem.c +++ b/afsk/telem.c @@ -25,20 +25,21 @@ #define PLUS_Z 6 #define MINUS_Z 7 -#define OFF -1 -#define ON 1 +define OFF -1 +define ON 1 int test_i2c_bus(int bus); const char pythonCmd[] = "python3 /home/pi/CubeSatSim/python/voltcurrent.py "; char pythonStr[100], pythonConfigStr[100], busStr[10]; int map[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; FILE *sopen(const char *program); +int debug = OFF; int main(int argc, char *argv[]) { if (argc > 1) { - ; - } + if ( * argv[1] == 'd') { + debug = ON; wiringPiSetup (); @@ -55,8 +56,6 @@ int main(int argc, char *argv[]) { map[PLUS_Z] = BAT; map[MINUS_Z] = PLUS_Z; - snprintf(busStr, 10, "%d %d", test_i2c_bus(1), test_i2c_bus(0)); - printf("New Bus String: %s \n", busStr); /* if (access("/dev/i2c-0", W_OK | R_OK) >= 0) { // Test if I2C Bus 0 is present printf("/dev/i2c-0 is present\n\n"); @@ -97,10 +96,6 @@ int main(int argc, char *argv[]) { map[BAT] = BUS; map[BUS] = BAT; - snprintf(busStr, 10, "%d %d", test_i2c_bus(1), test_i2c_bus(0)); - - printf("New Bus String: %s \n", busStr); - // strcpy(busStr,"1 0"); } else @@ -114,9 +109,7 @@ int main(int argc, char *argv[]) { map[MINUS_X] = MINUS_Y; map[PLUS_Z] = MINUS_X; map[MINUS_Y] = PLUS_Z; - snprintf(busStr, 10, "%d %d", test_i2c_bus(1), test_i2c_bus(3)); - - printf("New Bus String: %s \n", busStr); + if (debug == ON) /* if (test_i2c_b0) != OFF) strcpy(busStr,"1 "); @@ -189,10 +182,6 @@ int main(int argc, char *argv[]) { map[BAT] = BUS; map[PLUS_Z] = BAT; map[MINUS_Z] = PLUS_Z; - - snprintf(busStr, 10, "%d %d", test_i2c_bus(1), test_i2c_bus(0)); - - printf("New Bus String: %s \n", busStr); /* if (access("/dev/i2c-0", W_OK | R_OK) >= 0) { // Test if I2C Bus 0 is present printf("/dev/i2c-0 is present\n\n"); @@ -227,7 +216,7 @@ int main(int argc, char *argv[]) { // Reading I2C voltage and current sensors // printf("Starting\n"); - + strcpy(pythonStr, pythonCmd); strcat(pythonStr, busStr); strcat(pythonConfigStr, pythonStr); @@ -236,7 +225,12 @@ int main(int argc, char *argv[]) { char cmdbuffer[1000]; FILE *file1 = sopen(pythonConfigStr); // try new function fgets(cmdbuffer, 1000, file1); - fprintf(stderr, "pythonStr result: %s\n", cmdbuffer); + if (debug == ON) + { + snprintf(busStr, 10, "%d %d", test_i2c_bus(1), test_i2c_bus(0)); + printf("New Bus String: %s \n", busStr); + fprintf(stderr, "pythonStr result: %s\n", cmdbuffer); + } // FILE* file1 = popen(pythonConfigStr, "r"); // fgets(cmdbuffer, 1000, file1); // printf("pythonStr result: %s\n", cmdbuffer); From ebe2fd9fae4bcff2cab28721f6f2424a9b0e665d Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 08:58:19 -0400 Subject: [PATCH 330/415] define typo --- afsk/telem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/afsk/telem.c b/afsk/telem.c index 486d7aa0..a1080a65 100644 --- a/afsk/telem.c +++ b/afsk/telem.c @@ -25,8 +25,8 @@ #define PLUS_Z 6 #define MINUS_Z 7 -define OFF -1 -define ON 1 +#define OFF -1 +#define ON 1 int test_i2c_bus(int bus); const char pythonCmd[] = "python3 /home/pi/CubeSatSim/python/voltcurrent.py "; From 20f2c1276e9e29b4ecf71e2f3f0883a7bbb52f5a Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 08:59:15 -0400 Subject: [PATCH 331/415] extra if --- afsk/telem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/telem.c b/afsk/telem.c index a1080a65..a4ffba32 100644 --- a/afsk/telem.c +++ b/afsk/telem.c @@ -109,7 +109,7 @@ int main(int argc, char *argv[]) { map[MINUS_X] = MINUS_Y; map[PLUS_Z] = MINUS_X; map[MINUS_Y] = PLUS_Z; - if (debug == ON) + /* if (test_i2c_b0) != OFF) strcpy(busStr,"1 "); From 2367c53517de11ade1e849451fdb20e48d092874 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 09:01:16 -0400 Subject: [PATCH 332/415] missing } --- afsk/telem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/afsk/telem.c b/afsk/telem.c index a4ffba32..85219c6f 100644 --- a/afsk/telem.c +++ b/afsk/telem.c @@ -40,7 +40,8 @@ int main(int argc, char *argv[]) { if (argc > 1) { if ( * argv[1] == 'd') { debug = ON; - + } + } wiringPiSetup (); printf("\n"); From 0b020fef694e9838cee05b29bd7d52796e8ee326 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 09:04:10 -0400 Subject: [PATCH 333/415] added print --- python/voltcurrent.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index 49a3550b..2c8c1151 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -18,6 +18,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])): + print(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 f5b32bc7bbd91b2b498a78f2d2ef940cc2bcb518 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 09:07:01 -0400 Subject: [PATCH 334/415] print python command --- afsk/telem.c | 1 + 1 file changed, 1 insertion(+) diff --git a/afsk/telem.c b/afsk/telem.c index 85219c6f..f0f0d863 100644 --- a/afsk/telem.c +++ b/afsk/telem.c @@ -230,6 +230,7 @@ int main(int argc, char *argv[]) { { snprintf(busStr, 10, "%d %d", test_i2c_bus(1), test_i2c_bus(0)); printf("New Bus String: %s \n", busStr); + fprintf(stderr, "pythonConfigStr: %s \n", pythonConfigStr); fprintf(stderr, "pythonStr result: %s\n", cmdbuffer); } // FILE* file1 = popen(pythonConfigStr, "r"); From 8d1c6122fe1565dd71a449d465e348f8c9ce7603 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 09:17:54 -0400 Subject: [PATCH 335/415] added back in busString add --- afsk/telem.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/afsk/telem.c b/afsk/telem.c index f0f0d863..344a41f2 100644 --- a/afsk/telem.c +++ b/afsk/telem.c @@ -56,7 +56,7 @@ int main(int argc, char *argv[]) { map[BAT] = BUS; map[PLUS_Z] = BAT; map[MINUS_Z] = PLUS_Z; - + snprintf(busStr, 10, "%d %d", test_i2c_bus(1), test_i2c_bus(0)); /* if (access("/dev/i2c-0", W_OK | R_OK) >= 0) { // Test if I2C Bus 0 is present printf("/dev/i2c-0 is present\n\n"); @@ -96,7 +96,7 @@ int main(int argc, char *argv[]) { printf("vB4 Present\n"); map[BAT] = BUS; map[BUS] = BAT; - + snprintf(busStr, 10, "%d %d", test_i2c_bus(1), test_i2c_bus(0)); // strcpy(busStr,"1 0"); } else @@ -106,11 +106,11 @@ int main(int argc, char *argv[]) { if (digitalRead(26) != HIGH) { - printf("vB5 Present\n"); // Don't print normal board detection + // printf("vB5 or later present\n"); // Don't print normal board detection map[MINUS_X] = MINUS_Y; map[PLUS_Z] = MINUS_X; map[MINUS_Y] = PLUS_Z; - + snprintf(busStr, 10, "%d %d", test_i2c_bus(1), test_i2c_bus(3)); /* if (test_i2c_b0) != OFF) strcpy(busStr,"1 "); @@ -183,6 +183,7 @@ int main(int argc, char *argv[]) { map[BAT] = BUS; map[PLUS_Z] = BAT; map[MINUS_Z] = PLUS_Z; + snprintf(busStr, 10, "%d %d", test_i2c_bus(1), test_i2c_bus(0)); /* if (access("/dev/i2c-0", W_OK | R_OK) >= 0) { // Test if I2C Bus 0 is present printf("/dev/i2c-0 is present\n\n"); @@ -228,7 +229,6 @@ int main(int argc, char *argv[]) { fgets(cmdbuffer, 1000, file1); if (debug == ON) { - snprintf(busStr, 10, "%d %d", test_i2c_bus(1), test_i2c_bus(0)); printf("New Bus String: %s \n", busStr); fprintf(stderr, "pythonConfigStr: %s \n", pythonConfigStr); fprintf(stderr, "pythonStr result: %s\n", cmdbuffer); From bbf135e95cdbb7a46b33426a2bb5f133e0639416 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 09:20:44 -0400 Subject: [PATCH 336/415] comment out print --- python/voltcurrent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index 2c8c1151..5da9eeec 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -18,7 +18,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])): - print(sys.argv[1]) +# print(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 9be839f8fc21188ef9fcd1d392841694a3713ca6 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 09:22:38 -0400 Subject: [PATCH 337/415] only print vB5 if debug --- afsk/telem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/afsk/telem.c b/afsk/telem.c index 344a41f2..23d6e702 100644 --- a/afsk/telem.c +++ b/afsk/telem.c @@ -106,7 +106,8 @@ int main(int argc, char *argv[]) { if (digitalRead(26) != HIGH) { - // printf("vB5 or later present\n"); // Don't print normal board detection + if (debug == ON) + printf("vB5 or later present\n"); // Don't print normal board detection map[MINUS_X] = MINUS_Y; map[PLUS_Z] = MINUS_X; map[MINUS_Y] = PLUS_Z; From 5db33eff3b0f680f9236f488367d403a0c798a47 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 09:25:24 -0400 Subject: [PATCH 338/415] Update telem.c --- afsk/telem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/telem.c b/afsk/telem.c index 23d6e702..e6bb8714 100644 --- a/afsk/telem.c +++ b/afsk/telem.c @@ -296,7 +296,7 @@ int test_i2c_bus(int bus) char busS[5]; snprintf(busS, 5, "%d", bus); strcat (busDev, busS); - printf("Bus Dev String: %s \n", busDev); +// printf("Bus Dev String: %s \n", busDev); if (access(busDev, W_OK | R_OK) >= 0) { // Test if I2C Bus is present // printf("bus is present\n\n"); From 045e9189716801f33e956363bc61b7281cf61cc7 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 09:35:01 -0400 Subject: [PATCH 339/415] use diff for changes to .service files --- update.sh => update | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename update.sh => update (82%) diff --git a/update.sh b/update similarity index 82% rename from update.sh rename to update index 113feebc..2969cff7 100755 --- a/update.sh +++ b/update @@ -18,7 +18,7 @@ make debug FLAG=0 -if [[ $(grep 'cubesatsim.service' /home/pi/CubeSatSim/.updated) ]]; then +if [[ $(diff systemd/cubesatsim.service /etc/systemd/system/cubesatsim.service) ]]; then echo "copying cubesatsim.service" sudo cp systemd/cubesatsim.service /etc/systemd/system/cubesatsim.service FLAG=1 @@ -26,7 +26,7 @@ else echo "no changes to cubesatsim.service" fi -if [[ $(grep 'rpitx.service' /home/pi/CubeSatSim/.updated) ]]; then +if [[ $(diff systemd/rpitx.service /etc/systemd/system/rpitx.service) ]]; then echo "copying rpitx.service" sudo cp systemd/rpitx.service /etc/systemd/system/rpitx.service FLAG=1 From 9acc825ab8a0a0d806ac5dac9f55baecf4477152 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 09:45:09 -0400 Subject: [PATCH 340/415] grep for changes before reset --- update | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/update b/update index 2969cff7..a17d05e7 100755 --- a/update +++ b/update @@ -38,6 +38,8 @@ if [ $FLAG -eq 1 ]; then echo "systemctl daemon-reload" sudo systemctl daemon-reload else - echo "systemctl restart cubesatsim" - sudo systemctl restart cubesatsim + if [[ $(grep cat .updated) ]]; then + echo "systemctl restart cubesatsim" + sudo systemctl restart cubesatsim + fi fi From ec4d9d9999c9c0b4ef94bdcfb9ae9acc68316f6b Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 09:46:40 -0400 Subject: [PATCH 341/415] grep for 'updated' in pull --- update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update b/update index a17d05e7..58cf89b4 100755 --- a/update +++ b/update @@ -38,7 +38,7 @@ if [ $FLAG -eq 1 ]; then echo "systemctl daemon-reload" sudo systemctl daemon-reload else - if [[ $(grep cat .updated) ]]; then + if [[ $(grep 'updated' /home/pi/CubeSatSim/.updated) ]]; then echo "systemctl restart cubesatsim" sudo systemctl restart cubesatsim fi From 9a770d2007f513335130a6e4a21553d5e8404bb5 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 09:49:38 -0400 Subject: [PATCH 342/415] reversed grep --- update | 2 ++ 1 file changed, 2 insertions(+) diff --git a/update b/update index 58cf89b4..8fc92be0 100755 --- a/update +++ b/update @@ -39,6 +39,8 @@ if [ $FLAG -eq 1 ]; then sudo systemctl daemon-reload else if [[ $(grep 'updated' /home/pi/CubeSatSim/.updated) ]]; then + echo "nothing to do" + else echo "systemctl restart cubesatsim" sudo systemctl restart cubesatsim fi From a3e0ba32ada1d4456795aad8f4bf1ce7ca3ff1ef Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 09:54:26 -0400 Subject: [PATCH 343/415] added full path for files --- update | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/update b/update index 8fc92be0..82b61c8e 100755 --- a/update +++ b/update @@ -20,7 +20,7 @@ FLAG=0 if [[ $(diff systemd/cubesatsim.service /etc/systemd/system/cubesatsim.service) ]]; then echo "copying cubesatsim.service" - sudo cp systemd/cubesatsim.service /etc/systemd/system/cubesatsim.service + sudo cp /home/pi/CubeSatSim/systemd/cubesatsim.service /etc/systemd/system/cubesatsim.service FLAG=1 else echo "no changes to cubesatsim.service" @@ -28,7 +28,7 @@ fi if [[ $(diff systemd/rpitx.service /etc/systemd/system/rpitx.service) ]]; then echo "copying rpitx.service" - sudo cp systemd/rpitx.service /etc/systemd/system/rpitx.service + sudo cp /home/pi/CubeSatSim/systemd/rpitx.service /etc/systemd/system/rpitx.service FLAG=1 else echo "no changes to rpitx.service" From e9dc3079c652ab27b8977ffcde3af35e3aa837e0 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 09:56:17 -0400 Subject: [PATCH 344/415] updated to changed in grep --- update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update b/update index 82b61c8e..cd2cdaf8 100755 --- a/update +++ b/update @@ -27,7 +27,7 @@ else fi if [[ $(diff systemd/rpitx.service /etc/systemd/system/rpitx.service) ]]; then - echo "copying rpitx.service" + echo "changed rpitx.service" sudo cp /home/pi/CubeSatSim/systemd/rpitx.service /etc/systemd/system/rpitx.service FLAG=1 else From daed9e4862a7c6d4d927b57f2826b3fa24e21893 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 09:58:41 -0400 Subject: [PATCH 345/415] fixed changed --- update | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/update b/update index cd2cdaf8..a3c66f89 100755 --- a/update +++ b/update @@ -19,7 +19,7 @@ make debug FLAG=0 if [[ $(diff systemd/cubesatsim.service /etc/systemd/system/cubesatsim.service) ]]; then - echo "copying cubesatsim.service" + echo "changed cubesatsim.service" sudo cp /home/pi/CubeSatSim/systemd/cubesatsim.service /etc/systemd/system/cubesatsim.service FLAG=1 else @@ -38,7 +38,7 @@ if [ $FLAG -eq 1 ]; then echo "systemctl daemon-reload" sudo systemctl daemon-reload else - if [[ $(grep 'updated' /home/pi/CubeSatSim/.updated) ]]; then + if [[ $(grep 'changed' /home/pi/CubeSatSim/.updated) ]]; then echo "nothing to do" else echo "systemctl restart cubesatsim" From e49e95f200e43703e26e07d0210a07a70ecf41e0 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 10:13:16 -0400 Subject: [PATCH 346/415] added grep --- update | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/update b/update index a3c66f89..9d038fc5 100755 --- a/update +++ b/update @@ -38,10 +38,11 @@ if [ $FLAG -eq 1 ]; then echo "systemctl daemon-reload" sudo systemctl daemon-reload else + grep 'changed' /home/pi/CubeSatSim/.updated if [[ $(grep 'changed' /home/pi/CubeSatSim/.updated) ]]; then - echo "nothing to do" - else echo "systemctl restart cubesatsim" sudo systemctl restart cubesatsim + else + echo "nothing to do" fi fi From 21efa4038a44a3c56fd118cd8fcbffd63147242c Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 10:17:33 -0400 Subject: [PATCH 347/415] added restart after daemon-reload --- update | 1 + 1 file changed, 1 insertion(+) diff --git a/update b/update index 9d038fc5..b836c8ba 100755 --- a/update +++ b/update @@ -37,6 +37,7 @@ fi if [ $FLAG -eq 1 ]; then echo "systemctl daemon-reload" sudo systemctl daemon-reload + sudo systemctl restart cubesatsim else grep 'changed' /home/pi/CubeSatSim/.updated if [[ $(grep 'changed' /home/pi/CubeSatSim/.updated) ]]; then From c87288b169783e6b10772bd0c6f6a8c9a7f33206 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 10:20:39 -0400 Subject: [PATCH 348/415] added and restart to echo --- update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update b/update index b836c8ba..4b46d51f 100755 --- a/update +++ b/update @@ -35,7 +35,7 @@ else fi if [ $FLAG -eq 1 ]; then - echo "systemctl daemon-reload" + echo "systemctl daemon-reload and restart" sudo systemctl daemon-reload sudo systemctl restart cubesatsim else From 3c71dfddb886240f7b472f9c24109f24cd2c60b2 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 11:09:42 -0400 Subject: [PATCH 349/415] full filename for .mode --- config | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config b/config index fa79d5c6..a161e0fe 100755 --- a/config +++ b/config @@ -49,22 +49,22 @@ if [ "$1" = "-i" ]; then exit elif [ "$1" = "-a" ]; then echo "changing CubeSatSim to AFSK mode" - sudo echo "ARG1=a" > .mode + sudo echo "ARG1=a" > /home/pi/CubeSatSim/.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" > /home/pi/CubeSatSim/.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" > /home/pi/CubeSatSim/.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" > /home/pi/CubeSatSim/.mode sudo systemctl restart cubesatsim exit elif [ "$1" = "-h" ]; then From cb3b55714f3cc139f31e23ef4a0e8c452780aeca Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 15:18:37 -0400 Subject: [PATCH 350/415] added sudo to rm ready --- rpitx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index f464b8e6..71cf7f75 100644 --- a/rpitx.py +++ b/rpitx.py @@ -58,7 +58,7 @@ if __name__ == "__main__": 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") + os.system("sudo rm ready") time.sleep(0.5) except: time.sleep(0.5) From 84e18f05146ec5360433c3659a4ae23173ca7515 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 15:25:13 -0400 Subject: [PATCH 351/415] added full path to ready file --- rpitx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index 71cf7f75..30c909d4 100644 --- a/rpitx.py +++ b/rpitx.py @@ -56,7 +56,7 @@ if __name__ == "__main__": print("AFSK") while True: try: - f = open("ready") + f = open("/home/pi/CubeSatSim/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("sudo rm ready") time.sleep(0.5) From c0e0e9e2aead4fed6e00514b0d54c02eaf71379e Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 15:25:53 -0400 Subject: [PATCH 352/415] added full path to ready file --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 50344a10..3ab31857 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -874,7 +874,7 @@ void get_tlm(void) { 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 && touch ready"; // transmit is done by rpitx.py + char footer_str[] = ">CQ:010101/hi hi ' >> t.txt && touch /home/pi/CubeSatSim/ready"; // transmit is done by rpitx.py if (ax5043) { strcpy(str, header_str); From ab569afb3812ea7bcb9e1efa76d645d9976767ec Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 16:04:36 -0400 Subject: [PATCH 353/415] added sudo to gen_packets and full paths and close --- rpitx.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rpitx.py b/rpitx.py index 30c909d4..d77a5752 100644 --- a/rpitx.py +++ b/rpitx.py @@ -38,7 +38,7 @@ print(callsign) #GPIO.output(27, 1); GPIO.output(txLed, txLedOn); -system("echo 'de " + callsign + "' > id.txt && gen_packets -M 20 id.txt -o morse.wav -r 48000 > /dev/null 2>&1 && cat morse.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") +system("echo 'de " + callsign + "' > id.txt && sudo gen_packets -M 20 /home/pi/CubeSatSim/id.txt -o /home/pi/CubeSatSim/morse.wav -r 48000 > /dev/null 2>&1 && cat /home/pi/CubeSatSim/morse.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") #GPIO.output(27, 0); GPIO.output(txLed, txLedOff); @@ -57,7 +57,8 @@ if __name__ == "__main__": while True: try: f = open("/home/pi/CubeSatSim/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("sudo gen_packets -o /home/pi/CubeSatSim/telem.wav /home/pi/CubeSatSim/t.txt -r 48000 > /dev/null 2>&1 && cat /home/pi/CubeSatSim/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") + close(f) os.system("sudo rm ready") time.sleep(0.5) except: From 0359ba3311e7b39935f5ec7df9fcb0938a9283ab Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 16:10:42 -0400 Subject: [PATCH 354/415] added print --- rpitx.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rpitx.py b/rpitx.py index d77a5752..74ab8d60 100644 --- a/rpitx.py +++ b/rpitx.py @@ -56,12 +56,17 @@ if __name__ == "__main__": print("AFSK") while True: try: + print("Opening file") f = open("/home/pi/CubeSatSim/ready") + print("rpitx") os.system("sudo gen_packets -o /home/pi/CubeSatSim/telem.wav /home/pi/CubeSatSim/t.txt -r 48000 > /dev/null 2>&1 && cat /home/pi/CubeSatSim/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") + print("closing") close(f) + print("deleting") os.system("sudo rm ready") time.sleep(0.5) except: + print("Exception sleeping") time.sleep(0.5) elif (('s' == sys.argv[1]) or ('sstv' in sys.argv[1])): print("SSTV") From 35d1eb0edd079e577a84c6cebc35501f4bc8926f Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 16:12:08 -0400 Subject: [PATCH 355/415] os.system to system --- rpitx.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpitx.py b/rpitx.py index 74ab8d60..9bf6f5da 100644 --- a/rpitx.py +++ b/rpitx.py @@ -59,11 +59,11 @@ if __name__ == "__main__": print("Opening file") f = open("/home/pi/CubeSatSim/ready") print("rpitx") - os.system("sudo gen_packets -o /home/pi/CubeSatSim/telem.wav /home/pi/CubeSatSim/t.txt -r 48000 > /dev/null 2>&1 && cat /home/pi/CubeSatSim/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") + system("sudo gen_packets -o /home/pi/CubeSatSim/telem.wav /home/pi/CubeSatSim/t.txt -r 48000 > /dev/null 2>&1 && cat /home/pi/CubeSatSim/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") print("closing") close(f) print("deleting") - os.system("sudo rm ready") + system("sudo rm ready") time.sleep(0.5) except: print("Exception sleeping") From b428d69747e0277ec021f0810aaf193955254aae Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 16:17:41 -0400 Subject: [PATCH 356/415] sleep 4 for APRS --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 3ab31857..b678cc3e 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1009,7 +1009,7 @@ void get_tlm(void) { if (transmit) { FILE * file2 = popen(str, "r"); pclose(file2); - sleep(2); + sleep(4); } 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"); From 9581b2eddb888277859b676604d7cf9622dfa5f4 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 16:20:44 -0400 Subject: [PATCH 357/415] fixed close --- rpitx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index 9bf6f5da..5777781e 100644 --- a/rpitx.py +++ b/rpitx.py @@ -61,7 +61,7 @@ if __name__ == "__main__": print("rpitx") system("sudo gen_packets -o /home/pi/CubeSatSim/telem.wav /home/pi/CubeSatSim/t.txt -r 48000 > /dev/null 2>&1 && cat /home/pi/CubeSatSim/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") print("closing") - close(f) + f.close() print("deleting") system("sudo rm ready") time.sleep(0.5) From 6acdf249ed5c2bb8381cd3f6f7b3a86ee6696556 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 16:25:34 -0400 Subject: [PATCH 358/415] back to sleep 2 for APRS --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index b678cc3e..3ab31857 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1009,7 +1009,7 @@ void get_tlm(void) { if (transmit) { FILE * file2 = popen(str, "r"); pclose(file2); - sleep(4); + 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"); From d0d77c87c25f2ae4d3c6f8ba057e45d3d48aeebd Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 16:29:24 -0400 Subject: [PATCH 359/415] removing prints --- rpitx.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/rpitx.py b/rpitx.py index 5777781e..c202f458 100644 --- a/rpitx.py +++ b/rpitx.py @@ -56,17 +56,12 @@ if __name__ == "__main__": print("AFSK") while True: try: - print("Opening file") f = open("/home/pi/CubeSatSim/ready") - print("rpitx") system("sudo gen_packets -o /home/pi/CubeSatSim/telem.wav /home/pi/CubeSatSim/t.txt -r 48000 > /dev/null 2>&1 && cat /home/pi/CubeSatSim/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") - print("closing") f.close() - print("deleting") system("sudo rm ready") time.sleep(0.5) except: - print("Exception sleeping") time.sleep(0.5) elif (('s' == sys.argv[1]) or ('sstv' in sys.argv[1])): print("SSTV") From 6653b61b5f360422d5a757e744094eaa93d5f24f Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 16:39:56 -0400 Subject: [PATCH 360/415] moved i2c bus testing --- afsk/main.c | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 3ab31857..c06e6c98 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -159,7 +159,7 @@ char dest_addr[5] = "CQ"; float voltage_min[9], current_min[9], voltage_max[9], current_max[9], sensor_max[17], sensor_min[17], other_max[3], other_min[3]; int main(int argc, char * argv[]) { - + mode = FSK; frameCnt = 1; @@ -352,6 +352,26 @@ int main(int argc, char * argv[]) { fprintf(stderr, "pythonConfigStr: %s\n", pythonConfigStr); file1 = sopen(pythonConfigStr); // try new function + + // test i2c buses + i2c_bus0 = (test_i2c_bus(0) != -1) ? ON : OFF; + i2c_bus1 = (test_i2c_bus(1) != -1) ? ON : OFF; + i2c_bus3 = (test_i2c_bus(3) != -1) ? ON : OFF; + + // check for camera +// char cmdbuffer1[1000]; + FILE * file4 = popen("vcgencmd get_camera", "r"); + fgets(cmdbuffer, 1000, file4); + char camera_present[] = "supported=1 detected=1"; + // printf("strstr: %s \n", strstr( & cmdbuffer1, camera_present)); + camera = (strstr( (const char *)& cmdbuffer, camera_present) != NULL) ? ON : OFF; + // printf("Camera result:%s camera: %d \n", & cmdbuffer1, camera); + pclose(file4); + + #ifdef DEBUG_LOGGING + printf("INFO: I2C bus status 0: %d 1: %d 3: %d camera: %d\n", i2c_bus0, i2c_bus1, i2c_bus3, camera); + #endif + fgets(cmdbuffer, 1000, file1); fprintf(stderr, "pythonStr result: %s\n", cmdbuffer); /* @@ -425,25 +445,6 @@ int main(int argc, char * argv[]) { } } - // test i2c buses - i2c_bus0 = (test_i2c_bus(0) != -1) ? ON : OFF; - i2c_bus1 = (test_i2c_bus(1) != -1) ? ON : OFF; - i2c_bus3 = (test_i2c_bus(3) != -1) ? ON : OFF; - - // check for camera -// char cmdbuffer1[1000]; - FILE * file4 = popen("vcgencmd get_camera", "r"); - fgets(cmdbuffer, 1000, file4); - char camera_present[] = "supported=1 detected=1"; - // printf("strstr: %s \n", strstr( & cmdbuffer1, camera_present)); - camera = (strstr( (const char *)& cmdbuffer, camera_present) != NULL) ? ON : OFF; - // printf("Camera result:%s camera: %d \n", & cmdbuffer1, camera); - pclose(file4); - - #ifdef DEBUG_LOGGING - printf("INFO: I2C bus status 0: %d 1: %d 3: %d camera: %d\n", i2c_bus0, i2c_bus1, i2c_bus3, camera); - #endif - if ((i2c_bus3 == OFF) || (sim_mode == TRUE)) { sim_mode = TRUE; From 4eb8abfc1c90f3e982e01718a06bf398e6725311 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 16:46:19 -0400 Subject: [PATCH 361/415] i2c bus test printf --- afsk/main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/afsk/main.c b/afsk/main.c index c06e6c98..4a103926 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -354,9 +354,13 @@ int main(int argc, char * argv[]) { file1 = sopen(pythonConfigStr); // try new function // test i2c buses + printf("Test bus 0\n); i2c_bus0 = (test_i2c_bus(0) != -1) ? ON : OFF; + printf("Test bus 1\n); i2c_bus1 = (test_i2c_bus(1) != -1) ? ON : OFF; + printf("Test bus 3\n); i2c_bus3 = (test_i2c_bus(3) != -1) ? ON : OFF; + printf("Finished testing\n); // check for camera // char cmdbuffer1[1000]; From 32991f2eb7d21d2cfe4f98d76ed18f99a87be4b0 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 16:47:17 -0400 Subject: [PATCH 362/415] missing " --- afsk/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 4a103926..e98660b8 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -354,13 +354,13 @@ int main(int argc, char * argv[]) { file1 = sopen(pythonConfigStr); // try new function // test i2c buses - printf("Test bus 0\n); + printf("Test bus 0\n"); i2c_bus0 = (test_i2c_bus(0) != -1) ? ON : OFF; - printf("Test bus 1\n); + printf("Test bus 1\n"); i2c_bus1 = (test_i2c_bus(1) != -1) ? ON : OFF; - printf("Test bus 3\n); + printf("Test bus 3\n"); i2c_bus3 = (test_i2c_bus(3) != -1) ? ON : OFF; - printf("Finished testing\n); + printf("Finished testing\n"); // check for camera // char cmdbuffer1[1000]; From 9e7fdf8e61d9419392857047755a2a28fd52b59a Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 16:52:50 -0400 Subject: [PATCH 363/415] added flush --- afsk/main.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index e98660b8..3449cbcc 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -354,14 +354,19 @@ int main(int argc, char * argv[]) { file1 = sopen(pythonConfigStr); // try new function // test i2c buses - printf("Test bus 0\n"); + fflush(stdout); + printf("Test bus 0\n"); + fflush(stdout); i2c_bus0 = (test_i2c_bus(0) != -1) ? ON : OFF; - printf("Test bus 1\n"); + printf("Test bus 1\n"); + fflush(stdout); i2c_bus1 = (test_i2c_bus(1) != -1) ? ON : OFF; printf("Test bus 3\n"); + fflush(stdout); i2c_bus3 = (test_i2c_bus(3) != -1) ? ON : OFF; printf("Finished testing\n"); - + fflush(stdout); + // check for camera // char cmdbuffer1[1000]; FILE * file4 = popen("vcgencmd get_camera", "r"); From b20c693203c4411972b8f3c398b6c8310259a625 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 16:55:09 -0400 Subject: [PATCH 364/415] removed AFSK sleep(10) --- afsk/main.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 3449cbcc..959f15f9 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -508,9 +508,6 @@ int main(int argc, char * argv[]) { tx_freq_hz -= tx_channel * 50000; - if (mode == AFSK) - sleep(10); // delay awaiting CW ID completion - if (transmit == FALSE) { fprintf(stderr, "\nNo CubeSatSim Band Pass Filter detected. No transmissions after the CW ID.\n"); From 1ed3c264d1af65fe30700028302d55cfa75369dd Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 17:14:09 -0400 Subject: [PATCH 365/415] added sleep 15 at the start to cover CubeSatSim initialization time --- rpitx.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index c202f458..4badc2a9 100644 --- a/rpitx.py +++ b/rpitx.py @@ -23,7 +23,9 @@ else: txLed = 27 txLedOn = 1 txLedOff = 0 - + +time.sleep(15) // delay to cover cubesatsim initialization time + GPIO.setup(txLed, GPIO.OUT) print(txLedOn) print(txLed) From 3f1320a98c13fe6b712fd1abc557e64bbf8d7f2f Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 17:22:08 -0400 Subject: [PATCH 366/415] added 5 dummy packets at start of APRS --- rpitx.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/rpitx.py b/rpitx.py index 4badc2a9..295f4fe7 100644 --- a/rpitx.py +++ b/rpitx.py @@ -24,8 +24,6 @@ else: txLedOn = 1 txLedOff = 0 -time.sleep(15) // delay to cover cubesatsim initialization time - GPIO.setup(txLed, GPIO.OUT) print(txLedOn) print(txLed) @@ -55,7 +53,10 @@ if __name__ == "__main__": if (len(sys.argv)) > 1: # print("There are arguments!") if (('a' == sys.argv[1]) or ('afsk' in sys.argv[1])): - print("AFSK") + print("AFSK") + for x in range(5): + time.sleep(5); + system("sudo gen_packets -o /home/pi/CubeSatSim/telem.wav /home/pi/CubeSatSim/t.txt -r 48000 > /dev/null 2>&1 && cat /home/pi/CubeSatSim/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") while True: try: f = open("/home/pi/CubeSatSim/ready") From 76fa0082ebf4cd1e077b0cedfef17170c0d5af4a Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 17:25:10 -0400 Subject: [PATCH 367/415] sleep 4 --- rpitx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index 295f4fe7..db5250d1 100644 --- a/rpitx.py +++ b/rpitx.py @@ -55,7 +55,7 @@ if __name__ == "__main__": if (('a' == sys.argv[1]) or ('afsk' in sys.argv[1])): print("AFSK") for x in range(5): - time.sleep(5); + time.sleep(4); system("sudo gen_packets -o /home/pi/CubeSatSim/telem.wav /home/pi/CubeSatSim/t.txt -r 48000 > /dev/null 2>&1 && cat /home/pi/CubeSatSim/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") while True: try: From 88f0d60d84d89482f38761a3c9493075036c4a0c Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 17:26:25 -0400 Subject: [PATCH 368/415] range(4) --- rpitx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index db5250d1..5ef8f063 100644 --- a/rpitx.py +++ b/rpitx.py @@ -54,7 +54,7 @@ if __name__ == "__main__": # print("There are arguments!") if (('a' == sys.argv[1]) or ('afsk' in sys.argv[1])): print("AFSK") - for x in range(5): + for x in range(4): time.sleep(4); system("sudo gen_packets -o /home/pi/CubeSatSim/telem.wav /home/pi/CubeSatSim/t.txt -r 48000 > /dev/null 2>&1 && cat /home/pi/CubeSatSim/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") while True: From a59945cb9f0d23eb75c2f1bf969161e258fd352f Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 17:28:46 -0400 Subject: [PATCH 369/415] made sleep last --- rpitx.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index 5ef8f063..62815d19 100644 --- a/rpitx.py +++ b/rpitx.py @@ -54,9 +54,10 @@ if __name__ == "__main__": # print("There are arguments!") if (('a' == sys.argv[1]) or ('afsk' in sys.argv[1])): print("AFSK") + time.sleep(4) for x in range(4): - time.sleep(4); system("sudo gen_packets -o /home/pi/CubeSatSim/telem.wav /home/pi/CubeSatSim/t.txt -r 48000 > /dev/null 2>&1 && cat /home/pi/CubeSatSim/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") + time.sleep(4) while True: try: f = open("/home/pi/CubeSatSim/ready") From 158f474a92d7f364cda8a1b36906d76336de5a34 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 3 Jun 2021 17:31:08 -0400 Subject: [PATCH 370/415] back to range(5) --- rpitx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index 62815d19..bbad70c2 100644 --- a/rpitx.py +++ b/rpitx.py @@ -55,7 +55,7 @@ if __name__ == "__main__": if (('a' == sys.argv[1]) or ('afsk' in sys.argv[1])): print("AFSK") time.sleep(4) - for x in range(4): + for x in range(5): system("sudo gen_packets -o /home/pi/CubeSatSim/telem.wav /home/pi/CubeSatSim/t.txt -r 48000 > /dev/null 2>&1 && cat /home/pi/CubeSatSim/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") time.sleep(4) while True: From ed0fccd41ddeafadf433c76204ff681723829145 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 4 Jun 2021 06:41:58 -0400 Subject: [PATCH 371/415] changed to python3 -u --- afsk/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 959f15f9..c43d1afe 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -9,7 +9,7 @@ * it under the terms of the GNU General Public License as published by * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This program is distributed in the hope that it will be useful,python3 * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. @@ -151,7 +151,7 @@ double eclipse_time; int test_i2c_bus(int bus); -const char pythonCmd[] = "python3 /home/pi/CubeSatSim/python/voltcurrent.py "; +const char pythonCmd[] = "python3 -u /home/pi/CubeSatSim/python/voltcurrent.py "; char pythonStr[100], pythonConfigStr[100], busStr[10]; int map[8] = {0, 1, 2, 3, 4, 5, 6, 7}; char src_addr[5] = ""; From d4b9e93ee380c96e4ad58802da316ca8510cbcf0 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 4 Jun 2021 07:13:36 -0400 Subject: [PATCH 372/415] changed to forked repos, added camera steps, changed to enable_uart, renamed dropping .sh --- install.sh => install | 42 +++++++++++++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 7 deletions(-) rename install.sh => install (76%) diff --git a/install.sh b/install similarity index 76% rename from install.sh rename to install index 70f2a534..1fee06e4 100755 --- a/install.sh +++ b/install @@ -4,7 +4,7 @@ echo -e "\ninstallation script for CubeSatSim\n" sudo apt-get update && sudo apt-get dist-upgrade -y -sudo apt-get install -y wiringpi git libasound2-dev i2c-tools cpulimit +sudo apt-get install -y wiringpi git libasound2-dev i2c-tools cpulimit python-picamera python3-picamera build-essential libgd-dev libmagic-dev cd /tmp @@ -36,6 +36,7 @@ else echo "ARG1=f" >> .mode fi + FILE=/home/pi/CubeSatSim/sim.cfg if [ -f "$FILE" ]; then echo "$FILE exists." @@ -44,6 +45,7 @@ else echo $1 >> sim.cfg fi + cd git clone https://github.com/alanbjohnston/direwolf.git @@ -56,6 +58,7 @@ sudo make install make install-rpi + cd git clone https://github.com/alanbjohnston/pi-power-button.git @@ -64,14 +67,25 @@ cd pi-power-button ./script/install + +cd + +git clone https://github.com/alanbjohnston/PiSSTVpp.git + +cd PiSSTVpp + +make pisstvpp + + cd -git clone https://github.com/F5OEO/rpitx.git +git clone https://github.com/alanbjohnston/rpitx.git cd rpitx ./install.sh + cd sudo cp ~/CubeSatSim/systemd/cubesatsim.service /etc/systemd/system/cubesatsim.service @@ -82,13 +96,16 @@ sudo cp ~/CubeSatSim/systemd/rpitx.service /etc/systemd/system/rpitx.service sudo systemctl enable rpitx - sudo cp /boot/config.txt /boot/config.txt.0 sudo cp /boot/cmdline.txt /boot/cmdline.txt.0 + sudo raspi-config nonint do_i2c 0 +sudo raspi-config nonint do_camera 0 + + #if [ "$1" = "u" ]; then #fi @@ -103,11 +120,18 @@ sudo raspi-config nonint do_i2c 0 sudo sh -c 'echo "\ndtoverlay=i2c-gpio,bus=3,i2c_gpio_delay_us=1,i2c_gpio_sda=23,i2c_gpio_scl=24" >> /boot/config.txt' fi - if [[ $(grep 'dtoverlay=pi3-miniuart-bt' /boot/config.txt) ]]; then - echo "dtoverlay=pi3-miniuart-bt already in /boot/config.txt" + if [[ $(grep 'enable_uart=1' /boot/config.txt) ]]; then + echo "enable_uart=1 already in /boot/config.txt" else - echo "adding dtoverlay=pi3-miniuart-bt to /boot/config.txt" - sudo sh -c 'echo "\ndtoverlay=pi3-miniuart-bt" >> /boot/config.txt' + echo "adding enable_uart=1 to /boot/config.txt" + sudo sh -c 'echo "\nenable_uart=1" >> /boot/config.txt' + fi + + if [[ $(grep 'dtoverlay=disable-bt' /boot/config.txt) ]]; then + echo "dtoverlay=disable-bt already in /boot/config.txt" + else + echo "adding dtoverlay=disable-bt to /boot/config.txt" + sudo sh -c 'echo "\ndtoverlay=disable-bt" >> /boot/config.txt' fi if [[ $(grep 'dtoverlay=dwc2' /boot/config.txt) ]]; then @@ -124,5 +148,9 @@ sudo raspi-config nonint do_i2c 0 sudo sed -i 's/ rootwait/ rootwait modules-load=dwc2,g_ether/g' /boot/cmdline.txt fi +CubeSatSim/config -c + +CubeSatSim/config -l + echo "You need to reboot to complete the installation\n" From f24ebed020c32b281ae3ae88cac669756bd19803 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 4 Jun 2021 07:59:08 -0400 Subject: [PATCH 373/415] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c2a98d64..868b3be1 100644 --- a/README.md +++ b/README.md @@ -39,11 +39,11 @@ To get the software follow these steps: `git checkout master` -You are now ready to install the software. In the following command, CALLSIGN is your amateur radio callsign in all capitals, if you have one. If you don't you can put some other word which will be transmitted as a CW ID. +You are now ready to install the software using this script in the CubeSatSim directory: -`./install.sh CALLSIGN` +`./install` -The installation script will run for quite a while. It will prompt you if you want to modify /boot/config.txt file. Type a `y` and the script will complete. You will need to reboot. +The installation script will run for quite a while. You will get prompted for your amateur radio callsign in all capitals, if you have one. If you don't you can put some other word which will be transmitted as a CW ID. You will also be prompted for your latitude and longitude for APRS packets. The script will prompt you if you want to modify /boot/config.txt file. Type a `y` and the script will complete. You will need to reboot. See the Wiki for more details about the CubeSatSim https://github.com/alanbjohnston/CubeSatSim/wiki From e40c40b54cf80e20efdf564a91dfa5c85d644810 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 4 Jun 2021 11:10:31 -0400 Subject: [PATCH 374/415] fixed sim.cfg generation --- install | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install b/install index 1fee06e4..49a4453f 100755 --- a/install +++ b/install @@ -42,7 +42,7 @@ if [ -f "$FILE" ]; then echo "$FILE exists." else echo "creating $FILE" - echo $1 >> sim.cfg + echo "AMSAT 1 0.0 0.0" >> sim.cfg fi @@ -148,9 +148,9 @@ sudo raspi-config nonint do_camera 0 sudo sed -i 's/ rootwait/ rootwait modules-load=dwc2,g_ether/g' /boot/cmdline.txt fi -CubeSatSim/config -c +CubeSatSim/config -c -n -CubeSatSim/config -l +CubeSatSim/config -l -n echo "You need to reboot to complete the installation\n" From 855967df349a4a0408ee7337f719ff8cf71375df Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 4 Jun 2021 11:13:03 -0400 Subject: [PATCH 375/415] full path of sim.cfg --- install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install b/install index 49a4453f..daab8382 100755 --- a/install +++ b/install @@ -42,7 +42,7 @@ if [ -f "$FILE" ]; then echo "$FILE exists." else echo "creating $FILE" - echo "AMSAT 1 0.0 0.0" >> sim.cfg + echo "AMSAT 1 0.0 0.0" >> /home/pi/CubeSatSim/sim.cfg fi From f1749090bee6ea42da81ceda7c3b481651267c71 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 4 Jun 2021 11:14:14 -0400 Subject: [PATCH 376/415] fixed echo --- install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install b/install index daab8382..18789775 100755 --- a/install +++ b/install @@ -42,7 +42,7 @@ if [ -f "$FILE" ]; then echo "$FILE exists." else echo "creating $FILE" - echo "AMSAT 1 0.0 0.0" >> /home/pi/CubeSatSim/sim.cfg + echo "AMSAT 1 0.0 0.0" > /home/pi/CubeSatSim/sim.cfg fi From fbe211e6132a3cc7c089832263b3981b36827667 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 4 Jun 2021 11:17:11 -0400 Subject: [PATCH 377/415] added -n for no reset for callsign and lat long --- config | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/config b/config index a161e0fe..ca2fb56a 100755 --- a/config +++ b/config @@ -163,11 +163,14 @@ elif [ "$1" = "-c" ]; then echo $callsign $2 $3 $4 $5 echo $callsign $2 $3 $4 $5 > /home/pi/CubeSatSim/sim.cfg - echo - echo "Restarting CubeSatSim with new configuraation file" - echo - - sudo systemctl restart cubesatsim + + if [ "$2" = "-n" ]; then + echo + else + echo "Restarting CubeSatSim with new configuraation file" + echo + sudo systemctl restart cubesatsim + fi elif [ "$1" = "-c" ]; then @@ -203,10 +206,14 @@ elif [ "$1" = "-c" ]; then echo $callsign $2 $3 $4 $5 echo $callsign $2 $3 $4 $5 > /home/pi/CubeSatSim/sim.cfg echo - echo "Restarting CubeSatSim with new configuraation file" - echo - - sudo systemctl restart cubesatsim + + if [ "$2" = "-n" ]; then + echo + else + echo "Restarting CubeSatSim with new configuraation file" + echo + sudo systemctl restart cubesatsim + fi elif [ "$1" = "-r" ]; then From 854d2a38672640a27611e7896bd55d03282b52cb Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 4 Jun 2021 11:22:07 -0400 Subject: [PATCH 378/415] added norestart variable --- config | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/config b/config index ca2fb56a..03bed40b 100755 --- a/config +++ b/config @@ -2,6 +2,12 @@ # echo $1 +if [ "$2" = "-n" ]; then + norestart=1 +else + norestart=0 +fi + if [ "$1" = "" ]; then value=`cat /home/pi/CubeSatSim/.mode` echo "$value" > /dev/null @@ -164,7 +170,7 @@ elif [ "$1" = "-c" ]; then echo $callsign $2 $3 $4 $5 echo $callsign $2 $3 $4 $5 > /home/pi/CubeSatSim/sim.cfg - if [ "$2" = "-n" ]; then + if [ "$norestart" = "1" ]; then echo else echo "Restarting CubeSatSim with new configuraation file" @@ -207,7 +213,7 @@ elif [ "$1" = "-c" ]; then echo $callsign $2 $3 $4 $5 > /home/pi/CubeSatSim/sim.cfg echo - if [ "$2" = "-n" ]; then + if [ "$norestart" = "1" ]; then echo else echo "Restarting CubeSatSim with new configuraation file" From db81d39e1cd840e1f3617059ebcbd42a65ae301f Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 4 Jun 2021 11:28:30 -0400 Subject: [PATCH 379/415] added norestart to resets and lat long --- config | 89 ++++++++++++++++++++-------------------------------------- 1 file changed, 30 insertions(+), 59 deletions(-) diff --git a/config b/config index 03bed40b..1d6dbfb9 100755 --- a/config +++ b/config @@ -163,59 +163,19 @@ 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 $5 - echo $callsign $2 $3 $4 $5 > /home/pi/CubeSatSim/sim.cfg - - if [ "$norestart" = "1" ]; then - echo + norestart=1 else - echo "Restarting CubeSatSim with new configuraation file" - echo - sudo systemctl restart cubesatsim - fi - -elif [ "$1" = "-c" ]; then - - echo - echo "Editing the CALLSIGN in the" - echo "configuration file for CubeSatSim" - echo - echo "Return keeps current value." -# echo -e "Current sim.cfg configuration file:" -# echo - - value=`cat /home/pi/CubeSatSim/sim.cfg` - echo "$value" > /dev/null - set -- $value - - echo "Current value of CALLSIGN is" - echo $1 - echo -# echo $1 $2 $3 $4 $5 + echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n" - echo "Enter callsign in all capitals: " - read callsign - - if [ -z $callsign ] ; then - - callsign="$1" - echo "Keeping value of" $callsign + echo $callsign $2 $3 $4 $5 + echo $callsign $2 $3 $4 $5 > /home/pi/CubeSatSim/sim.cfg fi - echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n" - - echo $callsign $2 $3 $4 $5 - echo $callsign $2 $3 $4 $5 > /home/pi/CubeSatSim/sim.cfg - echo - if [ "$norestart" = "1" ]; then - echo + echo "no changes" else + echo echo "Restarting CubeSatSim with new configuraation file" echo sudo systemctl restart cubesatsim @@ -255,17 +215,24 @@ elif [ "$1" = "-r" ]; then echo "Error: not an integer!" resets="$2" echo "Keeping value of" $resets - fi + norestart=1 + else - echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n" + echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n" - echo $1 $resets $3 $4 $5 - echo $1 $resets $3 $4 $5 > /home/pi/CubeSatSim/sim.cfg - echo - echo "Restarting CubeSatSim with new configuraation file" - echo - - sudo systemctl restart cubesatsim + echo $1 $resets $3 $4 $5 + echo $1 $resets $3 $4 $5 > /home/pi/CubeSatSim/sim.cfg + fi + + if [ "$norestart" = "1" ]; then + echo + echo "no changes" + else + echo + echo "Restarting CubeSatSim with new configuraation file" + echo + sudo systemctl restart cubesatsim + fi elif [ "$1" = "-l" ]; then @@ -331,11 +298,15 @@ elif [ "$1" = "-l" ]; then echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n" echo $1 $2 $lat $long $5 echo $1 $2 $lat $long $5 > /home/pi/CubeSatSim/sim.cfg - echo - echo "Restarting CubeSatSim with new configuraation file" - echo - sudo systemctl restart cubesatsim + if [ "$norestart" = "1" ]; then + echo "no changes" + else + echo + echo "Restarting CubeSatSim with new configuraation file" + echo + sudo systemctl restart cubesatsim + fi fi # sudo systemctl restart cubesatsim From b6cb2270ab10e62b5be60fef3b6f7f59f80d45a5 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 4 Jun 2021 11:30:03 -0400 Subject: [PATCH 380/415] removed no changes echo --- config | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/config b/config index 1d6dbfb9..f2ed02ab 100755 --- a/config +++ b/config @@ -173,7 +173,7 @@ elif [ "$1" = "-c" ]; then fi if [ "$norestart" = "1" ]; then - echo "no changes" + echo else echo echo "Restarting CubeSatSim with new configuraation file" @@ -226,7 +226,6 @@ elif [ "$1" = "-r" ]; then if [ "$norestart" = "1" ]; then echo - echo "no changes" else echo echo "Restarting CubeSatSim with new configuraation file" @@ -300,7 +299,7 @@ elif [ "$1" = "-l" ]; then echo $1 $2 $lat $long $5 > /home/pi/CubeSatSim/sim.cfg if [ "$norestart" = "1" ]; then - echo "no changes" + echo else echo echo "Restarting CubeSatSim with new configuraation file" From cf4f0e32cdf4fd551a49f8d84cbb7ba652906cbb Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 4 Jun 2021 13:32:53 -0400 Subject: [PATCH 381/415] changed radioafsk to cubesatsim --- Makefile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 0f95bb8d..55e7b88a 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,11 @@ all: DEBUG_BEHAVIOR= all: libax5043.a -all: radioafsk +all: cubesatsim all: telem debug: DEBUG_BEHAVIOR = -DDEBUG_LOGGING debug: libax5043.a -debug: radioafsk +debug: cubesatsim debug: telem rebuild: clean @@ -20,7 +20,7 @@ clean: rm -f testax5043tx rm -f testax50432freq rm -f testax5043init - rm -f radioafsk + rm -f cubesatsim rm -f testafsktx rm -f libax5043.a rm -f */*.o @@ -78,11 +78,11 @@ testafsktx: afsktx/ax5043.o testafsktx: afsktx/main.o gcc -std=gnu99 $(DEBUG_BEHAVIOR) -o testafsktx -Wall -Wextra -L./ afsktx/ax25.o afsktx/ax5043.o afsktx/main.o -lwiringPi -lax5043 -radioafsk: libax5043.a -radioafsk: afsk/ax25.o -radioafsk: afsk/ax5043.o -radioafsk: afsk/main.o - gcc -std=gnu99 $(DEBUG_BEHAVIOR) -o radioafsk -Wall -Wextra -L./ afsk/ax25.o afsk/ax5043.o afsk/main.o -lwiringPi -lax5043 -lm +cubesatsim: libax5043.a +cubesatsim: afsk/ax25.o +cubesatsim: afsk/ax5043.o +cubesatsim: afsk/main.o + gcc -std=gnu99 $(DEBUG_BEHAVIOR) -o cubesatsim -Wall -Wextra -L./ afsk/ax25.o afsk/ax5043.o afsk/main.o -lwiringPi -lax5043 -lm telem: afsk/telem.o gcc -std=gnu99 $(DEBUG_BEHAVIOR) -o telem -Wall -Wextra -L./ afsk/telem.o -lwiringPi From fd39466badf84eba9ab24f80e805f2d39c7236e5 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 4 Jun 2021 13:34:32 -0400 Subject: [PATCH 382/415] changed radioafsk to cubesatsim --- demo.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/demo.sh b/demo.sh index 84b71b50..e25a8214 100755 --- a/demo.sh +++ b/demo.sh @@ -13,16 +13,16 @@ fi if [[ ("$1" = "a" ) || (("$1" = "c") && ("$(($y %4))" = 3)) ]]; then echo "Mode is continuous AFSK" - /home/pi/CubeSatSim/radioafsk afsk + /home/pi/CubeSatSim/cubesatsim afsk elif [[ ("$1" = "b" ) || (("$1" = "c") && ("$(($y %4))" = 1)) ]]; then echo "Mode is continuous BPSK" - sudo cpulimit -l 2.5 -b -P radioafsk - /home/pi/CubeSatSim/radioafsk bpsk + sudo cpulimit -l 2.5 -b -P cubesatsim + /home/pi/CubeSatSim/cubesatsim bpsk elif [[ ("$1" = "s" ) || (("$1" = "c") && ("$(($y %4))" = 2)) ]]; then echo "Mode is continuous SSTV" while true; do sleep 5; done else echo "Mode is continuous FSK" - /home/pi/CubeSatSim/radioafsk fsk + /home/pi/CubeSatSim/cubesatsim fsk fi From a5fc7fc4996aecfc2c4e4fdf716655ff3be93a21 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 5 Jun 2021 18:00:08 -0400 Subject: [PATCH 383/415] check for initial_image.jpg and copy and transmit as first SSTV image --- rpitx.py | 47 ++++++++++++++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/rpitx.py b/rpitx.py index bbad70c2..b4d5bfe0 100644 --- a/rpitx.py +++ b/rpitx.py @@ -32,8 +32,11 @@ GPIO.output(27, 0) print(transmit) -file = open("/home/pi/CubeSatSim/sim.cfg") -callsign = file.readline().split(" ")[0] +try: + file = open("/home/pi/CubeSatSim/sim.cfg") + callsign = file.readline().split(" ")[0] +except: + callsign = "AMSAT" print(callsign) #GPIO.output(27, 1); @@ -80,28 +83,38 @@ if __name__ == "__main__": print("No camera") camera_present = 0 - while 1: - GPIO.output(txLed, txLedOff) - if (camera_present == 1): - GPIO.output(txLed, txLedOn) +# while 1: + GPIO.output(txLed, txLedOff) + if (camera_present == 1): + try: + file = open("/home/pi/CubeSatSim/initial_image.jpg") + system("cp /home/pi/CubeSatSim/initial_image.jpg /home/pi/CubeSatSim/camera_out.jpg") + print("Initial image copied") + except: + print("No initial image") + system("raspistill -o /home/pi/camera_out.jpg -w 320 -h 256") # > /dev/null 2>&1") + print("Photo taken") + while 1: +# GPIO.output(txLed, txLedOn) system("/home/pi/PiSSTVpp/pisstvpp -r 48000 -p s2 /home/pi/camera_out.jpg") # > /dev/null 2>&1") - GPIO.output(txLed, txLedOff) +# GPIO.output(txLed, txLedOff) print ("Sending SSTV photo") time.sleep(1) - system("sudo killall -9 rpitx > /dev/null 2>&1") - system("sudo killall -9 csdr > /dev/null 2>&1") - system("sudo killall -9 cat > /dev/null 2>&1") +# system("sudo killall -9 rpitx > /dev/null 2>&1") +# system("sudo killall -9 csdr > /dev/null 2>&1") +# system("sudo killall -9 cat > /dev/null 2>&1") GPIO.output(txLed, txLedOn); system("cat /home/pi/camera_out.jpg.wav | csdr convert_i16_f | csdr gain_ff 14000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") # > /dev/null 2>&1") + GPIO.output(txLed, txLedOff) system("raspistill -o /home/pi/camera_out.jpg -w 320 -h 256") # > /dev/null 2>&1") print("Photo taken") - else: - system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3 &") - while 1: - GPIO.output(txLed, txLedOn) - time.sleep(60) - GPIO.output(txLed, txLedOff) - time.sleep(1) + else: + system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3 &") + while 1: + GPIO.output(txLed, txLedOn) + time.sleep(60) + GPIO.output(txLed, txLedOff) + time.sleep(1) elif (('b' == sys.argv[1]) or ('bpsk' in sys.argv[1])): print("BPSK") From 6151a5fa066c1e5b9405965b62f4ed56a55d918a Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 5 Jun 2021 18:07:51 -0400 Subject: [PATCH 384/415] moved initial_image to either camera or no camera --- rpitx.py | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/rpitx.py b/rpitx.py index b4d5bfe0..23af0ed3 100644 --- a/rpitx.py +++ b/rpitx.py @@ -82,32 +82,29 @@ if __name__ == "__main__": except: print("No camera") camera_present = 0 - + try: + file = open("/home/pi/CubeSatSim/initial_image.jpg") + print("Initial image detected") + system("/home/pi/PiSSTVpp/pisstvpp -r 48000 -p s2 /home/pi/initial_image.jpg") + print ("Sending SSTV photo") + GPIO.output(txLed, txLedOn); + system("cat /home/pi/initial_image.jpg.wav | csdr convert_i16_f | csdr gain_ff 14000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") # > /dev/null 2>&1") + GPIO.output(txLed, txLedOff) +# time.sleep(1) + except: + print("No initial image") # while 1: GPIO.output(txLed, txLedOff) if (camera_present == 1): - try: - file = open("/home/pi/CubeSatSim/initial_image.jpg") - system("cp /home/pi/CubeSatSim/initial_image.jpg /home/pi/CubeSatSim/camera_out.jpg") - print("Initial image copied") - except: - print("No initial image") + while 1: system("raspistill -o /home/pi/camera_out.jpg -w 320 -h 256") # > /dev/null 2>&1") print("Photo taken") - while 1: -# GPIO.output(txLed, txLedOn) - system("/home/pi/PiSSTVpp/pisstvpp -r 48000 -p s2 /home/pi/camera_out.jpg") # > /dev/null 2>&1") -# GPIO.output(txLed, txLedOff) + system("/home/pi/PiSSTVpp/pisstvpp -r 48000 -p s2 /home/pi/camera_out.jpg") print ("Sending SSTV photo") - time.sleep(1) -# system("sudo killall -9 rpitx > /dev/null 2>&1") -# system("sudo killall -9 csdr > /dev/null 2>&1") -# system("sudo killall -9 cat > /dev/null 2>&1") GPIO.output(txLed, txLedOn); system("cat /home/pi/camera_out.jpg.wav | csdr convert_i16_f | csdr gain_ff 14000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") # > /dev/null 2>&1") GPIO.output(txLed, txLedOff) - system("raspistill -o /home/pi/camera_out.jpg -w 320 -h 256") # > /dev/null 2>&1") - print("Photo taken") + time.sleep(1) else: system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3 &") while 1: From 9f95982a03f05268fd47f868d8c35e7e1c46c5f6 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 5 Jun 2021 18:22:16 -0400 Subject: [PATCH 385/415] initial_image in home directory --- rpitx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index 23af0ed3..7d8d7ef7 100644 --- a/rpitx.py +++ b/rpitx.py @@ -83,7 +83,7 @@ if __name__ == "__main__": print("No camera") camera_present = 0 try: - file = open("/home/pi/CubeSatSim/initial_image.jpg") + file = open("/home/pi/initial_image.jpg") print("Initial image detected") system("/home/pi/PiSSTVpp/pisstvpp -r 48000 -p s2 /home/pi/initial_image.jpg") print ("Sending SSTV photo") From 8261be321edc4cec393bc6edf043b3aa1414a227 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 5 Jun 2021 18:54:07 -0400 Subject: [PATCH 386/415] added reboot prompt at end of installation --- install | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/install b/install index 18789775..0a900206 100755 --- a/install +++ b/install @@ -152,5 +152,16 @@ CubeSatSim/config -c -n CubeSatSim/config -l -n -echo "You need to reboot to complete the installation\n" +echo "Would you like to reboot to complete the installation (y/n)?\n" +$read -r ANS + +if [ "$ANS" = "y" ]; then + + sudo reboot now + +else + + echo "\nThe CubeSatSim software will start next time you reboot" + +fi From fcbcffaf3e0e57f117a6ed5ddfb809a00b319f96 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 6 Jun 2021 07:17:38 -0400 Subject: [PATCH 387/415] added copying SSTV images from SSTV directory --- update | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/update b/update index 4b46d51f..68ab7573 100755 --- a/update +++ b/update @@ -47,3 +47,18 @@ else echo "nothing to do" fi fi + +FILE=/home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg +if [ -f "$FILE" ]; then +else + echo "Copying SSTV image 1" + cp /home/pi/CubeSatSim/sstv/sstv_image_1_320_x_256.jpg /home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg +fi + +FILE=/home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg +if [ -f "$FILE" ]; then +else + echo "Copying SSTV image 2" + cp /home/pi/CubeSatSim/sstv/sstv_image_2_320_x_256.jpg /home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg +fi + From 0f2ff9e038a851352b769dd96dd649b5aa03c771 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 6 Jun 2021 07:24:35 -0400 Subject: [PATCH 388/415] trying SSTV image 1 and 2 if present --- rpitx.py | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/rpitx.py b/rpitx.py index 7d8d7ef7..fdd2ebcd 100644 --- a/rpitx.py +++ b/rpitx.py @@ -83,16 +83,16 @@ if __name__ == "__main__": print("No camera") camera_present = 0 try: - file = open("/home/pi/initial_image.jpg") - print("Initial image detected") - system("/home/pi/PiSSTVpp/pisstvpp -r 48000 -p s2 /home/pi/initial_image.jpg") - print ("Sending SSTV photo") + file = open("/home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg") + print("First SSTV stored image detected") + system("/home/pi/PiSSTVpp/pisstvpp -r 48000 -p s2 /home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg") + print ("Sending SSTV image") GPIO.output(txLed, txLedOn); - system("cat /home/pi/initial_image.jpg.wav | csdr convert_i16_f | csdr gain_ff 14000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") # > /dev/null 2>&1") + system("cat /home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg.wav | csdr convert_i16_f | csdr gain_ff 14000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") # > /dev/null 2>&1") GPIO.output(txLed, txLedOff) # time.sleep(1) except: - print("No initial image") + print("No first image") # while 1: GPIO.output(txLed, txLedOff) if (camera_present == 1): @@ -100,18 +100,29 @@ if __name__ == "__main__": system("raspistill -o /home/pi/camera_out.jpg -w 320 -h 256") # > /dev/null 2>&1") print("Photo taken") system("/home/pi/PiSSTVpp/pisstvpp -r 48000 -p s2 /home/pi/camera_out.jpg") - print ("Sending SSTV photo") + print ("Sending SSTV image") GPIO.output(txLed, txLedOn); system("cat /home/pi/camera_out.jpg.wav | csdr convert_i16_f | csdr gain_ff 14000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") # > /dev/null 2>&1") GPIO.output(txLed, txLedOff) time.sleep(1) else: - system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3 &") - while 1: - GPIO.output(txLed, txLedOn) - time.sleep(60) - GPIO.output(txLed, txLedOff) - time.sleep(1) + try: + file = open("/home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg") + print("Second SSTV stored image detected") + system("/home/pi/PiSSTVpp/pisstvpp -r 48000 -p s2 /home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg") + while 1: + print ("Sending SSTV image") + GPIO.output(txLed, txLedOn); + system("cat /home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg.wav | csdr convert_i16_f | csdr gain_ff 14000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") # > /dev/null 2>&1") + GPIO.output(txLed, txLedOff) + time.sleep(5) + except: + system("(while true; do (sleep 5 && cat /home/pi/CubeSatSim/wav/sstv.wav); done) | csdr convert_i16_f | csdr gain_ff 7000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3 &") + while 1: + GPIO.output(txLed, txLedOn) + time.sleep(60) + GPIO.output(txLed, txLedOff) + time.sleep(1) elif (('b' == sys.argv[1]) or ('bpsk' in sys.argv[1])): print("BPSK") From b38914232421cfc6768f6a83933624c7012c28f2 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 6 Jun 2021 07:27:22 -0400 Subject: [PATCH 389/415] added ; null if file exists --- update | 2 ++ 1 file changed, 2 insertions(+) diff --git a/update b/update index 68ab7573..2bb74e14 100755 --- a/update +++ b/update @@ -50,6 +50,7 @@ fi FILE=/home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg if [ -f "$FILE" ]; then + ; else echo "Copying SSTV image 1" cp /home/pi/CubeSatSim/sstv/sstv_image_1_320_x_256.jpg /home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg @@ -57,6 +58,7 @@ fi FILE=/home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg if [ -f "$FILE" ]; then + ; else echo "Copying SSTV image 2" cp /home/pi/CubeSatSim/sstv/sstv_image_2_320_x_256.jpg /home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg From 8a83adf7fb16373dad2df7e2b8163efda7a05dad Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 6 Jun 2021 07:29:25 -0400 Subject: [PATCH 390/415] added not for SSTV image test --- update | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/update b/update index 2bb74e14..1e7a0d58 100755 --- a/update +++ b/update @@ -49,17 +49,13 @@ else fi FILE=/home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg -if [ -f "$FILE" ]; then - ; -else +if [ ! -f "$FILE" ]; then echo "Copying SSTV image 1" cp /home/pi/CubeSatSim/sstv/sstv_image_1_320_x_256.jpg /home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg fi FILE=/home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg -if [ -f "$FILE" ]; then - ; -else +if [ ! -f "$FILE" ]; then echo "Copying SSTV image 2" cp /home/pi/CubeSatSim/sstv/sstv_image_2_320_x_256.jpg /home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg fi From 18b031f141db6cee8449f459361106ef88001c8b Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 6 Jun 2021 07:35:05 -0400 Subject: [PATCH 391/415] initial add of two 320x256 images for SSTV transmission --- sstv/sstv_image_1_320_x_256.jpg | Bin 0 -> 33810 bytes sstv/sstv_image_2_320_x_256.jpg | Bin 0 -> 22803 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 sstv/sstv_image_1_320_x_256.jpg create mode 100644 sstv/sstv_image_2_320_x_256.jpg diff --git a/sstv/sstv_image_1_320_x_256.jpg b/sstv/sstv_image_1_320_x_256.jpg new file mode 100644 index 0000000000000000000000000000000000000000..0cfbf999cb9af80a80d38847fcbf8e745e270417 GIT binary patch literal 33810 zcmdpdWmp|e)8^pr5?q2?g1fuB6Ck*|dqR+4!QCae1a}DT9$bQZ&;UUac1Rw1zi;=) z?se_{*@l_9r@FejtGc?oy3aX}3yQ`- zm;nH2Ka3n5Z6VPCz|P*)Syf7uOj}2n3~mR22H*f};5mS8Wa8o|qO2?rfa&k&6aF_{ z&jFw$0GMHVlJzhBe+yxnnz@(&0K_Yh+t}2_#16!t0RTF~#L?Lm0AQc!6dtaQPxuXp zv7NyNf;iy`Tl~SrPuTbmZu`xnt||udOacHrvXPOq1puI~fOIl<6AMrd>H~%$FOy)27P^jLP z>RKQj5dfel-K{hgL5vFG7cMqxPwfHQ2F34fDfUGF&ExE*`qX|(kgjTGFC_|MP!}k7 zb7#pX-Jkfw?OZ_g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zWNW<+H$m9jpFPNsl@H=>?jE)U8nNwzxA zLu|ZW+es3<5Rk!Vu201y3gCLie%nj@~Q@ z4u}URC^ORgx`G9aFxV8((|=}Y`CGYW!YwHtLXb;qEu%xiHv*6V#+#lRe~k3u$@J#u zraSk&tJR%bB69DB)4($Mgx>}UB$`^8C_Rk28pK2|=cp`&y+TgY<}lmPldU?>0WW9} dNdn%=U25P|@c$-BivLBDU=_8J+NS?q|3A{}vuOYT literal 0 HcmV?d00001 diff --git a/sstv/sstv_image_2_320_x_256.jpg b/sstv/sstv_image_2_320_x_256.jpg new file mode 100644 index 0000000000000000000000000000000000000000..7eb43eb923275213acf698ca28afcd9aa4706282 GIT binary patch literal 22803 zcmb@t1ymhP(*`(~i@Uo!1cDRX-QC^Y-2;RGL4p(9U4sS!gkZrXNRXfrG&ls`A$i~L z`}f~HXLrxp=1$MkRn^s1Ju^MkJQ0bFxSPd9NjH6;K{|DGT5 zf78W00BQn&&#aHS{!9OVg|MxxJuLwMVgyQCSb17HgZKjgz~)%Gd3XT;{3D&l*URk@ zhk+Q^12hoCsgKz9FRpmR7Ju>kKQdYxlAz2K03f28n|s&-0Qw3@r}VM31@)lcf|%XK z%H9R^p9RDsmUiY=Abzx+#o5{Q5ody!5tMfW@dps|S^N*3w*Ld0n_K)xzqz^XfAC+w zz?z^DQudy1PUil93jcp*&Q9K7-~CDSV2*0%A*TVJalt~&N?j1J<4{;PFcH%|I;T> zA8Sv&N83Pom{u!mDQOUczC*XIU9=zlebn>Y%}e63EwC;uvYXSN=LDp~Qd>L8KGLZ{ z%=RHtc{zO+G8JrcEScYm@BA(7_71%D**q|8QKuToVWY4geQW#`8b*B>r%%0UwZl_aExt zx~zcBAFj`z8jipZumxv85pV*_-XOLH>-^iA4)6`6*#D>eZ|mluPD{{UC-8XW|KHR9 zrT$k^9Q0S|pSs@vwn&NbZ+&=acqw=}co}#mSYlWaSV34NFc$+4PFOxz{(t@WuRPoj zxM{dexH-6WxJ6U@aF74hN6NrD=+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_9T)Ra(T{oA?_{W9hNJ2HCl(PUoQ!(Vc{l7{=bghde_AHLUr zr}}RUJEa>891SFHtK%JD=BFm6p-zuDfG3NJah%bQ6B09Eg`oP z-n`+t92YYYR5Q;Jf%!(RAc|Pw$4A9jq6#GM&aFK@6-Jusz zH18np(|-*^s7PCPmTAuTa9bV=uQyd7mAV+0RcUi<&A>pIZ7UrBLwW@b?uS$ee0kOH zL7RktfnVj1crlbiDejx*>0&mns0~ zpwY5abSNRcitBhbQdls8K~e00Xw5m98t~1WAx}6c8=wrG&v*6L+y~5VSmv5VdM9@Y zW=`L&RSN`!qB~6z#BiK^;6DCauqvUgM{ijPmI4q61R)Z8X7L#r6mMYK^5xZtkn)My zhswiNDll&|y`$NkRFjh!lV?xo81)RAL;z?Zr8o$=CNuy5@5<7;z-I^@*lOOKK81V=dWDYU5zRO^g+rn8cr?g&wIA{{Ze))@Z0AcOK@SedXffgl$RY z?&V4(w!)!Hu?_mhnjr-ZHmIj_^rn+6Yazo->Zc)re#5M+))fVX(FY*nDj|HbRg^Y# zEp@aO)M2n2a85^~@lJVwIYD(?M2k5APV7i$M4Vrd#Dx@usvs%JF1h+MVhSx8(`(NC zfHV7`jqm6rRbdPKP*DTSdHsj<5ClAe34`?(U=oAx3qIp1nFbds{s7Pb00+>cr}o!} zH+S(eyg6PRuMSs-E5nuH%JAiQa=bZS9Ip;nhbzOC;mYv;09jrfuMSs-E5nuH%JAiQ ga=bZS9Ip;nhbzOC;mYvkcyhcsUL2}p{{R#J*(91*p#T5? literal 0 HcmV?d00001 From 1c766e38bc93b1184bfa20a072f55b308b2da310 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 6 Jun 2021 07:38:36 -0400 Subject: [PATCH 392/415] added test for update script update --- update | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/update b/update index 1e7a0d58..70ebfcea 100755 --- a/update +++ b/update @@ -34,6 +34,24 @@ else echo "no changes to rpitx.service" fi +FILE=/home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg +if [ ! -f "$FILE" ]; then + echo "Copying SSTV image 1" + cp /home/pi/CubeSatSim/sstv/sstv_image_1_320_x_256.jpg /home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg +fi + +FILE=/home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg +if [ ! -f "$FILE" ]; then + echo "Copying SSTV image 2" + cp /home/pi/CubeSatSim/sstv/sstv_image_2_320_x_256.jpg /home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg +fi + +grep 'update' /home/pi/CubeSatSim/.updated +if [[ $(grep 'update' /home/pi/CubeSatSim/.updated) ]]; then + echo "update script updated" + /home/pi/CubeSatSim/update +fi + if [ $FLAG -eq 1 ]; then echo "systemctl daemon-reload and restart" sudo systemctl daemon-reload @@ -47,16 +65,3 @@ else echo "nothing to do" fi fi - -FILE=/home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg -if [ ! -f "$FILE" ]; then - echo "Copying SSTV image 1" - cp /home/pi/CubeSatSim/sstv/sstv_image_1_320_x_256.jpg /home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg -fi - -FILE=/home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg -if [ ! -f "$FILE" ]; then - echo "Copying SSTV image 2" - cp /home/pi/CubeSatSim/sstv/sstv_image_2_320_x_256.jpg /home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg -fi - From d35a5f57bd9a142e886438310fff00bf9fb888cd Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 6 Jun 2021 07:39:24 -0400 Subject: [PATCH 393/415] Update update --- update | 1 + 1 file changed, 1 insertion(+) diff --git a/update b/update index 70ebfcea..725e6da7 100755 --- a/update +++ b/update @@ -65,3 +65,4 @@ else echo "nothing to do" fi fi + From 137b9f73fee31c8db32fa62b5464edceba314732 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 6 Jun 2021 08:07:29 -0400 Subject: [PATCH 394/415] changed camera image to CubeSatSim --- rpitx.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rpitx.py b/rpitx.py index fdd2ebcd..0184f54c 100644 --- a/rpitx.py +++ b/rpitx.py @@ -97,12 +97,12 @@ if __name__ == "__main__": GPIO.output(txLed, txLedOff) if (camera_present == 1): while 1: - system("raspistill -o /home/pi/camera_out.jpg -w 320 -h 256") # > /dev/null 2>&1") + system("raspistill -o /home/pi/CubeSatSim/camera_out.jpg -w 320 -h 256") # > /dev/null 2>&1") print("Photo taken") - system("/home/pi/PiSSTVpp/pisstvpp -r 48000 -p s2 /home/pi/camera_out.jpg") + system("/home/pi/PiSSTVpp/pisstvpp -r 48000 -p s2 /home/pi/CubeSatSim/camera_out.jpg") print ("Sending SSTV image") GPIO.output(txLed, txLedOn); - system("cat /home/pi/camera_out.jpg.wav | csdr convert_i16_f | csdr gain_ff 14000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") # > /dev/null 2>&1") + system("cat /home/pi/CubeSatSim/camera_out.jpg.wav | csdr convert_i16_f | csdr gain_ff 14000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f 434.9e3") # > /dev/null 2>&1") GPIO.output(txLed, txLedOff) time.sleep(1) else: From 6b8d8cba5096469db5941836e8fa2aa6b5e12eab Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 6 Jun 2021 10:23:53 -0400 Subject: [PATCH 395/415] echo .mode bug --- install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install b/install index 0a900206..58a3d163 100755 --- a/install +++ b/install @@ -33,7 +33,7 @@ if [ -f "$FILE" ]; then echo "$FILE exists." else echo "creating $FILE" - echo "ARG1=f" >> .mode + echo "ARG1=f" > .mode fi From f845a724ba5968f7bc327938abcd74ab0fe03316 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 6 Jun 2021 10:51:36 -0400 Subject: [PATCH 396/415] missing git clone CubeSatSim --- install | 2 ++ 1 file changed, 2 insertions(+) diff --git a/install b/install index 58a3d163..38d5e600 100755 --- a/install +++ b/install @@ -22,6 +22,8 @@ sudo pip3 install --upgrade setuptools sudo pip3 install adafruit-blinka RPI.GPIO adafruit-extended-bus adafruit-circuitpython-ina219 +git clone https://github.com/alanbjohnston/rpitx.git + cd ~/CubeSatSim git pull From 53cd1360b3da67b58afab5130b137b98943574ca Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 6 Jun 2021 11:09:57 -0400 Subject: [PATCH 397/415] copy of update script for backwards compatibility --- update.sh | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 update.sh diff --git a/update.sh b/update.sh new file mode 100644 index 00000000..70ebfcea --- /dev/null +++ b/update.sh @@ -0,0 +1,67 @@ +#!/bin/bash + +echo -e "\nupdate script for CubeSatSim\n" + +if [ "$1" = "u" ]; then + + sudo apt-get update && sudo apt-get dist-upgrade -y + + sudo apt-get install -y wiringpi git libasound2-dev i2c-tools cpulimit + +fi + +cd /home/pi/CubeSatSim + +git pull > .updated + +make debug + +FLAG=0 + +if [[ $(diff systemd/cubesatsim.service /etc/systemd/system/cubesatsim.service) ]]; then + echo "changed cubesatsim.service" + sudo cp /home/pi/CubeSatSim/systemd/cubesatsim.service /etc/systemd/system/cubesatsim.service + FLAG=1 +else + echo "no changes to cubesatsim.service" +fi + +if [[ $(diff systemd/rpitx.service /etc/systemd/system/rpitx.service) ]]; then + echo "changed rpitx.service" + sudo cp /home/pi/CubeSatSim/systemd/rpitx.service /etc/systemd/system/rpitx.service + FLAG=1 +else + echo "no changes to rpitx.service" +fi + +FILE=/home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg +if [ ! -f "$FILE" ]; then + echo "Copying SSTV image 1" + cp /home/pi/CubeSatSim/sstv/sstv_image_1_320_x_256.jpg /home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg +fi + +FILE=/home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg +if [ ! -f "$FILE" ]; then + echo "Copying SSTV image 2" + cp /home/pi/CubeSatSim/sstv/sstv_image_2_320_x_256.jpg /home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg +fi + +grep 'update' /home/pi/CubeSatSim/.updated +if [[ $(grep 'update' /home/pi/CubeSatSim/.updated) ]]; then + echo "update script updated" + /home/pi/CubeSatSim/update +fi + +if [ $FLAG -eq 1 ]; then + echo "systemctl daemon-reload and restart" + sudo systemctl daemon-reload + sudo systemctl restart cubesatsim +else + grep 'changed' /home/pi/CubeSatSim/.updated + if [[ $(grep 'changed' /home/pi/CubeSatSim/.updated) ]]; then + echo "systemctl restart cubesatsim" + sudo systemctl restart cubesatsim + else + echo "nothing to do" + fi +fi From baa566834c42c41d5d4cc002e6c0a261ff257d09 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 6 Jun 2021 15:40:30 -0400 Subject: [PATCH 398/415] added additions for camera installs for image --- update.sh | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/update.sh b/update.sh index 70ebfcea..30ef767a 100644 --- a/update.sh +++ b/update.sh @@ -65,3 +65,49 @@ else echo "nothing to do" fi fi + +if [ ! -d "/home/pi/PiSSTVpp" ]; then + + sudo apt-get install -y python-picamera python3-picamera build-essential libgd-dev libmagic-dev + + + git clone https://github.com/alanbjohnston/PiSSTVpp.git + + cd PiSSTVpp + + make pisstvpp + + cd + + + sudo raspi-config nonint do_camera 0 + + + FILE=/home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg + if [ ! -f "$FILE" ]; then + echo "Copying SSTV image 1" + cp /home/pi/CubeSatSim/sstv/sstv_image_1_320_x_256.jpg /home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg + fi + + FILE=/home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg + if [ ! -f "$FILE" ]; then + echo "Copying SSTV image 2" + cp /home/pi/CubeSatSim/sstv/sstv_image_2_320_x_256.jpg /home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg + fi + + echo "You need toreboot to complete the installation. Reboot now (y/n)?\n" + + $read -r ANS + + if [ "$ANS" = "y" ]; then + + sudo reboot now + + else + + echo "\nThe CubeSatSim software may not work correctly until you reboot." + + fi + + +fi From 670f7c21c9ea826b0439ccd51594e71f781b8b18 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 6 Jun 2021 15:46:52 -0400 Subject: [PATCH 399/415] added updates for image for camera --- update | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/update b/update index 725e6da7..30ef767a 100755 --- a/update +++ b/update @@ -66,3 +66,48 @@ else fi fi +if [ ! -d "/home/pi/PiSSTVpp" ]; then + + sudo apt-get install -y python-picamera python3-picamera build-essential libgd-dev libmagic-dev + + + git clone https://github.com/alanbjohnston/PiSSTVpp.git + + cd PiSSTVpp + + make pisstvpp + + cd + + + sudo raspi-config nonint do_camera 0 + + + FILE=/home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg + if [ ! -f "$FILE" ]; then + echo "Copying SSTV image 1" + cp /home/pi/CubeSatSim/sstv/sstv_image_1_320_x_256.jpg /home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg + fi + + FILE=/home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg + if [ ! -f "$FILE" ]; then + echo "Copying SSTV image 2" + cp /home/pi/CubeSatSim/sstv/sstv_image_2_320_x_256.jpg /home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg + fi + + echo "You need toreboot to complete the installation. Reboot now (y/n)?\n" + + $read -r ANS + + if [ "$ANS" = "y" ]; then + + sudo reboot now + + else + + echo "\nThe CubeSatSim software may not work correctly until you reboot." + + fi + + +fi From b4ecc2e526014d5f3c168531f2c26c9d7f26f562 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 6 Jun 2021 15:47:22 -0400 Subject: [PATCH 400/415] Delete update.sh --- update.sh | 113 ------------------------------------------------------ 1 file changed, 113 deletions(-) delete mode 100644 update.sh diff --git a/update.sh b/update.sh deleted file mode 100644 index 30ef767a..00000000 --- a/update.sh +++ /dev/null @@ -1,113 +0,0 @@ -#!/bin/bash - -echo -e "\nupdate script for CubeSatSim\n" - -if [ "$1" = "u" ]; then - - sudo apt-get update && sudo apt-get dist-upgrade -y - - sudo apt-get install -y wiringpi git libasound2-dev i2c-tools cpulimit - -fi - -cd /home/pi/CubeSatSim - -git pull > .updated - -make debug - -FLAG=0 - -if [[ $(diff systemd/cubesatsim.service /etc/systemd/system/cubesatsim.service) ]]; then - echo "changed cubesatsim.service" - sudo cp /home/pi/CubeSatSim/systemd/cubesatsim.service /etc/systemd/system/cubesatsim.service - FLAG=1 -else - echo "no changes to cubesatsim.service" -fi - -if [[ $(diff systemd/rpitx.service /etc/systemd/system/rpitx.service) ]]; then - echo "changed rpitx.service" - sudo cp /home/pi/CubeSatSim/systemd/rpitx.service /etc/systemd/system/rpitx.service - FLAG=1 -else - echo "no changes to rpitx.service" -fi - -FILE=/home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg -if [ ! -f "$FILE" ]; then - echo "Copying SSTV image 1" - cp /home/pi/CubeSatSim/sstv/sstv_image_1_320_x_256.jpg /home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg -fi - -FILE=/home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg -if [ ! -f "$FILE" ]; then - echo "Copying SSTV image 2" - cp /home/pi/CubeSatSim/sstv/sstv_image_2_320_x_256.jpg /home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg -fi - -grep 'update' /home/pi/CubeSatSim/.updated -if [[ $(grep 'update' /home/pi/CubeSatSim/.updated) ]]; then - echo "update script updated" - /home/pi/CubeSatSim/update -fi - -if [ $FLAG -eq 1 ]; then - echo "systemctl daemon-reload and restart" - sudo systemctl daemon-reload - sudo systemctl restart cubesatsim -else - grep 'changed' /home/pi/CubeSatSim/.updated - if [[ $(grep 'changed' /home/pi/CubeSatSim/.updated) ]]; then - echo "systemctl restart cubesatsim" - sudo systemctl restart cubesatsim - else - echo "nothing to do" - fi -fi - -if [ ! -d "/home/pi/PiSSTVpp" ]; then - - sudo apt-get install -y python-picamera python3-picamera build-essential libgd-dev libmagic-dev - - - git clone https://github.com/alanbjohnston/PiSSTVpp.git - - cd PiSSTVpp - - make pisstvpp - - cd - - - sudo raspi-config nonint do_camera 0 - - - FILE=/home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg - if [ ! -f "$FILE" ]; then - echo "Copying SSTV image 1" - cp /home/pi/CubeSatSim/sstv/sstv_image_1_320_x_256.jpg /home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg - fi - - FILE=/home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg - if [ ! -f "$FILE" ]; then - echo "Copying SSTV image 2" - cp /home/pi/CubeSatSim/sstv/sstv_image_2_320_x_256.jpg /home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg - fi - - echo "You need toreboot to complete the installation. Reboot now (y/n)?\n" - - $read -r ANS - - if [ "$ANS" = "y" ]; then - - sudo reboot now - - else - - echo "\nThe CubeSatSim software may not work correctly until you reboot." - - fi - - -fi From 6275b49b37c761af0c17937672f168bc684fc136 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 6 Jun 2021 15:54:17 -0400 Subject: [PATCH 401/415] fixed read for reboot --- update | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/update b/update index 30ef767a..0d91aa66 100755 --- a/update +++ b/update @@ -95,9 +95,9 @@ if [ ! -d "/home/pi/PiSSTVpp" ]; then cp /home/pi/CubeSatSim/sstv/sstv_image_2_320_x_256.jpg /home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg fi - echo "You need toreboot to complete the installation. Reboot now (y/n)?\n" + echo "You need to reboot to complete the installation. Reboot now (y/n)?" - $read -r ANS + read -r ANS if [ "$ANS" = "y" ]; then @@ -105,7 +105,7 @@ if [ ! -d "/home/pi/PiSSTVpp" ]; then else - echo "\nThe CubeSatSim software may not work correctly until you reboot." + echo "The CubeSatSim software may not work correctly until you reboot." fi From e0562f052903c7f46a64f9f6e7ecf10629a6c6f6 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 6 Jun 2021 15:55:11 -0400 Subject: [PATCH 402/415] fixed read for reboot --- install | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install b/install index 38d5e600..6e6f8ab5 100755 --- a/install +++ b/install @@ -154,9 +154,9 @@ CubeSatSim/config -c -n CubeSatSim/config -l -n -echo "Would you like to reboot to complete the installation (y/n)?\n" +echo "Would you like to reboot to complete the installation (y/n)?" -$read -r ANS +read -r ANS if [ "$ANS" = "y" ]; then @@ -164,6 +164,6 @@ if [ "$ANS" = "y" ]; then else - echo "\nThe CubeSatSim software will start next time you reboot" + echo "The CubeSatSim software will start next time you reboot" fi From 65fc3013c80d90f478f356ba1f080492cdf57657 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 6 Jun 2021 16:07:39 -0400 Subject: [PATCH 403/415] Update update --- update | 2 ++ 1 file changed, 2 insertions(+) diff --git a/update b/update index 0d91aa66..fc16b10c 100755 --- a/update +++ b/update @@ -71,6 +71,8 @@ if [ ! -d "/home/pi/PiSSTVpp" ]; then sudo apt-get install -y python-picamera python3-picamera build-essential libgd-dev libmagic-dev + cd + git clone https://github.com/alanbjohnston/PiSSTVpp.git cd PiSSTVpp From 44561a7e23e4a03c288a6405b0dca6327c3acad5 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 6 Jun 2021 16:19:56 -0400 Subject: [PATCH 404/415] creates symbolic links with .sh --- install.sh | 1 + update.sh | 1 + 2 files changed, 2 insertions(+) create mode 120000 install.sh create mode 120000 update.sh diff --git a/install.sh b/install.sh new file mode 120000 index 00000000..32ab0160 --- /dev/null +++ b/install.sh @@ -0,0 +1 @@ +/home/pi/CubeSatSim/install \ No newline at end of file diff --git a/update.sh b/update.sh new file mode 120000 index 00000000..0b0110f6 --- /dev/null +++ b/update.sh @@ -0,0 +1 @@ +/home/pi/CubeSatSim/update \ No newline at end of file From 4de327cae22c8f4ca4563447102e4ca7b84193d0 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 6 Jun 2021 17:30:37 -0400 Subject: [PATCH 405/415] added all packages for u option --- update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update b/update index fc16b10c..11225b24 100755 --- a/update +++ b/update @@ -6,7 +6,7 @@ if [ "$1" = "u" ]; then sudo apt-get update && sudo apt-get dist-upgrade -y - sudo apt-get install -y wiringpi git libasound2-dev i2c-tools cpulimit + sudo apt-get install -y wiringpi git libasound2-dev i2c-tools cpulimit python-picamera python3-picamera build-essential libgd-dev libmagic-dev fi From 2a793c2fa1fac97a78982f465eb3904f95a86607 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 6 Jun 2021 17:38:38 -0400 Subject: [PATCH 406/415] removed duplicate git clone CubeSatSim --- install | 1 - 1 file changed, 1 deletion(-) diff --git a/install b/install index 6e6f8ab5..554de89e 100755 --- a/install +++ b/install @@ -22,7 +22,6 @@ sudo pip3 install --upgrade setuptools sudo pip3 install adafruit-blinka RPI.GPIO adafruit-extended-bus adafruit-circuitpython-ina219 -git clone https://github.com/alanbjohnston/rpitx.git cd ~/CubeSatSim From f3ceddf4ea8cf27cd7bb89be682d10c9ffa94513 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 7 Jun 2021 07:29:52 -0400 Subject: [PATCH 407/415] added motd edit removing .sh --- update | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/update b/update index 11225b24..5d5bbf65 100755 --- a/update +++ b/update @@ -10,6 +10,9 @@ if [ "$1" = "u" ]; then fi +sudo sed -i 's/CubeSatSim/config.sh/CubeSatSim/config/g' /etc/motd + + cd /home/pi/CubeSatSim git pull > .updated @@ -68,6 +71,8 @@ fi if [ ! -d "/home/pi/PiSSTVpp" ]; then + sudo apt-get update && sudo apt-get dist-upgrade -y + sudo apt-get install -y python-picamera python3-picamera build-essential libgd-dev libmagic-dev From ab462cfec8420f45ae9ab0c2dcd6ac5bbced8d75 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 7 Jun 2021 07:31:07 -0400 Subject: [PATCH 408/415] fixed motd edit --- update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update b/update index 5d5bbf65..27b17ddb 100755 --- a/update +++ b/update @@ -10,7 +10,7 @@ if [ "$1" = "u" ]; then fi -sudo sed -i 's/CubeSatSim/config.sh/CubeSatSim/config/g' /etc/motd +sudo sed -i 's/config.sh/config/g' /etc/motd cd /home/pi/CubeSatSim From 15f743b3d00ef8e3315507b2d60dbc58d1af1909 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 7 Jun 2021 07:34:04 -0400 Subject: [PATCH 409/415] added line break in motd --- update | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/update b/update index 27b17ddb..de41beca 100755 --- a/update +++ b/update @@ -10,7 +10,10 @@ if [ "$1" = "u" ]; then fi -sudo sed -i 's/config.sh/config/g' /etc/motd +sudo sed -i 's/config.sh/config /g' /etc/motd + +sudo sed -i 's/installed and/installed\nand/g' /etc/motd + cd /home/pi/CubeSatSim @@ -51,7 +54,7 @@ fi grep 'update' /home/pi/CubeSatSim/.updated if [[ $(grep 'update' /home/pi/CubeSatSim/.updated) ]]; then - echo "update script updated" + echo "update script updated, running again" /home/pi/CubeSatSim/update fi From 3b3eec4694069b99276bd2368b133798b151e4ee Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 7 Jun 2021 07:36:28 -0400 Subject: [PATCH 410/415] more motd updates --- update | 2 ++ 1 file changed, 2 insertions(+) diff --git a/update b/update index de41beca..25d142e7 100755 --- a/update +++ b/update @@ -14,7 +14,9 @@ sudo sed -i 's/config.sh/config /g' /etc/motd sudo sed -i 's/installed and/installed\nand/g' /etc/motd +sudo sed -i 's/more information/more\ninformation/g' /etc/motd +sudo sed -i 's/update to/update\nto/g' /etc/motd cd /home/pi/CubeSatSim From 09d04d5dc6acd8c0d33614ba073f12023902bb01 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 7 Jun 2021 07:40:35 -0400 Subject: [PATCH 411/415] fixed update motd change --- update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update b/update index 25d142e7..4e9e29b9 100755 --- a/update +++ b/update @@ -10,7 +10,7 @@ if [ "$1" = "u" ]; then fi -sudo sed -i 's/config.sh/config /g' /etc/motd +sudo sed -i 's/update.sh/update /g' /etc/motd sudo sed -i 's/installed and/installed\nand/g' /etc/motd From 99c9a09b0e583036de18dbeba64106c62b3084a4 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 7 Jun 2021 07:47:29 -0400 Subject: [PATCH 412/415] original 1.11a file --- .../FoxTelem_11a/CubeSat_Simulator_PSK.MASTER | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 spacecraft/FoxTelem_11a/CubeSat_Simulator_PSK.MASTER diff --git a/spacecraft/FoxTelem_11a/CubeSat_Simulator_PSK.MASTER b/spacecraft/FoxTelem_11a/CubeSat_Simulator_PSK.MASTER new file mode 100644 index 00000000..50a8b142 --- /dev/null +++ b/spacecraft/FoxTelem_11a/CubeSat_Simulator_PSK.MASTER @@ -0,0 +1,72 @@ +#Fox 1 Telemetry Decoder Properties +#Thu Apr 11 13:23:23 EST 2020 +user_mode=4 +foxId=99 +IHU_SN=7 +catalogNumber=0 +model=0 +mpptResistanceError=6.58 +mpptSensorOffThreshold=1600 +name=CubeSatSim +displayName=CubeSatSim-BPSK +BATTERY_CURRENT_ZERO=-1.834 +hasImprovedCommandReceiver=true +EXP1=0 +EXP2=0 +EXP3=0 +EXP4=0 +description=CubeSatSim, the AMSAT CubeSat Simulator, is a functional satellite model that generates real telemetry from solar panels, batteries, and temperature sensors. Use this for BPSK telemetry. For more information see http://cubesatsim.org +numberOfFrameLayouts=5 +frameLayout0.filename=FOX1E_Type0_ALL_WOD.frame +frameLayout0.name=All WOD +frameLayout1.filename=CubeSatSim_PSK_Type1_HEALTH.frame +frameLayout1.name=Health +frameLayout2.filename=CubeSatSim_PSK_Type2_MINMAX.frame +frameLayout2.name=MinMax +frameLayout3.filename=FOX1E_Type3_REALTIME_BEACON.frame +frameLayout3.name=Realtime Beacon +frameLayout4.filename=FOX1E_Type4_WOD_BEACON.frame +frameLayout4.name=WOD Beacon +numberOfLayouts=9 +layout0.filename=FOX1A_debug.csv +layout0.name=DEBUG +layout1.filename=CubeSatSim_PSK_maxtelemetry.csv +layout1.name=maxtelemetry +layout2.filename=CubeSatSim_PSK_rttelemetry.csv +layout2.name=rttelemetry +layout3.filename=CubeSatSim_PSK_mintelemetry.csv +layout3.name=mintelemetry +layout4.filename=FOX1E_radtelemetry.csv +layout4.name=radtelemetry +layout5.filename=FOX1E_radtelemetry2.csv +layout5.name=radtelemetry2 +layout5.parentLayout=radtelemetry +layout6.filename=CubeSatSim_PSK_wodtelemetry.csv +layout6.name=wodtelemetry +layout7.filename=FOX1E_wodradtelemetry.csv +layout7.name=wodradtelemetry +layout8.filename=FOX1E_wodradtelemetry2.csv +layout8.name=wodradtelemetry2 +layout8.parentLayout=wodradtelemetry +numberOfLookupTables=3 +lookupTable0.filename=FOX1A_rssiFM.tab +lookupTable0=RSSI +lookupTable1.filename=FOX1E_ihuVBattSNx.tab +lookupTable1=IHU_VBATT +lookupTable2.filename=FOX1A_ihutempSN7.tab +lookupTable2=IHU_TEMP +maxFreqBoundkHz=434950 +measurementsFileName=measurements.csv +memsRestValueX=2129 +memsRestValueY=2131 +memsRestValueZ=2103 +minFreqBoundkHz=434850 +passMeasurementsFileName=passmeasurements.csv +telemetryDownlinkFreqkHz=434900 +track=false +useIHUVBatt=false +numberOfSources=1 +source0.name=amsat.cubesat_simulator.ihu.bpsk +user_format=0 +useConversionCoeffs=true +conversionCurvesFileName=CubeSatSim_conversion_curves.csv From 5f8ea3fabe9e982c54fc3b49406d56e56c75bc96 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 7 Jun 2021 17:19:18 -0400 Subject: [PATCH 413/415] Serial1 speed increased to 115200 and Sensor 3 removed --- arduino/Payload_BME280_MPU6050_XS.ino | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/arduino/Payload_BME280_MPU6050_XS.ino b/arduino/Payload_BME280_MPU6050_XS.ino index 9173fa97..cb419183 100644 --- a/arduino/Payload_BME280_MPU6050_XS.ino +++ b/arduino/Payload_BME280_MPU6050_XS.ino @@ -15,8 +15,7 @@ int RXLED = 17; // The RX LED has a defined Arduino pin int greenLED = 9; int blueLED = 8; int Sensor1 = 0; -int Sensor2 = 0; -float Sensor3 = 0; +float Sensor2 = 0; void eeprom_word_write(int addr, int val); short eeprom_word_read(int addr); int first_time = true; @@ -25,7 +24,7 @@ void setup() { Serial.begin(9600); // Serial Monitor for testing - Serial1.begin(9600); // Pi UART + Serial1.begin(115200); // Pi UART faster speed Serial.println("Starting!"); @@ -133,9 +132,7 @@ void loop() { Serial.print(" XS "); Serial.print(Sensor1); Serial.print(" "); - Serial.print(Sensor2); - Serial.print(" "); - Serial.println(Sensor3); + Serial.println(Sensor2); float rotation = sqrt(mpu6050.getGyroX()*mpu6050.getGyroX() + mpu6050.getGyroY()*mpu6050.getGyroY() + mpu6050.getGyroZ()*mpu6050.getGyroZ()); float acceleration = sqrt(mpu6050.getAccX()*mpu6050.getAccX() + mpu6050.getAccY()*mpu6050.getAccY() + mpu6050.getAccZ()*mpu6050.getAccZ()); @@ -201,10 +198,8 @@ void loop() { Serial1.print(" XS "); Serial1.print(Sensor1); Serial1.print(" "); - Serial1.print(Sensor2); - Serial1.print(" "); - Serial1.println(Sensor3); - + Serial1.println(Sensor2); + float rotation = sqrt(mpu6050.getGyroX()*mpu6050.getGyroX() + mpu6050.getGyroY()*mpu6050.getGyroY() + mpu6050.getGyroZ()*mpu6050.getGyroZ()); float acceleration = sqrt(mpu6050.getAccX()*mpu6050.getAccX() + mpu6050.getAccY()*mpu6050.getAccY() + mpu6050.getAccZ()*mpu6050.getAccZ()); // Serial.print(rotation); From 0cb3b3ca4d2065642a5e7124858ee65b10f3e555 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 8 Jun 2021 20:56:25 -0400 Subject: [PATCH 414/415] Delete update.sh --- update.sh | 1 - 1 file changed, 1 deletion(-) delete mode 120000 update.sh diff --git a/update.sh b/update.sh deleted file mode 120000 index 0b0110f6..00000000 --- a/update.sh +++ /dev/null @@ -1 +0,0 @@ -/home/pi/CubeSatSim/update \ No newline at end of file From e47c771c7388497214516728cab17b6752f5a3ac Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 8 Jun 2021 20:56:35 -0400 Subject: [PATCH 415/415] Delete install.sh --- install.sh | 1 - 1 file changed, 1 deletion(-) delete mode 120000 install.sh diff --git a/install.sh b/install.sh deleted file mode 120000 index 32ab0160..00000000 --- a/install.sh +++ /dev/null @@ -1 +0,0 @@ -/home/pi/CubeSatSim/install \ No newline at end of file