piBeacon: presence monitoring plugin discussions

Posted on
Thu Jun 01, 2017 4:22 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: presence monitoring plugin discussions

Yes I need to write a manual:

1. 101 pibeacon
2. 101 sensors
And then for the details to really get going. ... but writing manuals was never my strengths... but will do it.
Karl



Sent from my iPhone using Tapatalk

Posted on
Thu Jun 01, 2017 4:47 pm
Japple55 offline
Posts: 224
Joined: Sep 26, 2015
Location: NE Tennessee

Re: piBeacon: presence monitoring plugin discussions

CliveS wrote:
I also would like to see an idiots guide as I admit I bought a Pi3 and got so confused with the vast amount of data presented I just gave up and the Pi never left the box in the end.

CliveS


Me too :(

Posted on
Thu Jun 01, 2017 6:29 pm
johnfdl offline
Posts: 177
Joined: May 18, 2017
Location: Atlanta, GA USA

Re: piBeacon: presence monitoring plugin discussions

Well, I know nothing about rPis, linux, etc but I was able to get my PiBeacon installed and running via the following steps. Note: I documented some of these using the instructions found in the sticky announcements. I just found those a bit cryptic at points so this was an easy list from me to work from. Maybe it will help others.

Note: Below are the original steps as I wrote them, but these steps below have been corrected/improved. Please refer to the corrected/improved simple step-by-step here:
viewtopic.php?f=187&t=15562


  1. Buy Raspberry Pi3 (as it has all the necessary components)
  2. Buy iBeacon(s) (be sure they are ones that have been tested and work
  3. Buy 32 GB Micro SD card (8 GB is the min, but the 32 GB was $10 so I went for the big capacity)
  4. Download and install Plugin from here and install as you would any Indigo PlugIn
  5. Download SD image from here
  6. Open terminal window on your mac and type or paste: diskutil list
  7. Now put the SD in the mac and type or paste this into the terminal window: diskutil list
  8. Compare the two results from the two above commands to determine which is the disk # of the inserted SD card
  9. Enter/paste this command (replacing the y with the disk number from above step) into the terminal window: diskutil unmountDisk /dev/disky
  10. Enter/paste this command (replacing the y with the disk number from above step) into the terminal window. Note this may take 1+ hours: sudo newfs_msdos -F 16 /dev/disky
  11. Enter/paste this command (replacing the y with the disk number from above step and replacing the pathtoyourSSDimage with the path where you saved the downloaded image) into the terminal window: sudo dd bs=1m if=pathtoYourSSDImage of=/dev/rdisky
  12. Enter/paste this command (replacing the y with the disk number from above step) into the terminal window: diskutil unmountDisk /dev/disky
  13. Take ssd out and insert into raspberryPi
  14. Plug in ethernet into the Pi and HDMI into the Pi to connect to monitor/tv
  15. Power up the Pi (plug it in)
  16. Find out what IP address the Pi is assigned (I did this by checking my router)
  17. Back on your Mac, In terminal window type or paste (replacing x.x.x.x with the IP address of your Pi): ssh pi@x.x.x.x
  18. In terminal window,enter password (for me, it was raspberry)
  19. In terminal window type or paste: sudo raspi-config
  20. This will bring up a menu of options in the terminal. Select localization option (it was #4 for me)
  21. Select Change Timezone (for me, I selected America, then New York (since Atlanta was not in the list). Be sure it's the same time zone as your mac
  22. Select Advanced Options (#7 for me) once back on the main list of options menu, then select Expand Filesystem
  23. Select finish once back on the main menu and select Yes to reboot
  24. Once rebooted, connect again via the following command within terminal window: ssh pi@x.x.x.x
  25. In terminal window,enter password (for me, it was raspberry)
  26. Change password by typing this in the terminal window: passwd
  27. Enter old password when prompted (raspberry), then new password and again the new password
  28. In terminal window,enter or paste: sudo hciconfig hci0 up
  29. In terminal window,enter or paste: sudo hciconfig hci0 leadv
  30. In terminal window,enter or paste: sudo hcitool lescan
  31. In terminal window,enter or paste: sudo hcitool -i hci0 cmd 0x08 0x0008 1E 02 01 1A 1A FF 4C 00 02 15 2f 23 44 54 cf 6d 4a 0f ad f2 f4 91 1b a9 ff a6 00 01 00 01 C5 00
  32. In terminal window,enter or paste: hciconfig
  33. Now, configure the Indigo plugin: From the Indigo menubar, PlugIns->PiBeacon->Configure
  34. In the first section, I skipped all fields, accepting defaults
  35. In the second section, I changed My IP number to match that of my Indigo server (not the Pi)
  36. In the second section, I entered the userid and password for Indigo
  37. In the second section, I entered router IP number, wifi SSID, wifi password and Wifi security type
  38. I left all the other fields as their default and clicked Save
  39. Now, from Indigo menu, Plug-Ins->PiBeacon->Initial BASIC setup of rPi Servers
  40. In the pop-up box, select the first empty value in the picklist (it was 0 for me) and click CONFIRM button
  41. Set Enable rPi communication to ON
  42. Set Type of rPi to 40 pins
  43. Set rPi User ID to pi
  44. Set rPi password to the value you set up earlier (if you didn't change it, it is raspberry
  45. Set rPi IP number to the IP address for your PiBeacon
  46. Set last box to Restat programs on rPi (default)
  47. Click Confirm, then close.
  48. Now, from Indigo menu, Plug-Ins->PiBeacon->SendConfig/Restart/PGM.(etc) rPi Servers
  49. In Select rPi Server, select the one which has the IP address of your Pi and click Send Config button, then close.
  50. It should then create devices in your Indigo in a newly created piBeacon folder....one for the server and others for the Beacons it sees
  51. Any devices not renamed will be removed in an hour. So you need to rename any you want to keep by double clicking on the name and entering a new name to help you identify it.
    I don't know how you know which devices are what.....since I haven't yet received my xy3 iBeacons, this is as far as I have got.
Last edited by johnfdl on Fri Jun 02, 2017 5:32 am, edited 2 times in total.

Posted on
Thu Jun 01, 2017 7:42 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: presence monitoring plugin discussions

Wow. Could not have done it better.
Just step 28..32 are not needed.

If I may I will copy and paste in the sticky announcements




Sent from my iPhone using Tapatalk

Posted on
Thu Jun 01, 2017 10:44 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: presence monitoring plugin discussions

have added Johns writeup with some corrections to
http://forums.indigodomo.com/viewtopic.php?f=187&t=15562&p=110249#p110249 as pdf file.

Karl'

Posted on
Fri Jun 02, 2017 6:24 am
johnpolasek offline
Posts: 911
Joined: Aug 05, 2011
Location: Aggieland, Texas

Re: piBeacon: presence monitoring plugin discussions

Figuring out which beacons are which (especially if you buy a bunch at the same time) can be tricky; The easiest way is to power them up one by one and name each one when it appears. Note that if you don't change their name, they get deleted from the list after an hour. Also,IPhones will show up as beacons, but only for brief period of time when you bring them within range of the Pi, but they change their ID every time they connect (as a security measure to prevent them from being hacked in public) unless you play some tricks. Many other devices (android phones and fitbits for example) show up with permanent IDs and can be used instead of or in addition to the tiles.

Posted on
Fri Jun 02, 2017 7:05 am
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

piBeacon: presence monitoring plugin discussions

Some comments
-You can switch delete ibeacon on/off in config.
- iPhones can be used by using the uuid feature
- what I do to I'd new ibeacons: put the new one next to an rpi. You then should find a new ibeacon with high signal. Then move it away or take out the battery. Wait until signal disappears or it goes down. Then to confirm put it next to the rpi again.


Sent from my iPhone using Tapatalk

Posted on
Sat Jun 03, 2017 1:27 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: presence monitoring plugin discussions

Got a new (old) tektronix scope 2232 (5 nsec rise time analog w digital storage) .. good memories came back .. spend 5 years in front of one of these MANY years ago.. and they still work ..
Tek stopped making them 20+ years ago.

just a happy birthday kid :D

Karl.

ps a pic of the microwave sensor signal : with digital 1V/ div and analog signal 20mV/div. You can see when the digital signal triggers and how fast it is and what frequency ( ~ 40 Hz )

Need to find something in the 100Mhz region I can measure... to really use it if anyone has a challenge let me know ..
Attachments
Screen Shot 2017-06-03 at 14.17.26.png
Screen Shot 2017-06-03 at 14.17.26.png (386.82 KiB) Viewed 3359 times

Posted on
Wed Jun 07, 2017 9:25 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: presence monitoring plugin discussions

Just tested the pi zero w ( with wifi and BLE build in) with pibeacon.. after an op-sys upgrade pibeacon works now fine on that RPI type, before wifi and blue did not like each other. You need at least "2017-04-10-raspbian-jessie" version to run it .

I will publish a new SSD you can use. It will work on the pi0w as well as on all other RPI.

The list price is $ 10., but it is sold out. You can only get it with some other stuff for $20+ .

When It will finally be available in quantities, it will be a very good alternative for small wifi sensors (w or w/o iBeacon) $10+ sensors = $1-xx + box $ 5


Karl
creating a new SSD always takes about 3-5 hours.. a lot of Gbytes up and down load and upgrades and testing ..

Posted on
Sun Jun 11, 2017 5:38 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: presence monitoring plugin discussions

coming up:

1. some improvements for pulse input ,

2. thermometer output with neo-pixel .

3. neo-pixel clock with LED's in rings of 60/30/24/12 LEDs and seconds/min/hours stepping around the rings.. software is ready some want to test with some more be-pixels

4. a much more challenging piece.. that goes well beyond what I have done before: speech recognition on the RPI with our going to the cloud, everything local. CMU has code that can run on the RPI and in principle you can train it to recognize words and then pipe them into actions.

Karl

Posted on
Mon Jun 12, 2017 12:31 pm
johnfdl offline
Posts: 177
Joined: May 18, 2017
Location: Atlanta, GA USA

Re: piBeacon: presence monitoring plugin discussions

I'm trying to capture the timestamp a iBeacon last became UP. The device states all seem to be the last communication with the iBeacon. My plan is to write it to a variable using a trigger/action but thought to check here first to be sure I am not missing a better approach.

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

Re: piBeacon: presence monitoring plugin discussions

correct it currently has no last change state. I can add that.. would you like time since epoch (seconds) or date stamp and if what format (e.g. YYYY-mm-hh HH:MM:SS)

working in scripts time since epoch is easier to use -- time.time() gives you the seconds since epoch right now and you could do e.g.:
Code: Select all
import time
dev = indigo.devices["dev name of beacon"]
seondsSinceLastChange  = time.time() - float(dev.states["timeOfLastStateChange"])
that would give you the seconds since it was last changed fro Up..down..expired or down .. up.
doing that with date stamp requires some more steps (convert to date object then to time object then do the delta
or would you like to only see last UP time


Karl

Posted on
Mon Jun 12, 2017 7:12 pm
johnfdl offline
Posts: 177
Joined: May 18, 2017
Location: Atlanta, GA USA

Re: piBeacon: presence monitoring plugin discussions

That would be cool. My preference is for timestamp (YYYY-MM-DD-HH-MM-SS) as that would save me having to convert seconds to the date and time. My current need is only for last UP time but I could see others might be interested in timestamps of other states.

Posted on
Mon Jun 12, 2017 7:46 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: presence monitoring plugin discussions

The proposal is datestamp of last change (up/down)


Sent from my iPhone using Tapatalk

Posted on
Mon Jun 12, 2017 8:49 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: presence monitoring plugin discussions

how about this: "lastStateChangedDate"

I can do this for any device, code is ready, just need to add the state to the device def.
Attachments
Screen Shot 2017-06-12 at 21.47.42.png
Screen Shot 2017-06-12 at 21.47.42.png (120.92 KiB) Viewed 3121 times

Page 52 of 78 1 ... 49, 50, 51, 52, 53, 54, 55 ... 78

Who is online

Users browsing this forum: No registered users and 3 guests