bluefruit le uart friend and qt py? Anyone tried this?

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
plasnid
 
Posts: 12
Joined: Fri Oct 16, 2020 11:36 pm

bluefruit le uart friend and qt py? Anyone tried this?

Post by plasnid »

Anyone out there in forum land tried using the Bluefruit LE UART Friend with a qt py? Any code examples and/or wiring diagrams out there? I'm building a remotely controlled xylophone with a qt py rp2040. The qt py is plugged into an AW9523 gpio expander, which has the connections to the solenoid circuits. My next step is to add bluetooth and have it listen to messages from another microcontroller. Thoughts? Links?

Cheers,

Stuart

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

Re: bluefruit le uart friend and qt py? Anyone tried this?

Post by mikeysklar »

Stuart,

The Bluefruit Friend UART should be straight forward to use with QtPy. You have UART pins available so follow these two guides:

https://learn.adafruit.com/introducing- ... art-friend

https://learn.adafruit.com/adafruit-qt-py-2040/pinouts

User avatar
plasnid
 
Posts: 12
Joined: Fri Oct 16, 2020 11:36 pm

Re: bluefruit le uart friend and qt py? Anyone tried this?

Post by plasnid »

Thanks for your reply. The wiring guide was most helpful. I am running into some issues out of the gate that have me a bit stumped. I'm currently checkout the following code example from the repo:

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

In the example we start with:

Code: Select all

from adafruit_ble import BLERadio
from adafruit_ble.advertising.standard import ProvideServicesAdvertisement
from adafruit_ble.services.nordic import UARTService

ble = BLERadio()
uart = UARTService()
advertisement = ProvideServicesAdvertisement(uart)
I'm running into a few issues here that fall outside of what I see in the guides(thus my questions here)

First of all, uart which seems to actually need to be

Code: Select all

uart = busio.UART(board.TX, board.RX, baudrate=9600)
But thats alright, easy enough. The one that I don't have an avenue towards fixing is that running

Code: Select all

ble = BLERadio()
halts immediately with the error message:

File "code.py", line 17, in <module>
File "adafruit_ble/__init__.py", line 146, in __init__
RuntimeError: No adapter available

So I find myself wondering(as I've found the class in the init), what constitutes an adapter here and how do I need to modify it to work with the qt py rp2040?

Thoughts? I am unsure how to proceed, and the guides and samples don't seem to cover this.

User avatar
tannewt
 
Posts: 3314
Joined: Thu Oct 06, 2016 8:48 pm

Re: bluefruit le uart friend and qt py? Anyone tried this?

Post by tannewt »

`adafruit_ble` is designed to run on an nrf52840 or with an ESP32 coprocessor.

The UART friend predates the adafruit_ble library. The guide for the uart friend is here: https://learn.adafruit.com/introducing- ... art-friend

User avatar
plasnid
 
Posts: 12
Joined: Fri Oct 16, 2020 11:36 pm

Re: bluefruit le uart friend and qt py? Anyone tried this?

Post by plasnid »

Aaah I see. So the limitation here is that this is going to be arduino instead of python...then I'll be using the right libraries and will have better success :)

Awesome, thanks :)

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

Return to “Adafruit CircuitPython”