Jump to content

Since the LTT community is pretty friggin big, I was hoping somebody can give me a hand. I don't know exactly where to post this topic, but I'm just stabbing at the dark. (Mods, I give you FULL permission to move/copy this to wherever it is suitable, or where the problem can be resolved)

 

Background info:

I'm a 3rd year electronics and computer engineering student. We have a project term going on, and we've decided to create a WiFi / Bluetooth localization tracking system for a household environment. We are using the RSSI (Received Signal Strength Indication) sent by the target device over WiFi / BT. So we have several Raspberry Pi's located around the house, and a device that is with you that has a wireless connection (smartphone, tablet, smartwatch, laptop, etc) that will broadcast / send a signal...every 1/2 second. The Pi's will pick up the signal and will determine where you are located in the house via signal strength - these values will be compared to a table of values. With the limited time we have, we are using this with only a smart lights  system (Philips Hue).

 

Example: Your iPhone broadcasts a WiFi signal. Pi#1 picks up -20dBm signal. Pi#2 picks up -30dBm. Pi#3 -55dBm. Pi#4 -70dBm. Looking at a table of values, you should be in the kitchen. Send signal to Philips Hue system to turn on lights in kitchen.

 

So...you walk out of the kitchen and into your room...raspberry Pi's pick up your signal --> your location in the house. Turn off lights in kitchen, turn on bedroom lights. And so on.

 

The problem:

WiFi seems to be working okay, so we are on to BT testing stage. I was able to have my the BT on my group member's iPhone and my iPod working paired with the single testing Pi unit (we have 5 on hand but only have one configured for testing purposes). It can continuously give the signal strength.

 

It is unable to pair with Android devices that we (the project group) has on hand. That is...a Samsung Galaxy S3 and a Galaxy Nexus phone. It will refuse BT pairing.

 

Steps:

1) installed necessary bluetooth stack / files. "sudo apt-get install --no-install-recommends bluetooth"

2) Scan for available devices; the MAC address. "hcitool scan"

3) Connect to android device. "sudo rfcomm connect 0 [MAC Address] 10 >dev/null &"

4) ** Message pops up on phone asking to pair with raspberry pi. Apply. 

5)** Message appears on Pi terminal (Windows version of command prompt) saying "Can't connect RFCOMM socket: Connection Refused

6) Run "hcitool rssi [MAC adress]". Message shows "Not connected."

 

*** scenarios

a) It will say "Connected" on Apple device, and message will say connected on Pi. If type "hcitool rssi [MAC adress]", it will say something like "Connected. RSSI return value: -7." If device is at point-blank of Pi, value is 0. As I move further away, I will get a values of -5, -7, -12...all the way to -30 / -31 before I am too far away and connection is lost.

 

b ) On the Galaxy S3, it shows it is paired with the Pi on the phone itself, but the raspberry pi displays connection error message (as above).

 

c) Nexus phone does not see Pi at BT config screen. When we enter terminal code to connect to Nexus phone, message asking to pair appears on the smartphone. Click Apply. Error message prints out saying unable to connect  appears on Raspberry Pi.

 

I am thinking the protocols used on the Android devices are different, and it won't work, but Apple devices do. RFCOMM is serial to BT....I don't think the Android smartphones are HID to BT (or whatever). If any of you from the LTT community has got their Android-based devices working with the Pi over bluetoothhelp would be greatly appreciated. (I'll have to try if it works with my ASUS TF300T Android tablet later)

AMD Ryzen 9000 Rig

  • AMD R7 9800X3D + Alphacool CORE 1 w/ Performance Mount Kit + Thermal Grizzly AM5 Contact Frame
  • Gigabyte X870E Aorus Pro Ice
  • 32GB (16GB X2) G.Skill Trident Z5 Neo RGB DDR5-6400
  • Sapphire NITRO+ 6800 XT Special Edition + EKwb Full Cover Block
  • Custom Loop w/ 2x 360mm Radiators
  • WD SN850X + WD SN750 + Samsung 980
  • EVGA P2 850W + Red/White CableMod Cables
  • Lian-Li O11 Dynamic EVO XL

AMD Ryzen 5000 Rig

  • AMD R7-5800X
  • Gigabyte B550 Aorus Pro AC
  • 32GB (16GB X 2) Crucial Ballistix RGB DDR4-3600
  • Gigabyte Vision RTX 3060 Ti OC
  • EKwb D-RGB 360mm AIO
  • Intel 660p NVMe 1TB + Crucial MX500 1TB + WD Black 1TB HDD
  • EVGA P2 850W + White CableMod cables
  • Lian-Li LanCool II Mesh - White

Intel i7-8086K / Z390 Rig (Decommissioned Q2' 2025)

Intel i7-6800K / X99 Rig (Officially Decommissioned, Dead CPU returned to Intel)
Intel i5-4690K / Z97 Rig (Decommissioned)

AMD FX-8350 / 990FX Rig (Decommissioned)

AMD Phenom II X6 1090T / 890FX Rig (Decommissioned)

 

<> Electrical Engineer , B.Eng <>

<> Electronics & Computer Engineering Technologist (Diploma + Advanced Diploma) <>

<> Electronics Engineering Technician for the Canadian Department of National Defence <>

Link to comment
https://linustechtips.com/topic/62258-raspberry-pi-android-via-bluetooth/
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×