piBeacon: 3- presence monitoring download

Posted on
Thu Sep 07, 2017 2:54 pm
kw123 offline
User avatar
Posts: 8335
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: 3- presence monitoring download

posted V-7-64-142

added:
option in config: to always send the full UUID -Maj-Min instead of only every 10th time.
In the short mode the RPI will send at start the full UUID -maj-min ( .. 40 characters) then 10 times 0-0-0 as uuid and then the full again. - That reduces the traffic by 30*#ofbeacons*#ofRPI in my case: 6kbyte or 600 bytes per message. The full UUID about doubles the package size.
This was set to reduce the traffic into the plugin. If you have 10 RPi and 30 beacons that might help a bit.


Karl

Posted on
Sat Sep 09, 2017 11:21 am
kw123 offline
User avatar
Posts: 8335
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: 3- presence monitoring download

posted V-7-65-145

added:
1. support for raspberry stretch
2. menu option for special tracing of new beacons.
This is useful if you "accept new beacons" and you get a ton of new beacon devices .
After you switch this on for xx minutes the log file will be show any new message from these new beacons. when you move the beacon you want to add you should see the changes in signal strength/ and from which RPi the message comes. This tracing will turn itself off after xx minute you selected in the menu option.
here is how it would look like:
Code: Select all
12:18:18             -creating new beacon,  received from pi # 7/5C:F3:70:6D:D9:6E:      beacon-60:03:08:B7:00:03  UUID: 011a0bff4c00090603-24586-1
12:18:18             -new beacon logging::: created :2017-09-09 12:18:17  60:03:08:B7:00:03  beacon-60:03:08:B7:00:03  011a0bff4c00090603-24586-1                    pi#=7  rssi=-97.0  txPower=3.0
12:18:18             -new beacon logging::: newMSG  :2017-09-09 12:18:17 60:03:08:B7:00:03  beacon-60:03:08:B7:00:03  011a0bff4c00090603-24586-1                    pi#=7  rssi=-97.0  txPower=3.0
12:18:22             -new beacon logging::: newMSG  :2017-09-09 12:18:17 60:03:08:B7:00:03  beacon-60:03:08:B7:00:03  011a0bff4c00090603-24586-1                    pi#=7  rssi=-98.0  txPower=3.0
12:18:23             -new beacon logging::: newMSG  :2017-09-09 12:18:17 60:03:08:B7:00:03  beacon-60:03:08:B7:00:03  011a0bff4c00090603-24586-1                    pi#=7  rssi=-99.0  txPower=3.0

use the PI# and RSSI number to id you new iBeacon



changed
the short uuid form is now "x-x-x" instead of "0-0-0". There is actually a type of beacon that has 0-0-0 as its uuid-maj-min value. .. this is only used within the system, should not be visible to the users.

Karl

a new SSD image for raspberry stretch will be posted this afternoon, once it uploads.

Posted on
Thu Sep 28, 2017 8:39 am
kw123 offline
User avatar
Posts: 8335
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: 3- presence monitoring download

posted v 7.65.148

fixed:
- with a new install there were 2 different default values for the indigo directory (one in the plugin and one in config.xml) They are the same now
- the syntax for the alternative reboot was wrong was
sync;sleep (2);sudo reboot -f
is now correct:
sync;sleep 2;sudo reboot -f

added
reduced write to disk on the RPI. Almost all dynamic files are now in the pibeacon/temp directory that is a "ram"-disk. On most of my RPIs nothing gets written to the SD for minutes.
if a file gets send from the plugin a file pibeacon/temp/touchFile is created/touched and a process on the RPI checks that file. If "touched" it will copy everything to the virtual temp directory as needed. From then on all read/write will happen in the temp directory.


Karl

Posted on
Tue Oct 03, 2017 6:46 pm
kw123 offline
User avatar
Posts: 8335
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: 3- presence monitoring download

posted -v-7.66.152

