#Me vs Radio Bonnet on Pi Pico
1 messages · Page 1 of 1 (latest)
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
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.
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?
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.
perfect, thx
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
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?
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
OKTraceback (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.
You have MicroPython installed on your board, not CircuitPython.
The guide and eaxples are for CircuitPython.
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)
PROBLEM SOLVED
as mentioned in this reddit Post
https://www.reddit.com/r/circuitpython/comments/16th6gn/comment/kbhpjrk/?utm_source=reddit&utm_medium=web2x&context=3
Samsung Magician is the Problem. uninstalled it and now works fine
like what the hell?!
ah -- anything that accesses the CIRCUITPY drive is likely to cause problems. Glad to found the issue!. Good luck!
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"
On a Pico , pin names are "board.GP5" so use GPx instead of Dx
My code example uses GPx
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
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.
The Pico pin references are here https://learn.adafruit.com/getting-started-with-raspberry-pi-pico-circuitpython/pinouts
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
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.
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
take a look at the rfm69_check.py example in the guide https://learn.adafruit.com/adafruit-radio-bonnets/rfm69-raspberry-pi-setup It shows how to use the buttons and one way to use the display. this way of using the display is simpler but more limited than using “displayio”. that may also be an option depending on your needs. try the example first and ask questions if you have problems.
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.
After you get this example working, let me know if you are interested in an example using "displayio" I have it working based on this guide https://learn.adafruit.com/adafruit-oled-featherwing/circuitpython-and-python-setup but there were some changes necessary. I can go into the details if you are interested. Let me know.
i'll try your example. and if displayio makes my life easier i'm for sure interested
will ping you again
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!
makes sense. i will try your example first
will i destroy my board if i use it without the resistors?
no, but it won’t work
Only the display won't work. The radio and buttons will still be useable.
okay
ig then i'm using god ol' print statements isntead of the display till i got those resistors
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?
The bonnet will work with a Pi without the need for any additional pull-up resistors. What problems are you having? Yes, a piece of wire will work fine. See this guide https://learn.adafruit.com/adafruit-radio-bonnets/antenna-options
There is no wiring at all for the Pi!
However, the pico "should" work -- moving to a Pi may not solve the problems.
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?
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?
that's my problem right now, the bonnet won't "see" anything from the flipper.
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
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...
How are you sending it wit the Flipper? what modulation? It has to match the rfm69.
again -- to decode, you have to match the protocol. Can the Flipper do that?
You can use the Pi "headless" and just open an ssh terminal connection to it from your computer.
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.
where can i find the frm69 Modulation? flipper is sending with AM650 on 433.07 which i also set to exact this in the code
nope it' doesn't
for the pico: i connect it normal with a cable
the Model B is RN updating and i need to wire it up first (with the bonnet)
and then fight the wiring *** again
Okay.
gotta get doing this tomorrow (9:47PM here, dunno what timezone ur in)
The datasheet for the RFM69 is https://cdn-shop.adafruit.com/product-files/3076/sx1231.pdf The default mode is FSK -- not AM
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
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
Take a look at this from the Filpper forum https://forum.flipper.net/t/my-remote-isnt-supported-how-to-add-new-sub-ghz-protocol-in-flipper-zero/2033 Apparently FM includes FSK
The default deviation for the RFM69 (using the CircuitPython library) appears to be 250KHz https://github.com/adafruit/Adafruit_CircuitPython_RFM69/blob/main/adafruit_rfm69.py#L334
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.
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?
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.
i?m thinking about using a raspi 4, but ig then i'll get 4 dasys of errors just while wiring
What wiring? The bonnet just plugs in...
An a Pi 4 you may need to use the "stacking header" to clear the POE pins on the Pi. https://www.adafruit.com/product/4079
or https://www.adafruit.com/product/1992 or https://www.adafruit.com/product/1979 will also work.
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?
Are you asking about the display on the bonnet? If you plug the bonnet into the Pi 2x20 header, all the necessary pins are connected. You can use the display and the radio wiht no extra wiring.
like this #1183852234275029042 message
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?
You can "pre-configure" WLAN and ssh when you put RaspiOS on the PI's SDCard with the Raspberry Pi Imager. So - on a Pi4, you can set it up for "headless" ssh access when you create the image.
Pico: now the bonnet with the subGHZ part, no buttons or display
Pi 4b: 7" Touch Display
and i would need to rn the pi headless if i use all pins for the baord
If you use this tall header https://www.adafruit.com/product/1979 you can access the pins after they pass through the bonnet
Stack multiple plates, breakouts etc onto your Raspberry Pi Model B+ with this custom-made extra-tall and extra-long 2x20 female header. The female header part has extra spaces to make ...
Or you can get 5V and gnd from the 3 pins on the bonnet near the radio module https://learn.adafruit.com/assets/69641
the point is the 20-40.- shipping cost for a 3.- part...
that makes sense
the pi has 4 pins in the way, labeled PoE. i might get a 90 degree header tomorrow
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?)
https://learn.adafruit.com/adafruit-radio-bonnets/sending-data-using-a-lora-radio#circuitpython-transmitter-slash-receiver-example-3014169. this example from the guide uses all 3 parts. It should work as is.
You will need the same libraries from this example https://learn.adafruit.com/adafruit-radio-bonnets/rfm9x-raspberry-pi-setup#installing-circuitpython-libraries-3013548 -- you do not need to use "sudo" for the "pip install ...", in fact, you should not use sudo.
What Will happen if i use sudo? I mean *i am * root on the raspi...
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.
that's what i'm comfortable with.
i use some arch and ubuntu based distroy regulary, so raspian shouldn't be a problem
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
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
This is why I discouraged using sudo pip....https://learn.adafruit.com/python-virtual-environment-usage-on-raspberry-pi/tldr
It does work well once you get used to it 😉
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
in the venv just do "pip install adafruit-circuitpython-rfm9x" for example
after installing "blinka" from the guide above.
jep, found that out too
but pip3 install adafruit-circuitpython-rfm9x
with a rfm96? or do i need to pip3 install adafruit-circuitpython-rfm96?
do you mean rfm69 -- yes use rfm69 (sorry for the confusion) rfm96 is a different beast...
ah yes. meant rfm69
the rfm96 is the 433MHz version of the LoRa board (it would use rfm9x)
i have the 433MHz version, so pip3 install adafruit-circuitpython-rfm69 would be right? my bonnet is labeled 69, not 96...
yes -- that is correct
forget you ever heard of rfm96 😉 There has been very inconsistent naming of the rfm95/rfm96 boards...
okay
but i still have the "no module named board" error
did you install "blinka" in the same virtual environment you installed adafruit-circuitpython-rfm69?
should've
type "pip3 list" -- does it show adafruit-blinka
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
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"
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
That is between you and Thonny 😉
yep, i hate Thonny
it might feel that (;
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.
i think i'll just use the terminal then
but now i understand how those venvs work. isn't all negative
I usually just use nano 😉 -- occasionally "mu" but I am not a big fan of complcated editors. They give too much "help" 😉
and the other example works to, it states "waiting for PKT" and the buttons are working
actualy , I dont use "mu" when working on a Pi....
same with Thonny -- I only ever use them for Circutython or MicroPython boards.
i always get angry if i can't click into a certain word and have to use buttons to scroll. nano just on my server at home if nautilus hasn't root rights to edit a file or so (config files etc if Pulse or samba f's around)
i downloaded it, but only used it with the pico because i couldn't setup a remote python-env in pycharm
we use it in a IoT course, else i'm useing pycharm for python (for the rare amount of py-time i have)
Glad you are making progress.
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
I'm not much help with user interfaces...I spent 35 years writing embedded software -- no user interface! All this is now new to me as well.
You are welcome. I glad I could be of some help. It takes a lot of trial and error. I am fond of the saying "Experience is being able to recognize your mistakes when you make them again" 😁
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
Good luck and keep asking questions -- you may find more help for things like a UI in #help-with-projects
i'll remind myself of "jerry from adafruit" and venvs will be working without problems
Just to be clear, I don't work for Adafruit...
They take no responsibility for my comments 😉
but you're helping me on their server
then it will be: jerry from the adafruit discord
but your comments are working though
looks wunderful after it was dark for weeks (:
Very nice!
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
BTW -- I don't see an antenna. Make sure you install one. It is not good for the radio not to have one installed.
I'd be honored!
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
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)
now there are clear [whatever "Ausschläge" means in english].
i just sanded it off where i put it into the contact labeled "Antenna" and twistetd it around the thing where the adafruit antenna would come in for better contact.
ain't paying 20.- shipping cost for a 1.20 (or so) bucks antenna
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
What is the project for?
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
TL:DR
just for educational porpoises because i wanted to try something new
Sounds great! Have fun with it!