#Me vs Radio Bonnet on Pi Pico

1 messages · Page 1 of 1 (latest)

cold terrace
#

Organizing this i a thread so things will be kept together.

#

And will wire it up later

#

If Look at the pinnout, is the bonnet seen from the Front or the back? On the 2x20 connector

rocky oriole
#

Not a great picture, but it may help. I'm not sure what "pinout" you are referring to. You can see the RED wire -- it is on the Bonnet 5V pin for reference. Also in the picture, I have the I2C pins connected although they are not needed for the example -- I have SCL on GP1 and SDA on GP0.

cold terrace
#

i got this one. and 5V is on the top right, so i need to look at my bonnet from the front side, not the back side?

#

Like this

#

"on the Bonnet 5V pin for reference"
the Pi automatically gives the bonnet 5V?

rocky oriole
#

yes, the pin on the top right from the top side is 5V. When it is connected to a Pi, it get 5V via that pin. The bonnet has a regulator that generates the 3.3 V it needs.

#

So you have it lined up correctly with the schematic.

cold terrace
#

perfect, thx

cold terrace
#

i get errors with the import, but i don't know how to fix them (i don't know where i find the files i need to import, i got nothing like node modules in js)
ImportError: no module named 'board'
same with the others

rocky oriole
#

How are you executing tho code on the pico? Is does not sound like you are actually running it on the pico.

#

Are you at the REPL?

cold terrace
#

i get the output in this console window, so i think i'm on the Pi

#

MicroPython v1.21.0 on 2023-10-06; Raspberry Pi Pico W with RP2040
Type "help()" for more information.

raw REPL; CTRL-B to exit

OK
MPY: soft reboot
raw REPL; CTRL-B to exit
OK

Traceback (most recent call last):
File "<stdin>", line 8, in <module>
ImportError: no module named 'board'
>
MicroPython v1.21.0 on 2023-10-06; Raspberry Pi Pico W with RP2040
Type "help()" for more information.

rocky oriole
#

You have MicroPython installed on your board, not CircuitPython.

#

The guide and eaxples are for CircuitPython.

cold terrace
#

i'm literally 100% sure i dragged the circtuitPython file on the PI

and now i feel dumb that i haven't seen it in the log i even pasted in here😂

#

and the pi now appears as circuitpython drive and then just disappears again

#

"USB device not recognized"

guess i'll try it with linux, because this are most likley windows things (again)

#

for 2 secons now, then it dissapears (in the explorer to)

rocky oriole
#

ah -- anything that accesses the CIRCUITPY drive is likely to cause problems. Glad to found the issue!. Good luck!

cold terrace
#

was working on other stuff and now getting back here, i always get "board.D5 is not defined" when initializing my rfm69 object. and i can't look in the file because it's mpy which is binary. i got 1:1 your sample code (or the file with (c) tony di cola) and it doesn't work for me.
i found some other librarys which i can't get to work either.
and it might be agood idea to use "officail stuff"

rocky oriole
#

My code example uses GPx

cold terrace
#

if i use GP25 (for pin 25 as example) it didn't work either.
don't have the pico with me now, but i thought it was "no attribute GP25 of board" or somth. like this too

rocky oriole
#

I think you are confused about the pinouts. There is no GP25 on a Pico. You cannot have something connected to it. Make sure you are using the PICO pin references, not the Bonnet Pin references. You connect the Pico Pin to the Bonnet Pin but use the Pico Pin reference. Can you post a picture of your wiring and the exact code you are trying to run.

rocky oriole
cold terrace
#

My wiring atm

cold terrace
#

i try to run:

import board
import busio
import digitalio

import adafruit_rfm69


# radio parameters.
RADIO_FREQ_MHZ = 433.0

# Define pins connected to the chip
CS = digitalio.DigitalInOut(board.GP8)
RESET = digitalio.DigitalInOut(board.GP9)

# Initialize SPI bus.
spi = busio.SPI(board.GP10, MOSI=board.GP11, MISO=board.GP12)

