piBeacon: 3- presence monitoring download

Posted on
Thu Mar 10, 2016 10:50 am
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: piBEACON: presence monitoring download

posted v1.15.2

fixed:
-

added/improved:
with the learnings from the issues users had, I added some more error checks:
1. Menue option reducing the logfile entries (suppress the rPi messages in the log file) has now an on and off option. - you still need to stop/start the server, but don't need to reinstall indigo, to re-enable the logging
2. if you have an rPi configured but switched off by accident (that happened to me too) you will get a warning in the log file in red once an hour - either switch the rPi on, or blank the userid to get rid of the message
3. the data/ file transfer from the indigo plugin to the rPis covers now more situations and should be able to recover from more exceptions i.e. RSA key wrong..
4. some situations where unicode characters where in the device name etc is now handled better
5. and some other english language improvements in the menus/ log files (also called typos)


If you are happy with 1.15.1 no need to upgrade, but if you run into an issue I will ask you to upgrade to this one.

Karl

Posted on
Thu Mar 10, 2016 12:06 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: piBEACON: presence monitoring download

posted v 1.15.3

fixed:
when I introduced the option "do not accept new iBeacons" I killed the phone #mac to uuid feature.

it should work again now


Karl

Posted on
Sat Mar 12, 2016 1:18 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: piBEACON: presence monitoring download

posted V 1.16.1

fixed:
smaller things, menu checking etc

added
- you can now add NON-bluetooth rPi for sensors and output functions only. In my setup I have 10 BLE rPis. Adding more would not improve the bluetooth detection and will keep the rPi Bluetooth talking to and about each other too much.
So rPI#10-19 can not be setup as regular rPi with just sensor/input and output, sound etc functions.

- added time stamp info the to messages send from the rPi to the plugin. First it will just be used to check if the time zone etc are setup correctly. If not you will get a warning..." do sudo rasps-config on your rip and change timezone etc in the logfile.

- improved communication between plugin and rPi. only send if as needed, keep things undisturbed as much as possible ( periodically the plugin send configs and programs to make sure everything is in sync This is optimized)

- small add: in menu send config/ programs to rPi has now some more options: just send files, send files and restart programs, send ... and reboot .., mostly for me to make it easier to develop and test code

Karl

Posted on
Mon Mar 14, 2016 5:15 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: piBEACON: presence monitoring download

Posted v 1.17.1

fixed:

added:

  • reduced the rPi bluetooth send frequency from 10/sec to 1/10 seconds. This is only used to check if the rPis are up. And the time period is > 60 seconds.
    This reduces the background bluetooth traffic significantly: with 10 rPI from 100/second to 1/ second. I have not seen any negative effect.
  • added support for bluetooth connect tracking. With this you can track your iPhone without any additional software running on the iPhone. iBeacons send signals all the time and the system just listens to traffic coming by. Normal bluetooth does something only when you want an action. Now this version will try to connect to a devices (e.g. phone) with a given mac number. It will launch a unix process: " sudo hcitool cc mac && sudo hcitool rssi mac " (replace mac with xx:yy... the mac number tested) and read the response
    - find the MAC number of e.g. your iPhone in setup/general/bluetooth
    - create a device name = xxx type/.. =piBeacon/ BLE-connect
    - select which rPi should track this device. I tried 10, that works.
    - select refresh/ requery when UP . each of the interactions requires a lot of power, not like the iBeacons at ~ -60dBm, but at 1+ dBm. If the rPi knows the iPhone is up, it does not need to ask again 1 second later. I would set this one to >90 seconds
    - select refresh /requery when down. this should be much faster. you want to know when the iPhone is back as soon as possible. I tried 2 seconds that works. But might also drain the battery
    - select after how much time the devices should go from up-> down-> expired
    - select the normal power level your phone sends data. 0 seems to be good value .. needs more testing. The plugin cuts off at +1( normal iBeacon=-60 that is 10^-6 less power)
After a minute you should start seeing entries in your device view like this:
Screen Shot 2016-03-14 at 6.00.46 PM.png
Screen Shot 2016-03-14 at 6.00.46 PM.png (97.55 KiB) Viewed 4638 times

You could do multiple iPhone/ samsung.. at the same time. for each MAC numerate a separate independent process is launched and will send its info to the plugin separately.

It does some optimizing on its own. i.e. if no answer it does a second immediately after the failed on. thats seems to catch 99% of any connect issues-- don't know why..

You can use these devices also in FINGSCAN like regular iBeacons.

There will likely be still some bugs. as this is the first version with this functionality and we will need to tune the algorithms to optimize reopens/ battery life/ ...


And many thanks to Hackencrash for figuring out how to do this...

Karl

ps after installing this, all rPi will take a bit longer to come back online, as several programs will get loaded.. ~ 1-5 minutes is normal

the device edit screen:
Attachments
Screen Shot 2016-03-14 at 6.01.54 PM.png
Screen Shot 2016-03-14 at 6.01.54 PM.png (73.26 KiB) Viewed 4638 times

Posted on
Wed Mar 23, 2016 11:16 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: piBEACON: presence monitoring download

posted 1.17.3

fixed:
1. expiration parameter was not set for new beacons
2. iphone BLE expiration was not handled correctly
3. only one iPhone per rPi was accepted

added:
you now can map inputGPIO 0/1 to ON/off or off/ON in the status display and the icon shows ON/off


for iPhone BLE to work you need to have one (in) active pair defined on your iPhone

Karl

Posted on
Sun Mar 27, 2016 9:41 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: piBEACON: presence monitoring download

posted V 1.17.4

fixed:
connect-BLE/iphoneBLE timeouts are done correctly (up--> down--> expired)

added
- a option to restart each rPi at 0:00,1:00,2:00,3:00 in the morning; set in config
- added some more options to send/restart py pgms/ reload libraries/ reboot the rPi and combinations thereof.
Mostly for me during development or when you get an update or anything did not get pushed properly
- added command to be issued directly on the rPi to do an op-sys upgrade with a major rPi version i.e. with jessie. I decided not to automate this as it might take ~ 1-2 hours to finish. You will need to login (ssh pi@...) and issue the command "sudo python installLibs upgradeOpSys"


some data format was changed. You might get some error messages until all the programs etc have been distributed to your rPis and activated ( something like "bad data format for Alive ..")


Karl

Posted on
Tue Mar 29, 2016 12:16 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: piBEACON: presence monitoring download

posted v 1.17.5

Fixed:
when send to rPi with restart loop was used it did a send and reboot instead.
smaller minor fixes

added:
better language in menus, a bit more help..


posted new4 GByte SSD .
Tis is to just post the latest Version. if your system works, no need to upgrade
Games, Wofram, and some other overhead was remove.
It now uses 3Gbyte, with 1 GByte left free (you still need a 8GByte SSD though) .
All configs are done. You only need to set timezone and expand the disk in sudo raspi-config and send the configs(uid, passwords ..) from your plugin

Karl

removed programs from std rPi op-sys with:
sudo apt-get purge wolfram-engine python-pygame python-tk python3-tk purge scratch nuscratch sonic-pi minecraft-pi python-minecraftpi
sudo apt-get -y autoremove

Posted on
Wed Mar 30, 2016 9:34 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: piBEACON: presence monitoring download

poster v 1.17.6

fixed: for BLE-Connect devices search only
when several iPhone where tracked in iPhoneBLE / BLE connect mode it sometimes created false positive Up states . This was due to the fact that the bluez library does not seem to be fully multitasking and some overlap between the data of 2 different queries was created.
Now the the queries are serialized. The Wait time is not simple wait time 1 + wait time 2 before a device gets queried, but in the loop (once every 0.1 seconds) the current time stamp is compared with the time stamp of each iPhone individually and the next query then only depends on these 2 times. In rare circumstance where the calculated 2 timestamps are too close it might create a delay of ~ 2seconds before the next detection test of the iPhone. sounds complicated but is actually not so much. the coding was easier than writing it down.


Karl

Posted on
Sun Apr 03, 2016 7:19 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: piBEACON: presence monitoring download

posted v 1-17-9

fixed:
with OOOLLLDdD iBeacon indigo devices there was a chance that the "note" field had Pi-x as value. That confused the plugin, this will be corrected now. It should be something like this: "beacon-tile ,txP= -67". Only for rPi devices it should be "Pi-x"