added:
- support for myBLUE-t sensor
This is a BLE temperature sensor that is water tight. It cost ~ $25 at amazon. https://www.amazon.com/gp/product/B00EJQ8PVC/ref=oh_aui_detailpage_o00_s00?ie=UTF8&psc=1
It not as accurate as the others temp sensors (~ 1F) but you can throw it into water, ice water .. and it still works. Though likely not from the bottom of the pool as the signal will not get out. But it works nicely in the freezer and in a glass of ice water.
This is the first sensor that works through bluetooth that this plugin supports. It requires no config (and actually has none)
It sends a short message every 20-60 seconds - like an iBeacon -- with the temp in 3 bytes of the message.

It is a bit tricky to find the MAC number of the sensor. The app that comes with it shows a shortened version of the MAC number and in revers as the name. That is why we added a menu item:
- menue option to print BLE scan info from the RPI in the indigo logfile
it looks like this:
Code: Select all
19:19:56             -BLEreport received:
19:19:56 hcitool lescan-=======================================
LE Scan ...
D0:4F:7E:21:73:37 (unknown)
64:D6:47:A3:97:2C (unknown)
28:F0:76:72:D3:49 (unknown)
28:F0:76:72:D3:49 (unknown)
4A:AA:AD:8F:A8:AB (unknown)
4A:AA:AD:8F:A8:AB (unknown)
13:82:B2:AB:14:D9 (unknown)
00:EA:24:20:D5:A4 (unknown)
00:EA:24:20:D5:A4 XY-D5A4
64:D6:47:A3:97:2C (unknown)
CB:4A:59:D7:C6:6B (unknown)
CB:4A:59:D7:C6:6B (unknown)
F1:4C:CE:08:E4:80 (unknown)
F1:4C:CE:08:E4:80 (unknown)
E0:48:5B:9B:B5:5A (unknown)
E0:48:5B:9B:B5:5A (unknown)
00:EA:23:09:81:54 (unknown)
00:EA:23:09:81:54 XY-8154-5F
D4:F5:13:79:F3:E7 (unknown)
D4:F5:13:79:F3:E7 sw10090
00:EA:23:11:2B:E7 (unknown)
00:EA:23:11:2B:E7 XY-2BE7-5F
00:EA:23:0B:E2:54 (unknown)
00:EA:23:0B:E2:54 XY-E254-62
C8:69:CD:88:9E:AC (unknown)
C8:69:CD:88:9E:AC (unknown)
C7:6C:45:83:9F:61 tkr
C7:6C:45:83:9F:61 (unknown)
F5:19:E6:7F:DC:DE Puck.js dcde
F5:19:E6:7F:DC:DE (unknown)
5C:F3:70:77:FB:6C (unknown)
00:EA:23:11:2B:E4 (unknown)
00:EA:23:11:2B:E4 XY-2BE4-5F
D2:6E:5A:3B:94:93 Tile
D2:6E:5A:3B:94:93 (unknown)
5C:F3:70:78:31:82 (unknown)
00:EA:23:09:81:57 (unknown)
00:EA:23:09:81:57 XY-8157-5F
00:EA:23:0B:E2:57 (unknown)
00:EA:23:0B:E2:57 XY-E257-62
00:EA:24:20:D5:A7 (unknown)
00:EA:24:20:D5:A7 XY-D5A7
A0:14:3D:CD:0C:16 (unknown)
A0:14:3D:CD:0C:16 Parrot pot 0c16
5C:F3:70:77:4A:A1 (unknown)
D0:4F:7E:21:73:37 (unknown)
C5:7D:B7:58:B4:22  224BD75C
19:19:56             -no errors
19:19:56 hciconfig   -=======================================
hci0:   Type: BR/EDR  Bus: USB
   BD Address: 5C:F3:70:6D:DA:7A  ACL MTU: 1021:8  SCO MTU: 64:1
   UP RUNNING
   RX bytes:90720 acl:128 sco:0 events:3070 errors:0
   TX bytes:8686 acl:128 sco:0 commands:439 errors:0
19:19:56             -no errors
19:19:56 hcitool scan-=======================================
Scanning ...
   28:F0:76:72:D3:49   iMac
   00:1F:5B:E3:4E:83   dad
   AC:29:3A:EC:A9:9F   karlMacMini
   50:85:69:E4:4A:F3   [TV]Samsung LED65
