piBeacon: presence monitoring plugin discussions

Posted on
Sat Aug 10, 2019 7:21 pm
GlennNZ offline
Posts: 669
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: piBeacon: presence monitoring plugin discussions

Hi Karl,

Hope all is well.

I had a thought regarding pulling Bluetooth Device data into Indigo - what started it off was a Bluetooth Car Battery monitor. I thought it would be great to get this data into Indigo and then could add to control page/alert as usual when everything not okay. The one I have setup is Masons https://www.supercheapauto.com.au/p/mat ... 40712.html.

I immediately thought of piBeacon - and wondered whether this might be possible.

I see that essentially you have done this already with BLEsensor.py and the BlueZ sensor!

Any chance of opening these packets up to a genericBLESensor and we can figure out the packets ourself?
Still in the process and sorting out what means what - in my case should be straight-forward single packet I would hope......

Would think there may be a whole lot of Bluetooth devices which we could connect to Indigo via pibeacon and rpi....

Thanks for considering!

Glenn

Posted on
Sat Aug 10, 2019 7:55 pm
kw123 offline
User avatar
Posts: 6896
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: presence monitoring plugin discussions

looks like no api, only iphone/ android app that can be downloaded.

if you can get an api, it might be possible..

BUT sofar pibeacon only listens, does not attach to sensor. - besides BLEconnect, that does a simple "teaser" to the phone and checkss if it answers, gets the signal strength from that package .. that's all.

The only "sensor" I found that is dumb and only sends broadcasts is the BLEsensor temp sensor. It sends once per minute a package that just has 2 more bytes than the iBeacon msg (for temp)

Karl

Posted on
Sat Aug 10, 2019 8:46 pm
GlennNZ offline
Posts: 669
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: piBeacon: presence monitoring plugin discussions

Thanks Karl

Ah Okay - didn't release blueZ didn't connect.

