Feature request: Detect Bluetooth from Phones without pair

Posted on
Wed May 04, 2016 1:54 pm
Asconasny offline
Posts: 161
Joined: Jan 16, 2015

Re: Feature request: Detect Bluetooth from Phones without pa

http://www.mywalli.com
-Would this work with piBeacon?

Pricey but handy.

Asconasny

Posted on
Wed May 04, 2016 2:00 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Feature request: Detect Bluetooth from Phones without pa

depends if it sends out anything remotely equivalent to iBeacon. e.g. TILE, pebbleBee are not iBeacon compliant, but piBeacon recognizes them and many others that drive by in a car or walk by

1. buy one and test
2. send email and ask if it sends iBeacon signals, or what is the package structure

Karl

Posted on
Wed May 04, 2016 2:37 pm
Hackencrash offline
User avatar
Posts: 246
Joined: Dec 16, 2015
Location: UK

Re: Feature request: Detect Bluetooth from Phones without pa

Hi Karl,

In piBeacon v1.17.26 I'm getting frequent events like this in the /var/log/BLEconnect.log:
Code: Select all
requested a restart of BLE stack due to no signal for 300 seconds

One BLEconnect device (iPhone) that should be up is currently showing down that matches the above log file.

I've selected from the Indigo menu: Plugins > piBeacon > Send Config... > Selected the rPi server (always forget this) and clicked on send Config and py and RESTART.

The rPi does not restart, however, it does output this to the console:
Code: Select all
starting logfile rotation due to  limited disk space
error: cannot stat -: No such file or directory

df shows my root (/) partition to be 78% used which is OK, so the above output was confusing, perhaps something like starting log file rotation to reduce disk space consumption (or something)

A manual reboot of the rPi in question appears to have fixed this and my BLEconnect device (iPhone) is correctly showing up again.

This may now be fixed from now until eternity, although running the send Config and py and RESTART command, whilst not showing the error following the manual reboot, does not reboot.

I clicked on RESTART and that doesn't work either. This is not the first time I've seen this issue though so I don't think it's been introduced in this version.

Thanks for the removal of the sudo's and for the Indigo Utilities tip - so far no cross contamination of status' between BLE devices :)

piBeacon is the best plugin!

Posted on
Wed May 04, 2016 2:50 pm
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Feature request: Detect Bluetooth from Phones without pa

Swancoat wrote:
howartp wrote:
Swancoat wrote:
I've put beacons in both of our vehicles, and if I can find a beacon that fits in my walls, everything will be perfect.


haha, I never realized when I initially posted this but there through some combination of typo/autocorrect I typed 'fits in my walls' but meant to type 'fits in my WALLET'.

Actually, your typo said "Walled" which I corrected in my quote to "walls" as that's what I thought you meant :-p

Posted on
Wed May 04, 2016 2:50 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Feature request: Detect Bluetooth from Phones without pa

There is a check on available disk space. If > 60% used it will start a logfile rotate (logrotate - f /etc/logrotate.d/rsyslog)
This my first attempt to add logfile size management
With ssd you should have a lot of disk space free as the number of writes is limited. And if there is only a little left they get written too often. So if you have an 8gssd 4 g should be unused.
Now if you have the logging on full throttle it could fill that up quickly. That's why I have the check every 30 minutes if used>60% then logfile rotate.

As for the request restart. If bleconnect does not get any signals for some time it sends a request to beaconloop to restart the ble stack ( only one task should manage the stack )
I added this because I thought that if it is stuck a ble stack restart could fix it. I could add an option to enable/ disable

Don't understand why it's not rebooting. Mine does.
Could you turn plugin logging on (1) ; do a send restart ; copy the command (expect..)
Add a -d after expect and execute in a terminal window.
And post / send result. ( remove uid/ passdwd )



Sent from my iPhone using Tapatalk

Posted on
Wed May 04, 2016 2:52 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Feature request: Detect Bluetooth from Phones without pa

I hate spellcheckers


Sent from my iPhone using Tapatalk

Posted on
Wed May 04, 2016 3:09 pm
Hackencrash offline
User avatar
Posts: 246
Joined: Dec 16, 2015
Location: UK

Re: Feature request: Detect Bluetooth from Phones without pa

/usr/bin/expect -d ’/Library/Application Support/Perceptive Automation/Indigo 6/Plugins/piBeacon.indigoPlugin/Contents/Server Plugin/reboot.exp' pi raspberry 192.168.1.121 spawn ssh pi@192.168.1.121 pi@192.168.1.121's password: ********
expect version 5.45
argv[0] = /usr/bin/expect argv[1] = -d argv[2] = ’/Library/Application argv[3] = Support/Perceptive argv[4] = Automation/Indigo argv[5] = 6/Plugins/piBeacon.indigoPlugin/Contents/Server argv[6] = Plugin/reboot.exp pi raspberry 192.168.1.121 spawn ssh pi@192.168.1.121 pi@192.168.1.121s argv[7] = password: argv[8] = ********
set argc 6
set argv0 "’/Library/Application"
set argv "Support/Perceptive Automation/Indigo 6/Plugins/piBeacon.indigoPlugin/Contents/Server {Plugin/reboot.exp pi raspberry 192.168.1.121 spawn ssh pi@192.168.1.121 pi@192.168.1.121s} password: ********"
executing commands from command file ’/Library/Application
couldn't read file "’/Library/Application": no such file or directory

