From 4edcfaebb1f87fe61a9cbf4c680d39cd9b435767 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Nov 2022 15:47:55 -0500 Subject: [PATCH 01/14] remove transmit_off in transmit_callsign --- cubesatsim/cubesatsim.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cubesatsim/cubesatsim.ino b/cubesatsim/cubesatsim.ino index 3754f224..bd149a15 100644 --- a/cubesatsim/cubesatsim.ino +++ b/cubesatsim/cubesatsim.ino @@ -3871,7 +3871,7 @@ void transmit_callsign(char *callsign) { program_radio(); } */ - transmit_off(); +/// transmit_off(); transmit_string(id); // transmit_on(); } From 5935bedb2e931de3014d24ab93385d13db7f6cea Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Nov 2022 16:03:32 -0500 Subject: [PATCH 02/14] move config_telem up in change mode --- cubesatsim/cubesatsim.ino | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cubesatsim/cubesatsim.ino b/cubesatsim/cubesatsim.ino index bd149a15..715c28da 100644 --- a/cubesatsim/cubesatsim.ino +++ b/cubesatsim/cubesatsim.ino @@ -328,11 +328,12 @@ void loop() { /// start_button_isr(); // restart button isr /// } mode = new_mode; // change modes if button pressed - write_mode(); + write_mode(); + config_telem(); if (new_mode != CW) transmit_callsign(callsign); sleep(0.5); - config_telem(); +/// config_telem(); config_radio(); if ((mode == FSK) || (mode == BPSK)) { digitalWrite(LED_BUILTIN, HIGH); From 68c34e90af3de1d0c8ab8b7d5a0d0a8aadbe3427 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Nov 2022 16:07:36 -0500 Subject: [PATCH 03/14] config_telem depending on FSK or BPSK --- cubesatsim/cubesatsim.ino | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/cubesatsim/cubesatsim.ino b/cubesatsim/cubesatsim.ino index 715c28da..d326a1a3 100644 --- a/cubesatsim/cubesatsim.ino +++ b/cubesatsim/cubesatsim.ino @@ -328,12 +328,18 @@ void loop() { /// start_button_isr(); // restart button isr /// } mode = new_mode; // change modes if button pressed - write_mode(); - config_telem(); + write_mode(); + + if (mode == BPSK) + config_telem(); + if (new_mode != CW) transmit_callsign(callsign); - sleep(0.5); -/// config_telem(); + sleep(0.5); + + if (mode == FSK) + config_telem(); + config_radio(); if ((mode == FSK) || (mode == BPSK)) { digitalWrite(LED_BUILTIN, HIGH); From 0553a21f8ed5ac37553bc7dd5baa8ea983db2646 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Nov 2022 16:12:52 -0500 Subject: [PATCH 04/14] config_telem in usual place for all modes except BPSK --- cubesatsim/cubesatsim.ino | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cubesatsim/cubesatsim.ino b/cubesatsim/cubesatsim.ino index d326a1a3..cf8fb86b 100644 --- a/cubesatsim/cubesatsim.ino +++ b/cubesatsim/cubesatsim.ino @@ -331,14 +331,14 @@ void loop() { write_mode(); if (mode == BPSK) - config_telem(); + config_telem(); // run this before cw only for BPSK mode if (new_mode != CW) transmit_callsign(callsign); sleep(0.5); - if (mode == FSK) - config_telem(); + if (mode != BPSK) + config_telem(); // run this here for all other modes config_radio(); if ((mode == FSK) || (mode == BPSK)) { From d9564355f0293fa61bf1ba5bd4abc536827fc369 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Nov 2022 16:26:32 -0500 Subject: [PATCH 05/14] add cw_stop = false --- cubesatsim/cubesatsim.ino | 1 + 1 file changed, 1 insertion(+) diff --git a/cubesatsim/cubesatsim.ino b/cubesatsim/cubesatsim.ino index cf8fb86b..957efad5 100644 --- a/cubesatsim/cubesatsim.ino +++ b/cubesatsim/cubesatsim.ino @@ -323,6 +323,7 @@ void loop() { // check to see if the mode has changed if (mode != new_mode) { Serial.println("Changing mode"); + cw_stop = false; // enable CW or won't hear CW ID /// if (mode == SSTV) { /// ITimer1.detachInterrupt(); /// start_button_isr(); // restart button isr From 63e68d94904560ed90245b30ea8987b50e6f20c6 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Nov 2022 16:40:08 -0500 Subject: [PATCH 06/14] also change config for CW -> FSK mode change --- cubesatsim/cubesatsim.ino | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cubesatsim/cubesatsim.ino b/cubesatsim/cubesatsim.ino index 957efad5..379ca314 100644 --- a/cubesatsim/cubesatsim.ino +++ b/cubesatsim/cubesatsim.ino @@ -328,17 +328,21 @@ void loop() { /// ITimer1.detachInterrupt(); /// start_button_isr(); // restart button isr /// } + int old_mode = mode; + bool config_done = false; mode = new_mode; // change modes if button pressed write_mode(); - if (mode == BPSK) + if (mode == BPSK) || ((new_mode == FSK) && (old_mode == CW)) { config_telem(); // run this before cw only for BPSK mode + config_done = true; + } if (new_mode != CW) transmit_callsign(callsign); sleep(0.5); - if (mode != BPSK) + if (!config_done) config_telem(); // run this here for all other modes config_radio(); From daae31d6134c485873eb83f6248a197b579fcfc1 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Nov 2022 16:41:21 -0500 Subject: [PATCH 07/14] typo --- cubesatsim/cubesatsim.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cubesatsim/cubesatsim.ino b/cubesatsim/cubesatsim.ino index 379ca314..c9b5b74d 100644 --- a/cubesatsim/cubesatsim.ino +++ b/cubesatsim/cubesatsim.ino @@ -333,7 +333,7 @@ void loop() { mode = new_mode; // change modes if button pressed write_mode(); - if (mode == BPSK) || ((new_mode == FSK) && (old_mode == CW)) { + if ((mode == BPSK) || ((new_mode == FSK) && (old_mode == CW)) { config_telem(); // run this before cw only for BPSK mode config_done = true; } From dfbdcbffb9795343bd2f345e2109f7cc5d12b65d Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Nov 2022 16:43:38 -0500 Subject: [PATCH 08/14] typo --- cubesatsim/cubesatsim.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cubesatsim/cubesatsim.ino b/cubesatsim/cubesatsim.ino index c9b5b74d..5de4af51 100644 --- a/cubesatsim/cubesatsim.ino +++ b/cubesatsim/cubesatsim.ino @@ -333,7 +333,7 @@ void loop() { mode = new_mode; // change modes if button pressed write_mode(); - if ((mode == BPSK) || ((new_mode == FSK) && (old_mode == CW)) { + if ((mode == BPSK) || ((new_mode == FSK) && (old_mode == CW))) { config_telem(); // run this before cw only for BPSK mode config_done = true; } From adfb3bbd51bd268babb29dc7a252bd0cee23cb44 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 28 Nov 2022 17:04:19 -0500 Subject: [PATCH 09/14] revert CW -> FSK mode change exception --- cubesatsim/cubesatsim.ino | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cubesatsim/cubesatsim.ino b/cubesatsim/cubesatsim.ino index 5de4af51..af1b55f6 100644 --- a/cubesatsim/cubesatsim.ino +++ b/cubesatsim/cubesatsim.ino @@ -333,7 +333,8 @@ void loop() { mode = new_mode; // change modes if button pressed write_mode(); - if ((mode == BPSK) || ((new_mode == FSK) && (old_mode == CW))) { +// if ((mode == BPSK) || ((new_mode == FSK) && (old_mode == CW))) { + if (mode == BPSK) { config_telem(); // run this before cw only for BPSK mode config_done = true; } From 0a3a6852c0d54ea49238de1fb35ad6a01989fced Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 29 Nov 2022 08:41:53 -0500 Subject: [PATCH 10/14] don't change order for BPSK --- cubesatsim/cubesatsim.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cubesatsim/cubesatsim.ino b/cubesatsim/cubesatsim.ino index af1b55f6..7f330827 100644 --- a/cubesatsim/cubesatsim.ino +++ b/cubesatsim/cubesatsim.ino @@ -332,13 +332,13 @@ void loop() { bool config_done = false; mode = new_mode; // change modes if button pressed write_mode(); - +/* // if ((mode == BPSK) || ((new_mode == FSK) && (old_mode == CW))) { if (mode == BPSK) { config_telem(); // run this before cw only for BPSK mode config_done = true; } - +*/ if (new_mode != CW) transmit_callsign(callsign); sleep(0.5); From 26f4e16e305a926a457259734692aa4274aca8e7 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 29 Nov 2022 09:06:35 -0500 Subject: [PATCH 11/14] restart after mode change --- cubesatsim/cubesatsim.ino | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cubesatsim/cubesatsim.ino b/cubesatsim/cubesatsim.ino index 7f330827..f0527109 100644 --- a/cubesatsim/cubesatsim.ino +++ b/cubesatsim/cubesatsim.ino @@ -338,7 +338,9 @@ void loop() { config_telem(); // run this before cw only for BPSK mode config_done = true; } -*/ +*/ + machine.reset(); // restart Pico + if (new_mode != CW) transmit_callsign(callsign); sleep(0.5); From 3358c3308efbc707a203a4cd6b3b4f9b2862383d Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 29 Nov 2022 09:12:29 -0500 Subject: [PATCH 12/14] changed to watchdog --- cubesatsim/cubesatsim.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cubesatsim/cubesatsim.ino b/cubesatsim/cubesatsim.ino index f0527109..2a68c109 100644 --- a/cubesatsim/cubesatsim.ino +++ b/cubesatsim/cubesatsim.ino @@ -339,7 +339,7 @@ void loop() { config_done = true; } */ - machine.reset(); // restart Pico + watchdog_reboot (0, SRAM_END, 10); // restart Pico if (new_mode != CW) transmit_callsign(callsign); From 36c0caec3eabc86c993a2be0cd5ccd721fea6075 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 29 Nov 2022 09:15:23 -0500 Subject: [PATCH 13/14] add includes --- cubesatsim/cubesatsim.ino | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cubesatsim/cubesatsim.ino b/cubesatsim/cubesatsim.ino index 2a68c109..ea68d477 100644 --- a/cubesatsim/cubesatsim.ino +++ b/cubesatsim/cubesatsim.ino @@ -43,6 +43,8 @@ #include "LittleFS.h" #include #include "picosstvpp.h" +#include "pico/bootrom.h" +#include "hardware/watchdog.h" // jpg files to be stored in flash storage on Pico (FS 512kB setting) //#include "sstv1.h" From 62c0c03a02b2aba5b95c49d9a6e5bcc89e222770 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 29 Nov 2022 09:58:04 -0500 Subject: [PATCH 14/14] removed blinks and delays in startup --- cubesatsim/cubesatsim.ino | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cubesatsim/cubesatsim.ino b/cubesatsim/cubesatsim.ino index ea68d477..2adfe459 100644 --- a/cubesatsim/cubesatsim.ino +++ b/cubesatsim/cubesatsim.ino @@ -92,7 +92,7 @@ void setup() { pinMode(LED_BUILTIN, OUTPUT); blinkTimes(1); - sleep(5.0); +/// sleep(5.0); // otherwise, run CubeSatSim Pico code @@ -111,7 +111,7 @@ void setup() { // detect Pi Zero using 3.3V // if Pi is present, run Payload OK software - load_files(); +/// load_files(); /* pinMode(PI_3V3_PIN, INPUT); Serial.print("Pi 3.3V: "); @@ -165,7 +165,8 @@ void setup() { // strcpy(callsign, call); if (mode != CW) transmit_callsign(callsign); - sleep(5.0); +// sleep(5.0); + sleep(1.0); /**/ config_telem(); @@ -2486,7 +2487,7 @@ void start_payload() { Serial.println("Starting payload!"); blink_setup(); - +/* blink(500); sleep(0.25); // delay(250); blink(500); @@ -2497,7 +2498,8 @@ void start_payload() { led_set(blueLED, HIGH); sleep(0.25); // delay(250); led_set(blueLED, LOW); - +*/ + if (bme.begin()) { bmePresent = 1; } else {