Having issues connecting with hcitool and have moved to bluetoothctl (which seems available on the Pi's and more popular)
Connected/paired very easily, just thinking about getting data... still..

Code: Select all
[bluetooth]# connect 78:04:73:09:24:C0
Attempting to connect to 78:04:73:09:24:C0
[CHG] Device 78:04:73:09:24:C0 Connected: yes
Connection successful
[NEW] Primary Service
   /org/bluez/hci0/dev_78_04_73_09_24_C0/service000c
   00001801-0000-1000-8000-00805f9b34fb
   Generic Attribute Profile
[NEW] Characteristic
   /org/bluez/hci0/dev_78_04_73_09_24_C0/service000c/char000d
   00002a05-0000-1000-8000-00805f9b34fb
   Service Changed
[NEW] Descriptor
   /org/bluez/hci0/dev_78_04_73_09_24_C0/service000c/char000d/desc000f
   00002902-0000-1000-8000-00805f9b34fb
   Client Characteristic Configuration
[NEW] Primary Service
   /org/bluez/hci0/dev_78_04_73_09_24_C0/service0010
   0000180a-0000-1000-8000-00805f9b34fb
   Device Information
[NEW] Characteristic
   /org/bluez/hci0/dev_78_04_73_09_24_C0/service0010/char0011
   00002a23-0000-1000-8000-00805f9b34fb
   System ID
[NEW] Characteristic
   /org/bluez/hci0/dev_78_04_73_09_24_C0/service0010/char0013
   00002a24-0000-1000-8000-00805f9b34fb
   Model Number String
[NEW] Characteristic
   /org/bluez/hci0/dev_78_04_73_09_24_C0/service0010/char0015
   00002a25-0000-1000-8000-00805f9b34fb
   Serial Number String
[NEW] Characteristic
   /org/bluez/hci0/dev_78_04_73_09_24_C0/service0010/char0017
   00002a26-0000-1000-8000-00805f9b34fb
   Firmware Revision String
[NEW] Characteristic
   /org/bluez/hci0/dev_78_04_73_09_24_C0/service0010/char0019
   00002a27-0000-1000-8000-00805f9b34fb
   Hardware Revision String
[NEW] Characteristic
   /org/bluez/hci0/dev_78_04_73_09_24_C0/service0010/char001b
   00002a28-0000-1000-8000-00805f9b34fb
   Software Revision String
[NEW] Characteristic
   /org/bluez/hci0/dev_78_04_73_09_24_C0/service0010/char001d
   00002a29-0000-1000-8000-00805f9b34fb
   Manufacturer Name String
[NEW] Characteristic
   /org/bluez/hci0/dev_78_04_73_09_24_C0/service0010/char001f
   00002a2a-0000-1000-8000-00805f9b34fb
   IEEE 11073-20601 Regulatory Cert. Data List
[NEW] Characteristic
   /org/bluez/hci0/dev_78_04_73_09_24_C0/service0010/char0021
   00002a50-0000-1000-8000-00805f9b34fb
   PnP ID
[NEW] Primary Service
   /org/bluez/hci0/dev_78_04_73_09_24_C0/service0023
   0000fff0-0000-1000-8000-00805f9b34fb
   Unknown
[NEW] Characteristic
   /org/bluez/hci0/dev_78_04_73_09_24_C0/service0023/char0024
   0000fff1-0000-1000-8000-00805f9b34fb
   Unknown
[NEW] Descriptor
   /org/bluez/hci0/dev_78_04_73_09_24_C0/service0023/char0024/desc0026
   00002901-0000-1000-8000-00805f9b34fb
   Characteristic User Description
[NEW] Characteristic
   /org/bluez/hci0/dev_78_04_73_09_24_C0/service0023/char0027
   0000fff2-0000-1000-8000-00805f9b34fb
   Unknown
[NEW] Descriptor
   /org/bluez/hci0/dev_78_04_73_09_24_C0/service0023/char0027/desc0029
   00002901-0000-1000-8000-00805f9b34fb
   Characteristic User Description
[NEW] Characteristic
   /org/bluez/hci0/dev_78_04_73_09_24_C0/service0023/char002a
   0000fff3-0000-1000-8000-00805f9b34fb
   Unknown
[NEW] Descriptor
   /org/bluez/hci0/dev_78_04_73_09_24_C0/service0023/char002a/desc002c
   00002901-0000-1000-8000-00805f9b34fb
   Characteristic User Description
[NEW] Characteristic
   /org/bluez/hci0/dev_78_04_73_09_24_C0/service0023/char002d
   0000fff4-0000-1000-8000-00805f9b34fb
   Unknown
[NEW] Descriptor
   /org/bluez/hci0/dev_78_04_73_09_24_C0/service0023/char002d/desc002f
   00002902-0000-1000-8000-00805f9b34fb
   Client Characteristic Configuration
[NEW] Descriptor
   /org/bluez/hci0/dev_78_04_73_09_24_C0/service0023/char002d/desc0030
   00002901-0000-1000-8000-00805f9b34fb
   Characteristic User Description
[NEW] Characteristic
   /org/bluez/hci0/dev_78_04_73_09_24_C0/service0023/char0031
   0000fff5-0000-1000-8000-00805f9b34fb
   Unknown
[NEW] Descriptor
   /org/bluez/hci0/dev_78_04_73_09_24_C0/service0023/char0031/desc0033
   00002901-0000-1000-8000-00805f9b34fb
   Characteristic User Description
[NEW] Primary Service
   /org/bluez/hci0/dev_78_04_73_09_24_C0/service0034
   f000ffc0-0451-4000-b000-000000000000
   Vendor specific
[NEW] Characteristic
   /org/bluez/hci0/dev_78_04_73_09_24_C0/service0034/char0035
   f000ffc1-0451-4000-b000-000000000000
   Vendor specific
[NEW] Descriptor
   /org/bluez/hci0/dev_78_04_73_09_24_C0/service0034/char0035/desc0037
   00002902-0000-1000-8000-00805f9b34fb
   Client Characteristic Configuration
[NEW] Descriptor
   /org/bluez/hci0/dev_78_04_73_09_24_C0/service0034/char0035/desc0038
   00002901-0000-1000-8000-00805f9b34fb
   Characteristic User Description
[NEW] Characteristic
   /org/bluez/hci0/dev_78_04_73_09_24_C0/service0034/char0039
   f000ffc2-0451-4000-b000-000000000000
   Vendor specific
[NEW] Descriptor
   /org/bluez/hci0/dev_78_04_73_09_24_C0/service0034/char0039/desc003b
   00002902-0000-1000-8000-00805f9b34fb
   Client Characteristic Configuration
[NEW] Descriptor
   /org/bluez/hci0/dev_78_04_73_09_24_C0/service0034/char0039/desc003c
   00002901-0000-1000-8000-00805f9b34fb
   Characteristic User Description
[CHG] Device 78:04:73:09:24:C0 UUIDs: 00001800-0000-1000-8000-00805f9b34fb
[CHG] Device 78:04:73:09:24:C0 UUIDs: 00001801-0000-1000-8000-00805f9b34fb
[CHG] Device 78:04:73:09:24:C0 UUIDs: 0000180a-0000-1000-8000-00805f9b34fb
[CHG] Device 78:04:73:09:24:C0 UUIDs: 0000fff0-0000-1000-8000-00805f9b34fb
[CHG] Device 78:04:73:09:24:C0 UUIDs: f000ffc0-0451-4000-b000-000000000000
[CHG] Device 78:04:73:09:24:C0 ServicesResolved: yes
[CHG] Device 78:04:73:09:24:C0 Modalias: bluetooth:v000Dp0000d0110


Code: Select all
[Battery Monitor]# select-attribute /org/bluez/hci0/dev_78_04_73_09_24_C0/service0034/char0039/desc003c
[Battery Monitor:/service0034/char0039/desc003c]# read
Attempting to read /org/bluez/hci0/dev_78_04_73_09_24_C0/service0034/char0039/desc003c
[CHG] Attribute /org/bluez/hci0/dev_78_04_73_09_24_C0/service0034/char0039/desc003c Value: 0x49
[CHG] Attribute /org/bluez/hci0/dev_78_04_73_09_24_C0/service0034/char0039/desc003c Value: 0x6d
[CHG] Attribute /org/bluez/hci0/dev_78_04_73_09_24_C0/service0034/char0039/desc003c Value: 0x67
[CHG] Attribute /org/bluez/hci0/dev_78_04_73_09_24_C0/service0034/char0039/desc003c Value: 0x20
[CHG] Attribute /org/bluez/hci0/dev_78_04_73_09_24_C0/service0034/char0039/desc003c Value: 0x42
[CHG] Attribute /org/bluez/hci0/dev_78_04_73_09_24_C0/service0034/char0039/desc003c Value: 0x6c
[CHG] Attribute /org/bluez/hci0/dev_78_04_73_09_24_C0/service0034/char0039/desc003c Value: 0x6f
[CHG] Attribute /org/bluez/hci0/dev_78_04_73_09_24_C0/service0034/char0039/desc003c Value: 0x63
[CHG] Attribute /org/bluez/hci0/dev_78_04_73_09_24_C0/service0034/char0039/desc003c Value: 0x6b
  49 6d 67 20 42 6c 6f 63 6b                       Img Block       
[Battery Monitor:/service0034/char0039/desc003c]#


Sorry about spam - another thread?

Posted on
Sat Aug 10, 2019 9:00 pm
kw123 offline
User avatar
Posts: 6896
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: presence monitoring plugin discussions

I am busy until early September. Then I am done with my big project.

Have done little for pibeacon and all the other things in the last 6 months.


Karl

Posted on
Fri Aug 16, 2019 5:04 pm
kw123 offline
User avatar
Posts: 6896
Joined: May 12, 2013
Location: Dallas, TX

piBeacon: presence monitoring plugin discussions

just a quick update .. regarding raspberry pi4

I got 2 in the mail and they seem to work fine. No pibeacon issues (iBeacon, BLEconnect work fine)!
Install took ~ 4 minutes and all libs where installed,

Tested an BME680 BME280 i2c sensors and oneWire , they seem to work fine.

And this thing gets hot, you need the cpu heat sink if not a fan.

But I need to go through the detailed testing.. at least for some more of the sensors

pibeacon generates about 3% cpu load

BUT::::

1. you can not use any intelligent USB-C power supply. - they do not work. It's a bug in the hardware . Only very simple ones work, old USB do not work.

2. the POE solutions work, I got 3 ($12, 25, $39 = more than the RPI!) , and will go through them.
the RPi-4 uses ~ 5 watt = 1 amp at this low cpu load. RPI 2 types use ~ 2.0 watts

3. you must use the latest OS. The previous SSDs will not work.


I will need some time to go through the testing, then publish the new SSD for RPI4 etc.


Karl

Posted on
Sat Aug 24, 2019 10:02 am
forestfield offline
Posts: 81
Joined: Dec 29, 2014
Location: West Sussex

Re: piBeacon: presence monitoring plugin discussions

Hi Karl,
I've just upgraded to 7.9..303 and I'm seeing this in the indigo log...

Code: Select all
2019-08-24 16:48:43.151   piBeacon Error   Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 9037, in runConcurrentThread
  File "plugin.py", line 9060, in dorunConcurrentThread
  File "plugin.py", line 8875, in initConcurrentThread
AttributeError: 'Plugin' object has no attribute 'userIdOfServer'

2019-08-24 16:48:43.152   piBeacon Error   plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)


Reverting to 7.105.293 removes the error.

... Later

One of my piBeacons had disappeared - recreated and all is good. Don't know why it went away though

Posted on
Tue Oct 01, 2019 9:33 am
kw123 offline
User avatar
Posts: 6896
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: presence monitoring plugin discussions

tried the new iPhone 11 (*)

BLE connect works fine, stayed ON all night. seems to work fine.
Went off / expired when i left the house and came back ON when i got home

Karl

(*) yes I am a victim of marketing

Posted on
Wed Oct 02, 2019 7:46 pm
pixelpipeline offline
Posts: 9
Joined: Dec 21, 2014

Plugin keeps restarting

Hello!

I just started using this plugin but unfortunately, I can't getup any pi units as the plugin reboots constantly:

Code: Select all
Oct 2, 2019 at 6:39:19 PM
   piBeacon Error                  Line 16218 has error=local variable 'TCPserverHandle' referenced before assignment
   piBeacon Error                  tcpip stack did not load, restarting.. if this error continues, try restarting indigo server
   piBeacon                         ..  initialized
   piBeacon                        quitNow:  tcpip stack did not load, restart--- you might see an indigo error message, can be ignored
   piBeacon                        runConcurrentThread stopping plugin due to:  :::::  tcpip stack did not load, restart :::::
   Reloading plugin "piBeacon 7.111.311"
   Stopping plugin "piBeacon 7.111.311" (pid 47529)
   Stopped plugin "piBeacon 7.111.311"
   Starting plugin "piBeacon 7.111.311" (pid 47705)
   piBeacon                        initializing    ...
   piBeacon                        path To files:          =================
   piBeacon                        indigo                  /Library/Application Support/Perceptive Automation/
   piBeacon                        installFolder           /Library/Application Support/Perceptive Automation/Indigo 7.4/
   piBeacon                        plugin.py               /Library/Application Support/Perceptive Automation/Indigo 7.4/Plugins/piBeacon.indigoPlugin/Contents/Server Plugin/
   piBeacon                        Plugin params           /Library/Application Support/Perceptive Automation/Indigo 7.4/Preferences/Plugins/com.karlwachs.piBeacon/
   piBeacon Warning                logger  enabled for     WARNING        ==> TEST ONLY
   piBeacon Error                  logger  enabled for     ERROR          ==> TEST ONLY
   piBeacon Critical Error         logger  enabled for     CRITICAL       ==> TEST ONLY
   piBeacon                        check                   /Library/Application Support/Perceptive Automation/Indigo 7.4/Logs/com.karlwachs.piBeacon/plugin.log  <<<<    for detailed logging
   piBeacon                        Plugin short Name       piBeacon
   piBeacon                        my PID                  47705
   piBeacon                        set params for indigo V 7.4
   Started plugin "piBeacon 7.111.311"
   piBeacon                        myLogSet setting parameters -- logFileActive= ; logFile= /Library/Application Support/Perceptive Automation/Indigo 7.4/Preferences/Plugins/com.karlwachs.piBeacon/plugin.log;  debug plugin:[]   RPI#:-1
   piBeacon                        testing if variable enableTimeTracking_piBeacon is == on/off/print-option to enable/end/print time tracking of all functions and methods (option:'',calls,cumtime,pcalls,time)
   piBeacon                         --V 7.111.311   initializing  --
   piBeacon Error                  Line 468 has error=u''

