Go to advanced search

by Douglas6
Thu Jul 02, 2020 3:25 am
Forum: Troubleshooting
Topic: Bluetooth troubles
Replies: 13
Views: 293

Re: Bluetooth troubles

Artimis11 wrote:
Thu Jul 02, 2020 3:15 am
However, if I were to do this using the desktop icon for bluetooth, I get the issues of "No usable services on this device"
The GUI is only interested in a few classic Bluetooth profiles ; AD2P, HID, SPP. It has no knowledge of BLE. That message confuses a number of users. Ignore it.
by Douglas6
Thu Jul 02, 2020 12:50 am
Forum: Troubleshooting
Topic: Bluetooth troubles
Replies: 13
Views: 293

Re: Bluetooth troubles

You can nuse bluetoothctl or gatttool to communicate with a BLE device. You can use the Bluepy Python library, or you can modify the BlueZ Python sample oode at https://github.com/bluez/bluez/blob/mas ... att-client.
by Douglas6
Tue Jun 30, 2020 10:33 pm
Forum: Troubleshooting
Topic: Bluetooth troubles
Replies: 13
Views: 293

Re: Bluetooth troubles

Light blue is a BLE app, no? Is the ESP32 transmitting BLE or classic Bluetooth SPP? Bjg difference, in terms of reading the results. Research the difference.
by Douglas6
Fri May 29, 2020 1:45 pm
Forum: Networking and servers
Topic: BLE connection with an android
Replies: 26
Views: 3735

Re: BLE connection with an android

You will need to change the ReadValue() function for your characteristic to return the proper bytes of your text file.

I'm not sure how 'active' vs. 'sleep' mode applies here, but you're the one who has done this before, so I'm going to leave it to you.
by Douglas6
Thu May 28, 2020 3:58 pm
Forum: Networking and servers
Topic: BLE connection with an android
Replies: 26
Views: 3735

Re: BLE connection with an android

If using BLE, you'll need to break up the text file into small pieces (18 - 20 bytes) to transmit, and then assemble them on the other end.
by Douglas6
Wed May 27, 2020 6:45 pm
Forum: Troubleshooting
Topic: Raspberry bluetooth speaker org.bluez.Error.Failed
Replies: 4
Views: 253

Re: Raspberry bluetooth speaker org.bluez.Error.Failed

I kept my response brief to make it easy to understand, but perhaps you should reread it. Bluetoothctl knows nothing of the OS's sound system, so even if you could get it to connect under bluetoothctl, it wouldn't operate as a speaker. I'll repeat: stop trying to connect a Bluetooth speaker using bl...
by Douglas6
Wed May 27, 2020 10:27 am
Forum: Troubleshooting
Topic: Raspberry bluetooth speaker org.bluez.Error.Failed
Replies: 4
Views: 253

Re: Raspberry bluetooth speaker org.bluez.Error.Failed

Is the speaker paired and trusted? Don't bother trying to connect a speaker in bluetoothctl, it will serve no purpose.
by Douglas6
Mon May 18, 2020 9:15 pm
Forum: Raspberry Pi OS
Topic: Bluetooth audio straeming from 3B+ to a car radio with id3tag info?
Replies: 1
Views: 108

Re: Bluetooth audio straeming from 3B+ to a car radio with id3tag info?

Bluetooth doesn't support id3-tags but can use the AVRCP profile for transmitting similar info such as album, artist and track titles (and even album art in the newer versions). I played with it some years ago, but that was in a receiving situation rather than transmitting. I would start with some G...
by Douglas6
Sun May 17, 2020 11:11 pm
Forum: Python
Topic: Bluetooth programming
Replies: 10
Views: 10328

Re: Bluetooth programming

Blue dot is certainly not passing an integer to the data_received function. It might be a string, or byte array. So you can't compare it with an integer. Try

Code: Select all

if data == "3":
Or something like that.
by Douglas6
Fri May 15, 2020 2:30 am
Forum: Beginners
Topic: [Guide] Python BLE GATT server for the Raspberry Pi
Replies: 7
Views: 4046

Re: [Guide] Python BLE GATT server for the Raspberry Pi

The purpose of the UUID is to identify a unique service and characteristic, not a unique device.

By all means, use the same UUIDs.
by Douglas6
Fri May 15, 2020 1:58 am
Forum: Beginners
Topic: [Guide] Python BLE GATT server for the Raspberry Pi
Replies: 7
Views: 4046

Re: [Guide] Python BLE GATT server for the Raspberry Pi

First question: In both examples, in the advertisement class, you call Advertisement.__init__(self, index, "peripheral"). What's the index for? Good question. It's a BlueZ thing. You'd think there could only be one advertisement, but BlueZ requires the index. I probably could have hidden that in th...
by Douglas6
Fri May 15, 2020 12:13 am
Forum: Beginners
Topic: [Guide] Python BLE GATT server for the Raspberry Pi
Replies: 7
Views: 4046

Re: [Guide] Python BLE GATT server for the Raspberry Pi

Yeah, I should probably have added some comments. My intention was not to teach the details of BLE, however, and it's hard to decide just what level of detail is appropriate. Here's the code for a different, and slightly simpler application, that just writes out the Pi's IP address. Perhaps another ...
by Douglas6
Thu May 14, 2020 9:35 pm
Forum: Advanced users
Topic: Find Eddystone URL using HCIDump
Replies: 2
Views: 167

