Page 10 of 21

Re: piBeacon: 3- presence monitoring download

PostPosted: Wed Jun 07, 2017 11:39 pm
by kw123
posted v 7-60-103

added/fixed:
- log files are now in the system ram disk /run/user/1000/pibeacon/" -- created by op-sys automatically. No need for enabling ram disk for log files anymore. You can still use a ram disk for var/log/ for the system log files if you like.

sensor i2c OPT3001 works well now. It delivers visible light Lux 0.1 .. 85k Lux equivalent to the human eye. works very well, highly recommended. ( it had the high and low byte flipped.. took me some time to figure that out)
sensor i2c LSM 303 magnetic direction and acceleration works fine now.
Both can be bought on eBay for a few $. Amazon cost 2-3 times as much

added some functionality to PULSE input.
- now we have simple CONT of pulses and BURSTS They both can be tuned:
count: min time delta between pulse, ignore frequent up/down/up if you have a non 100% digital signal (typical range: 0.01secs ...1 sec)
Burst min time delta between pulses and min pulses in timewindow to make a burst event, e.g. min tim delta = 0.05 secs and min # of pulses=5 in 3 seconds. would get suppress any one off pulses and also some flicking of sensor.
- in addition burst can initiate a local action on the RPI directly w/o going back to indigo, like other GPIO input sensors.

This works extremely well with a microwave motion sensor. It is insensitive to light or temperature. very fast, little noise or wrong positives. range some meters .. 12 meters depending on sensorr and settings. both together (PULEs sensor in burst mode) gives a very good motion sensor.

A new SSD image is posted: v 2017-06-7. This supports also the rPi zeroW. ;pi zero with wifi and BLE on board and has the latest program versions already installed.


Karl

will post some more details on all the sensors in the coming days ..

Re: piBeacon: 3- presence monitoring download

PostPosted: Thu Jun 08, 2017 9:06 am
by kw123
posted v 7-60-104

fixed:
GPIO input had a bug (a last minute change in the last version)

Karl

Re: piBeacon: 3- presence monitoring download

PostPosted: Wed Jun 14, 2017 10:35 am
by kw123
posted V 7-61-106

fixed: -

added:
1. added state "lastStatusChange" this will contain the date stamp of last UP/down/expired 0/1 change in status
Screen Shot 2017-06-14 at 11.31.27.png
Screen Shot 2017-06-14 at 11.31.27.png (6.03 KiB) Viewed 4354 times
This is implemented for
beacons, RPI, sensors that have a 0/1 state i.e. GPIO input, touch, not for temp sensors.
with this script you can get the seconds since last status change from the date stamp:
Code: Select all
import datetime, time
theDate           = indigo.devices["devnameofibeacon"].states["lastStatusChange"]
dd               = datetime.datetime.strptime(theDate, "%Y-%m-%d-%H%M%S")
secsSinceChange   = int(  time.time() - time.mktime(dd.timetuple())  )


2. added device type neo-pixel Clock .
You can use this to create a neo-pixle clock with rings of neo-pixels i.e. with a 12 and 60 ring ..
You can set color, # of pixels, which rings are used for HH,MM,SS, can set marks (dim light at e.g. 0/3/6/9..)

2. added an action for neo pixel to setup a thermometer using e.g. a string of 100 neo-pixels.
You can set e.g. change color from blue to full green for pixel 0..50 and set marks on the thermometer for e.g. current temp With this you could do a large thermometer where you can see internal and external temp, humidity ...

will be posting some examples how to use these

Karl

Re: piBeacon: 3- presence monitoring download

PostPosted: Wed Jun 14, 2017 8:40 pm
by kw123
fixed the SSD upload link
and if you downloaded the plugin on june 14, please download again. I might have mixed up some files.

Re: piBeacon: 3- presence monitoring download

PostPosted: Tue Jun 20, 2017 5:58 pm
by kw123
posted v 7-61-120

fixed:
bug in BLE connect did not expired BLE connect devices.. the device type name in devices.xml was changed from BLE-connect to BLEconnect. and that was not properly reflected in the py code
if you have a BLEconenct device, you might need to recreate them.. ( thanks to siclark for helping debugging this)

improved:
the neopixel clock now has many more options for hour/min/secs with:
- 1-3 LED on,
- show pixels in various rings,
- blink pixels from on/off to 59 secs on/ 1 sec off (e.g. off when minute changes .. off every 10 sec 15 secs 30 secs ..)
really cool now

Karl

a pic of the neo pixel clock. the colors and intensities are not well reflected in the iPhone image , they are too bright .

will add more details in the neopixel section (the neopixel device shown is ~ $51.)

Re: piBeacon: 3- presence monitoring download

PostPosted: Wed Jun 21, 2017 9:34 pm
by kw123
Posted V 7-61-121


added:
added more choices for expiration times i.e. 65 70 80 ...95 secs in case you like to fine tune the timings.
e.g. the RPI refresh is 60 secs and you want to set expiration not to 60 but 65 secs to make sure that you don't miss the window by a second .
- in config = default expiration time for all
- in device edit for RPI, BLEconnect iBeacon.

Karl

Re: piBeacon: 3- presence monitoring download

PostPosted: Thu Jul 06, 2017 4:44 pm
by kw123
posted V 7-62-121

added:
support for hardware clock (RTC) model DS3231 and DS1307(should work, not tested)
You need to add the HW clock selection in RPI device edit. The rest is done by the plugin.
It adds to /boot/config.txt.:
Code: Select all
dtoverlay=i2c-rtc,ds3231
and to /etc/rc.local
Code: Select all
/sbin/hwclock -s
See
https://trick77.com/adding-ds3231-real-time-clock-raspberry-pi-3/ and many other pages for discussion on this topic.

if you add/ remove the clock the plugin will add/ remove the changes from the system files and reboot.

These modules are very cheap ~ $1.50 with shipping and battery from china - via eBay.
The module goes on the GPIO header in the i2c pin section: 1,3,5,7,9 (needs V3.3, i2c and ground)

Please be aware that these clocks use 0x68 as their i2c address. If you have a sensor that uses the same.. no luck.

In addition the plugin will update the date/time on the RPIs automatically if they are off by > 10 secs. You can do this also in the menu or in an action. The resulting time delta is better than 0.5 secs.


Karl

piBeacon: 3- presence monitoring download

PostPosted: Mon Jul 24, 2017 9:26 pm
by kw123
posted v 7-63-125


fixed:
- the RTC (clock) now works fine.
- sync the time MAC - RPI is working much better now. it compensates for all kids of thins. -- only interesting if you do not allow the RPI to get its time from the internet (NTP)
- fixed light sensor 2561. Used the adafruit code. But that had a bug. It reversed the bytes read. Now that sensor really makes sense and works fine.

