Sniff/Snoop bluetooth packets using developer tools - Samsung Galaxy S9 Questions & Answers

I'm trying to sniff the bluetooth commands from a certain app so that I can replicate them on a raspberry pi. I turned on developer tools and subsequently turned on the bluetooth snooping HCI...then went back to the app in question, completed a bluetooth command (which I can confirm was sent) but I am not seeing any log info. Obviously wit the S9 i'm on Oreo if that matters.
Anyone know where to find this bluetooth log OR (my gut says) why it is not being created in the first place?

Did you ever figure this out?

On ...Android O you have to enable bluetooth, enable HCI snooping in developer settings, disable and reenable bluetooth and reboot.
After that you can get the log by going to developer settings and "take bug report" and get a full log.
The file bt_stack.conf is not changed and there is no new file on /sdcard as on other devices
Click to expand...
Click to collapse
source

Related

[Q] A2DP bluetooth autoconnect immediately disconnects?

Hi, I've got a small issue with my bluetooth a2dp device. The device is this one:
BlackBerry Remote Stereo Bluetooth Gateway. It is made by RIM, but works with any device supporting a2dp. My issue with the Galaxy Nexus is that it no longer auto connects.
My setup is in my vehicle, I keep the bluetooth receiver connected to the aux power jack and aux audio in in the center console. This way, when I start the car, the receiver powers up and tries to auto-connect to the last device. On my vibrant with Android 2.1/2.2 this worked fine. When I dabbled with CyanogenMod and some other custom roms, it stopped working but I chalked it up to some problem with the custom rom.
Now, I'm seeing the same sort of problem: if I keep the screen of my nexus on, I can see the bluetooth icon change blue, and then immediately change back to gray. To me, this indicates that the receiver succeeds in connecting but is then disconnected for some reason. The device only supports a2dp, not the handsfree profile. When I looked into the Android kernel code, I found a place where the kernel will try to connect the handsfree profile if the a2dp profile is auto-connected, but it wasn't clear if that was the actual problem or not.
Anyone else have any similar experiences?
I have the same device in my 2008 Accord coupe which is placed in the center arm console. I had an Evo 3D that would automatically connect when I would start the car and BT was already enabled on my phone. I too switched to a different ROM and would have issues auto connecting so I switched back to a different ROM. Now on my stock GN, I have to manually go into settings and click the device to connect. I see no settings about auto connecting when in range. I will have to see if the BT icon turns blue and then back to gray... haven't looked for that. If anyone has thoughts on this, I'm all ears!!
bigdawgr6 said:
I have the same device in my 2008 Accord coupe which is placed in the center arm console. I had an Evo 3D that would automatically connect when I would start the car and BT was already enabled on my phone. I too switched to a different ROM and would have issues auto connecting so I switched back to a different ROM. Now on my stock GN, I have to manually go into settings and click the device to connect. I see no settings about auto connecting when in range. I will have to see if the BT icon turns blue and then back to gray... haven't looked for that. If anyone has thoughts on this, I'm all ears!!
Click to expand...
Click to collapse
I suspect it has something to do with Android's attempts to auto connect to the headset profile when a A2DP profile is connected.
See:
# Automatically connect both A2DP and HFP/HSP profiles for incoming
# connections. Some headsets that support both profiles will only connect the
# other one automatically so the default setting of true is usually a good
# idea.
#AutoConnect=true
Click to expand...
Click to collapse
from https://github.com/android/platform_system_bluetooth/blob/master/data/audio.conf
I have seen the code where this happens and it seemed that if the headset profile failed to connect, the A2DP connection was also disconnected. Though, I can't recall what file it was.
jjohns63 said:
I suspect it has something to do with Android's attempts to auto connect to the headset profile when a A2DP profile is connected.
See:
from https://github.com/android/platform_system_bluetooth/blob/master/data/audio.conf
I have seen the code where this happens and it seemed that if the headset profile failed to connect, the A2DP connection was also disconnected. Though, I can't recall what file it was.
Click to expand...
Click to collapse
Strangely enough, the phone paired with the device twice without issue yesterday and failed once later on that same day. I'm toggling BT off and then on to get connection for now.
It seems like the phone and device are connecting without issue but I know I haven't done anything to change it. I'm on AOKP M3 and Leankernel V1.8 if that helps. When I first flashed those two, I still had connections issues, so switching to them wasn't a resolution.
I am not sure this really helps your issue but it is related. I wrote an app that will auto-connect Bluetooth devices. It is free on the market and is called A2DP Volume. The current implementation of auto-connect looks for one device connection and then connects another. I started another widget that will simply connect a Bluetooth device but I have not finished that one. A2DP Volume is free, open source, and ad free. You can find the open source project on Google Code. Just search for A2DP Volume.
I have been trying this for weeks and this app solved it!!! Thanks for making the app!
jroal said:
I am not sure this really helps your issue but it is related. I wrote an app that will auto-connect Bluetooth devices. It is free on the market and is called A2DP Volume. The current implementation of auto-connect looks for one device connection and then connects another. I started another widget that will simply connect a Bluetooth device but I have not finished that one. A2DP Volume is free, open source, and ad free. You can find the open source project on Google Code. Just search for A2DP Volume.
Click to expand...
Click to collapse
jjohns63 and bigdawgr6,
Any update on this problem? I don't have the Nexus, but I have Droid Incredible 2. I also run into the same problem when I use CyanogenMod 7.2, which is a AOSP based ROM. The connection is fine with the stock ROM. I have tried to change things in the audio.config but it does not seem to help. I think I ran into a post somewhere saying HTC stock ROM uses a propietary bluetooth stack and AOSP and CyanogenMod uses BlueZ open source stack, and that is where the problem is.
Anyway, it would be nice if you guys can share some info.
Thanks!

