Skip to content

fix frequency setter and misc items #7

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 9 commits into from
Jul 16, 2018
Merged

fix frequency setter and misc items #7

merged 9 commits into from
Jul 16, 2018

Conversation

jerryneedell
Copy link
Contributor

@jerryneedell jerryneedell commented Jul 9, 2018

This fixes the frequency setter to correctly set fewquency_mhz.
I also added a timeout to the send function to avoid a potential hang.
the parameters to set the send/receive timeouts were renamed from timeout_s to timeout to be compatible with the standard naming conventions.
The deafault SPI baudrate was lowered to 5MHz as was done for the RF95x to avoid problems with the breakout boards.

Note : I cannot make any sense of the RSSI readings from this module. I did not change the way they are reported and this issue was present in the current release, but the values reported are much lower than expected and much lower than those reported by Arduino.

I tested this with both an RFM69HCW featherwing and an RFM69HCW breakout board

@jerryneedell jerryneedell requested a review from tannewt July 9, 2018 14:31
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Just a couple small things. Thanks!

README.rst Outdated
The baud rate may be specified as an keyword parameter when initializing the board.
To set it to 1000000 use :
.. code-block:: python# Initialze RFM radio
.. code-block:: python
Copy link
Member

Choose a reason for hiding this comment

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

this looks like a merge error.

# Go back to idle mode after transmit.
self.idle()
if timed_out:
raise RuntimeError('Timeout during packet send')
Copy link
Member

Choose a reason for hiding this comment

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

Nice!

# Listen again if necessary and return the result packet.
if keep_listening:
self.listen()
if not timed_out:
Copy link
Member

Choose a reason for hiding this comment

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

Invert this and return None early. That simplifies the code below it

README.rst Outdated
.. code-block:: python
# Initialze RFM radio
rfm9x = adafruit_rfm9x.RFM9x(spi, CS, RESET, RADIO_FREQ_MHZ,baudrate=1000000)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Clearly, am not formatting this correctly -- What am I doing wrong?

@jerryneedell
Copy link
Contributor Author

@tannewt Are there more changes needed? Let me know if I missed something.

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks for the ping.

@tannewt tannewt merged commit 28dd218 into adafruit:master Jul 16, 2018
@jerryneedell jerryneedell deleted the jerryn_fix_freq branch July 18, 2018 20:17
tannewt pushed a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Jul 19, 2018
Updating https://github.com/adafruit/Adafruit_CircuitPython_RFM69 to 1.1.3 from 1.1.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_RFM69#8 from jerryneedell/jerryn_fixpylint
  > Merge pull request adafruit/Adafruit_CircuitPython_RFM69#7 from jerryneedell/jerryn_fix_freq

Updating https://github.com/adafruit/Adafruit_CircuitPython_STMPE610 to 1.0.1 from 0.8.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_STMPE610#5 from jerryneedell/jerryn_fixpylint
  > Merge pull request adafruit/Adafruit_CircuitPython_STMPE610#4 from jerryneedell/jerryn_fixspi
  > Merge pull request adafruit/Adafruit_CircuitPython_STMPE610#2 from adafruit/tannewt-patch-1
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.

2 participants