AlbertaSat / ex3_software

All software from flight to ground station and everything in between for the epic mission of Ex-Alta 3.
Apache License 2.0
2 stars 0 forks source link

Drake/feature/groundstation beacon client #66

Closed DrakBoul closed 1 week ago

DrakBoul commented 1 week ago

In this PR I added an additional tcp client in the cli groundstation code to listen exclusively for the Simulated UHF Beacon. It works by listening to a server hosted by the simulated UHF (Different from the servers used to send commands and downlink data). Since I had to implement an additional TCP server in simulated UHF, this PR is dependent on this pull request in ex3_simulated_subsystems repository. If you want to test this branch please use the simulated subsystem branch mentioned in the PR linked above.

Additionally, I am open to suggestions on what the beacon contents should be (Besides the content that can be manually modified by sending a set beacon command to the UHF handler). @rcunrau mentioned it does not make much sense to have the usual header message for the beacon. Please give me recommendations and I will make the changes before we continue with the review.

rcunrau commented 1 week ago

I think it will definitely be a nice feature to have the ground station display the beacon contents. Since we will eventually get the info from gnu radio, we could potentially show the beacon from any satellite overhead! In terms of content, it is normal to prepend the beacon with our call sign (VE6 LRN, I think). We found this part of the endurosat fairly inscrutable - we could never figure out what call sign it was broadcasting, which made it difficult to differentiate our satellites :-(

DrakBoul commented 1 week ago

IMHO, the main loop of the CLI needs a complete rewrite :-( There's sort of a select call there but we don't really use it, and there are locks and the whole thing is async which is unnecessary (if we used select correctly). I started to fix it in my PR that is forever blocked, so perhaps it's best if you merge this and I'll just include it in my rewrite. If you wanted to try to fix it, stdin and the beacon should be the two fds in the select() (eventually it will also be the http port, and ultimately we may be in the middle of a bulk download). If you get a beacon just print it; if you get a command you have to send to the satellite and block (with timeout) waiting for the reponse.

Okay, Ill look into fixing the main loop of the groundstation. for now I'll just merge this PR after the PR in sim subsystems is approved and merged.

rcunrau commented 1 week ago

If you want to try to fix the main loop it's fine, but I definitely had it on my TODO list. We could have a race, or work on it together, or break it into different parts, or whatever you like. I definitely agree I'm not super productive, so you'll likely finish more quickly, but it also has a lot more moving parts than most other components.

DrakBoul commented 1 week ago

@rcunrau Okay, I can take a crack at it since I do not have much going on right now. But I would appreciate your help, I can create a PR later that we can both contribute to.