However
Code: Select all
sudo python /usr/local/bin/check_beacon_presence.py
Starting the service seems to work
Code: Select all
root@raspberrypi:/home/pi# sudo /etc/init.d/check_beacon_presence start
[ ok ] Starting check_beacon_presence (via systemctl): check_beacon_presence.service.
Code: Select all
root@raspberrypi:/home/pi# sudo /etc/init.d/check_beacon_presence status
● check_beacon_presence.service - LSB: This daemon manages the bluetooth low energy device detector : check_beacon_presence
Loaded: loaded (/etc/init.d/check_beacon_presence)
Active: active (running) since Sun 2016-05-29 17:31:31 CEST; 13min ago
Process: 1437 ExecStop=/etc/init.d/check_beacon_presence stop (code=exited, status=0/SUCCESS)
Process: 1484 ExecStart=/etc/init.d/check_beacon_presence start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/check_beacon_presence.service
└─1491 /usr/bin/python /usr/local/bin/check_beacon_presence.py
May 29 17:31:31 raspberrypi sudo[1518]: root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/bin/hciconfig hci0 down
May 29 17:31:31 raspberrypi sudo[1518]: pam_unix(sudo:session): session opened for user root by (uid=0)
May 29 17:31:31 raspberrypi sudo[1518]: pam_unix(sudo:session): session closed for user root
May 29 17:31:31 raspberrypi sudo[1533]: root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/bin/hciconfig hci0 up
May 29 17:31:31 raspberrypi sudo[1533]: pam_unix(sudo:session): session opened for user root by (uid=0)
May 29 17:31:32 raspberrypi sudo[1533]: pam_unix(sudo:session): session closed for user root
May 29 17:31:32 raspberrypi sudo[1548]: root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/bin/hciconfig
May 29 17:31:32 raspberrypi sudo[1548]: pam_unix(sudo:session): session opened for user root by (uid=0)
May 29 17:31:32 raspberrypi sudo[1548]: pam_unix(sudo:session): session closed for user root
May 29 17:38:46 raspberrypi systemd[1]: Started LSB: This daemon manages the bluetooth low energy device detector : check...esence.
Hint: Some lines were ellipsized, use -l to show in full.
root@raspberrypi:/home/pi#
This is part of the check_beacon_presence.py
Code: Select all
#
# Configure your Beacons in the TAG_DATA table with : [Name,MacAddress,Timeout,0,idx,mode]
# Name : the name of the uservariable used in Domoticz
# macAddress : case insensitive
# Timeout is in secondes the elapsed time without a detetion for switching the beacon AWAY. Ie :if your beacon emits every 3 to 8$
# 0 : used by the script (will keep the time of the last broadcast)
# idx of the uservariable in Domoticz for this beacon
# mode : SWITCH_MODE = One update per status change / REPEAT_MODE = continuous updating the RSSI every 3 secondes
TAG_DATA = [
["Tag_MIC","D3:28:DC:59:B5:3E",15,0,1,SWITCH_MODE],
["Tag_VANEZ","F9:26:9F:29:BA:39",15,0,2,SWITCH_MODE]
]
import logging
# choose between DEBUG (log every information) or CRITICAL (only error)
logLevel=logging.DEBUG
#logLevel=logging.CRITICAL
logOutFilename='/var/log/check_beacon_presence.log' # output LOG : File or console (comment this line to console output)
ABSENCE_FREQUENCY=5 # frequency of the test of absence. in seconde. (without detection, switch "AWAY".
Any advice to get this working again?