piBeacon: 6- tips and tricks

Posted on
Tue Mar 08, 2016 9:35 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

piBeacon: 6- tips and tricks

change the display state column value:

The indigo state values of the GPIO input pins are
1 = GPIO input connected to ground
0 = GPIO open or high

if you want to inverse this for the display state value: set offset to -1 and multiplier to -1 in device INPUT edit that will do
0 = GPIO input connected to ground
1 = GPIO open or high
but only for the display state column not for the other states.

Posted on
Wed Mar 09, 2016 3:55 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: tips and tricks

Common UUID for different iBeacons used

Code: Select all
"xy": "07775dd0111b11e491910800200c9a66",
 tile": "01",
"sanwo": "fda50693a4e24fb1afcfc6eb07647825",
"radius": "2f234454cf6d4a0fadf2f4911ba9ffa6",
"pebbleBee": "1804180f1803190002020a0808ff0e0a",
"JINOU": "e2c56db5dffb48d2b060d0f5a71096e0",
"Jaalee": "ebefd08370a247c89837e7b5634df524",

you can replace the 32 digits with a name in the menu "MAP UUID to NAME"
then in the notes column the UUID will be replaced by the name you give that UUID

example: for xy ibeaocns map 07775dd0111b11e491910800200c9a66 to xy

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

Re: piBeacon: tips and tricks

if your wifi boot takes to long do this:
Code: Select all
ssh pi@x.x.x.x
sudo nano /etc/dhcp/dhclient.conf
change line
Code: Select all
#timeout 60;
to
Code: Select all
timeout 15;
save with CTRL-o <return> CTRL-x<return>
and reboot

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

Re: piBeacon: tips and tricks

how to replace a BLE adaptor on an rPi 0,1,2

