-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for l2ping alike functionality as Low-Level Protocol presence detection #71
Comments
Bluez l2ping utility (device does not need to be in discovery mode as long as the MAC is known) $ sudo l2ping 6C:C4:D5:6C:C5:BC Now, lets see how the command responds when the Bluetooth OFF $ sudo l2ping 6C:C4:D5:6C:C5:BC |
Hi, this might not be realizable within the current architecture without adding middle layers. Speaking from experience on implementing bluez/dbus transport, bluez does not expose l2ping interface through dbus. Therefore, to perform l2ping, you need to actually call a seduid binary that can be bound to raw bluetooth socket + handle the way l2ping gets elevated priviledges. Therefore, for practial use, I suggest to enable calling l2ping with sudoerrs and use - for example - exec binding or similar. |
Hi xrucka, thanks for the comment. I have the l2ping working through the Exec binding and it works fine. Having similar functionality available in the BT Binding would be much cleaner i guess without sudoers etc. |
Hi @janlinders, could you please elaborate what phone you are using? Also could you please let us know what is rationale not to have |
Hi Vlad, thanks for your reply.
The phones I have available are
Huawei P7-L10 Android 5.1.1 kernel 3.0.8-00595-gc29cecf
IPhone 5S ios 12.0.1
Also my television has BT onboard : [LG] webOS TV OLED55E6V
All 3 are giving response using l2ping with their respective BT MAC
addresses.
Don't know what BT versions these run. I will see if I can find this.
Discoverable on means indeed privacy issue and power usage.
I have openhab2 v 2.3 (openhabian) installed on an Raspberry PI Model 2 B+
BT USB dongle : CSR8510 A10
Bluez :● bluetooth.service - Bluetooth service
Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor
preset: enabled)
Active: active (running) since Mon 2018-11-19 20:24:26 CET; 1s ago
Docs: man:bluetoothd(8)
Main PID: 21628 (bluetoothd)
Status: "Running"
CGroup: /system.slice/bluetooth.service
└─21628 /usr/libexec/bluetooth/bluetoothd
Nov 19 20:24:26 openHABianPi bluetoothd[21628]: Bluetooth daemon 5.47
Nov 19 20:24:26 openHABianPi bluetoothd[21628]: Starting SDP server
Nov 19 20:24:27 openHABianPi bluetoothd[21628]: Bluetooth management
interface 1.14 initialized
KR, Jan
…On Mon, Nov 19, 2018 at 7:51 PM Vlad Kolotov ***@***.***> wrote:
Hi @janlinders <https://github.com/janlinders>, could you please
elaborate what phone you are using?
As far as I know, the l2ping utility is used for older BT devices (prior
BT 4.0), new devices that support BT 4.0 won't be able to respond for
l2ping. It would be great if they could. Please confirm.
Also could you please let us know what is rationale not to have
discoverable mode enabled on your phone? Is this to achieve privacy?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#71 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ArE5X0CjDtXFWYY9HYJRJXFjBUC0gVVzks5uwv2ZgaJpZM4Yo9F6>
.
|
Found I think the BT versions of the phones.
Huawei P10 BT 4.2, A2DP, LE, aptX
iPhone 5s - BT 4.0 A2DP
…On Mon, Nov 19, 2018 at 7:51 PM Vlad Kolotov ***@***.***> wrote:
Hi @janlinders <https://github.com/janlinders>, could you please
elaborate what phone you are using?
As far as I know, the l2ping utility is used for older BT devices (prior
BT 4.0), new devices that support BT 4.0 won't be able to respond for
l2ping. It would be great if they could. Please confirm.
Also could you please let us know what is rationale not to have
discoverable mode enabled on your phone? Is this to achieve privacy?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#71 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ArE5X0CjDtXFWYY9HYJRJXFjBUC0gVVzks5uwv2ZgaJpZM4Yo9F6>
.
|
Very interesting. Are you saying that even if your phones are not in discoverable mode (make sure you close BT settings and leave it for 2-3 mins), you still can ping them via |
Confirmed.
…On Mon, Nov 19, 2018 at 8:41 PM Vlad Kolotov ***@***.***> wrote:
Very interesting. Are you saying that even if your phones are not in
discoverable mode (make sure you close BT settings and leave it for 2-3
mins), you still can ping them via l2ping?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#71 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ArE5X1XJ513r9iH2YS_12DvMli6rC-Lpks5uwwlmgaJpZM4Yo9F6>
.
|
Very good, thank you. As @xrucka mentioned earlier, that would not be very easy to add support for. What is rationale not to enable/(force to be enabled) discoverable mode in your devices? Privacy/security? |
And yeah, just double checking. Do you mobile phones have fixed/static MAC address when in discoverable mode or they change it every so often? |
Thx.
I'm aware of the tools from the AppStore / PlayStore to force enable
discoverable mode
That means indeed Privacy/Security concerns if I have that on all the time.
So even when from home (anywhere else) people can see the device and it's
vulnerable for attacks.
KR
…On Mon, Nov 19, 2018 at 9:20 PM Vlad Kolotov ***@***.***> wrote:
Very good, thank you. As @xrucka <https://github.com/xrucka> mentioned
earlier, that would not be very easy to add support for.
What is rationale not to enable/(force to be enabled) discoverable mode in
your devices? Privacy/security?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#71 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ArE5X3i8ye-_1dClfVUmcXfLf3zoDJ-aks5uwxKdgaJpZM4Yo9F6>
.
|
what i noticed using bluetoothctl (after switching the devices to discover
mode and bluetoothctl scan on) is that they have fixed MAC addresses.
…On Mon, Nov 19, 2018 at 9:29 PM Vlad Kolotov ***@***.***> wrote:
And yeah, just double checking. Do you mobile phones have fixed/static MAC
address when in discoverable mode or they change it every so often?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#71 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ArE5X8t57H8lLYKcwuEhdXz-m0FVQFacks5uwxTHgaJpZM4Yo9F6>
.
|
Right, that's the thing. This is quite unusual for new phones if they have static mac addresses. I'll try to ping my devices to see if it is possible, but I doubt it is... If it is possible, then we might have a good way to track presence, although that would be quite difficult to add support for. Furthermore, looks like bluegiga adapters do not support it at all. |
Understood.
Simple to test :
#!/bin/sh
sudo /usr/bin/l2ping -c5 XX:XX:XX:XX:XX:XX >/dev/null 2>&1
if [ $? -eq 0 ]
then
echo HOME
else
echo AWAY
fi
…On Mon, Nov 19, 2018 at 9:41 PM Vlad Kolotov ***@***.***> wrote:
Right, that's the thing. This is quite unusual for new phones if they have
static mac addresses. I'll try to ping my devices to see if it is possible,
but I doubt it is... If it is possible, then we might have a good way to
track presence, although that would be quite difficult to add support for.
Furthermore, looks like bluegiga adapters do not support it at all.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#71 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ArE5X8mzhvDrYMWtNBCIdZ-daT2bTkvCks5uwxdjgaJpZM4Yo9F6>
.
|
No description provided.
The text was updated successfully, but these errors were encountered: