piBeacon: presence monitoring plugin discussions

Posted on
Sat Jun 17, 2017 2:00 pm
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

piBeacon: presence monitoring plugin discussions

Ok that's it:
Do not change types of devices.

The plugin internal dict still thinks it is a beacon although now it is a BLE device. They do not have the note state.


... I likely can not fix this easily... need to catch when aa device type is changed and then recreate the internal data structures.. if you could just delete THAT one and recreate it.


Sent from my iPhone using Tapatalk

Posted on
Sat Jun 17, 2017 2:41 pm
johnpolasek offline
Posts: 911
Joined: Aug 05, 2011
Location: Aggieland, Texas

Re: piBeacon: presence monitoring plugin discussions

Thanks... I was still in the old original mindset when you originally said never to create beacons myself because the plugin had to set up a bunch of auxiliary stuff. Its not tied to anything yer so I'll just delete it and make a new one.

Posted on
Sat Jun 17, 2017 3:05 pm
siclark offline
Posts: 1961
Joined: Jun 13, 2017
Location: UK

Re: piBeacon: presence monitoring plugin discussions

kw123 wrote:
is there a line with http ... in the debug log?


This is on the Pi
20170617-21:45:43 msg: ['/usr/bin/curl', '-u', u'Simon:xxxxxx', '--digest', '-X', 'PUT', '-d', 'value={"pi":"0","sensors":{"BLEconnect":{"1428643960":{"BC:54:36:1E:68:B2":{"txPower":-999,"signal":-999}}}},"program":"BLEconnect","ipAddress":"192.168.0.23","ts":"1497732343=BST"}', u'http://192.168.0.138:8176/variables/pi_IN_0']

20170617-21:46:59 timeout -s SIGINT 10s hcitool cc A4:67:06:36:7C:92; hcitool rssi A4:67:06:36:7C:92; hcitool tpl A4:67:06:36:7C:92
20170617-21:46:59 A4:67:06:36:7C:92 1. try ret: --- err>>Can't create connection: Connection timed out
Read RSSI failed: Input/output error
HCI read transmit power level request failed: Input/output error<<
20170617-21:46:59 timeout -s SIGINT 10s hcitool cc BC:54:36:1E:68:B2; hcitool rssi BC:54:36:1E:68:B2; hcitool tpl BC:54:36:1E:68:B2
20170617-21:46:59 BC:54:36:1E:68:B2 1. try ret: --- err>>Read RSSI failed: Input/output error
HCI read transmit power level request failed: Input/output error<<
20170617-21:47:06 timeout -s SIGINT 10s hcitool cc A4:67:06:36:7C:92; hcitool rssi A4:67:06:36:7C:92; hcitool tpl A4:67:06:36:7C:92
20170617-21:47:06 A4:67:06:36:7C:92 1. try ret: RSSI return value: -26
Current transmit power level: 12 --- err>><<
20170617-21:47:06 msg: ['/usr/bin/curl', '-u', u'Simon:xxxxxx', '--digest', '-X', 'PUT', '-d', 'value={"pi":"0","sensors":{"BLEconnect":{"1871373428":{"A4:67:06:36:7C:92":{"txPower":12,"signal":-26}}}},"program":"BLEconnect","ipAddress":"192.168.0.23","ts":"1497732426=BST"}', u'http://192.168.0.138:8176/variables/pi_IN_0']

20170617-21:48:28 timeout -s SIGINT 10s hcitool cc A4:67:06:36:7C:92; hcitool rssi A4:67:06:36:7C:92; hcitool tpl A4:67:06:36:7C:92
20170617-21:48:28 A4:67:06:36:7C:92 1. try ret: RSSI return value: -27
Current transmit power level: 12 --- err>><<
20170617-21:48:28 msg: ['/usr/bin/curl', '-u', u'Simon:xxxxxx', '--digest', '-X', 'PUT', '-d', 'value={"pi":"0","sensors":{"BLEconnect":{"1871373428":{"A4:67:06:36:7C:92":{"txPower":12,"signal":-27}}}},"program":"BLEconnect","ipAddress":"192.168.0.23","ts":"1497732508=BST"}', u'http://192.168.0.138:8176/variables/pi_IN_0']

20170617-21:48:33 timeout -s SIGINT 10s hcitool cc BC:54:36:1E:68:B2; hcitool rssi BC:54:36:1E:68:B2; hcitool tpl BC:54:36:1E:68:B2
20170617-21:48:33 BC:54:36:1E:68:B2 1. try ret: --- err>>Can't create connection: Input/output error
Not connected.

From what I can see above it looks to be not seeing my iPhone, theBC:54:36:1E:68:B2 address, which is correct as bluetooth has been off for 30 minutes, but the device still shows as up.