Oct 2, 2019 at 6:40:47 PM
   piBeacon Error                  Line 16218 has error=local variable 'TCPserverHandle' referenced before assignment
   piBeacon Error                  tcpip stack did not load, restarting.. if this error continues, try restarting indigo server
   piBeacon                         ..  initialized
   piBeacon                        quitNow:  tcpip stack did not load, restart--- you might see an indigo error message, can be ignored
   piBeacon                        runConcurrentThread stopping plugin due to:  :::::  tcpip stack did not load, restart :::::
   Reloading plugin "piBeacon 7.111.311"
   Stopping plugin "piBeacon 7.111.311" (pid 47705)
   Stopped plugin "piBeacon 7.111.311"
   Starting plugin "piBeacon 7.111.311" (pid 47878)
   piBeacon                        initializing    ...
   piBeacon                        path To files:          =================
   piBeacon                        indigo                  /Library/Application Support/Perceptive Automation/
   piBeacon                        installFolder           /Library/Application Support/Perceptive Automation/Indigo 7.4/
   piBeacon                        plugin.py               /Library/Application Support/Perceptive Automation/Indigo 7.4/Plugins/piBeacon.indigoPlugin/Contents/Server Plugin/
   piBeacon                        Plugin params           /Library/Application Support/Perceptive Automation/Indigo 7.4/Preferences/Plugins/com.karlwachs.piBeacon/
   piBeacon Warning                logger  enabled for     WARNING        ==> TEST ONLY
   piBeacon Error                  logger  enabled for     ERROR          ==> TEST ONLY
   piBeacon Critical Error         logger  enabled for     CRITICAL       ==> TEST ONLY
   piBeacon                        check                   /Library/Application Support/Perceptive Automation/Indigo 7.4/Logs/com.karlwachs.piBeacon/plugin.log  <<<<    for detailed logging
   piBeacon                        Plugin short Name       piBeacon
   piBeacon                        my PID                  47878
   piBeacon                        set params for indigo V 7.4
   Started plugin "piBeacon 7.111.311"
   piBeacon                        myLogSet setting parameters -- logFileActive= ; logFile= /Library/Application Support/Perceptive Automation/Indigo 7.4/Preferences/Plugins/com.karlwachs.piBeacon/plugin.log;  debug plugin:[]   RPI#:-1
   piBeacon                        testing if variable enableTimeTracking_piBeacon is == on/off/print-option to enable/end/print time tracking of all functions and methods (option:'',calls,cumtime,pcalls,time)