# Initialze RFM radio
rfm69 = adafruit_rfm69.RFM69(spi, CS, RESET, RADIO_FREQ_MHZ)

and have the following Error:

  File "code.py", line 22, in <module>
  File "adafruit_rfm69.py", line 316, in __init__
RuntimeError: Invalid RFM69 version, check wiring!```

Edit: proper Code Formation
rocky oriole
#

It is really hard to see the wiring on the bonnet but that error is almost always due to a wiring error or a bad connection. Check and double check. It looks to me like the RESET and CLK wires may be in the wrong places on the Bonnet end. But it is hard to tell from the picture, but MISO, MOSI and SCLK should all be on the same side of the 2x20 header and they don't appear to be.

cold terrace
#

there was indeed some wrong wiring. now it works as intended.
now i have to get the display and the buttons working (would you mind helping me again? because if i do it myself i'll probably hurt my laptop (bcs. wall is more solid than it 😶‍🌫️))

gotta rewrite the algorythm to send .sub files in python ig

rocky oriole
rocky oriole
#

I have this example working with my Pico and bonnet. I had to make a few changes to the example and add pull-up resistors (10K) to the SCL and SDA lines since neither the bonnet nor the pico have them. (A Raspberry Pi does have pull-ups so they are not normally needed for the bonnet).

#

Here is the additional wiring to what you already have ```
Pico Bonnet
GP0 SDA
GP1 SCL
GP2 5 (button a)
GP3 6 (button b)
GP4 12 (button c)
on the Pico I added 10K resistors from GP0 to 3.3V and GP1 to 3.3V
Note: in the guide the RESET for the OLED display is defined as Pin D4(for a Raspberry Pi) but it is actually not used on the bonnet so you don't need it and the pin is just set to None in the code. According to the schematic for the bonnet OLED_RESET is hardwired via a pull-up resistor. You will need to install the fon5x8.bin file and the adafruit_ssd1306 library -- you can get them by downloading the "project" bundle from the guide. You do not need the "framebuffer" library -- that is a Raspberry Pi thing. Remember, the guide was written for using this bonnet with a Pi! Take a look at the example and give it a try. I will also try to create an example using displayio but that is something I have to relearn how to do first! Good luck. Also Note: my example uses 915MHz, it looks like you are using 433.

rocky oriole
cold terrace
#

i'll try your example. and if displayio makes my life easier i'm for sure interested
will ping you again

rocky oriole
# cold terrace i'll try your example. and if displayio makes my life easier i'm for sure intere...

I would not call displayio “easier”, in fact, I find it far more complex, but far more powerful especially for handling graphics. I am still a novice at using it. There are many other folks here who will be able to help you with it though so don’t shy away from it. It’s really a matter of choice and learning curve. The first example (non displayio) is certainly easier to get something on the screen. With displayio, you may be able to make it “prettier” . One step at a time!

cold terrace
#

makes sense. i will try your example first

#

will i destroy my board if i use it without the resistors?

rocky oriole
#

no, but it won’t work

cold terrace
#

okay
then i need to organise those for me...

#

could take some time

rocky oriole
cold terrace
#

okay

ig then i'm using god ol' print statements isntead of the display till i got those resistors

cold terrace
#

might a "normal" pi (not pico) solve many of my problems?
is it worth the pain of rewiring if i switch to a normal pi 4?

#

and can i just take a pice of copper wire as antenna?

rocky oriole
#

There is no wiring at all for the Pi!

#

However, the pico "should" work -- moving to a Pi may not solve the problems.

rocky oriole
cold terrace
#

right now, my problem is that i can't receive packets
i'm sending from the bonnet and i see it in the "read raw" from my flipper zero, but if i make my cod eto just receiving in 10 seconds timeout and play the raw from the flipper it won't read anything

#

i have a 2018 Pi model B at mines if that works. looks like a can just put it straight on the 2/20 connector?

rocky oriole
# cold terrace i have a 2018 Pi model B at mines if that works. looks like a can just put it st...