This is on debug log when I turn on the phone bluetooth

17 Jun 2017 22:01:50
WebServer request to set variable "pi_IN_Alive" value to "{"program":"master","i2c":[],"ipAddress":"192.168.0.23","pi":"0","ts":"1497733310=BST"}" from 192.168.0.23
WebServer request to set variable "pi_IN_0" value to "{"pi":"0","sensors":{"BLEconnect":{"1428643960":{"BC:54:36:1E:68:B2":{"txPower":12,"signal":-22}}}},"program":"BLEconnect","ipAddress":"192.168.0.23","ts":"1497733320=BST"}" from 192.168.0.23
piBeacon bleconenct data: {u'1428643960': {u'BC:54:36:1E:68:B2': {u'txPower': 12, u'signal': -22}}}
piBeacon BLEconnect 0 mac BC:54:36:1E:68:B2 -22.0 12.0
piBeacon dev Simon Iphone BLE
piBeacon rssi txP dist -22.0 12.0 50.1 -22.0
WebServer request to set variable "pi_IN_Alive" value to "{"program":"master","i2c":[],"ipAddress":"192.168.0.23","pi":"0","ts":"1497733326=BST"}" from 192.168.0.23

Posted on
Sat Jun 17, 2017 4:41 pm
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: presence monitoring plugin discussions

Code: Select all
21:45:43  ":{"1428643960":{"BC:54:36:1E:68:B2":{"txPower":-999,"signal":-999}}}}
: means it sends a down signal
Code: Select all
22:01:50 piBeacon bleconenct data: {u'1428643960': {u'BC:54:36:1E:68:B2': {u'txPower': 12, u'signal': -22}}}
means it receives a UP signal

I need to see a down signal on the RPI and then the corresponding down signal in the plugin log (same event) and then need to see whats happening with the down signal

after the plugin receives a down signal (=-999) it will wait for "expiration time" to elapse and then will change the status of the BLEconnect device to down..
-- at least thats the theory ..

Posted on
Sun Jun 18, 2017 3:21 am
roquej offline
User avatar
Posts: 609
Joined: Jan 04, 2015
Location: South Florida, USA

Re: piBeacon: presence monitoring plugin discussions

Karl,

Adding hard reboot and hard shut down to actions will be very helpful. Especially to address issues like the one happening now with the rPI and I am traveling.

JP

Posted on
Sun Jun 18, 2017 6:27 am
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

piBeacon: presence monitoring plugin discussions

You could do this already now using "send any unix command" action.
Use
"sync;sync;sleep 2;sudo reboot-f"
As command


Sent from my iPhone using Tapatalk

Posted on
Sun Jun 18, 2017 3:09 pm
siclark offline
Posts: 1961
Joined: Jun 13, 2017
Location: UK

Re: piBeacon: presence monitoring plugin discussions

kw123 wrote:
Code: Select all
21:45:43  ":{"1428643960":{"BC:54:36:1E:68:B2":{"txPower":-999,"signal":-999}}}}
: means it sends a down signal
Code: Select all
22:01:50 piBeacon bleconenct data: {u'1428643960': {u'BC:54:36:1E:68:B2': {u'txPower': 12, u'signal': -22}}}
means it receives a UP signal

I need to see a down signal on the RPI and then the corresponding down signal in the plugin log (same event) and then need to see whats happening with the down signal

after the plugin receives a down signal (=-999) it will wait for "expiration time" to elapse and then will change the status of the BLEconnect device to down..
-- at least thats the theory ..


18 Jun 2017 21:58:03
WebServer request to set variable "pi_IN_Alive" value to "{"program":"master","i2c":[],"ipAddress":"192.168.0.23","pi":"0","ts":"1497819483=BST"}" from 192.168.0.23
WebServer request to set variable "pi_IN_0" value to "{"pi":"0","sensors":{"BLEconnect":{"1428643960":{"BC:54:36:1E:68:B2":{"txPower":-999,"signal":-999}}}},"program":"BLEconnect","ipAddress":"192.168.0.23","ts":"1497819484=BST"}" from 192.168.0.23
piBeacon bleconenct data: {u'1428643960': {u'BC:54:36:1E:68:B2': {u'txPower': -999, u'signal': -999}}}
piBeacon BLEconnect 0 mac BC:54:36:1E:68:B2 -999.0 -999.0
piBeacon dev Simon Iphone BLE
WebServer request to set variable "pi_IN_0" value to "{"pi":"0","sensors":{"BLEconnect":{"1871373428":{"A4:67:06:36:7C:92":{"txPower":12,"signal":-25}}}},"program":"BLEconnect","ipAddress":"192.168.0.23","ts":"1497819485=BST"}" from 192.168.0.23
piBeacon bleconenct data: {u'1871373428': {u'A4:67:06:36:7C:92': {u'txPower': 12, u'signal': -25}}}
piBeacon BLEconnect 0 mac A4:67:06:36:7C:92 -25.0 12.0
piBeacon dev Kitchen iPad BLE
piBeacon rssi txP dist -25.0 12.0 70.8 -25.0