changed:
the BLEconnect type (was iPhoneBLE) is now called BLEconnect also the py program on the rPi is BLEconnect.py.
Due to this you will need to edit you BLEconnect indigo devices (iPhones) and change the type to BLEconnect
This is a technical change, but I had 2 different names for the same thing.

improved:
- the BLE connect now has the option toenabled/disable rerun the connect if it fails to connect (in edit device).
- the connection is tested 10% before the end of the time wait if it is UP. If it finds it down it will re-test again and only after it fails to connect twice it will send "-999" as signal back to the plugin (= no connection) This is to improve stability of up/down states, just in case by accident it does not connect, it tries one more time.

- the time to go from up--> down--> expired is now calculated from the last UP signal. For this there is an additional state: lastUP. It shows the date/time stamp when the last up-Signal was received.
(before it was using an estimate .. not really clean)

I have changed the internal data structure for all sensors and output devices. Much cleaner now. If you have none defined you should not see any change. If you have some defined, please edit the devices and save them. It will correct any changes in structure.

Karl

The next issue I would like to tackle is the long time out when the rPi tries to connect to an (i)Phone and it does not connect, it is ~ 5 seconds.
I have not found a place where we could change the time-out settings. I would like to get it down to ~ 2 seconds.
If anyone sees any discussion about this please let me know.

Posted on
Mon Apr 04, 2016 3:52 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: piBEACON: presence monitoring download

V 1-17.10 posted

fixed:
the expiration times for the 3 minutes option were wrong instead of 180 seconds they were 18 seconds .. missed a 0 in devices.xml

added:
you now can select if the BLE queries / connection attempt are done in series or in parallel. This is important as a not online BLE device will take ~ 5 seconds to time out. During these 5 seconds no other BLE device can be queried. So with this option you can test your BLE devices without waiting for timeouts. I have tested this on an rPi-0 , don't know it it works on an rPi-2 with external BLE dongles. You will need to try that yourself in your setup. You set this option in the rPi device edit as it is not just for one BLE device but for all on an rPi. If you want to activate it for all rPi you need to set it in each rPi device edit. Default is in series.


Karl

Posted on
Tue Apr 05, 2016 8:57 am
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: piBEACON: presence monitoring download

v1.17.11 posted

fixed:
added a check if rPis are properly defined

Posted on
Tue Apr 05, 2016 9:56 am
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: piBEACON: presence monitoring download

v 1.17.12 posted

fixed version numbers ... should all be the same now 1.17.12, no other changed vs .11

Karl

Posted on
Tue Apr 05, 2016 6:50 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: piBEACON: presence monitoring download

v 1.17.14 posted

new:
as the rPi does not offer a stop/ shutdown button, one has to just unplug the power or do a shutdown command in a terminal session.
The version 1.17.14 now offers a hard wired option. If you add a switch between ground(e.g. PIN#9 just a cross GPIO 15) and GPIO 15 (rxDO, pin # 10) and hold/short it for >= 5 seconds the rPi will issue a
Code: Select all
sudo shutdown -h now
command which will gracefully shutdown the rPi.
You will need to enable that option in rPi edit device


Karl
ps
you can restart/reset the rPi by shorting the P6 / reset pins also labeled RUN. they are at different places for each rPi version each for "raspberry reset pins" in google

Posted on
Tue Apr 05, 2016 10:20 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: piBEACON: presence monitoring download

posted v 1-17-15

fixed:
bug that messed up rPi config and stopped plugin from adding a new rPi.

hope that solves many issues.

Karl

ps also make sure you don't have 2 piBeacon plugin running .. that also creates a real mess.
Only way to fix this:
1. disable piBEacon plugin
2. stop indigo server
3. if there is still a file piBEacon.plugin in the active plugin folder, please delete.
4. start indigo server
5. enable piBeacon

Posted on
Wed Apr 06, 2016 4:47 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: 3- presence monitoring download

posted 1-17-17

fixed:

- nasty bug in rPi update, with the help of roquej, should be wrestled to the ground
- also Address filed for BLE devices is now updated when you edit a BLE connect device.


Karl

Who is online

Users browsing this forum: No registered users and 16 guests