19:19:56             -no errors
19:23:26             - stopping plugin due to:  :::::  restart / stop requested  :::::
19:23:32             - --V 7.65.152   initializing
Or with errors if the switch of the BLE stack does not work:
Code: Select all
19:23:53             -request BLE report from   192.168.1.20;  "[{\"command\": \"BLEreport\"}]"
19:24:05             -BLEreport received:
19:24:05 hcitool lescan-=======================================

19:24:05 hcitool lescan-errors:
Can't init device hci0: Connection timed out (110)
Set scan parameters failed: File descriptor in bad state
19:24:05 hciconfig   -=======================================
hci0:   Type: BR/EDR  Bus: USB
   BD Address: 5C:F3:70:6D:DA:7A  ACL MTU: 1021:8  SCO MTU: 64:1
   UP RUNNING
   RX bytes:109290 acl:70 sco:0 events:3588 errors:0
   TX bytes:5085 acl:70 sco:0 commands:254 errors:0
19:24:05             -no errors
19:24:05 hcitool scan-=======================================

19:24:05 hcitool scan-errors:
Device is not available: No such device

after delivering the report the RPI will reboot to make sure that the BLE stack works again properly.

The lescan info for a myBLUE-t sensor would look like:
Code: Select all
C5:7D:B7:58:B4:22  224BD75C
Where 224BD75C is the info shown in the myBLUE-t app on the phone.
You would then create a pibeacon device type BLEsensor and enter that MAC #(C5:7D:B7:58:B4:22 ) and the RPI which should read the sensor.


Karl

Posted on
Tue Oct 10, 2017 2:53 pm
kw123 offline
User avatar
Posts: 8335
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: 3- presence monitoring download

posed v 7.66.152

fixed:
signal delta mode send too many messages, now does the correct compare and only sends a message to indigo if signal from iBeacon changed by > xx dBm.


added:
== now offers a new way of getting the data from the RPI to indigo.
the RPi opens a direct tcp/ip socket to the indigo plugin and send the data directly. This avoids the loooong path RPI->HTTP->Indigowebserver -> log file ->SQLlogger-> subscribe toVariableChanges - >plugin. It also measures stats that can be shown in the log file, e.g.:
Code: Select all
15:14:39 pi TCPIP socket     -Stats for RPI-->INDIGO data transfers. Tracking started 2017-10-10 14:52:10. Report TX errors if time between errors is <:10Min
15:14:39 pi TCPIP socket     -IP              name         type       first               last                    #MSGs       #bytes bytes/MSG bytes/min  MSGs/min
15:14:39                     -192.168.1.20    pi_IN_0      ok         2017-10-10 14:52:25 2017-10-10 15:14:33        98        18912       192  841.0400    4.3582
15:14:39                     -192.168.1.20    pi_IN_Alive  ok         2017-10-10 14:59:09 2017-10-10 15:10:14         2          232       116   10.3173    0.0889
15:14:40                     -192.168.1.21    pi_IN_1      ok         2017-10-10 14:52:23 2017-10-10 15:14:22        65        16575       255  737.1107    2.8906
15:14:40                     -192.168.1.21    pi_IN_Alive  ok         2017-10-10 14:54:55 2017-10-10 15:05:41         2          226       113   10.0505    0.0889
15:14:40                     -192.168.1.22    pi_IN_2      ok         2017-10-10 14:52:25 2017-10-10 15:14:39       109        33730       309    1500.0    4.8474
15:14:40                     -192.168.1.22    pi_IN_Alive  ok         2017-10-10 15:01:02 2017-10-10 15:13:27         2          238       119   10.5842    0.0889
15:14:40                     -192.168.1.23    pi_IN_3      ok         2017-10-10 14:52:27 2017-10-10 15:14:27       126       103786       823    4615.5    5.6034
15:14:40                     -192.168.1.23    pi_IN_Alive  ok         2017-10-10 14:59:32 2017-10-10 15:10:38         2          224       112    9.9616    0.0889
15:14:40                     -192.168.1.24    pi_IN_4      ok         2017-10-10 14:52:26 2017-10-10 15:13:59        55        56187      1021    2498.7    2.4459
15:14:40                     -192.168.1.24    pi_IN_Alive  ok         2017-10-10 14:52:44 2017-10-10 15:13:40         3          345       115   15.3426    0.1334
15:14:40                     -192.168.1.25    pi_IN_5      errLength  2017-10-10 14:53:42 2017-10-10 15:11:08         4         5792      1448  257.5774    0.1779
15:14:40                     -192.168.1.25    pi_IN_5      ok         2017-10-10 14:52:50 2017-10-10 15:14:25        63        82089      1303    3650.6    2.8017
15:14:40                     -192.168.1.25    pi_IN_Alive  ok         2017-10-10 14:53:20 2017-10-10 15:14:18         3          339       113   15.0757    0.1334
15:14:40                     -192.168.1.26    pi_IN_6      ok         2017-10-10 14:52:35 2017-10-10 15:14:23        93        51379       552    2284.9    4.1358
15:14:40                     -192.168.1.26    pi_IN_Alive  ok         2017-10-10 15:02:26 2017-10-10 15:12:49         2          238       119   10.5842    0.0889
15:14:40                     -192.168.1.27    pi_IN_7      ok         2017-10-10 14:52:23 2017-10-10 15:13:51        13         2182       167   97.0362    0.5781
15:14:40                     -192.168.1.27    pi_IN_Alive  ok         2017-10-10 14:53:57 2017-10-10 15:13:30        11         1210       110   53.8102    0.4892
15:14:40                     -192.168.1.28    pi_IN_8      ok         2017-10-10 14:52:23 2017-10-10 15:14:39        58        15291       263  680.0096    2.5793
15:14:40                     -192.168.1.28    pi_IN_Alive  ok         2017-10-10 14:57:04 2017-10-10 15:07:52         2          226       113   10.0505    0.0889
15:14:40                     -192.168.1.29    pi_IN_9      ok         2017-10-10 14:52:30 2017-10-10 15:14:06        15         3540       236  157.4282    0.6671
15:14:40                     -192.168.1.29    pi_IN_Alive  ok         2017-10-10 14:52:27 2017-10-10 15:11:08        12         1392       116   61.9040    0.5337
15:14:40                     -192.168.1.31    pi_IN_11     ok         2017-10-10 14:52:28 2017-10-10 15:14:40        63        20790       330  924.5569    2.8017
15:14:40                     -192.168.1.31    pi_IN_Alive  ok         2017-10-10 15:02:39 2017-10-10 15:13:01         2          222       111    9.8726    0.0889
15:14:40                     -192.168.1.33    pi_IN_13     ok         2017-10-10 14:52:52 2017-10-10 15:14:11        24         7046       293  313.3443    1.0673
15:14:40                     -192.168.1.33    pi_IN_Alive  ok         2017-10-10 14:55:03 2017-10-10 15:05:39         2          252       126   11.2068    0.0889
15:14:40                     -192.168.1.34    pi_IN_14     ok         2017-10-10 14:52:42 2017-10-10 15:14:39        17         3315       195  147.4221    0.7560
15:14:40                     -192.168.1.34    pi_IN_Alive  ok         2017-10-10 14:54:25 2017-10-10 15:06:21         3          354       118   15.7428    0.1334
15:14:40                     -192.168.1.36    pi_IN_16     ok         2017-10-10 14:52:42 2017-10-10 15:14:19        59        13629       231  606.0984    2.6238
15:14:40                     -192.168.1.36    pi_IN_Alive  ok         2017-10-10 14:55:20 2017-10-10 15:05:57         2          222       111    9.8726    0.0889
15:14:40                     -192.168.1.38    pi_IN_18     ok         2017-10-10 14:52:38 2017-10-10 15:13:41        15         2696       179  119.8944    0.6671
15:14:40                     -192.168.1.38    pi_IN_Alive  ok         2017-10-10 14:52:34 2017-10-10 15:13:38         8         1066       133   47.4063    0.3558
15:14:40                     -total                                                                                 935       443725       474   19733.0   41.5806
15:14:40 pi TCPIP socket     - ===  Stats for RPI --> INDIGO data transfers ==  END total minutes measured: 22
you can see e.g. the bad packages from RPI_5. every 10th page has the wrong length = incomplete package. using a different cable the RPI is fine.. now I need to replace the cable in the wall.
the new method can be selected in config. You need to set the incoming PORT default is 12087.. any port > 10k should be fine.

==option to ignore "junk beacons" set in config. Junk beacons are beacon with no data in the package, UUID undefined, rx=tx ..
==accept new beacons can be set to a dBm value instead of just on/off This allow to add a new beacon and set e.g. the threshold to -60 dBm and put the beacon on the RPI. It should only see THAT beacon as a new one as all the others should have much lower signal strength.
==ignore signals that are too weak you can set a threshold for each beacon individually to ignore a signal < xxdBm (e.g. -88). The RPI will ignore these signals and not update indigo. This should allow to suppress up/down/up/down for beacons that are just at the edge of the detection distance.

==changed default folder device and variable names replaced any "-" with a "_" character. As indigo is not fully supporting a - sign in some of these case I changed all occurrences from - to _. This might require you to edit e.g. events that rigger on e.g. signal variables with a - sign e.g. "iBeacon_Count_ALL_Away" is the new name..

when starting this plugin you SHOULD go into config and make sure that all parameters are set properly.

Karl

this was a major learning experience to have a threaded tcpcip listener running in indigo and feeding the plugin in a very fast and efficient way.

and thanks to all the professional help from Matt/Jay/R.

Posted on
Fri Oct 13, 2017 9:05 pm
kw123 offline
User avatar
Posts: 8335
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: 3- presence monitoring download

posted v 7-69-155

added:
show positions of iBeacons in a png file.
first enable the function in config:
Screen Shot 2017-10-13 at 21.47.44.png
Screen Shot 2017-10-13 at 21.47.44.png (129.32 KiB) Viewed 4309 times

Then enable the beacons you would like to sho in beacon device edit:
Screen Shot 2017-10-13 at 21.48.18.png
Screen Shot 2017-10-13 at 21.48.18.png (48.86 KiB) Viewed 4309 times

This will create something like this
Screen Shot 2017-10-13 at 21.57.23.png
Screen Shot 2017-10-13 at 21.57.23.png (48.69 KiB) Viewed 4309 times

As you can see some of the options eg. triangle do not make much sense.. but for fun left them in.

The image file is run through compress (pngquant). That reduces the size by at least 50%.

The process produces its own log file in ~ /indigo/pibeacon/plotPositions.log
The temp etc files are in ~/indigo/piBeacon/plotPositions

Karl

As you can see I am not that gifted with graphics .. but the tool works fine .. you can use any fancy drawing file (png) of your home as background.

Posted on
Thu Oct 19, 2017 11:55 am
kw123 offline
User avatar
Posts: 8335
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: 3- presence monitoring download

posted v 7.70.158

fixed:
- some error control for tcp/ip socket communication, e.g. when RPi is disconnected, it will reconnect now properly.
- odd end

improved:
- reboot through ssh: if option "reboot -f" instead of "reboot now" for a RPI is selected the ssh command will now also use that command to reboot (before on if the rpi rebooted itself )
- some menus (print, logging) where combined as the menu list became longer that the screen, looks much better now
- for tcp/ip stats calculation the start time was always the plugin restart. Now it is the date/time when you reset the stats
- the beacon position display works now much better, more efficient, and the images are looking nice.
.. you can show a caption i.e. what do the symbols mean
.. you can show the positions of the RPI
.. switch on/off enable compress of png
.. symbols look better

Karl


the position calculation is still not perfect, but reasonable. Currently it takes uses distance to the nearest RPI and determines the direction from the vector to the RPI with the next highest signal.
I tried to play around with using more RPis, but then the calculations become really complex as the distances ( calculated from signal strengths TX,RX) when going though a wall are not correct.
one could use the measured signal strength of the RPI's seeing each other and the given positions to correct the signal strength of the beacons.. but that becomes complicated VERY quickly.. some n- dimensional fitting every time any signal strength changes ..