18 Jun 2017 22:05:16
WebServer request to set variable "pi_IN_0" value to "{"pi":"0","sensors":{"BLEconnect":{"1871373428":{"A4:67:06:36:7C:92":{"txPower":-999,"signal":-999}}}},"program":"BLEconnect","ipAddress":"192.168.0.23","ts":"1497819915=BST"}" from 192.168.0.23
piBeacon bleconenct data: {u'1871373428': {u'A4:67:06:36:7C:92': {u'txPower': -999, u'signal': -999}}}
piBeacon BLEconnect 0 mac A4:67:06:36:7C:92 -999.0 -999.0
piBeacon dev Kitchen iPad BLE
WebServer request to set variable "pi_IN_Alive" value to "{"program":"master","i2c":[],"ipAddress":"192.168.0.23","pi":"0","ts":"1497819916=BST"}" from 192.168.0.23
WebServer request to set variable "pi_IN_0" value to "{"pi":"0","sensors":{"BLEconnect":{"1428643960":{"BC:54:36:1E:68:B2":{"txPower":-999,"signal":-999}}}},"program":"BLEconnect","ipAddress":"192.168.0.23","ts":"1497819921=BST"}" from 192.168.0.23
piBeacon bleconenct data: {u'1428643960': {u'BC:54:36:1E:68:B2': {u'txPower': -999, u'signal': -999}}}
piBeacon BLEconnect 0 mac BC:54:36:1E:68:B2 -999.0 -999.0
piBeacon dev Simon Iphone BLE

Not sure where I see the timeout duration, but still showing as up despite 7 mins between above messages and no bluetooth on phone.

Posted on
Sun Jun 18, 2017 4:08 pm
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: presence monitoring plugin discussions

ok i need to do a deeper dive.. RPI works fine, plugin gets the down messages..

could you set "Transition from Up to Down to Expired" in device edit to 10 secs .
then switch iPhone BLE on wait 20 secs, off and check if it goes down

Karl

Posted on
Sun Jun 18, 2017 11:16 pm
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: presence monitoring plugin discussions

siclark , could you try this version and switch on BLE debug in config then turn BLE on/off/on on your iPhone - wait 2 minutes in between ( or > expiration time)

https://www.dropbox.com/s/p1cgw1nh3huapxp/piBeacon-v-7-61-109.zip?dl=0

then post the log file.

this version has just some are debug statements .

Karl

Posted on
Mon Jun 19, 2017 3:51 pm
siclark offline
Posts: 1961
Joined: Jun 13, 2017
Location: UK

Re: piBeacon: presence monitoring plugin discussions

Bluetooth turned on
19 Jun 2017 22:41:42
WebServer request to set variable "pi_IN_Alive" value to "{"program":"master","i2c":[],"ipAddress":"192.168.0.23","pi":"0","ts":"1497908501=BST"}" from 192.168.0.23
WebServer request to set variable "pi_IN_0" value to "{"pi":"0","sensors":{"BLEconnect":{"1428643960":{"BC:54:36:1E:68:B2":{"txPower":12,"signal":-6}}}},"program":"BLEconnect","ipAddress":"192.168.0.23","ts":"1497908511=BST"}" from 192.168.0.23

Blluetooth turned off
19 Jun 2017 22:44:04
WebServer request to set variable "pi_IN_Alive" value to "{"program":"master","i2c":[],"ipAddress":"192.168.0.23","pi":"0","ts":"1497908706=BST"}" from 192.168.0.23
WebServer request to set variable "pi_IN_0" value to "{"pi":"0","sensors":{"BLEconnect":{"1428643960":{"BC:54:36:1E:68:B2":{"txPower":-999,"signal":-999}}}},"program":"BLEconnect","ipAddress":"192.168.0.23","ts":"1497908707=BST"}" from 192.168.0.23
piBeacon BLEconnect data: {u'1428643960': {u'BC:54:36:1E:68:B2': {u'txPower': -999, u'signal': -999}}}
piBeacon BLEconnect PI= 0; mac BC:54:36:1E:68:B2 -999.0 -999.0