[BOUNTY]SMS,Callerid,internet over bluetooth

Hi Im look to get someone to figure out how to get caller id,sms, and interent over bluetooth to work on windows phone. Im willing to pay 50$ for such an app.
You can already get the phone to speak the caller ID over a Bluetooth headset. In fact, I thought it did by default? I can't find a place to turn it off.
For SMS, go into Settings -> Speech. There's an option for "Read aloud incoming text messages". If you enable this (I have it set for "Bluetooth only" but you can also set it to work for wired headsets, always, or never) then the phone will say to you "Incoming message from <name>" (or <number> if it doesn't know the name) "You can say 'read it' or 'ignore'" and the phone will then listen for your response; if you say 'read it' the phone will read you the message and then give you the option of also replying by voice.
As for Internet over Bluetooth, that could be either tethering via BT (have a PC access your phone's Internet connection over BT) or joining a BT network (enable BT networking on you PC and share the Internet connection through it, then connect your phone to that). So far, I don't know of anybody who has gotten either of those to work. The official Internet Sharing feature has some hidden options that make it look like it should support using BT, but basically nobody seems to use BT networking anyhow, so maybe that wasn't implemented.
GoodDayToDie said:
You can already get the phone to speak the caller ID over a Bluetooth headset. In fact, I thought it did by default? I can't find a place to turn it off.
For SMS, go into Settings -> Speech. There's an option for "Read aloud incoming text messages". If you enable this (I have it set for "Bluetooth only" but you can also set it to work for wired headsets, always, or never) then the phone will say to you "Incoming message from <name>" (or <number> if it doesn't know the name) "You can say 'read it' or 'ignore'" and the phone will then listen for your response; if you say 'read it' the phone will read you the message and then give you the option of also replying by voice.
As for Internet over Bluetooth, that could be either tethering via BT (have a PC access your phone's Internet connection over BT) or joining a BT network (enable BT networking on you PC and share the Internet connection through it, then connect your phone to that). So far, I don't know of anybody who has gotten either of those to work. The official Internet Sharing feature has some hidden options that make it look like it should support using BT, but basically nobody seems to use BT networking anyhow, so maybe that wasn't implemented.
Click to expand...
Click to collapse
on a side note but still related,
i think MS saw the writing on the wall for most of the BT stack along time ago, most of whats left is pretty much "it will do" cant say i really miss whats missing
i love the irony of users now trying to make WP like WM after spending a long time moaning about WM
GoodDayToDie said:
You can already get the phone to speak the caller ID over a Bluetooth headset. In fact, I thought it did by default? I can't find a place to turn it off.
For SMS, go into Settings -> Speech. There's an option for "Read aloud incoming text messages". If you enable this (I have it set for "Bluetooth only" but you can also set it to work for wired headsets, always, or never) then the phone will say to you "Incoming message from <name>" (or <number> if it doesn't know the name) "You can say 'read it' or 'ignore'" and the phone will then listen for your response; if you say 'read it' the phone will read you the message and then give you the option of also replying by voice.
As for Internet over Bluetooth, that could be either tethering via BT (have a PC access your phone's Internet connection over BT) or joining a BT network (enable BT networking on you PC and share the Internet connection through it, then connect your phone to that). So far, I don't know of anybody who has gotten either of those to work. The official Internet Sharing feature has some hidden options that make it look like it should support using BT, but basically nobody seems to use BT networking anyhow, so maybe that wasn't implemented.
Click to expand...
Click to collapse
yes i know of these but i want the caller id to be able to be sent as text over bluetooth. for example to show up on another screen saying xxxxx is calling you. Same goes for sms.
as for internet im talking about having your device provide interent to your computer or tablet via bluetooth
Not Development, so moved to General :good:
GoodDayToDie said:
You can already get the phone to speak the caller ID over a Bluetooth headset. In fact, I thought it did by default? I can't find a place to turn it off.
For SMS, go into Settings -> Speech. There's an option for "Read aloud incoming text messages". If you enable this (I have it set for "Bluetooth only" but you can also set it to work for wired headsets, always, or never) then the phone will say to you "Incoming message from <name>" (or <number> if it doesn't know the name) "You can say 'read it' or 'ignore'" and the phone will then listen for your response; if you say 'read it' the phone will read you the message and then give you the option of also replying by voice.
As for Internet over Bluetooth, that could be either tethering via BT (have a PC access your phone's Internet connection over BT) or joining a BT network (enable BT networking on you PC and share the Internet connection through it, then connect your phone to that). So far, I don't know of anybody who has gotten either of those to work. The official Internet Sharing feature has some hidden options that make it look like it should support using BT, but basically nobody seems to use BT networking anyhow, so maybe that wasn't implemented.
Click to expand...
Click to collapse
BT PAN & DUN are not supported profiles. In other words, tethering is available only through USB (if your particular device supports it) or wi-fi (same caveat).
---------- Post added at 07:27 PM ---------- Previous post was at 07:19 PM ----------
dazza9075 said:
on a side note but still related,
i think MS saw the writing on the wall for most of the BT stack along time ago, most of whats left is pretty much "it will do" cant say i really miss whats missing
i love the irony of users now trying to make WP like WM after spending a long time moaning about WM
Click to expand...
Click to collapse
That moaning you hear is because you expect progress in the realm of technology. Windows Mobile runs rings around any other OS as far as connectivity is concerned. This is how you can connect your laptop to the internet with Windows Mobile:
1. Bluetooth PAN
2. Bluetooth DUN
3. USB
4. Wi-Fi
Only the freeTether homebrew on webOS gets near that (no DUN). Here's the kicker: DUN is client-side initiated so you don't even have to unholster your phone. Sorry dude, I need a tool and not a toy. My daughter plays with the iEtch-A-Sketch.
Display of callers name is a function of the BT device not the phone. My car hands-free displays caller ID because contacts were sync'd to it from the phone.
Sent from my HD7 using Board Express
Aah, I do miss the BT PAN. Maybe the user wants to save on battery power, I know I would.
Vukile said:
Aah, I do miss the BT PAN. Maybe the user wants to save on battery power, I know I would.
Click to expand...
Click to collapse
*walks into old thread that has some relevance to him* Bluetooth PAN has more than just laptop and tablet tethering uses. Smart accessories, such as smart watches and (most likely based on what ive read) the upcoming Google Glass require such capabilities. New technologies are coming out that connect to your phone via this very feature. If your phone does not have this, youre sunk.
does anyone know if there is any way to use pan in windows phone?
There is no reason it can't be added, but I suspect it won't be added
Sent from my SGH-i937 using XDA Windows Phone 7 App
dazza9075 said:
There is no reason it can't be added, but I suspect it won't be added
Sent from my SGH-i937 using XDA Windows Phone 7 App
Click to expand...
Click to collapse
-w- im committed to windows phone, but I find it silly the things they leave out (and have removed.)
I mean, pan wouldn't be too hard to add I would think... also, there is Play music voice command and a return of the lockscreen
music controls that is needed (with an option to disable it for those who complain saying "its still running! I want them gone.")....
Microsoft seems to of not heard the saying "If its not broke don't fix it." instead they heard "If its not broke fix it before it is."
I am really looking forward to Glass but if it wont work with my phone that sucks. same with smartwatches.
Glass half empty again?
Sent from my Lumia 900 using Board Express

Tasker Bluetooth connected Profile not triggering

I have a Tasker Profile which should be activated based on a Bluetooth state - i.e. when connected to my car Bluetooth system. When creating the Profile I used a search to locate the correct Bluetooth device from the list. The problem is that this profile is not being activated when the phone is connected to the car Bluetooth system - the Tasker notification just says that there is no active profile.
I've tried adding both the Bluetooth device name and address using the Search function, and I've also left both the name and address blank to see if the Profile can be triggered by connecting to any Bluetooth device, but the Profile never gets triggered. Has anyone else had any success triggering a Bluetooth Connected Profile on their G4?
I'm running Tasker 4.7m on a rooted LG G4 TWN model (Android 5.1).
The Tasker Profile definition is below:
Profile: In Honda (17)
State: BT Connected [ Name:JVC Unit Address:00:10:601:AC:20/00:10:601:AC:20 ]
Enter: Gmail Notifications Off (14)
A1: Secure Settings [ Configuration:Gmail Notifications Disabled Package:com.intangibleobject.securesettings.plugin Name:Secure Settings Timeout (Seconds):0 ]
Exit: Gmail Notifications On (15)
A1: Secure Settings [ Configuration:Gmail Notifications Enabled Package:com.intangibleobject.securesettings.plugin Name:Secure Settings Timeout (Seconds):0 ]
I use Tasker to open Waze when connected to the Bluetooth in my car and it works no problem. The exit task to close/kill Waze doesn't seem to work for some reason.
rick09 said:
I use Tasker to open Waze when connected to the Bluetooth in my car and it works no problem. The exit task to close/kill Waze doesn't seem to work for some reason.
Click to expand...
Click to collapse
Any chance that you could paste an export of your Profile definition here so that I can compare it with mine?
Profile: Waze (2)
State: BT Connected [ Name:CAR KIT Address:00:13:04:Blah:Blah ]
Enter: Waze (3)
A1: Launch App [ App:Waze Data: Exclude From Recent Appsff Always Start New Copyff ]
Exit: Close Waze (5)
A1: [X] Kill App [ App:Waze Use Rootff ]
A2: [X] Say [ Text:KILLING WAZE Engine:Voice:default:default Stream:3 Pitch:5 Speed:5 Respect Audio Focusn Networkff Continue Task Immediatelyff ]
Is that what you're looking for?
rick09 said:
I use Tasker to open Waze when connected to the Bluetooth in my car and it works no problem. The exit task to close/kill Waze doesn't seem to work for some reason.
Click to expand...
Click to collapse
rick09 said:
Profile: Waze (2)
State: BT Connected [ Name:CAR KIT Address:00:13:04:Blah:Blah ]
Enter: Waze (3)
A1: Launch App [ App:Waze Data: Exclude From Recent Appsff Always Start New Copyff ]
Exit: Close Waze (5)
A1: [X] Kill App [ App:Waze Use Rootff ]
A2: [X] Say [ Text:KILLING WAZE Engine:Voice:default:default Stream:3 Pitch:5 Speed:5 Respect Audio Focusn Networkff Continue Task Immediatelyff ]
Is that what you're looking for?
Click to expand...
Click to collapse
Yes - thanks. It looks like you're doing it exactly the same way that I am, except for some reason mine isn't responding to the bluetooth connected event. Must be something on my phone that's interfering with it
???
itm said:
I have a Tasker Profile which should be activated based on a Bluetooth state - i.e. when connected to my car Bluetooth system.
Click to expand...
Click to collapse
Bluetooth Near works for me on my profile. I've not tried Bluetooth Connected.
Be aware that there is a lag exiting the profile though, based on the display off monitor interval. For my purposes however, the lag isn't important.
soyelmango said:
Bluetooth Near works for me on my profile. I've not tried Bluetooth Connected.
Be aware that there is a lag exiting the profile though, based on the display off monitor interval. For my purposes however, the lag isn't important.
Click to expand...
Click to collapse
Bluetooth Near doesn't trigger anything for me either, and I've tried this with a Bluetooth headset as well as the car Bluetooth. The Tasker logs don't register thing for any Bluetooth-related events it seems :0(
itm said:
Bluetooth Near doesn't trigger anything for me either, and I've tried this with a Bluetooth headset as well as the car Bluetooth. The Tasker logs don't register thing for any Bluetooth-related events it seems :0(
Click to expand...
Click to collapse
A few things to try, in no particular order...
Bluetooth hardware address is optional, try it without.
Select the Bluetooth name using the magnifying glass, to avoid typing errors.
Is the JVC unit always discoverable? (ie: broadcasting its name for tasker to see).
Are you giving the profile enough time to fire, according to either the screen on or screen off monitor values?
According to Bluetooth Connected help page, tasker only detects the act of connection or disconnection, but not the state of being connected.
Let us know how you get on... Good luck!
soyelmango said:
A few things to try, in no particular order...
Bluetooth hardware address is optional, try it without.
Select the Bluetooth name using the magnifying glass, to avoid typing errors.
Is the JVC unit always discoverable? (ie: broadcasting its name for tasker to see).
Are you giving the profile enough time to fire, according to either the screen on or screen off monitor values?
According to Bluetooth Connected help page, tasker only detects the act of connection or disconnection, but not the state of being connected.
Click to expand...
Click to collapse
Thanks for the suggestions. I did use the Search function to populate both the device name and address. I also tried specifying name only, and even leaving both blank (to test for any bluetooth device being connected, but none of these options worked.
The JVC Unit does seem to be discoverable - i.e. it always shows up when I scan for bluetooth devices. This problem isn't limited to the one unit however - I also can't get the profile to activate with the Parrot unit in my wife's car, or with a Sony MW600 headphone adapter.
Re. giving the profile enough time to fire - could you please elaborate on where I need to specify the appropriate values for this? (or do you mean am I waiting long enough? - in which case the answer is yes, I've waited 30 minutes after watching the unit connect to the JVC unit in the car!)
I just tried a different test. I created a simple profile with a single context of "BT Status on". I then turned off Bluetooth on the phone, turned it back on, and waited a few minutes. My new profile never activated. It seems that Tasker is completely blind to changes of Bluetooth state on my phone
???
itm said:
Re. giving the profile enough time to fire - could you please elaborate on where I need to specify the appropriate values for this? (or do you mean am I waiting long enough? - in which case the answer is yes, I've waited 30 minutes after watching the unit connect to the JVC unit in the car!)
Click to expand...
Click to collapse
You're definitely waiting long enough! See tasker preferences > monitor > display on monitoring, and display off monitoring. Tasker's help file explains how the values work.
itm said:
I just tried a different test. I created a simple profile with a single context of "BT Status on". I then turned off Bluetooth on the phone, turned it back on, and waited a few minutes. My new profile never activated. It seems that Tasker is completely blind to changes of Bluetooth state on my phone
???
Click to expand...
Click to collapse
Other things to try:
Watch out for battery savers, task killers, memory cleaners, background service freezers, phone boosters unwittingly killing Tasker.
Way back, when I used Titanium Backup to restore my apps, it did Secure Settings first then Tasker… didn't work! Long shot: Reinstall Tasker, then Secure Settings.
What a mystery!
itm said:
I have a Tasker Profile which should be activated based on a Bluetooth state - i.e. when connected to my car Bluetooth system. When creating the Profile I used a search to locate the correct Bluetooth device from the list. The problem is that this profile is not being activated when the phone is connected to the car Bluetooth system - the Tasker notification just says that there is no active profile.
Click to expand...
Click to collapse
you mentioned the tasker notification, but do you have "Run in Foreground" checked within the preferences? if you do not, then most likely the bluetooth trigger will not work.
I did have both Clean Master and Greenify installed, but have now uninstalled both of them and I still get the same problem. At this point I'm monitoring only for "BT Status On", but Tasker is not triggering my profile when I turn on Bluetooth (and wait for a few minutes).
I do also have the "Run in foreground" option set.
itm said:
I did have both Clean Master and Greenify installed, but have now uninstalled both of them and I still get the same problem. At this point I'm monitoring only for "BT Status On", but Tasker is not triggering my profile when I turn on Bluetooth (and wait for a few minutes).
I do also have the "Run in foreground" option set.
Click to expand...
Click to collapse
Did you ever figure out what the problem is? I'm seeing the same behavior. I can't get my Profile to activate when I connect my bluetooth headset.
I tried forgetting my bluetooth and re-adding it, no luck.
I'm currently on Marshmallow 6.0.1 on a Nexus 6 and Tasker v4.8
It turns out that the version Tasker that I purchased from the Amazon app store was not legitimate. I got a refund from Amazon, repurchased it from the Play Store, and now I don't have the problem
itm said:
It turns out that the version Tasker that I purchased from the Amazon app store was not legitimate. I got a refund from Amazon, repurchased it from the Play Store, and now I don't have the problem
Click to expand...
Click to collapse
Thank you very much. I downloaded a "mod" version and it didn't work until I downloaded from Play Store

Force bluetooth "phone audio" from nexus 7?

Nexus 7 2013 WiFi
Stock 6.0.1 rooted with Timur's Kernel v4
For some reason when I BT connect my tablet to ANY pioneer head unit (tried 3 so far) I don't get the check box in bluetooth options for "phone audio" . I am using the Verizon messages+ app to make calls and receive texts over wifi Hotspot from my phone. This works amazingly but for some reason I can't get it to route through to the pioneer bluetooth connection. I tried a set of bluetooth headphones and the phone audio checkbox is there and it works flawlessly.
I did some Google searching and searched this sub but don't see anything relating to this problem.
edit: see below for update
Is there a way to force a bluetooth profile to use "phone audio"? Is there a Config file anywhere I can manually edit?
I've tried Bluetooth Auto Connect and choosing the phone audio option for the head unit but it did not change anything.
I assume your nexus is lte ?
deadgiveaway said:
I assume your nexus is lte ?
Click to expand...
Click to collapse
Sorry should have put that info in the initial post. No, it is the WiFi model.
I would be wifi tethering my phone to get network connectivity. This is a Nexus 7 carputer type build.
Bit of an update though:
Per a website that I cant post a link to until i make 10 posts.... It looks like the nexus 7 2013 lacks the HFP (Hands Free Profile) by default. Now I'm not entirely sure why the bluetooth headset works if this profile is not present other than its possible the headset uses the HSP (Head Set Profile) but I can't seem to find any documentation on if the N7 actually has the HSP.
Through extensive googling, I ended up at posts talking about Bluez bluetooth stack implementation. This is a bit over my head though and cant really find any solid documentation on implementing it on Stock 6.0.1
I also ended up getting directed to the source.android page that mentions at the bottom:
Custom Bluetooth profiles - If you want to add Bluetooth profiles that do not have HAL interfaces provided by Android, you must supply an SDK add-on download to make the profile available to app developers, make the APIs available in the Bluetooth system process app (packages/apps/Bluetooth), and add them to the default stack (system/bt).
Click to expand...
Click to collapse
But like I said, this is over my head.
Anyone with any sort of experience give me some insight?

KLD6 - enable Mock Locations?

Hi, first I'd like to note I've searched all over for information about enabling Mock Locations on these Chinese head-units (mine is a MTCB-KLD6-V2.81) and so far I've drawn a complete blank. One thread about using password 7890 to turn on Developer Options turned out to be for a different unit, unfortunately.
For some reason Developer Options is disabled on my 4.4.4 device and no amount of tapping on the build number (or any of the 'About tablet' values) gives me this option. I've also tried turning root on with the password *#hct#root#, which shows me the Superuser option.
Although the GPS is ok on this device with the antenna mounted up in the A-pillar it still only updates at 1Hz. If I can enable Mock Locations I can use the app 'Bluetooth GPS' to connect my Garmin Glo which gives me very high accuracy ~10Hz.
I'd love to be able to crack this one.
Thanks.

Categories

Resources