Posted on
Wed May 04, 2016 3:13 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Feature request: Detect Bluetooth from Phones without pa

the first ' is a curly ' (expect -d ’/Libr)
don't use text edit. it messes this things up, use text wrangler to edit the string
this should work:
Code: Select all
/usr/bin/expect -d '/Library/Application Support/Perceptive Automation/Indigo 6/Plugins/piBeacon.indigoPlugin/Contents/Server Plugin/reboot.exp' pi raspberry 192.168.1.121

Posted on
Wed May 04, 2016 3:33 pm
Hackencrash offline
User avatar
Posts: 246
Joined: Dec 16, 2015
Location: UK

Re: Feature request: Detect Bluetooth from Phones without pa

OK, the flat single quote was how it appears in the Indigo log window with debug set to 1. The paste below now uses the curly single quote and I also tried the tick single for good measure and both produced just the output below - that's it!

/usr/bin/expect -d ’/Library/Application Support/Perceptive Automation/Indigo 6/Plugins/piBeacon.indigoPlugin/Contents/Server Plugin/reboot.exp’ pi raspberry 192.168.1.121 spawn ssh pi@192.168.1.121 pi@192.168.1.121's password: ******
>
>

Posted on
Wed May 04, 2016 4:38 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Feature request: Detect Bluetooth from Phones without pa

the curly WILL NOT WORK in any way !! It will wait for some more input
are you sure you did the cut and paste correctly?

my plugin produces::
Code: Select all
/usr/bin/expect '/Library/Application Support/Perceptive Automation/Indigo 6/Plugins/piBeacon.indigoPlugin/Contents/Server Plugin/reboot.exp'  xx xx 192.168.1.20


and it produces:
Code: Select all
/usr/bin/expect '/Library/Application Support/Perceptive Automation/Indigo 6/Plugins/piBeacon.indigoPlugin/Contents/Server Plugin/reboot.exp'  xx xx 192.168.1.20
spawn ssh pi@192.168.1.20
pi@192.168.1.20's password:

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Wed May  4 17:22:04 2016
sudo rm /home/pi/installLibs.done
sudo reboot
pi@raspberrypi:~ $ sudo rm /home/pi/installLibs.done
pi@raspberrypi:~ $ sudo reboot
Connection to 192.168.1.20 closed by remote host.
Connection to 192.168.1.20 closed.
expect: spawn id exp7 not open
    while executing
"expect eof"
    (file "/Library/Application Support/Perceptive Automation/Indigo 6/Plugins/piBeacon.indigoPlugin/Contents/Server Plugin/reboot.exp" line 21)

and it works fine.
may be the time-out is too short.. but is is 15 seconds.. that should be plenty..

Karl

I will fix the last lines, just optics waits for a string, but the connection already closed as the rPi rebooted and it recognizes that it worked

Posted on
Fri May 06, 2016 11:20 am
Hackencrash offline
User avatar
Posts: 246
Joined: Dec 16, 2015
Location: UK

Re: Feature request: Detect Bluetooth from Phones without pa

v1.17.28 appears very stable.

The reboot issues I had are now fixed :)

I like the ingenious idea of doing another detect when up to eliminate false positives in parallel mode. This appears to work well, even under the most aggressive settings :)

Excellent work Karl 8)

Posted on
Fri May 06, 2016 4:11 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Feature request: Detect Bluetooth from Phones without pa

I would like to declare this part done and work on the sensors-

- more dynamic setup
- create "dimmers", "relays", "temp sensors" etc in the proper indigo way so that the indigo defaults work like switch on, dim, sensor displays
- add more on the detection side i.e. ultrasound distance detectors , energy counters (WattH...)

and thanks for your help designing this.


Karl

ps I got a new ibeacon from social retail that fits into my wallet.
thinnest I have found so far.

Posted on
Sat May 07, 2016 12:33 pm
Hackencrash offline
User avatar
Posts: 246
Joined: Dec 16, 2015
Location: UK

Re: Feature request: Detect Bluetooth from Phones without pa

Hi Karl, great work with this - I'm very very happy with it :)

Just one last thing that would make this really useful, and that would be the ability to instantaneously bluetooth ping phones based on an event, such as a door sensor or movement sensor, so that you could determine at that instance who's going out the house or who's gone into a room or simply who is where exactly at the moment the event is triggered, using the triangulation of more than one piBeacon rPi's (or just reading the PL_1_Distance parameter of the BLEconnect device in Indigo with only one rPi)

Performing this based on an event would provide far richer location information whilst being able to set the "try to reach phone when UP again" BLEconnect device parameter to several minutes and hence not draining our precious smartphone batteries whilst at home 8)

piBeacon is the best bit of software I've ever come across for home automation.

Posted on
Sat May 07, 2016 12:50 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Feature request: Detect Bluetooth from Phones without pa

You are not giving up?
This requires some more communication work to the rpi.

Let me think about it.


Sent from my iPhone using Tapatalk

Posted on
Sat May 07, 2016 1:09 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Feature request: Detect Bluetooth from Phones without pa

You are not giving up?
This requires some more communication work to the rpi.

Let me think about it.


Sent from my iPhone using Tapatalk

Who is online

Users browsing this forum: No registered users and 15 guests