any idea what is wrong here or how I can fix that?

THANKS

Posted on
Wed Oct 02, 2019 8:08 pm
kw123 offline
User avatar
Posts: 6896
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: presence monitoring plugin discussions

That’s an error message that the plugin can not start the tcpip stack.

A - disable plugin wait 30 secs enable check if works

B- stop server restart server. Check if works

C- switch to http comm in config.
You will get a lot of messages in the logfile.
You can switch that off with the menu “replace Webserver logging”. That adds 2 lines to the Webserver logging py program to ignore the strings coming from the rpis.
Every time to reinstall Indigo or upgrade indigo that patch will be removed again.

Let me know if that does the trick.


Karl.


Sent from my iPhone using Tapatalk

Posted on
Wed Oct 02, 2019 10:36 pm
pixelpipeline offline
Posts: 9
Joined: Dec 21, 2014

Re: piBeacon: presence monitoring plugin discussions

Hello Karl,

thank you for the quick reply.

"C" did the trick - the error is gone :)

However the generated device has a "IPconnectin and BLE down" error.

Is that normal - should I just wait for an update or is there something I can do?


I also checked the PI and there are none of the processes running that you mention in the help ...



THANKS !!!


Stefan
Last edited by pixelpipeline on Wed Oct 02, 2019 10:48 pm, edited 1 time in total.

Posted on
Wed Oct 02, 2019 10:47 pm
kw123 offline
User avatar
Posts: 6896
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: presence monitoring plugin discussions

Some more questions:

Could you describe your macsetuo
Os , hardware ... I like to understand why the tcpip socket does not work


2.also could you elaborate a little more when and how and exactly is the error occurring . On the mac log on the rpi ...

And how are your rpi setup. which version 1-2/3/4. W extra ble dongle ?. WiFi / Ethernet etc


Karl


Sent from my iPhone using Tapatalk

Posted on
Wed Oct 02, 2019 10:55 pm
pixelpipeline offline
Posts: 9
Joined: Dec 21, 2014

Re: piBeacon: presence monitoring plugin discussions

Hello Karl,

the server is running on a late 2012 MACmini with High Sierra with 8GB RAM.

The issue came up during the initial try to get it working with a 3B+ using the internal BT and WiFi. there is nothing connected to RJ45. I used the .img from the thread to do the initial setup on a 16GB card.

Please let me know if you need any more info or logs.

If it helps you I can set up a TeamVirewer session ...

THANKS !

Posted on
Wed Oct 02, 2019 11:21 pm
kw123 offline
User avatar
Posts: 6896
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: presence monitoring plugin discussions

Ok
The Mac mini might be timing out for the tcpip socket. I can set the window higher

As for the ble and WiFi. Could try to use an Ethernet cable just to if that works.

Which ssd image do you use? Busted?

Gn
Karl



Sent from my iPhone using Tapatalk

Posted on
Wed Oct 02, 2019 11:26 pm
kw123 offline
User avatar
Posts: 6896
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: presence monitoring plugin discussions

One last thing

Set debug on for the rpi
Then
ssh pi@...
tail -F /var/log/pibeacon.log
And let it run
Check for errors. / post.


Sent from my iPhone using Tapatalk

Posted on
Wed Oct 02, 2019 11:31 pm
pixelpipeline offline
Posts: 9
Joined: Dec 21, 2014

Re: piBeacon: presence monitoring plugin discussions

Dumb question:

how do i set debug on for the PI ?



I'm setting it up wired now ...

Who is online

Users browsing this forum: No registered users and 1 guest