1. delete rPi device in plugin
2.on rPi replace BLE device and reboot
3. allow new iBeacons in plugin config..(if you had it turned on) wait until new rPi shows up in device listing
4. setup new rPi in menu (userid and passwords etc should still be there and send config ... to new rPi
5. finish config of rPi in device edit
6. if you want to : disallow new iBeacons in plugin config after ~ 5 minutes or until all other rPi have seen and accepted the new rPi.


Karl

Posted on
Sat Nov 26, 2016 9:05 am
CraftGeek offline
User avatar
Posts: 107
Joined: May 13, 2015

piBeacon: 6- tips and tricks

Hi Karl,

My installation of piBeacon has been serving us very well, Thank you.

There are no issues to correct. I want to perform a yearly maintenance update of the rPi.

So, I have some questions.
  • Do you think that periodic maintenance updates are a good idea in this case? Or, if it is working it should be left alone?
  • Should the OS be updated also?
  • I can execute console commands remotely via SSH. Should this be the method I use to update the rPi? Or would you create new SSD cards from scratch?
  • What is the quickest way to check if my version of PiBeacon server needs updating?
  • If SSH to console is best, what commands would I use to update the PiBeacon server software on the rPi?

Thanks for your time and creating what has become a central part of our home automation and security.

Sean
Last edited by CraftGeek on Sat Nov 26, 2016 7:23 pm, edited 1 time in total.

Sean

Posted on
Sat Nov 26, 2016 10:13 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: 6- tips and tricks

first of all: YES use SSH.

to upgrade manually:

ssh into api
Code: Select all
sudo apt-get -y update &
sudo apt-get -y upgrade &

that does upgrades to existing installed programs ( cd pibeacon; sudo python installLibs.py force & does that for you on the RPI)
But I suggest to use the manual way. you might see an error message

if you want to get the latest RPI OPSYS image with ALL programs apps etc you need to do:
Code: Select all
sudo apt-get -y update &
sudo apt-get  dist-upgrade &

(no -y in 2. line). but many of them are not needed AND THIS WILL TAKE SOME HOURS !!

I do not suggest to download a fresh copy from raspberry as there are many libs needed by pibeacon you would need to be install manually.

The latest posted SSD (November2016 ) in downloads has all the new RPi version and configs libs .. installed. (it took me a day to create that one with all downloads, sizing, imaging redoing things ....)

I have ~15 RPI. Some of them are still on the original SSD (feb this year) and some have the latest. All of them work.
Whenever I have an issue on an RPI, I pop in the latest SSD . But then I need to set the network config on a monitor when I use WiFi on the RPI.

anyway if it works don't break it .. but the new pibeacon has some really nice features with groups and significant reduced CPU on the indigo server when you use i7

so if you like to tinker . download the new SSD from the pibeacon download, configure network, . that should be it.

you could also just use the new pibeacon plugin

hope that answers your questions..

Karl

Posted on
Sat Nov 26, 2016 10:11 pm
CraftGeek offline
User avatar
Posts: 107
Joined: May 13, 2015

Re: piBeacon: 6- tips and tricks

Perfect.

I added
Code: Select all
sudo shutdown now -r
and now I have my quarterly maintenance routine.

Thank you!

Sean

Posted on
Sun Nov 27, 2016 11:14 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: 6- tips and tricks

and please when you use the latest plugin enable RAM disk usage in RPI device edit. this will reduce the write to the SSD significantly.

Posted on
Thu Jul 27, 2017 5:32 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: 6- tips and tricks

reducing syslog logging on the RPI:

the following are easy to do and can reduce system loging by 90% on the RPI

disable avahi client = apple file sharing
Dec 31 18:04:01 raspberrypi avahi-daemon[385]: Withdrawing address record for fe80::eab9:d86e:20c7:bf9b on wlan0.
Dec 31 18:04:01 raspberrypi avahi-daemon[385]: Withdrawing address record for 192.168.1.38 on wlan0.
Dec 31 18:04:01 raspberrypi avahi-daemon[385]: Withdrawing workstation service for wlan0.
Dec 31 18:04:01 raspberrypi avahi-daemon[385]: Withdrawing workstation service for lo.

do:
Code: Select all
sudo systemctl disable avahi-daemon

remove entries like these:
Dec 31 18:57:28 raspberrypi rsyslogd-2007: action 'action 17' suspended, next retry is Fri Dec 31 18:58:58 1999 [try http://www.rsyslog.com/e/2007 ]

do:
Code: Select all
sudo nano /etc/rsyslog.conf

and comment last 4 lines:
#daemon.*;mail.*;\
#   news.err;\
#   *.=debug;*.=info;\
#   *.=notice;*.=warn   |/dev/xconsole

ctrl-o  to save
ctrl-x  to exit

to remove:
Jul 27 10:59:07 raspberrypi vncserver-x11[565]: AgentInitCheck: agent comms failure
Jul 27 10:59:12 raspberrypi vncserver-x11[565]: AgentInitCheck: no response from agent
Code: Select all
sudo raspi-config / interfaces
disable vnc 

to remove:
w1_master_driver w1_bus_master1: Family 0 for 00.700000000000.f8 is not registered.
do
if you do not use 1wire temp disable 1wire in
Code: Select all
sudo raspi-config / interfaces /
disable one wire


All of that together has reduced /var/log/syslog entries by 90% on my RPIs.. then you only see there real stuff


Karl

Posted on
Fri Dec 01, 2017 10:15 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: 6- tips and tricks

HOW to replace an RPI

==============
0. power down..
1. take SD out from the old put into new
2. boot up new
3. find new ip number of the new api (unifi, fingscan, your router)
4. ssh pi@newip (old password should still be fine
5. sudo ifconfig eth0 --oldIP-- netmask 255.255.255.0 ## set old IP number if you want that or change the ip number to the new one in menu basic initial setup
may be also in your router: set this IP-MAC number to the old IP number
==============

that worked for me, about 5 minutes total

Karl

Posted on
Mon Nov 12, 2018 11:10 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: 6- tips and tricks

issue: when RPI shuts down, it does not restart on its own when power is not interrupted.. need to connect reset pin to ground to do that.

The attached drawing should do that automatically.
If you have an RPI UPS HAT for the RPI: here a way to reset the RPI when +5V comes back online.

setup:
1. when +5V raw goes down, RPI starts counter (connect +5V raw to GPI-IN through resistor divider), When > 1 hour time w/o raw power, do auto shutdown.
2. when +5 raw comes back: T2 gets triggered (through R 10k+C100nF ) and the RPi resets = starts
when RPI is running a GPIO output pin is set high and disables T2 through T1. This disables shutdowns eg when you have a short power interruption.


Karl
Attachments
Screen Shot 2018-11-13 at 22.14.17.png
Screen Shot 2018-11-13 at 22.14.17.png (66.42 KiB) Viewed 7489 times

Posted on
Tue Nov 13, 2018 9:55 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: 6- tips and tricks

==== with RPI UPS HAT and this little piece of electronics you have ==== ====
- backup power of several hours
- soft / controlled shut shutdown before battery runs out
- restart when +5V per is back
==== ==== ==== ==== ==== ==== ==== ==== ==== ==== ==== ==== ====
this actually works!!

with the RPI UPS HAT you can have a battery back that can keep the RPI running for xx minutes = keepRunning(*) (set in rpi device edit) (3.7Ah = 12 hours for an rpiZero W)
after keep running is expired and +5V raw is not back the rpi will do a soft shutdown.

T2 will pull the "reset/RUN" pin down for some millisecs when +5Vraw is back and start the RPI
While RPI is running T1 will short the basis of T2 so that any change of V+5 raw does NOT trigger a reset / run.
Normally when the RPI (like the MAC) was shutdown in a regular way and power is still present (battery is still a charged) while shutting down it can only be restarted through a power cycle or a reset/run short to ground

To setup: in RPI device edit define
= shutdown input pin
= shutdown output pin
= keepRunning time


I was thinking about this for some years.. it finally works.

Will be working out the kinks(***), but this is very promising.. It will keep the SSD cards alive (damage due to wild power shutdowns) And will cover power failures ...

Karl


(*)how long does shut down input pin have to be active (= 0 Volt on R 3.3k) == keepRunning time

(***) things like : if power comes back for a short period of time and goes on/off while battery is not yet charged ie can not run for eg 5 hours
Attachments
Screen Shot 2018-11-13 at 22.02.06.png
Screen Shot 2018-11-13 at 22.02.06.png (35.33 KiB) Viewed 7495 times

Posted on
Fri Jun 14, 2019 12:41 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: 6- tips and tricks

If you have your RPI in a place where it is difficult to get to the SD, and you need to swap the SD more than once here an extender that seems to work fine. They have a 10cm option (shortest)

At amazon for $7:
>>OUSHE 10cm TF/Micro SD to Micro SD Extension Cable Flexible 4 8 16 32GB TF Memory Card Reader Adapter Zip Extender Cord for MacBook/Kindle/Raspberry Pi/Camera/Arduino/3D Printer/Monitoring System/TV<<

Karl
Attachments
Screen Shot 2019-06-14 at 11.54.03.png
Screen Shot 2019-06-14 at 11.54.03.png (150.38 KiB) Viewed 5980 times

Posted on
Sun Mar 21, 2021 8:55 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: piBeacon: 6- tips and tricks

if you have many RPi (or beacons) and want to know if any / which is offline you can use this script:
Code: Select all
# show which rpi is offline
# create trigger on variable changed (eg b_PI_nHome) , add condition value < number of rpi you have

for dev in indigo.devices.iter(u"props.isRPIDevice"):
   if dev.states["status"] != u"up":
      indigo.server.log(u"rpi is not up: {:25s} last message received:{}".format(dev.name, dev.states["last_MessageFromRpi"]))


or for beacons:
Code: Select all
# show which family beacon went down
# 1. add beacons to one group eg family  (in device edit)
# 2. create trigger on variable changed (eg beacons_family_home) , add condition value < number of beacons in your family you have

for dev in indigo.devices.iter(u"props.isBeaconDevice"):
   if dev.states["status"] != u"up":
      if dev.states["groupMember"].find(u"Family") >-1:
         indigo.server.log(u"Family beacon is not home: {:30s} last message received:{}".format(dev.name, dev.lastChanged))


or for BLEconnect:
Code: Select all
# show which BLEconnect phone  went down
# 2. create trigger on variable changed b_BLEconnect_nHome , add condition value < number of beacons in your family you have

for dev in indigo.devices.iter(u"props.isBLEconnectDevice"):
   if dev.states["status"] != u"up":
         indigo.server.log(u"beacon is not home: {:30s} last message received:{}".format(dev.name, dev.lastChanged))

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 6 guests