Re: Find Eddystone URL using HCIDump

Try using the hcidump --hex flag (in place of the -a flag) to view the packet data in hex format.

If you have a spare Pi lying around, it's quite simple to turn it into an Eddystone beacon, for testing.
by Douglas6
Thu May 07, 2020 5:13 pm
Forum: General discussion
Topic: Need help getting bt to work
Replies: 2
Views: 139

Re: Need help getting bt to work

1. What operating system are you using? What version?
2. What make/model of the Pi are you using?
3. What (if any) changes have you made to the OS.since installing it?
by Douglas6
Sat May 02, 2020 12:48 am
Forum: Troubleshooting
Topic: rpi-update always fails on a slow connection
Replies: 4
Views: 192

Re: rpi-update always fails on a slow connection

Simple. Don't do rpi-update. Multiple problems solved.
by Douglas6
Tue Apr 28, 2020 6:39 pm
Forum: Beginners
Topic: [BLE] Write Characteristic to Raspberry Pi
Replies: 5
Views: 290

Re: [BLE] Write Characteristic to Raspberry Pi

I'm afraid I know nothing about Android programming. StackOverflow has some information on resetting the cache (which saves the discovered services for each connected device). A Google search on "android ble refresh device cache" might help you.

Where do the HM-18s come into the picture?
by Douglas6
Thu Apr 23, 2020 1:02 pm
Forum: Networking and servers
Topic: Improving Bluetooth reception of a Pi
Replies: 2
Views: 211

Re: Improving Bluetooth reception of a Pi

Bluetooth radio is affected by walls, etc., and other RF sources. So being outside in the open air will probably improve reception, though there may be fewer devices to detect. A Bluetooth dongle will also probably improve reception, but you just won't get much more than 10 meters.
by Douglas6
Wed Apr 22, 2020 9:36 pm
Forum: Troubleshooting
Topic: Audio over Bluetooth on PI4 with Raspbian Lite
Replies: 6
Views: 276

Re: Audio over Bluetooth on PI4 with Raspbian Lite

I'm afraid I'm not familiar with Kodi, you might want to try their website. I generally make my Bluetooth speaker the ALSA default speaker by creating a ~/.asoundrc file (removes the need for that ungodly device name in the aplay command). There are instructions on the BlueALSA github main page. You...
by Douglas6
Wed Apr 22, 2020 8:25 pm
Forum: Troubleshooting
Topic: Audio over Bluetooth on PI4 with Raspbian Lite
Replies: 6
Views: 276

Re: Audio over Bluetooth on PI4 with Raspbian Lite

Interesting. Did you install it? I didn't think it came with Lite.

I notice that on the BlueALSA github (https://github.com/Arkq/BlueZ-alsa), there's a different syntax for the aplay command:

Code: Select all

aplay -D bluealsa:SRV=org.bluealsa,DEV=XX:XX:XX:XX:XX:XX,PROFILE=a2dp Bourree_in_E_minor.wav
by Douglas6
Wed Apr 22, 2020 4:18 pm
Forum: Troubleshooting
Topic: Audio over Bluetooth on PI4 with Raspbian Lite
Replies: 6
Views: 276

Re: Audio over Bluetooth on PI4 with Raspbian Lite

Try this:

Code: Select all

sudo apt install bluealsa
by Douglas6
Tue Apr 21, 2020 8:47 pm
Forum: Beginners
Topic: [BLE] Write Characteristic to Raspberry Pi
Replies: 5
Views: 290

Re: [BLE] Write Characteristic to Raspberry Pi

Are you running the unmodified cputemp.py code? Are you sure you're using nRF Connect to properly send a text string? I haven't run that code recently, but it was working the last time I did, and others have had success as well. If you're running Buster, you shouldn't need the - Experimental flag an...
by Douglas6
Wed Apr 15, 2020 12:53 am
Forum: Beginners
Topic: Control bluetooth device
Replies: 5
Views: 211

Re: Control bluetooth device

Ok. You have some work to do. I have no idea what the 'ma' values mean. Maybe someone else here does. Start with connecting via rfcomm and see what kind of response you get.
by Douglas6
Tue Apr 14, 2020 11:20 pm
Forum: Beginners
Topic: Control bluetooth device
Replies: 5
Views: 211

Re: Control bluetooth device

Ok, probably classic Bluetooth. But if that's all you know, it will be difficult establishing communications. I recommend you try and dig up more information on the device.
by Douglas6
Tue Apr 14, 2020 10:22 pm
Forum: Beginners
Topic: Control bluetooth device
Replies: 5
Views: 211

Re: Control bluetooth device

First determine whether the relay is classic Bluetooth or BLE. Your approach will be vastly different between the two. If classic, you'll probably use rfcomm and the serial communications protocol. There's lots of info on this forum on how to setup rfcomm. If BLE, you'll need to do some research on ...
by Douglas6
Sun Apr 12, 2020 11:47 pm
Forum: Networking and servers
Topic: BLE connection with an android
Replies: 26
Views: 3735

Re: BLE connection with an android

Cputemp.py (referenced above) acts as a BLE server. That means it responds to requests from from a client (say, nRF Connect on your phone). If the client requests a characteristic, cputemp.py will respond with the value of that characteristic. The server can also be instructed to periodically send t...

Go to advanced search