From 999d14aecd96948287c25e942dae294e45710bfe Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 31 Aug 2024 09:49:35 -0400 Subject: [PATCH 01/18] Update CubeSatSim_rttelemetry.csv c2cstatus 2 bit --- spacecraft/FoxTelem_1.13e/CubeSatSim_rttelemetry.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spacecraft/FoxTelem_1.13e/CubeSatSim_rttelemetry.csv b/spacecraft/FoxTelem_1.13e/CubeSatSim_rttelemetry.csv index 7b66db49..14389ff1 100644 --- a/spacecraft/FoxTelem_1.13e/CubeSatSim_rttelemetry.csv +++ b/spacecraft/FoxTelem_1.13e/CubeSatSim_rttelemetry.csv @@ -44,5 +44,5 @@ 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,C2CStatus,1,-,COMMAND_STATUS,Computer Software,3,5,0,Command Control, Command & Control Status -46,RT,Pad,57,-,0,NONE,0,0,0,NONE,NONE +45,RT,C2CStatus,2,-,COMMAND_STATUS,Computer Software,3,5,0,Command Control, Command & Control Status +46,RT,Pad,56,-,0,NONE,0,0,0,NONE,NONE From 3679f039b4424a31ac7ae80e154908952c704923 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 31 Aug 2024 09:50:01 -0400 Subject: [PATCH 02/18] Update CubeSatSim_maxtelemetry.csv c2cstatus 2 bit --- spacecraft/FoxTelem_1.13e/CubeSatSim_maxtelemetry.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spacecraft/FoxTelem_1.13e/CubeSatSim_maxtelemetry.csv b/spacecraft/FoxTelem_1.13e/CubeSatSim_maxtelemetry.csv index 10e0e4d6..d888016a 100644 --- a/spacecraft/FoxTelem_1.13e/CubeSatSim_maxtelemetry.csv +++ b/spacecraft/FoxTelem_1.13e/CubeSatSim_maxtelemetry.csv @@ -44,5 +44,5 @@ 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,C2CStatus,1,-,STATUS_ON_OFF,NONE,3,5,0,Command Control, Command & Control Status -46,MAX,Pad,57,-,0,NONE,0,0,0,NONE,NONE +45,MAX,C2CStatus,2,-,STATUS_ON_OFF,NONE,3,5,0,Command Control, Command & Control Status +46,MAX,Pad,56,-,0,NONE,0,0,0,NONE,NONE From e9a1a2e7fe8bbfcb402544eab28e5c079c9ecb62 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 31 Aug 2024 09:50:32 -0400 Subject: [PATCH 03/18] Update CubeSatSim_mintelemetry.csv c2cstatus 2 bit --- spacecraft/FoxTelem_1.13e/CubeSatSim_mintelemetry.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spacecraft/FoxTelem_1.13e/CubeSatSim_mintelemetry.csv b/spacecraft/FoxTelem_1.13e/CubeSatSim_mintelemetry.csv index 3941d7a8..bc0eb974 100644 --- a/spacecraft/FoxTelem_1.13e/CubeSatSim_mintelemetry.csv +++ b/spacecraft/FoxTelem_1.13e/CubeSatSim_mintelemetry.csv @@ -44,5 +44,5 @@ 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,C2CStatus,1,-,STATUS_ON_OFF,NONE,3,5,0,Command Control, Command & Control Status -46,MIN,Pad,57,-,0,NONE,0,0,0,NONE,NONE +45,MIN,C2CStatus,2,-,STATUS_ON_OFF,NONE,3,5,0,Command Control, Command & Control Status +46,MIN,Pad,56,-,0,NONE,0,0,0,NONE,NONE From ea5f0a24b12c3e4638ba1aee1eecf8d3850adbbb Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 31 Aug 2024 10:01:57 -0400 Subject: [PATCH 04/18] Update main.c move startup message --- main.c | 106 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/main.c b/main.c index bf7c185c..f3b92f7f 100644 --- a/main.c +++ b/main.c @@ -25,59 +25,6 @@ int main(int argc, char * argv[]) { - FILE * command_file = fopen("/home/pi/CubeSatSim/command_control", "r"); - if (command_file == NULL) { - fprintf(stderr,"Command and control is OFF\n"); - c2cStatus = 0; - } else { - command_file = fopen("/home/pi/CubeSatSim/command_control_direwolf", "r"); - if (command_file == NULL) { - fprintf(stderr,"Command and control Carrier (squelch) is ON\n"); - c2cStatus = 1; - } else - fprintf(stderr,"Command and control DTMF or APRS is ON\n"); - c2cStatus = 2; - } - char resbuffer[1000]; -// const char testStr[] = "cat /proc/cpuinfo | grep 'Revision' | awk '{print $3}' | sed 's/^1000//' | grep '9000'"; - const char testStr[] = "cat /proc/cpuinfo | grep 'Revision' | awk '{print $3}' | sed 's/^1000//'"; - FILE *file_test = sopen(testStr); // see if Pi Zero 2 - fgets(resbuffer, 1000, file_test); - fprintf(stderr, "Pi test result: %s\n", resbuffer); - fclose(file_test); - - FILE * uptime_file = fopen("/proc/uptime", "r"); - fscanf(uptime_file, "%f", & uptime_sec); - printf("Uptime sec: %f \n", uptime_sec); - fclose(uptime_file); - - fprintf(stderr, " %x ", resbuffer[0]); - fprintf(stderr, " %x \n", resbuffer[1]); - if ((resbuffer[0] != '9') || (resbuffer[1] != '0') || (resbuffer[2] != '0') || (resbuffer[3] != '0')) - { - // voltageThreshold = 3.7; - fprintf(stderr, "Pi Zero not detected (could be Pi Zero 2)\n"); - pi_zero_2_offset = 500; - if (uptime_sec < 30.0) { - FILE * rpitx_stop = popen("sudo systemctl start rpitx", "r"); - pclose(rpitx_stop); - fprintf(stderr, "Sleep 5 sec"); - sleep(5); // try sleep at start to help boot - } - } - else { - fprintf(stderr,"Pi Zero detected\n"); - if ((c2cStatus == 0) || (c2cStatus == 1)) { - pi_zero_2_offset = 500; - } - if (uptime_sec < 30.0) { - FILE * rpitx_stop = popen("sudo systemctl start rpitx", "r"); - pclose(rpitx_stop); - fprintf(stderr,"Sleep 10 sec"); - sleep(10); - } - } - printf("\n\nCubeSatSim v1.3.2 starting...\n\n"); wiringPiSetup(); @@ -131,6 +78,59 @@ int main(int argc, char * argv[]) { if (strcmp(hab_yes, "yes") == 0) { hab_mode = TRUE; fprintf(stderr, "HAB mode is ON\n"); + } + + FILE * command_file = fopen("/home/pi/CubeSatSim/command_control", "r"); + if (command_file == NULL) { + fprintf(stderr,"Command and control is OFF\n"); + c2cStatus = 0; + } else { + command_file = fopen("/home/pi/CubeSatSim/command_control_direwolf", "r"); + if (command_file == NULL) { + fprintf(stderr,"Command and control Carrier (squelch) is ON\n"); + c2cStatus = 1; + } else + fprintf(stderr,"Command and control DTMF or APRS is ON\n"); + c2cStatus = 2; + } + char resbuffer[1000]; +// const char testStr[] = "cat /proc/cpuinfo | grep 'Revision' | awk '{print $3}' | sed 's/^1000//' | grep '9000'"; + const char testStr[] = "cat /proc/cpuinfo | grep 'Revision' | awk '{print $3}' | sed 's/^1000//'"; + FILE *file_test = sopen(testStr); // see if Pi Zero 2 + fgets(resbuffer, 1000, file_test); + fprintf(stderr, "Pi test result: %s\n", resbuffer); + fclose(file_test); + + FILE * uptime_file = fopen("/proc/uptime", "r"); + fscanf(uptime_file, "%f", & uptime_sec); + printf("Uptime sec: %f \n", uptime_sec); + fclose(uptime_file); + + fprintf(stderr, " %x ", resbuffer[0]); + fprintf(stderr, " %x \n", resbuffer[1]); + if ((resbuffer[0] != '9') || (resbuffer[1] != '0') || (resbuffer[2] != '0') || (resbuffer[3] != '0')) + { + // voltageThreshold = 3.7; + fprintf(stderr, "Pi Zero not detected (could be Pi Zero 2)\n"); + pi_zero_2_offset = 500; + if (uptime_sec < 30.0) { + FILE * rpitx_stop = popen("sudo systemctl start rpitx", "r"); + pclose(rpitx_stop); + fprintf(stderr, "Sleep 5 sec"); + sleep(5); // try sleep at start to help boot + } + } + else { + fprintf(stderr,"Pi Zero detected\n"); + if ((c2cStatus == 0) || (c2cStatus == 1)) { + pi_zero_2_offset = 500; + } + if (uptime_sec < 30.0) { + FILE * rpitx_stop = popen("sudo systemctl start rpitx", "r"); + pclose(rpitx_stop); + fprintf(stderr,"Sleep 10 sec"); + sleep(10); + } } // FILE * rpitx_stop = popen("sudo systemctl stop rpitx", "r"); From abc5b5498b2c3c2ec3ad1aa669e95305c7fa454c Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 31 Aug 2024 10:11:41 -0400 Subject: [PATCH 05/18] Update main.c print c2cStatus --- main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/main.c b/main.c index f3b92f7f..38f80b7b 100644 --- a/main.c +++ b/main.c @@ -1565,6 +1565,7 @@ void get_tlm_fox() { (i2c_bus0 == OFF) * 16 + (i2c_bus1 == OFF) * 32 + (i2c_bus3 == OFF) * 64 + (camera == OFF) * 128 + groundCommandCount * 256; encodeA(b, 51 + head_offset, status); + fprintf("c2cStatus: %d \n", c2cStatus); encodeB(b, 52 + head_offset, rxAntennaDeployed + txAntennaDeployed * 2 + c2cStatus * 4); if (txAntennaDeployed == 0) { From 6992b96fab9449e7bcdb02b9bf74f0c805048fee Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 31 Aug 2024 10:14:54 -0400 Subject: [PATCH 06/18] Update main.c fix printf --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index 38f80b7b..a57384ea 100644 --- a/main.c +++ b/main.c @@ -1565,7 +1565,7 @@ void get_tlm_fox() { (i2c_bus0 == OFF) * 16 + (i2c_bus1 == OFF) * 32 + (i2c_bus3 == OFF) * 64 + (camera == OFF) * 128 + groundCommandCount * 256; encodeA(b, 51 + head_offset, status); - fprintf("c2cStatus: %d \n", c2cStatus); + printf("c2cStatus: %d \n", c2cStatus); encodeB(b, 52 + head_offset, rxAntennaDeployed + txAntennaDeployed * 2 + c2cStatus * 4); if (txAntennaDeployed == 0) { From bb3a9da6d3f48bd81ea22ed69312796e9b8d5b32 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 31 Aug 2024 10:21:22 -0400 Subject: [PATCH 07/18] Update main.c fix c2cstatus print --- main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index a57384ea..d031f500 100644 --- a/main.c +++ b/main.c @@ -89,10 +89,12 @@ int main(int argc, char * argv[]) { if (command_file == NULL) { fprintf(stderr,"Command and control Carrier (squelch) is ON\n"); c2cStatus = 1; - } else + } else { fprintf(stderr,"Command and control DTMF or APRS is ON\n"); c2cStatus = 2; + } } + printf("c2cStatus: %d", c2cStatus); char resbuffer[1000]; // const char testStr[] = "cat /proc/cpuinfo | grep 'Revision' | awk '{print $3}' | sed 's/^1000//' | grep '9000'"; const char testStr[] = "cat /proc/cpuinfo | grep 'Revision' | awk '{print $3}' | sed 's/^1000//'"; From 4aa8febd55aabdbd693365681a8c6da1d5203e3d Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 31 Aug 2024 10:26:40 -0400 Subject: [PATCH 08/18] Update main.c check c2cStatus each time --- main.c | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/main.c b/main.c index d031f500..3ecef964 100644 --- a/main.c +++ b/main.c @@ -81,7 +81,7 @@ int main(int argc, char * argv[]) { } FILE * command_file = fopen("/home/pi/CubeSatSim/command_control", "r"); - if (command_file == NULL) { + if (command_file == NULL) { fprintf(stderr,"Command and control is OFF\n"); c2cStatus = 0; } else { @@ -94,7 +94,8 @@ int main(int argc, char * argv[]) { c2cStatus = 2; } } - printf("c2cStatus: %d", c2cStatus); + printf("c2cStatus: %d", c2cStatus); + char resbuffer[1000]; // const char testStr[] = "cat /proc/cpuinfo | grep 'Revision' | awk '{print $3}' | sed 's/^1000//' | grep '9000'"; const char testStr[] = "cat /proc/cpuinfo | grep 'Revision' | awk '{print $3}' | sed 's/^1000//'"; @@ -1567,7 +1568,28 @@ void get_tlm_fox() { (i2c_bus0 == OFF) * 16 + (i2c_bus1 == OFF) * 32 + (i2c_bus3 == OFF) * 64 + (camera == OFF) * 128 + groundCommandCount * 256; encodeA(b, 51 + head_offset, status); - printf("c2cStatus: %d \n", c2cStatus); + + FILE * command_file = fopen("/home/pi/CubeSatSim/command_control", "r"); + if (command_file == NULL) { + if (c2cStatus != 0) { + fprintf(stderr,"Command and control is OFF\n"); + c2cStatus = 0; + } + } else { + command_file = fopen("/home/pi/CubeSatSim/command_control_direwolf", "r"); + if (command_file == NULL) { + if (c2cStatus != 1) { + fprintf(stderr,"Command and control Carrier (squelch) is ON\n"); + c2cStatus = 1; + } + } else { + if (c2cStatus != 2) { + fprintf(stderr,"Command and control DTMF or APRS is ON\n"); + c2cStatus = 2; + } + } + } + printf("c2cStatus: %d", c2cStatus); encodeB(b, 52 + head_offset, rxAntennaDeployed + txAntennaDeployed * 2 + c2cStatus * 4); if (txAntennaDeployed == 0) { From 41bc192c1936963ae5cdbe60d73c9e9a4018897d Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 31 Aug 2024 10:39:42 -0400 Subject: [PATCH 09/18] Update rpitx.py reset serial back to 115200 after programming --- rpitx.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rpitx.py b/rpitx.py index 47b98d35..8c079e7a 100644 --- a/rpitx.py +++ b/rpitx.py @@ -363,7 +363,8 @@ if __name__ == "__main__": # ser.write(b"AT+DMOSETGROUP=0,435.0000,434.9000,0,3,0,0\r\n") ser.write(uhf_string.encode()) sleep(0.1) - ser.close() + ser.close() + ser = serial.Serial("/dev/ttyAMA0", 115200) # reset back to 115200 for cubesatsim code for payload sensor data except: print("Error in serial write") output(pd, 0) From 83667c7e99c3d8ce0fabdeccf495240b39b6c9a0 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 31 Aug 2024 10:42:50 -0400 Subject: [PATCH 10/18] Update CubeSatSim_mintelemetry.csv add COMMAND_STATUS --- spacecraft/FoxTelem_1.13e/CubeSatSim_mintelemetry.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacecraft/FoxTelem_1.13e/CubeSatSim_mintelemetry.csv b/spacecraft/FoxTelem_1.13e/CubeSatSim_mintelemetry.csv index bc0eb974..eefa1e48 100644 --- a/spacecraft/FoxTelem_1.13e/CubeSatSim_mintelemetry.csv +++ b/spacecraft/FoxTelem_1.13e/CubeSatSim_mintelemetry.csv @@ -44,5 +44,5 @@ 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,C2CStatus,2,-,STATUS_ON_OFF,NONE,3,5,0,Command Control, Command & Control Status +45,MIN,C2CStatus,2,-,COMMAND_STATUS,NONE,3,5,0,Command Control, Command & Control Status 46,MIN,Pad,56,-,0,NONE,0,0,0,NONE,NONE From eab0de6a1fdfe558527c4bcc5b1681c1e4714e00 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 31 Aug 2024 10:43:14 -0400 Subject: [PATCH 11/18] Update CubeSatSim_maxtelemetry.csv --- spacecraft/FoxTelem_1.13e/CubeSatSim_maxtelemetry.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacecraft/FoxTelem_1.13e/CubeSatSim_maxtelemetry.csv b/spacecraft/FoxTelem_1.13e/CubeSatSim_maxtelemetry.csv index d888016a..c442b89d 100644 --- a/spacecraft/FoxTelem_1.13e/CubeSatSim_maxtelemetry.csv +++ b/spacecraft/FoxTelem_1.13e/CubeSatSim_maxtelemetry.csv @@ -44,5 +44,5 @@ 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,C2CStatus,2,-,STATUS_ON_OFF,NONE,3,5,0,Command Control, Command & Control Status +45,MAX,C2CStatus,2,-,COMMAND_STATUS,NONE,3,5,0,Command Control, Command & Control Status 46,MAX,Pad,56,-,0,NONE,0,0,0,NONE,NONE From dc3a66849e645d1707470dad363c80aa9f96b9ad Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 31 Aug 2024 10:52:18 -0400 Subject: [PATCH 12/18] Update config restart cubesatsim with rpitx too --- config | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/config b/config index 2f5bdeb7..10d038ed 100755 --- a/config +++ b/config @@ -350,7 +350,7 @@ if [ "$1" = "" ]; then elif [ "$1" = "-i" ]; then - reboot=1 + restart=1 elif [ "$1" = "-a" ]; then @@ -807,8 +807,9 @@ elif [ "$1" = "-d" ]; then # reboot=1 sudo systemctl restart command if [[ $(arecord -l | grep card) ]]; then - echo "restarting cubesatsim software" - sudo systemctl restart cubesatsim + restart=1 +### echo "restarting cubesatsim software" +### sudo systemctl restart cubesatsim fi ## sudo reboot now fi From 13a93188062311ed20756f0ad0ccace7608b9fec Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 31 Aug 2024 10:58:58 -0400 Subject: [PATCH 13/18] Update CubeSatSim_PSK_rttelemetry.csv add COMMAND_STATUS --- spacecraft/FoxTelem_1.13e/CubeSatSim_PSK_rttelemetry.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spacecraft/FoxTelem_1.13e/CubeSatSim_PSK_rttelemetry.csv b/spacecraft/FoxTelem_1.13e/CubeSatSim_PSK_rttelemetry.csv index b751bacd..17ef4ab6 100644 --- a/spacecraft/FoxTelem_1.13e/CubeSatSim_PSK_rttelemetry.csv +++ b/spacecraft/FoxTelem_1.13e/CubeSatSim_PSK_rttelemetry.csv @@ -44,7 +44,7 @@ 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,1,-,16,Radio,1,2,0,TX Antenna,Transmit antenna status -45,realTime,C2CStatus,1,-,STATUS_ON_OFF,Computer Software,3,5,0,Command Control, Command & Control Status +45,realTime,C2CStatus,2,-,COMMAND_STATUS,Computer Software,3,5,0,Command Control, Command & Control Status 46,realTime,ICR3VProt,12,V,43,NONE,7,2,3,3V Prot,ICR 3V Proteted 47,realTime,ICR2dot5V,12,V,43,NONE,7,3,3,2.5V,ICR 2.5V 48,realTime,ICR2dot5VProt,12,V,43,NONE,7,4,3,2.5V Prot,ICR 2.5V Protected @@ -59,4 +59,4 @@ 57,realTime,swCmds,32,-,35,NONE,7,6,0,Diagnostic,ICR Diagnostic information 58,realTime,hwCmdCnt,6,-,1,NONE,7,7,0,HW Command Count,Number of hardware commands since last reset 59,realTime,swCmdCnt,6,-,1,NONE,7,8,0,SW Command Count,Number of software commands since last reset -60,realTime,pad2,28,-,0,NONE,0,0,0,NONE,Filler +60,realTime,pad2,27,-,0,NONE,0,0,0,NONE,Filler From 1bad1a50222f3f565932d2175a407b8d459e0db9 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 31 Aug 2024 10:59:44 -0400 Subject: [PATCH 14/18] Update CubeSatSim_PSK_mintelemetry.csv add COMMAND_STATUS --- spacecraft/FoxTelem_1.13e/CubeSatSim_PSK_mintelemetry.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spacecraft/FoxTelem_1.13e/CubeSatSim_PSK_mintelemetry.csv b/spacecraft/FoxTelem_1.13e/CubeSatSim_PSK_mintelemetry.csv index 8b06f27c..97dcaa4b 100644 --- a/spacecraft/FoxTelem_1.13e/CubeSatSim_PSK_mintelemetry.csv +++ b/spacecraft/FoxTelem_1.13e/CubeSatSim_PSK_mintelemetry.csv @@ -44,7 +44,7 @@ 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,C2CStatus,1,-,STATUS_ON_OFF,NONE,3,5,0,Command Control, Command & Control Status +45,MIN,C2CStatus,2,-,COMMAND_STATUS,NONE,3,5,0,Command Control, Command & Control Status 46,MIN,ICR3VProt,12,V,43,NONE,7,2,3,3V Prot,ICR 3V Proteted 47,MIN,ICR2dot5V,12,V,43,NONE,7,3,3,2.5V,ICR 2.5V 48,MIN,ICR2dot5VProt,12,V,43,NONE,7,4,3,2.5V Prot,ICR 2.5V Protected @@ -59,4 +59,4 @@ 57,MIN,swCmds,32,-,35,NONE,7,6,0,Diagnostic,ICR Diagnostic information 58,MIN,hwCmdCnt,6,-,1,NONE,7,7,0,HW Command Count,Number of hardware commands since last reset 59,MIN,swCmdCnt,6,-,1,NONE,7,8,0,SW Command Count,Number of software commands since last reset -60,MIN,pad2,28,-,0,NONE,0,0,0,NONE,Filler +60,MIN,pad2,27,-,0,NONE,0,0,0,NONE,Filler From 3f8fc45460470ee4bad31bc32d4727e3e6d587ca Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 31 Aug 2024 11:00:24 -0400 Subject: [PATCH 15/18] Update CubeSatSim_PSK_maxtelemetry.csv add COMMAND_STATUS --- spacecraft/FoxTelem_1.13e/CubeSatSim_PSK_maxtelemetry.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spacecraft/FoxTelem_1.13e/CubeSatSim_PSK_maxtelemetry.csv b/spacecraft/FoxTelem_1.13e/CubeSatSim_PSK_maxtelemetry.csv index 49526e8b..5e421492 100644 --- a/spacecraft/FoxTelem_1.13e/CubeSatSim_PSK_maxtelemetry.csv +++ b/spacecraft/FoxTelem_1.13e/CubeSatSim_PSK_maxtelemetry.csv @@ -44,7 +44,7 @@ 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,C2CStatus,1,-,STATUS_ON_OFF,NONE,3,5,0,Command Control, Command & Control Status +45,MAX,C2CStatus,2,-,COMMAND_STATUS,NONE,3,5,0,Command Control, Command & Control Status 46,MAX,ICR3VProt,12,V,43,NONE,7,2,3,3V Prot,ICR 3V Proteted 47,MAX,ICR2dot5V,12,V,43,NONE,7,3,3,2.5V,ICR 2.5V 48,MAX,ICR2dot5VProt,12,V,43,NONE,7,4,3,2.5V Prot,ICR 2.5V Protected @@ -59,4 +59,4 @@ 57,MAX,swCmds,32,-,35,NONE,7,6,0,Diagnostic,ICR Diagnostic information 58,MAX,hwCmdCnt,6,-,1,NONE,7,7,0,HW Command Count,Number of hardware commands since last reset 59,MAX,swCmdCnt,6,-,1,NONE,7,8,0,SW Command Count,Number of software commands since last reset -60,MAX,pad2,28,-,0,NONE,0,0,0,NONE,Filler +60,MAX,pad2,27,-,0,NONE,0,0,0,NONE,Filler From 8e3774c967913f1e17ae64cd5d6381ad0760706d Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 31 Aug 2024 11:01:48 -0400 Subject: [PATCH 16/18] Create CubeSat_Simulator_PSK.MASTER intial file --- .../CubeSat_Simulator_PSK.MASTER | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 spacecraft/FoxTelem_1.13e/CubeSat_Simulator_PSK.MASTER diff --git a/spacecraft/FoxTelem_1.13e/CubeSat_Simulator_PSK.MASTER b/spacecraft/FoxTelem_1.13e/CubeSat_Simulator_PSK.MASTER new file mode 100644 index 00000000..4ef708f3 --- /dev/null +++ b/spacecraft/FoxTelem_1.13e/CubeSat_Simulator_PSK.MASTER @@ -0,0 +1,75 @@ +#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 +numberOfStringLookupTables=1 +stringLookupTable0.filename=status_on_off.tab +stringLookupTable0=STATUS_ON_OFF +maxFreqBoundkHz=434950 +measurementsFileName=measurements.csv +memsRestValueX=2129 +memsRestValueY=2131 +memsRestValueZ=2103 +minFreqBoundkHz=434850 +passMeasurementsFileName=passmeasurements.csv +telemetryDownlinkFreqkHz=434900 +track=true +useIHUVBatt=false +numberOfSources=1 +source0.name=amsat.cubesat_simulator.ihu.bpsk +user_format=0 +useConversionCoeffs=true +conversionCurvesFileName=CubeSatSim_conversion_curves.csv From 68a2a90389b33c89fbaef0a42bee965423aab913 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 31 Aug 2024 11:03:01 -0400 Subject: [PATCH 17/18] Update CubeSat_Simulator_PSK.MASTER add COMMAND_STATUS --- spacecraft/FoxTelem_1.13e/CubeSat_Simulator_PSK.MASTER | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spacecraft/FoxTelem_1.13e/CubeSat_Simulator_PSK.MASTER b/spacecraft/FoxTelem_1.13e/CubeSat_Simulator_PSK.MASTER index 4ef708f3..56c22e88 100644 --- a/spacecraft/FoxTelem_1.13e/CubeSat_Simulator_PSK.MASTER +++ b/spacecraft/FoxTelem_1.13e/CubeSat_Simulator_PSK.MASTER @@ -55,9 +55,11 @@ lookupTable1.filename=FOX1E_ihuVBattSNx.tab lookupTable1=IHU_VBATT lookupTable2.filename=FOX1A_ihutempSN7.tab lookupTable2=IHU_TEMP -numberOfStringLookupTables=1 +numberOfStringLookupTables=2 stringLookupTable0.filename=status_on_off.tab stringLookupTable0=STATUS_ON_OFF +stringLookupTable1=COMMAND_STATUS +stringLookupTable1.filename=command_status.tab maxFreqBoundkHz=434950 measurementsFileName=measurements.csv memsRestValueX=2129 From 0a22628c7c5509937f4b8c5a448e1935650a5769 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 31 Aug 2024 11:07:57 -0400 Subject: [PATCH 18/18] Update main.c print c2cstatus with /n --- main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index 3ecef964..77b9afa4 100644 --- a/main.c +++ b/main.c @@ -94,7 +94,7 @@ int main(int argc, char * argv[]) { c2cStatus = 2; } } - printf("c2cStatus: %d", c2cStatus); + printf("c2cStatus: %d \n", c2cStatus); char resbuffer[1000]; // const char testStr[] = "cat /proc/cpuinfo | grep 'Revision' | awk '{print $3}' | sed 's/^1000//' | grep '9000'"; @@ -1589,7 +1589,7 @@ void get_tlm_fox() { } } } - printf("c2cStatus: %d", c2cStatus); + // printf("c2cStatus: %d \n", c2cStatus); encodeB(b, 52 + head_offset, rxAntennaDeployed + txAntennaDeployed * 2 + c2cStatus * 4); if (txAntennaDeployed == 0) {