Bluetooth turned back on
19 Jun 2017 22:47:25
WebServer request to set variable "pi_IN_Alive" value to "{"program":"master","i2c":[],"ipAddress":"192.168.0.23","pi":"0","ts":"1497908845=BST"}" from 192.168.0.23
WebServer request to set variable "pi_IN_0" value to "{"msgs":[],"ts":"1497908847=BST","secsCol":"60","mac":"B8:27:EB:32:D2:3B","program":"beaconloop","pi":"0","ipAddress":"192.168.0.23"}" from 192.168.0.23
WebServer request to set variable "pi_IN_0" value to "{"pi":"0","sensors":{"BLEconnect":{"1871373428":{"A4:67:06:36:7C:92":{"txPower":-999,"signal":-999}}}},"program":"BLEconnect","ipAddress":"192.168.0.23","ts":"1497908847=BST"}" from 192.168.0.23
piBeacon BLEconnect data: {u'1871373428': {u'A4:67:06:36:7C:92': {u'txPower': -999, u'signal': -999}}}
piBeacon BLEconnect PI= 0; mac A4:67:06:36:7C:92 -999.0 -999.0
WebServer request to set variable "pi_IN_0" value to "{"pi":"0","sensors":{"BLEconnect":{"1428643960":{"BC:54:36:1E:68:B2":{"txPower":12,"signal":-3}}}},"program":"BLEconnect","ipAddress":"192.168.0.23","ts":"1497908860=BST"}" from 192.168.0.23
piBeacon BLEconnect data: {u'1428643960': {u'BC:54:36:1E:68:B2': {u'txPower': 12, u'signal': -3}}}
piBeacon BLEconnect PI= 0; mac BC:54:36:1E:68:B2 -3.0 12.0
piBeacon rssi txP dist distCorrected-3.0 12.0 5.6 -3.0

No change to the status of the BLE device when bluetooth off. Time for status goes from up to down to expired is 20 seconds.

Have I caught all the right lines?

Posted on
Mon Jun 19, 2017 6:10 pm
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: presence monitoring plugin discussions

could we do a quick online session (w teamviewer?). I should be able to figure this out quickly .. ? if you like send me your id/passwd in indigo email

Karl

Posted on
Tue Jun 20, 2017 9:21 am
roquej offline
User avatar
Posts: 609
Joined: Jan 04, 2015
Location: South Florida, USA

Re: piBeacon: presence monitoring plugin discussions

Karl.

FYI - did as you suggested and sent "sync;sync;sleep 2;sudo reboot-f" via sending unix command. No reboot. The rPI still having the error "ssh_exchange_identification: read: Connection reset by peer" when trying to ssh.

Only option now is to power cycle, unless you have any other suggestion to try remotely. If not, will cycle the power when I get home tonight.

JP

Posted on
Tue Jun 20, 2017 10:25 am
siclark offline
Posts: 1961
Joined: Jun 13, 2017
Location: UK

Re: piBeacon: presence monitoring plugin discussions

kw123 wrote:
could we do a quick online session (w teamviewer?). I should be able to figure this out quickly .. ? if you like send me your id/passwd in indigo email

Karl


Sure, thanks. Will PM you

Posted on
Tue Jun 20, 2017 11:58 am
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: presence monitoring plugin discussions

FYI - did as you suggested and sent "sync;sync;sleep 2;sudo reboot-f" via sending unix command. No reboot. The rPI still having the error "ssh_exchange_identification: read: Connection reset by peer" when trying to ssh.

Only option now is to power cycle, unless you have any other suggestion to try remotely. If not, will cycle the power when I get home tonight.


for next time you could try the watchdog feature:
1. it will ping the mac every xx minutes.
2.if no connection for ~ 10 minutes or so it will do a reboot.

but if it hangs that does not work.. only other option I see is hardware
but if this is consistent for just one RPI there must be something specific.

if you have several I would rotate them and see if the problem moves with the RPI or stays or disappears.. You will need to rotate the IP numbers in the plugin 9and push config to the RPI) the rest should be automatic

Karl

Posted on
Tue Jun 20, 2017 4:23 pm
siclark offline
Posts: 1961
Joined: Jun 13, 2017
Location: UK

Re: piBeacon: presence monitoring plugin discussions

kw123 wrote:
could we do a quick online session (w teamviewer?). I should be able to figure this out quickly .. ? if you like send me your id/passwd in indigo email

Karl


Huge thanks Karl for figuring out the problem and spending the time tonight. Only been on Indigo a few weeks and really impressed with the product and especially all the plugin developers.

Page 56 of 78 1 ... 53, 54, 55, 56, 57, 58, 59 ... 78

Who is online

Users browsing this forum: No registered users and 15 guests

cron