Skip to content

Introduce radio manager+factory for RFM9x #161

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Mar 6, 2025
Merged

Conversation

nateinaction
Copy link
Member

@nateinaction nateinaction commented Feb 15, 2025

Summary

This PR introduces radio factory and radio manager to handle calls to the RFM9x radio.
The factory handles all calls directly interacting with the adafruit library while the manager holds the instance of the radio and manage interactions between the radio and its callers.

How was this tested

  • Added new unit tests
  • Ran code on hardware (screenshots are helpful)
  • Other (Please describe)
Screenshot 2025-02-15 at 12 01 26

@nateinaction nateinaction requested review from Mikefly123, dbgen1 and a team February 15, 2025 18:33
@nateinaction nateinaction mentioned this pull request Feb 15, 2025
3 tasks
Copy link
Member Author

@nateinaction nateinaction left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think I'm going to get the test coverage any higher. With the free version of SonarQube I cannot create my own "quality gate" with a lower test coverage required. We'll have to either:

  1. live with these failures until we add more testing
  2. remove code coverage reporting in SonarQube
  3. stop using SonarQube

As much as I dislike seeing these failures, they're a good push. I even went back and added a few more tests to try and satisfy it... I got close.

@Mikefly123
Copy link
Member

I don't think I'm going to get the test coverage any higher. With the free version of SonarQube I cannot create my own "quality gate" with a lower test coverage required. We'll have to either:

  1. live with these failures until we add more testing
  2. remove code coverage reporting in SonarQube
  3. stop using SonarQube

As much as I dislike seeing these failures, they're a good push. I even went back and added a few more tests to try and satisfy it... I got close.

I'm pretty new to these DevOps tools, but would be perhaps consider self-hosting the SonarQube Community Edition to get around this? It's possible we could set up an environment in one of our labs to oversee this kind of stuff.

Copy link
Member

@Mikefly123 Mikefly123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR looks great @nateinaction! I only have 1 requested change on that low_datarate_optimize thing that needs to be updated before merging. Most of my other comments are more just food for thought that we can wrench on with future PRs.

Looking forward to seeing this get into the main codebase!

@nateinaction nateinaction mentioned this pull request Feb 18, 2025
3 tasks
@Mikefly123 Mikefly123 linked an issue Feb 19, 2025 that may be closed by this pull request
4 tasks
@nateinaction
Copy link
Member Author

I'm pretty new to these DevOps tools, but would be perhaps consider self-hosting the SonarQube Community Edition to get around this? It's possible we could set up an environment in one of our labs to oversee this kind of stuff.

100% can be done. I'm not sure if it's going to jump to the top of my priority list though. I think we can keep bring up test coverage pretty quickly so it's a temporary annoyance. We're already above 10% on main with more to come!

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
79.1% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@nateinaction
Copy link
Member Author

@Mikefly123 Thanks for your patience, this is ready for rereview. I addressed feedback on low_datarate_optimize and moving hardcoded values to config.

I have replied with questions on your other feedback to hopefully help me understand your mindset. Ultimately I think we are aligned that there are still painpoints and that we are introducing painpoint for satellite operators with extractions like these. I know we can make progress on resolving some of those but I'll need help where I lack understanding.

@Mikefly123
Copy link
Member

@Mikefly123 Thanks for your patience, this is ready for rereview. I addressed feedback on low_datarate_optimize and moving hardcoded values to config.

I have replied with questions on your other feedback to hopefully help me understand your mindset. Ultimately I think we are aligned that there are still painpoints and that we are introducing painpoint for satellite operators with extractions like these. I know we can make progress on resolving some of those but I'll need help where I lack understanding.

Hey @nateinaction! Yeah I saw the comments come in yesterday and haven't quite gotten around to replying to them all yet. Sorry to stall getting this PR through, but I can commit to getting back on the horse with this over the weekend after we get through our big design review for SCALES tomorrow!

Copy link
Member

@Mikefly123 Mikefly123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay this all looks good to me!

I am on travel right now, so I don't have the hardware to do and end to end test. If we can quickly verify that the new code behaves and transmits as expected let's merge this thing!

@nateinaction
Copy link
Member Author

Output looks normal:
Screenshot 2025-03-05 at 22 10 57

@nateinaction nateinaction merged commit d2d950c into main Mar 6, 2025
3 of 4 checks passed
@nateinaction nateinaction deleted the rfm9x-factory-manager branch March 6, 2025 04:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[TASK] Extract Safe_Init to its Own Class
2 participants