Conversation
…ybernate, and listen_loiter into the SleepHelper class
…ameter to the Functions constructor
…e safe_sleep() is called
|
@blakejameson thanks for the quick turn around on this work! Before we rubber stamp this, could you run a quick test and show that directly calling all of the safe_sleep functions (ideally with various inputs) actually sleeps the satellite for the intended duration? |
|
@Mikefly123 I appreciate you asking for some tests In the image attached, I put an underscore under where I call the function and after the function call is over. It is still a lot to look through but the lines help somewhat. One thing to note is that of course, as previous, duration logic works in increment of 15s. So far example, an input of 15 through 29 would result in an actual duration of 15. A duration input of 30 to 44 would result in an actual duration of 30, and so on. This is because of the 'while duration >= 15' logic combined with the 'duration-=15' that is featured in the while loop. The test furthest down was a duration input of 16 seconds but of course results in an actual duration of 15 seconds, as shown
|
|
@Mikefly123 And here is the code I put together in main.py to run the tests you see above |
|
@Mikefly123 Snap, I just realized I misinterpreted your ask, and you probably wanted me to test short_hibernate and long_hibernate as well |
|
@Mikefly123 It appears that short and long hibernate are erroring out since self.enable_rf is set to a boolean value. Saying 'bool.value = False' is causing an Exception, as shown in the output. I am going to stop working for the night and will get back at it tomorrow
|
|
Hey @blakejameson, good catch on that hibernation bug! I believe that is going on here is that the |
|
@Mikefly123 Here is testing the short and long hibernate functions. As shown, the short hibernate goes for 120 seconds, matching the safe_sleep(120) function call the function definition contains. The long hibernate goes for 180 seconds, despite the safe_sleep(600) function call the function definition contains. This makes sense however, because with the safe_sleep function, the iterations logic only allows up to 12 iterations of 15 seconds. 12*15 = 180, so it makes sense that the safe_sleep will only go up to 3 minutes. |
|
@Mikefly123 Also, given the potential exception seen earlier in this thread regarding the type of
|
|
Hi Blake! All here looks good, thanks for making the changes and running these tests. I like that recommendation of checking for how the I want to add just for context, in the near future we will want to refactor the hibernate functions to genuinely sleep the satellite for longer than 3 minutes at a time, but for Orpheus we opted not to do that to make operations safer (so we don't end up in a position where the satellite is unexpectedly uncommunicable). When we transition to V2 PROVES Kit, we'll want to bring back genuine hibernation functions that might allow the satellite to sleep for hours or even days at a time. |
|
@Mikefly123 That context helps a ton! Thank you so much for explaining |
|
@Mikefly123 Alright, so I went ahead and tested again with the newer way of checking the type of |
|
@Mikefly123 However, I noticed that whether running the code on this branch here with 'legacy' set to true in the config.json or even on the main branch with 'legacy' set to true in the config.json, it errors out with the following message: I guess that explains the Temporary Fix for RF_ENAB section in the code? |
|
@blakejameson good catch on that bug when I was actually just thinking, once the Could you submit an Issue Ticket that describes this |
|
@Mikefly123 Yes! I will create an issue ticket regarding And now after a recent push for my last commit, the code is ready for review |
Mikefly123
left a comment
There was a problem hiding this comment.
LGTM! Thanks for these updates Blake
nateinaction
left a comment
There was a problem hiding this comment.
Good extraction from functions.py. @blakejameson since you have context right now could you add doc comments to the new SleepHelper class/methods?
…ed in SleepHelper
|
@Mikefly123 Had recently thought about safe sleep and am curious if now the work can be done to allow for sleeping longer than 3 minutes and also correcting the logic to allow for precise sleep duration (instead of the current 15-second increment way) |
|
Hey @blakejameson thanks for circling back on this! If you would like to open a new ticket in the
We can also move away from the 15 second increments but some gotchas to watch out for when doing that:
|
|
@Mikefly123 Great, thanks so much!! I will go open a new ticket |












Summary
I created the SleepHelper class, adding the safe_sleep, short_hibernate, and long_hibernate functions to the class. For Functions, I edited the constructor to be passed a parameter of a SleepHelper object.
How was this tested