Posted on
Fri Oct 27, 2017 9:07 pm
kw123 offline
User avatar
Posts: 8335
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: 3- presence monitoring download

posted V 7.70.160

fixed:
iBeacon in Line '9300' has error=''float' object has no attribute 'strip''

Karl

Posted on
Wed Nov 08, 2017 4:25 pm
kw123 offline
User avatar
Posts: 8335
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: 3- presence monitoring download

posted v 7.70.161

added:
option to NOT show expired iBeacons in position plot (set in config)


Karl

Posted on
Sun Nov 19, 2017 9:05 pm
kw123 offline
User avatar
Posts: 8335
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: 3- presence monitoring download

posted v 7.72.164

fixed:
- When a RPI is down and the plugin tries to ssh / send info / commands via socket to the RPI it keeps the Plugin waiting.
now when the RPI is disabled, it will not try to connect the RPI
- some reduced writing / reading from the SD

added; support for some http://www.controleverything.com sensors
ADC121: MQ3, MQ4, MQ9, A13xx, 021 TA12_200 = various gases, hallefect, current Voltage , .. sensors
mpu6050: 01BA, 02BA, 05BA, 07BA, 30BA, 14BA = temp/pressure sensor for various environments and sensitivities, liquid, air ,..

Karl

[edit]
the MQ sensors as shipped by the company do not work correctly. They are all heated with +5V, though many of them will require a heat voltage of 1.5.
At 5V they are either in cleaning mode or detect another set of gases.!!
especially the CO sensor does not work (MQ9). it will detect LNG only

Posted on
Mon Nov 27, 2017 3:15 pm
kw123 offline
User avatar
Posts: 8335
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: 3- presence monitoring download

posted v 7.74.164


fixed:
- menus, typos..
- now fully supports the MQ series sensors from connect everything. fixed the formula posted on their web site the RPI version was just wrong. the Arduino version was ok. and as a side effect i learned a lot about sensors .


added:
Support for BOSCH sensor bme680: temp/humidity/presure AND air quality. This sensor measures VOC contents of the surrounding air.
the plugin will auto calibrate the sensor assuming it is in clean air during calibration; it will show:
Screen Shot 2017-11-27 at 15.12.05.png
Screen Shot 2017-11-27 at 15.12.05.png (15.46 KiB) Viewed 4126 times

The gas quality is measured in Ohm as the sensors resistivity. Then as the air quality gets reduced the GasSore lowers.
Example: opening up a can of liquid tape next to it reduces the GasSore to ~ 10%
There are 3 methods of calibration available, auto, set value, use stored value from last calibration.

Karl

ps this is likely the last version posted here, The next will be on github.. still a lot of work to set up all the fields, helps etc..

Posted on
Sat Dec 02, 2017 12:55 pm
kw123 offline
User avatar
Posts: 8335
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: 3- presence monitoring download

new release 7.74.175 on indigo plugin store https://www.indigodomo.com/pluginstore/59/

data structure improved, improved timeout handling for PPI --> indigo comm.

Karl

Posted on
Sat Dec 09, 2017 9:08 pm
kw123 offline
User avatar
Posts: 8335
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: 3- presence monitoring download

new release 7.76.185 posted in the plugin store
https://www.dropbox.com/s/nnwlvv3wezjofi3/IMG_6749.m4v?dl=1

Karl

Posted on
Mon Dec 11, 2017 8:30 am
kw123 offline
User avatar
Posts: 8335
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: 3- presence monitoring download

released v 7.76.186

small fix . When a RPI reboots the plugin sets a variable xx_Rebooting to the name of the RPI that is rebooting..

there were two "_" in the variable name in the plugin


Karl

Posted on
Sun Jan 07, 2018 12:24 pm
kw123 offline
User avatar
Posts: 8335
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: 3- presence monitoring download

released v 7.77.192
download at https://www.indigodomo.com/pluginstore/59/

Page 11 of 21 1 ... 8, 9, 10, 11, 12, 13, 14 ... 21

Who is online

Users browsing this forum: No registered users and 4 guests