The Pi 2B should work fine with the Bonnet. You will need to install the "Blinka" software on the Pi in order to use the CircuitPython libraries. This guide should you how https://learn.adafruit.com/circuitpython-on-raspberrypi-linux You will also need the adafruit-circuitpython-framebuf library as in this guide https://learn.adafruit.com/adafruit-radio-bonnets/rfm9x-raspberry-pi-setup It was not needed on the pico. Note, the guide says to use "sudo pip ..." to install the libraries, but you don't really need to use "sudo" just "pip" will work fine.

#

But -- I don't think that will help your problem.... What is the "flipper zero" ? Do you have a link to a description? I don't know what you are trying to do.

#

Ah found it https://flipperzero.one You say it receives raw packets....that is good. Does it expect some particular packet format?

#

What do you mean by "i see it in the read raw" from my flipper zero"?

#

OK -- I found some documentation https://docs.flipper.net/sub-ghz/read-raw If it receives with raw-read, then I think everything is working as well as you can expect. As to using the "read" function, you have to create packets that match the expected formats and I don't know if that information is available to you. What are you hopig to do with it? From the documentation Remotes have different frequencies and modulations To read signals correctly, you need to know the remote control's parameters and configure your Flipper Zero accordingly. If Flipper Zero is unable to read the signal with the default settings, you will need to interact with Frequency and Modulation parameters in the Configuration Menu.

#

Can you send packets from the Flipper to the Bonnet?

cold terrace
rocky oriole
#

That is likely because the Flipper is not configured to send data in a format that the Bonnet can receive.

#

I looked at some of the documentation and some of the flipper forum discussions https://forum.flipper.net/c/sub-ghz/6 and I'm not quite sure what you can or can't do with it. It looks like a very interesting device.

#

Can you please confirm that in "read-raw" mode it was "seeing something"?

#

If so, then it sounds like the hardware is all working. It may be tricky to get them to actually talk to eachother. You may want to post on the flipper discord or forms https://flipperzero.one/community

cold terrace
#

if i read raw with the flipper, then i see the peaks like in the picture above.
but if i do rfm59.receive(timeout=10) and send the raw with the flipper, the bonnet doesn't read anything

#