added:
- is checking the RPI log file for core dumps (occurs when writing to the SD fails. the plugin will show and error message in the log file., something like this:
Code: Select all
9:50:20             -rPi error message :  {"pi":"13","program":"master","ipAddress":"192.168.1.33","ts":"1500303020=CDT","text":"checkSystemLOG_register_dump_occured_ Please check that RPI  you might need to replace SD

This should give you an early indication of a failing SD. just one a week should not be a problem. There could be other reasons.
- added some debug statement i.e. for "did not match C++ signature:updateStateOnServer(" error message
- the neo-pixel clock now works perfectly . you can create one and set it to no network mode - with the RTC it should keep the time for years and take it anywhere
- the neo-pixel clock now has many features (how to show time, set time, light intensity , timezones ..) ... . but before I write an extensive manual I would ike to know if anyone is interested ..
- ... in no network mode you can start your own ad-hoc WiFI network with a push of a button on the RPI ...

Karl

Re: piBeacon: 3- presence monitoring download

PostPosted: Tue Jul 25, 2017 6:28 am
by kw123
==>> only for indigo 6 users <=====
fixed indigo 6 older version compatibility

The device state update method changed over time. Now it will be using the OLD OLD update version if you are using indigo 6 and 5 ..

BUT this will be the last fix for indigo 6 ..
Indigo 7 has MANY advantages in speed functionality ..

Re: piBeacon: 3- presence monitoring download

PostPosted: Wed Aug 02, 2017 9:28 am
by kw123
posted v 7.63.130

fixed:
- RPI restart at night seems t work fine now , have had it running for 5 days and all RPi restarted when they should have.
- fixed many loose ends

worked mostly on the neoPixelCLock to cover exceptions; network on/off/; Hardware RTC clock . choosable light patterns, light sensitivity response ..

Karl

Re: piBeacon: 3- presence monitoring download

PostPosted: Fri Aug 04, 2017 8:43 am
by kw123
had a big bug in v .130 (removed from post) . posted v ..133 ..

also added:
if RPI is offline you got a message every minute or so that updates not success full. this message now will only appear if you have debug "RPI update" on

Re: piBeacon: 3- presence monitoring download

PostPosted: Wed Aug 30, 2017 12:01 pm
by kw123
posted v 7-63-136

fixed:
some smaller issues with output devices, i.e. set GPIO output (if analog value was set to "" , not a number it erred)

changed/ improved:
1. changed device states: STATUS and ONLINE for RPI and RPI sensors:
- STATUS is behaves now as if it is iBeacon - which for the RPI w/o sensors it is, values=up,down,expired
- ONLINE: shows if the RPI sends messages and can be connected by plugin, values: receiving data, offline, offline, offline-expired
2. added state; "lastMessage" = date-stamp of the last message received from the RPI directly (not beacon info from another RPI showing that the RPI is active)
this is useful to see if the RPI is working. It might be in a state where the BLE is still sending ibeacon messages and it is detects from other RPI, but it is not connected the the IP network.
3. some smaller improvements in menus
4. for output devices the delays start parameter is now relative to the current time - this is useful if the RPi time is off. the plugin will send relative times to "now" the RPI will then store this in its local time.
5. the start of the plugin has now more error checks in case something is not right (i.e. bad directories, rights etc)

Karl

Re: piBeacon: 3- presence monitoring download

PostPosted: Sun Sep 03, 2017 10:37 am
by kw123
posted v 7-63-140

changed:
==RPI device state "online" now has the following possible values: up/down/expired/reboot
changed this from other values to make it more consistent with other conventions = know when a device is "UP"
== if you set reboot to ON for the RPIs they will not reboot all at the same time but ~ 2minutes apart depending on their pi#:
E.g reboot time = 2am, pi#5 will reboot at 2am +2*5 minutes = 2:10 am


added:
alive messages are now send from RPi to the plugin if no other message was send in the last 85-95 seconds. If the message (curl) errors it will retry every 10 seconds to send a message (using the timestamp of file ~piBeacon/temp/messageSend )
The state "ONLINE" will go from up --> down after 120 seconds of having not received ANY message from the RPI. This is independent of any BLE message from another RPI that detects that RPI. Those will set the state "status" to up for RPI with BLE enabled
So you have TWO states that describe the state of each RPI: "status" = sending out BLE messages, "online" = sending messages to the plugin

This now enables a good way of detecting if an RPI has connection issues, i.e. loses network connection due to e.g. wifi problems or if it hangs
you can set a trigger on state "online" not equal "up" for each RPI to detect network problems

Thanks to Joe L for helping working through this.

Karl

Re: piBeacon: 3- presence monitoring download

PostPosted: Wed Sep 06, 2017 10:36 am
by kw123
posted v 7-64-140

added:
for apple devices that change MAC numbers but keep part of the UUID-MAJ-MIN message fixed:

you now can link
UUID or
UUID-MAJ or
UUID-MAJ-MIN or
UUID--MIN
to a fixed MAC number

When ever a uuid-xx message gets received, the RPI will overwrite the received MAC number with the MAC number in INDIGO. If it has changed or not.

Use the menu item "Define iPhone/iPad - UUID link" to set it up.
Screen Shot 2017-09-06 at 11.34.38.png
Screen Shot 2017-09-06 at 11.34.38.png (54.54 KiB) Viewed 3798 times

You can also setup a name that will overwrite the UUID part in the notes field.

Not completely tested, but it seems to work. I still need to make the menu a little bit more elegant.. currently it forgets previous settings etc ..

Karl

Re: piBeacon: 3- presence monitoring download

PostPosted: Thu Sep 07, 2017 10:00 am
by kw123
posted V-7-64-141

changed:
- menu structure to enter (apple) device to UUID link entry is now flowing better, lists are displayed with indicator if new or already defined.
- in print config: uuid link devices are now printed nicely formatted

Karl

print out of config for UUID to device links section
Code: Select all
10:56:48 pi configuration- ======  UUID to device LINKS ==============
10:56:48 pi configuration-MAC--------------  IndigoName---------------       UUID-Major-Minor--------------------          nickname--------------------   ConstType
10:56:48 pi configuration-45:A1:10:DB:F7:BD  b-ddd                           010607ff4c-16-523                             iphoneTest                     uuid-maj-     
10:56:48 pi configuration-B0:34:95:38:25:A5  b-B0:34:95:38:25:A5             011a0bff4c00090603-1290-1                     hhhh                           uuid-maj-     
10:56:48 pi configuration-27:6C:7B:D6:EC:B0  b-27:6C:7B:D6:EC:B0             011b0bff4c00090603-1728-43009                 xxx                            uuid-maj-     
10:56:48 pi configuration-D0:4F:7E:21:73:37  b-D0:4F:7E:21:73:37             011a0bff4c00090603-23050-1                    jjjj                           uuid-maj-     
10:56:48 pi configuration-27:3B:A1:92:7B:FE  b-aaa                           011b0bff4c00090603-4544-43009                 aaa                            uuid-maj-     
10:56:48 pi configuration-70:56:81:ED:65:B9  b-70:56:81:ED:65:B9             011a0bff4c00090602-47552-43008                ggg                            uuid-maj-