use rfm9x gpio pins from circuitpython?

For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Rcayot
 
Posts: 321
Joined: Sat Feb 08, 2020 6:48 pm

use rfm9x gpio pins from circuitpython?

Post by Rcayot »

Sometimes is is convenient to reset my PICO running my weather station remotely.

I was wondering if I could use one of the RFM9x breakout boards gpio pins to reset the pico. I am using circuit-python, and none of the documentation comments on how to use those. What I was thinking was that I could send a command via REPL to pull a gpio pin low connected to the 'run' pin on the PICO.

Roger

User avatar
mikeysklar
 
Posts: 14181
Joined: Mon Aug 01, 2016 8:10 pm

Re: use rfm9x gpio pins from circuitpython?

Post by mikeysklar »

Roger,

I can see why you would want the remote reset ability for hangs, etc.

The RP2040 does support the CMSIS functions so you can also consider trigger reset in your code via REPL console.

; soft reset

Code: Select all

import supervisor
supervisor.reload()
; hard reset

Code: Select all

import microcontroller
microcontroller.reset()

User avatar
Rcayot
 
Posts: 321
Joined: Sat Feb 08, 2020 6:48 pm

Re: use rfm9x gpio pins from circuitpython?

Post by Rcayot »

Thanks Mike.

I think if I cannot use the RFM9x GPIO, (probably need to be running Arduino code for that), then I could use a button. I would like to have a local display to output the serial port to, but the low power ones, like e-ink, are likely too slow to keep up with serial out, except or unless I disable all my debugg 'prints'. Which is no problem.

I will investigate if micropython has a port of the radiohead library.

Roger

User avatar
mikeysklar
 
Posts: 14181
Joined: Mon Aug 01, 2016 8:10 pm

Re: use rfm9x gpio pins from circuitpython?

Post by mikeysklar »

Roger,

Looking through the rfm9x (CircuitPython library) I don't see GPIO controls. There is a reset() function for the radio only, but not for the CircuitPython board that is connected to it.

https://github.com/adafruit/Adafruit_Ci ... t_rfm9x.py

What I like to do when I'm doing remote development and need to have a REPL console and way to reset the microcontroller is use a Pi Zero and connect your controller to the USB port. Then you can do all the development over ssh / CLI. The only downside in your case is it sound as though you have a power constraint.

Locked
Please be positive and constructive with your questions and comments.

Return to “Wireless: WiFi and Bluetooth”