-> i see that the bonnet is sending something (that's enough for me, so i can shot "i have something sent"), but it would be nice to receive with the bonnet. event if it's just the raw binary or whatever is printed.

#

and i'm trying to get a Model B working with the touch-display because i don't have anymore hdmi monitors here. maybe then it gets eaier.
but if i just plug the board into the Raspi, then i cant plug anymore pins for the display...

rocky oriole
rocky oriole
rocky oriole
#

AH -- your Pi 2 does not have WiFi does it, or do you have a WiFi dongle attached to it?

#

There are many ways to do things.... and it is difficult to offer suggestions without knwing more about what you have to work with.

#

I have to go offline - probably for the rest of the day. Hopefully someone else can help. If not, post some more information about what you are trying to connect together. As I noted above, I think your rfm69 bonnet is working. The problem is that yout Flipper is not configured in a way to be able to decode packets from the bonnet or send them to th bonnet in a form the bonnet can receive. If your goal is to be able to use the Flipper to send/receive data, then I suggest you spend more time figuring out how to do that. The bonnet seems to be working OK with your pico.

#

It may not be trivial to get the Flipper configured in such a way. I don't know enough about it, but from what I have read today, I think it will be challenging. Not necessarily impossible, but it will take some time to learn and experiment with ti.

cold terrace
cold terrace
cold terrace
rocky oriole
#

I don't think it does AM -- it does FSK or OOK as far as I know and I have only used it in its default mode.

#

I am not even sure what it means for the FIipper to be using AM.

#

Good night -- I am in Time Zone -5

cold terrace
#

i have no FSK or OOK option on the flipper, only AM, FM, FM15k, pagers, HND_1

#

AM270, AM650, FM238, FM476, FM95, FM15k, Pagers, HND_1

rocky oriole
#

I may be misinterpreting the deviation setting in the CircuitPython library. Hopefully someone else with more understanding of how the deviation is specified can help.

#

For help with the Flipper, you may be better off posting to their forum.

cold terrace
#

i think for now i will just use it as "it's sendign something" and try to get the buttons working

#

it's only the display which needs pullups right?

#

should i use a 1k as a pullup?

rocky oriole
# cold terrace should i use a 1k as a pullup?

use 10K. The Pull-ups are for the I2C bus and you only need one set of pull-ups. All I2C devices will "see" them. If you have another I2C device installed that already has pull-ups, then you won't to add them. As I noted, if you switch to using a Raspberry Pi then it already has the pull-ups on it. You only need them with the Pico.

cold terrace
#

i?m thinking about using a raspi 4, but ig then i'll get 4 dasys of errors just while wiring

rocky oriole
#

What wiring? The bonnet just plugs in...

cold terrace
#

then i first need to configure wlan etc, because my disply rn uses 5V and GND

#

or can i plug it into the 5V and GND pins into the ponnet down to the pins of the pi?

rocky oriole
#

I'm confused about what you have connected. Can you post a picture and list all the things you are connecting to the Pi or the Pico?

rocky oriole
cold terrace
rocky oriole
cold terrace
cold terrace
#

the pi has 4 pins in the way, labeled PoE. i might get a 90 degree header tomorrow

cold terrace
#

Do you have an Snippet which works with the buttons, Display and subGHZ? or should i just copy all the adafruit-guides together? (does this work with the pins?)

rocky oriole
cold terrace
#

What Will happen if i use sudo? I mean *i am * root on the raspi...

rocky oriole
#

You can if you want to and you know what you are doing.... I think it just adds confusion. On RaspiOS version pre "bookworm" it will probably work ok. If you are using "bookworm" then it may be even more confusion since you have to work within a "virtual environment". Do what you are comfortable with or perhaps someone else will offer some guidance.

cold terrace
#

that's what i'm comfortable with.
i use some arch and ubuntu based distroy regulary, so raspian shouldn't be a problem

cold terrace
#

This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.

#

well

#

it won't let me install the libs.
ir can i just make a folder "libs" with the mpy file? xactly as on the pico?

#

OR do i need it in the env/lib folder instead of lib/ ?
because the env has a lib folder

rocky oriole
# cold terrace This environment is externally managed ╰─> To install Python packages system...

As I mentioned, If you are using RaspiOS Bookworm, you have to work in a "virtual environment" see the Blinka installation guide https://learn.adafruit.com/circuitpython-on-raspberrypi-linux/installing-circuitpython-on-raspberry-pi#setup-virtual-environment-3157129 you do not use a "lib" folder on a Raspberry Pi and you don't use the .mpy files,, use the .py files. There is more on virtual environments here https://learn.adafruit.com/python-virtual-environment-usage-on-raspberry-pi/overview

#

It does work well once you get used to it 😉

cold terrace
#

i'm getting used to
now i get the point in sudo
still fugirung out how to install the sutff in the virtual environment though

#

can't do npm install package😂 as easy as js is

rocky oriole
#

in the venv just do "pip install adafruit-circuitpython-rfm9x" for example

#

after installing "blinka" from the guide above.

cold terrace
#

jep, found that out too

#

but pip3 install adafruit-circuitpython-rfm9x
with a rfm96? or do i need to pip3 install adafruit-circuitpython-rfm96?

rocky oriole
#

do you mean rfm69 -- yes use rfm69 (sorry for the confusion) rfm96 is a different beast...

cold terrace
#

ah yes. meant rfm69

rocky oriole
#

the rfm96 is the 433MHz version of the LoRa board (it would use rfm9x)

cold terrace
#

i have the 433MHz version, so pip3 install adafruit-circuitpython-rfm69 would be right? my bonnet is labeled 69, not 96...

rocky oriole
#

yes -- that is correct

#

forget you ever heard of rfm96 😉 There has been very inconsistent naming of the rfm95/rfm96 boards...

cold terrace
#

okay
but i still have the "no module named board" error

rocky oriole
#

did you install "blinka" in the same virtual environment you installed adafruit-circuitpython-rfm69?

cold terrace
#

should've

rocky oriole
#

type "pip3 list" -- does it show adafruit-blinka

cold terrace
#

Adafruit-Blinka                    8.30.0
adafruit-circuitpython-busdevice   5.2.6
adafruit-circuitpython-framebuf    1.6.5
adafruit-circuitpython-requests    2.0.4
adafruit-circuitpython-rfm69       2.1.19
adafruit-circuitpython-ssd1306     2.12.16
adafruit-circuitpython-typing      1.9.6
Adafruit-PlatformDetect            3.58.0
Adafruit-PureIO                    1.1.11
adafruit-python-shell              1.8.0

this is the whole adaruit-block it has installed

#

so blinka is there

rocky oriole
#

OK -- what are you doing next... to get the "no module named board " error?

#

you should still be in the virtual environment and run your script "python3 yourscript.py"

cold terrace
#

wait
if i run it in the terminal via python3, it works fine
but if i run it via Thonny (where it's open) it throws errors

rocky oriole
#

That is between you and Thonny 😉

cold terrace
#

yep, i hate Thonny
it might feel that (;

rocky oriole
#

Thonny is probaly not using the virual environment you set up. I'm not a Thonny expert... not sure how to get it to use the venv.

cold terrace
#

i think i'll just use the terminal then
but now i understand how those venvs work. isn't all negative

rocky oriole
#

I usually just use nano 😉 -- occasionally "mu" but I am not a big fan of complcated editors. They give too much "help" 😉

cold terrace
#

and the other example works to, it states "waiting for PKT" and the buttons are working

rocky oriole
#

actualy , I dont use "mu" when working on a Pi....

#

same with Thonny -- I only ever use them for Circutython or MicroPython boards.

cold terrace
cold terrace
cold terrace
rocky oriole
cold terrace
#

now it's just the code i need to replace for the button-events and maybe i'll make a interface on the touchscreen i have.
i only know tkinter for interfaces, is there a more intuitive library? (if you might have one in mind)

#

and thank you for your patience with me. must've been hard sometimes (;
I learned a lot of new things that could come in handy. at least the py-venv and how it works

rocky oriole
rocky oriole
cold terrace
#

that explains why you're using nano ig
i'll get the buttons working as i want them too and then i'll have a look how mich time i got left and might make a UI. no problem

i also like writing backends more than frontend, just because i'm not "limited" to anything UI/UX

rocky oriole
#

Good luck and keep asking questions -- you may find more help for things like a UI in #help-with-projects

cold terrace
rocky oriole
#

Just to be clear, I don't work for Adafruit...

#

They take no responsibility for my comments 😉

cold terrace
#

but you're helping me on their server
then it will be: jerry from the adafruit discord

cold terrace
#

looks wunderful after it was dark for weeks (:

rocky oriole
#

Very nice!

cold terrace
#

yess
i'm happy now
now i have 5 weeks to get things running smooth.
am i allowed to mention you in my presentation? just course-intern

rocky oriole
#

BTW -- I don't see an antenna. Make sure you install one. It is not good for the radio not to have one installed.

cold terrace
#

I have this copper cable here. At the lenght wich i calculated somewhere

#

and now the flipper "sees" the signals, which it din't before. i can't send them, but i see clear signals

rocky oriole
#

Oh good. That should be fine.. It is also ok for the antenna to have some coating on it. I just use solid core hookup wire (22 guage)

cold terrace
#

now there are clear [whatever "Ausschläge" means in english].

cold terrace
cold terrace
# rocky oriole I'd be honored!

then i'l mention you of course
for your 5h (or probably more, i don't know how long you did search things for me) of work the least i could do

rocky oriole
#

What is the project for?

cold terrace
#

a period of time where you create a Project on your own instead of "having step by step explanation".
biggest pain is the documentation
and i choose this one, because i wanted to try something new and don't just make a webiste which i made like 20 before

cold terrace
rocky oriole
#

Sounds great! Have fun with it!