Anwesenheitserkennung mittels BT und RASPBERRY

User stellen ihre Haussteuerung vor

Moderator: Co-Administratoren

marius.jaworowski@gmail.com
Beiträge: 26
Registriert: 30.04.2016, 11:50

Re: Anwesenheitserkennung mittels BT und RASPBERRY

Beitrag von marius.jaworowski@gmail.com » 13.06.2017, 16:49

ich werde mir das die mal genauer ansehen und ein Update hoch laden.

elvthg
Beiträge: 44
Registriert: 06.06.2016, 02:46
Hat sich bedankt: 3 Mal

Re: Anwesenheitserkennung mittels BT und RASPBERRY

Beitrag von elvthg » 14.06.2017, 11:55

Hallo Marius,
marius.jaworowski@gmail.com hat geschrieben:ich werde mir das die mal genauer ansehen und ein Update hoch laden.
super, wäre klasse wenn Du da was finden würdest.

Denn zumindest bei mir besteht das Problem, das die Sensoren auch ab und an weg sind, dann hilft nur, alles neu zu starten, meist geht es dann wieder für viele Stunden, manchmal auch nicht.

Code: Alles auswählen

14.06.2017 01:29:40 [INFO    ] Load Config file.. /opt/spot/spot.cfg
14.06.2017 01:29:40 [INFO    ] Preparing to run in daemon mode
14.06.2017 01:29:40 [INFO    ] Starting to collect parameters
14.06.2017 01:29:42 [INFO    ] Connection to the CCU establish (RX): 10.20.30.25
14.06.2017 01:29:42 [INFO    ] All parameters collected. System OK -> STARTING WORK
14.06.2017 01:30:16 [ERROR   ] Sensor 10.20.30.32 timeout - sensor_com.py - display_msg
14.06.2017 01:30:24 [ERROR   ] Sensor 10.20.30.28 timeout - sensor_com.py - display_rgbled
14.06.2017 01:30:33 [ERROR   ] Sensor 10.20.30.28 timeout - sensor_com.py - get_sensor_name
14.06.2017 01:30:33 [INFO    ] Sensor :10.20.30.28 (unknown) is online
14.06.2017 01:30:33 [INFO    ] Sensor :10.20.30.32 (rpi-zw1) is online
14.06.2017 01:31:19 [ERROR   ] Sensor 10.20.30.28 timeout - sensor_com.py - display_rgbled
14.06.2017 01:32:04 [INFO    ] Sensor : 10.20.30.28 . Disconnected
14.06.2017 01:32:14 [INFO    ] Sensor : 10.20.30.32 . Disconnected
14.06.2017 01:32:14 [ERROR   ] All Sensor are offline!
14.06.2017 01:32:30 [ERROR   ] Sensor 10.20.30.28 timeout - sensor_com.py - display_rgbled
14.06.2017 01:32:59 [INFO    ] Sensor : 10.20.30.28 . Disconnected
14.06.2017 01:33:42 [ERROR   ] Sensor 10.20.30.28 timeout - sensor_com.py - display_msg
14.06.2017 01:34:00 [ERROR   ] Sensor 10.20.30.28 timeout - sensor_com.py - display_rgbled
14.06.2017 01:34:17 [ERROR   ] Sensor 10.20.30.32 timeout - sensor_com.py - display_rgbled
14.06.2017 01:34:23 [ERROR   ] Sensor 10.20.30.28 timeout - sensor_com.py - get_sensor_name
14.06.2017 01:34:23 [INFO    ] Sensor :10.20.30.28 (unknown) is online
14.06.2017 01:34:24 [ERROR   ] Sensor 10.20.30.32 timeout - sensor_com.py - get_sensor_name
14.06.2017 01:34:24 [INFO    ] Sensor :10.20.30.32 (unknown) is online
14.06.2017 01:34:41 [ERROR   ] Sensor 10.20.30.28 timeout - sensor_com.py - display_rgbled
14.06.2017 01:34:48 [ERROR   ] Sensor 10.20.30.32 timeout - sensor_com.py - display_rgbled
14.06.2017 01:35:20 [INFO    ] Sensor : 10.20.30.28 . Disconnected
14.06.2017 01:35:30 [INFO    ] Sensor : 10.20.30.32 . Disconnected
14.06.2017 01:35:30 [ERROR   ] All Sensor are offline!
14.06.2017 01:35:47 [ERROR   ] Sensor 10.20.30.28 timeout - sensor_com.py - display_rgbled
14.06.2017 01:36:03 [ERROR   ] Sensor 10.20.30.32 timeout - sensor_com.py - display_rgbled
14.06.2017 01:36:25 [INFO    ] Sensor : 10.20.30.28 . Disconnected
14.06.2017 01:36:35 [INFO    ] Sensor : 10.20.30.32 . Disconnected
14.06.2017 01:36:43 [INFO    ] Load Config file.. /opt/spot/spot.cfg
14.06.2017 01:37:23 [INFO    ] Load Config file.. /opt/spot/spot.cfg
14.06.2017 01:37:23 [INFO    ] Preparing to run in daemon mode
14.06.2017 01:37:24 [INFO    ] Starting to collect parameters
14.06.2017 01:37:26 [INFO    ] Connection to the CCU establish (RX): 10.20.30.25
14.06.2017 01:37:26 [INFO    ] All parameters collected. System OK -> STARTING WORK
14.06.2017 01:37:36 [INFO    ] Sensor : 10.20.30.32 . Disconnected
Auf der "Spot-Zentrale" lief noch der Sensor, nicht aber spot.py selbst, nach dem Löschen des PID-Files habe ich neu gestartet:

Code: Alles auswählen

14.06.2017 11:45:00 [INFO    ] Load Config file.. /opt/spot/spot.cfg
14.06.2017 11:45:00 [INFO    ] Preparing to run in daemon mode
14.06.2017 11:45:00 [INFO    ] Starting to collect parameters
14.06.2017 11:45:03 [INFO    ] Connection to the CCU establish (RX): 10.20.30.25
14.06.2017 11:45:03 [INFO    ] All parameters collected. System OK -> STARTING WORK
14.06.2017 11:45:42 [INFO    ] Sensor :10.20.30.28 (rpi-31) is online
14.06.2017 11:45:42 [INFO    ] Sensor :10.20.30.32 (rpi-zw1) is online
14.06.2017 11:46:34 [ERROR   ] Sensor 10.20.30.32 timeout - sensor_com.py - display_rgbled
14.06.2017 11:47:34 [INFO    ] Sensor : 10.20.30.32 . Disconnected
14.06.2017 11:47:41 [ERROR   ] Sensor 10.20.30.28 timeout - sensor_com.py - display_rgbled
14.06.2017 11:47:57 [ERROR   ] Sensor 10.20.30.32 timeout - sensor_com.py - display_rgbled
14.06.2017 11:48:29 [INFO    ] Sensor : 10.20.30.28 . Disconnected
14.06.2017 11:48:39 [INFO    ] Sensor : 10.20.30.32 . Disconnected
14.06.2017 11:48:39 [ERROR   ] All Sensor are offline!
14.06.2017 11:48:56 [ERROR   ] Sensor 10.20.30.28 timeout - sensor_com.py - display_rgbled
14.06.2017 11:49:12 [ERROR   ] Sensor 10.20.30.32 timeout - sensor_com.py - display_rgbled
14.06.2017 11:49:35 [INFO    ] Sensor : 10.20.30.28 . Disconnected
14.06.2017 11:49:45 [INFO    ] Sensor : 10.20.30.32 . Disconnected
14.06.2017 11:50:07 [INFO    ] Sensor : 10.20.30.28 . Disconnected
14.06.2017 11:50:17 [INFO    ] Sensor : 10.20.30.32 . Disconnected
14.06.2017 11:50:39 [INFO    ] Sensor : 10.20.30.28 . Disconnected
14.06.2017 11:50:49 [INFO    ] Sensor : 10.20.30.32 . Disconnected
14.06.2017 11:51:11 [INFO    ] Sensor : 10.20.30.28 . Disconnected
14.06.2017 11:51:21 [INFO    ] Sensor : 10.20.30.32 . Disconnected
14.06.2017 11:51:43 [INFO    ] Sensor : 10.20.30.28 . Disconnected
14.06.2017 11:51:53 [INFO    ] Sensor : 10.20.30.32 . Disconnected
Und nun sind wieder alle Sensoren weg.

Keine Ahnung wesbalb.

Grüße elvthg

elvthg
Beiträge: 44
Registriert: 06.06.2016, 02:46
Hat sich bedankt: 3 Mal

Re: Anwesenheitserkennung mittels BT und RASPBERRY

Beitrag von elvthg » 14.06.2017, 12:07

Noch ein Log, Neustart im Debug-Modus:

Code: Alles auswählen

root@rpi-31:/opt/spot# python spot.py -l
info     Load Config file.. /opt/spot/spot.cfg
------------------- Spot 1.5.2 -------------------
------------------- Log DEBUG manual set to True -------------------
debug    DEBUG LOG manual set to True 
Terminal Mode
Local Sensor Mode Enabled - You will need to stop the Sensor manually : python spot_sensor.py -s
debug    Script file is present, OK .
debug    Starting : spot_sensor.py
info     Load Config file.. /opt/spot/spot.cfg
------------------- spot_sensore 1.6.2 -------------------
---------- Sensor name : rpi-31 ----------
debug    Got the option to stop the Daemon 
Could not stop, pid file '/tmp/spot_sensor.pid' missing.
info     Load Config file.. /opt/spot/spot.cfg
------------------- spot_sensore 1.6.2 -------------------
---------- Sensor name : rpi-31 ----------
------------------- Log DEBUG manual set to True -------------------
debug    DEBUG LOG manual set to True
------------------- Preparing to run in daemon mode -------------------
info     Preparing to run in daemon mode

started with pid 3001
info     Starting to collect parameters
debug    checking if ip interface is ready
debug    IP interface is ready to go! local IP : 10.20.30.28
debug    Running Auto Discovery for Sensors 
debug    sending broadcast to discover the sensors
debug    1 sensors discovered : {'10.20.30.32': '10002 '}
debug    Getting Devices for check from CCU2
debug    Connecting to the CCU to get device list : 10.20.30.25
info     Connection to the CCU establish (RX): 10.20.30.25
info     All parameters collected. System OK -> STARTING WORK
debug    checking if : 10.20.30.32 . ready to receive the device list
debug    Sensor ping failed to : 10.20.30.32 . Moving on to the next sensor
info     Sensor : 10.20.30.32 . Disconnected
debug    Beginning to calculate the presence information from the Sensors
debug    All Sensors Down. loop counter 1
debug    0 of 7 are in the coverage of Spot
debug    going sleep for 20.0 s
debug    Rediscovering Sensor and devices. Loop : 2
debug    Connecting to the CCU to get device list : 10.20.30.25
debug    sending broadcast to discover the sensors
debug    2 sensors discovered : {'10.20.30.28': '10002 ', '10.20.30.32': '10002 '}
Traceback (most recent call last):
  File "spot.py", line 538, in <module>
    main()
  File "spot.py", line 231, in main
    hostnamesensor = get_sensor_name(sensor, sensor_port)
UnboundLocalError: local variable 'sensor_port' referenced before assignment
Den .32-Sensor habe ich dann neu gestartet, dann den spot und spot_sensor auf der .28 gestartet.
Auf der .28 habe ich dann aber die spot.py "gekillt" und erneut im Debug-Modus aufgerufen, weil die "Erfahrung" gezeigt hat, das der lokale Sensor eher gefunden wird, wenn er bereits läuft und man dann erst den Spot startet.

Das neue Log, zunächst geht alles, dann verliert spot.py aber die Sensoren, auch seinen eigenen, lokalen, was ich nicht verstehe. Ein ps findet jedoch sowohl auf der .28, als auch auf der .32 die "spot_sensor.py".

Code: Alles auswählen

root@rpi-31:/opt/spot# /etc/init.d/spot start
Start spot ... OK
root@rpi-31:/opt/spot# info     Load Config file.. /opt/spot/spot.cfg
------------------- Spot 1.5.2 -------------------
------------------- Preparing to run in daemon mode -------------------
info     Preparing to run in daemon mode
debug    Script file is present, OK .
debug    Starting : spot_sensor.py
info     Load Config file.. /opt/spot/spot.cfg
------------------- spot_sensore 1.6.2 -------------------
---------- Sensor name : rpi-31 ----------
debug    Got the option to stop the Daemon 
info     Load Config file.. /opt/spot/spot.cfg
------------------- spot_sensore 1.6.2 -------------------
---------- Sensor name : rpi-31 ----------
------------------- Preparing to run in daemon mode -------------------
info     Preparing to run in daemon mode

started with pid 3030

started with pid 3032

root@rpi-31:/opt/spot# ps aux | grep spot
root      3030  0.2  0.7  21228  7540 ?        Sl   12:04   0:00 python /opt/spot/spot_sensor.py -d
root      3032  1.2  0.8  12868  8432 ?        S    12:04   0:00 python /opt/spot/spot.py -d
root      3035  0.0  0.1   3124  1784 pts/1    S+   12:04   0:00 grep spot
root@rpi-31:/opt/spot# kill -9 3032
root@rpi-31:/opt/spot# rm /tmp/spot_
spot_check.pid   spot_sensor.pid  
root@rpi-31:/opt/spot# rm /tmp/spot_check.pid 
root@rpi-31:/opt/spot# python spot.py -l
info     Load Config file.. /opt/spot/spot.cfg
------------------- Spot 1.5.2 -------------------
------------------- Log DEBUG manual set to True -------------------
debug    DEBUG LOG manual set to True 
Terminal Mode
Local Sensor Mode Enabled - You will need to stop the Sensor manually : python spot_sensor.py -s
debug    Script file is present, OK .
debug    Script is already running, OK .
info     Starting to collect parameters
debug    checking if ip interface is ready
debug    IP interface is ready to go! local IP : 10.20.30.28
debug    Running Auto Discovery for Sensors 
debug    sending broadcast to discover the sensors
debug    2 sensors discovered : {'10.20.30.28': '10002 ', '10.20.30.32': '10002 '}
debug    Getting Devices for check from CCU2
debug    Connecting to the CCU to get device list : 10.20.30.25
info     Connection to the CCU establish (RX): 10.20.30.25
info     All parameters collected. System OK -> STARTING WORK
debug    checking if : 10.20.30.28 . ready to receive the device list
debug    10.20.30.28 . is ready to receive the device list. Sending list..
debug    10.20.30.28 done..
debug    sendVariableToCCU2 Command : http://10.20.30.25/config/xmlapi/statechange.cgi?ise_id=17821&new_value=true
debug    sendVariableToCCU2.html Answer from CCU2 : <?xml version="1.0" encoding="ISO-8859-1" ?><result><changed id="17821" new_value="true" /></result>
debug    10.20.30.28 sending msg to sensor's display : Hello TG
debug    Sensor 10.20.30.28 has not displayed Text: Hello TG
debug    10.20.30.32 sending msg to sensor's display : Hello TG
error    Sensor 10.20.30.32 timeout - sensor_com.py - display_msg
debug    10.20.30.28 sending rgb LED to sensor's LED : 001
debug    Sensor 10.20.30.28 showing RGB : 001
debug    10.20.30.32 sending rgb LED to sensor's LED : 001
debug    Sensor 10.20.30.32 showing RGB : 001
debug    Sensor 10.20.30.28 replied with rpi-31 to gethostname
info     Sensor :10.20.30.28 (rpi-31) is online
debug    Sensor 10.20.30.32 replied with rpi-zw1 to gethostname
info     Sensor :10.20.30.32 (rpi-zw1) is online
debug    checking if : 10.20.30.32 . ready to receive the device list
debug    10.20.30.32 . is ready to receive the device list. Sending list..
debug    10.20.30.32 done..
debug    Beginning to calculate the presence information from the Sensors
debug    xx:xx:xx:xx:xx:53 remains unavailable
debug    xx:xx:xx:xx:xx:B1 remains unavailable
debug    xx:xx:xx:xx:xx:48 is still present. Loop : 1 Seen by : 10.20.30.28 10.20.30.32 
debug    xx:xx:xx:xx:xx:17 is first time no seen. Loop : 1
debug    xx:xx:xx:xx:xx:9A remains unavailable
debug    xx:xx:xx:xx:xx:1F remains unavailable
debug    xx:xx:xx:xx:xx:72 remains unavailable
debug    2 of 7 are in the coverage of Spot
debug    2 devices around
debug    10.20.30.28 sending rgb LED to sensor's LED : 010
debug    Sensor 10.20.30.28 showing RGB : 010
debug    10.20.30.32 sending rgb LED to sensor's LED : 010
debug    Sensor 10.20.30.32 showing RGB : 010
debug    going sleep for 20.0 s
debug    checking if : 10.20.30.28 . ready to receive the device list
debug    Sensor ping failed to : 10.20.30.28 . Moving on to the next sensor
info     Sensor : 10.20.30.28 . Disconnected
debug    checking if : 10.20.30.32 . ready to receive the device list
debug    10.20.30.32 . is ready to receive the device list. Sending list..
debug    10.20.30.32 done..
debug    Beginning to calculate the presence information from the Sensors
debug    xx:xx:xx:xx:xx:53 remains unavailable
debug    xx:xx:xx:xx:xx:B1 remains unavailable
debug    xx:xx:xx:xx:xx:48 is still present. Loop : 2 Seen by : 10.20.30.28 10.20.30.32 
debug    xx:xx:xx:xx:xx:17 is still present. Loop : 2 Seen by : 10.20.30.32 
debug    xx:xx:xx:xx:xx:9A remains unavailable
debug    xx:xx:xx:xx:xx:1F remains unavailable
debug    xx:xx:xx:xx:xx:72 remains unavailable
debug    2 of 7 are in the coverage of Spot
debug    going sleep for 20.0 s
debug    Rediscovering Sensor and devices. Loop : 3
debug    Connecting to the CCU to get device list : 10.20.30.25
debug    sending broadcast to discover the sensors
debug    2 sensors discovered : {'10.20.30.28': '10002 ', '10.20.30.32': '10002 '}
debug    checking if : 10.20.30.28 . ready to receive the device list
debug    Sensor ping failed to : 10.20.30.28 . Moving on to the next sensor
info     Sensor : 10.20.30.28 . Disconnected
debug    checking if : 10.20.30.32 . ready to receive the device list
debug    Sensor ping failed to : 10.20.30.32 . Moving on to the next sensor
info     Sensor : 10.20.30.32 . Disconnected
debug    Beginning to calculate the presence information from the Sensors
error    All Sensor are offline!
debug    All Sensors Down. loop counter 3
debug    0 of 7 are in the coverage of Spot
debug    no more devices around
debug    10.20.30.28 sending rgb LED to sensor's LED : 100
error    Sensor 10.20.30.28 timeout - sensor_com.py - display_rgbled
debug    10.20.30.32 sending rgb LED to sensor's LED : 100
debug    Sensor 10.20.30.32 showing RGB : 100
debug    going sleep for 10 s
debug    Rediscovering Sensor and devices. Loop : 4
debug    Connecting to the CCU to get device list : 10.20.30.25
debug    sending broadcast to discover the sensors
debug    2 sensors discovered : {'10.20.30.28': '10002 ', '10.20.30.32': '10002 '}
debug    checking if : 10.20.30.28 . ready to receive the device list
debug    Sensor ping failed to : 10.20.30.28 . Moving on to the next sensor
info     Sensor : 10.20.30.28 . Disconnected
debug    checking if : 10.20.30.32 . ready to receive the device list
debug    10.20.30.32 . is ready to receive the device list. Sending list..
debug    10.20.30.32 done..
debug    sendVariableToCCU2 Command : http://10.20.30.25/config/xmlapi/statechange.cgi?ise_id=17821&new_value=true
debug    sendVariableToCCU2.html Answer from CCU2 : <?xml version="1.0" encoding="ISO-8859-1" ?><result><changed id="17821" new_value="true" /></result>
debug    10.20.30.28 sending msg to sensor's display : Hello TG
error    Sensor 10.20.30.28 timeout - sensor_com.py - display_msg
debug    10.20.30.32 sending msg to sensor's display : Hello TG
debug    Sensor 10.20.30.32 has not displayed Text: Hello TG
debug    10.20.30.28 sending rgb LED to sensor's LED : 001
error    Sensor 10.20.30.28 timeout - sensor_com.py - display_rgbled
debug    10.20.30.32 sending rgb LED to sensor's LED : 001
error    Sensor 10.20.30.32 timeout - sensor_com.py - display_rgbled
error    Sensor 10.20.30.28 timeout - sensor_com.py - get_sensor_name
info     Sensor :10.20.30.28 (unknown) is online
error    Sensor 10.20.30.32 timeout - sensor_com.py - get_sensor_name
info     Sensor :10.20.30.32 (unknown) is online
debug    Beginning to calculate the presence information from the Sensors
debug    xx:xx:xx:xx:xx:53 remains unavailable
debug    xx:xx:xx:xx:xx:B1 remains unavailable
debug    xx:xx:xx:xx:xx:48 is still present. Loop : 4 Seen by : 10.20.30.32 
debug    xx:xx:xx:xx:xx:17 is first time no seen. Loop : 4
debug    xx:xx:xx:xx:xx:9A remains unavailable
debug    xx:xx:xx:xx:xx:1F remains unavailable
debug    xx:xx:xx:xx:xx:72 remains unavailable
debug    1 of 7 are in the coverage of Spot
debug    1 devices around
debug    10.20.30.28 sending rgb LED to sensor's LED : 010
error    Sensor 10.20.30.28 timeout - sensor_com.py - display_rgbled
debug    10.20.30.32 sending rgb LED to sensor's LED : 010
error    Sensor 10.20.30.32 timeout - sensor_com.py - display_rgbled
debug    going sleep for 20.0 s
debug    Rediscovering Sensor and devices. Loop : 5
debug    Connecting to the CCU to get device list : 10.20.30.25
debug    sending broadcast to discover the sensors
debug    2 sensors discovered : {'10.20.30.28': '10002 ', '10.20.30.32': '10002 '}
debug    checking if : 10.20.30.28 . ready to receive the device list
debug    Sensor ping failed to : 10.20.30.28 . Moving on to the next sensor
info     Sensor : 10.20.30.28 . Disconnected
debug    checking if : 10.20.30.32 . ready to receive the device list
debug    Sensor ping failed to : 10.20.30.32 . Moving on to the next sensor
info     Sensor : 10.20.30.32 . Disconnected
debug    Beginning to calculate the presence information from the Sensors
error    All Sensor are offline!
debug    All Sensors Down. loop counter 5
debug    0 of 7 are in the coverage of Spot
debug    no more devices around
debug    10.20.30.28 sending rgb LED to sensor's LED : 100
error    Sensor 10.20.30.28 timeout - sensor_com.py - display_rgbled
debug    10.20.30.32 sending rgb LED to sensor's LED : 100
error    Sensor 10.20.30.32 timeout - sensor_com.py - display_rgbled
debug    going sleep for 10 s
debug    Rediscovering Sensor and devices. Loop : 6
debug    Connecting to the CCU to get device list : 10.20.30.25
debug    sending broadcast to discover the sensors
debug    2 sensors discovered : {'10.20.30.28': '10002 ', '10.20.30.32': '10002 '}
debug    checking if : 10.20.30.28 . ready to receive the device list
debug    Sensor ping failed to : 10.20.30.28 . Moving on to the next sensor
info     Sensor : 10.20.30.28 . Disconnected
debug    checking if : 10.20.30.32 . ready to receive the device list
debug    Sensor ping failed to : 10.20.30.32 . Moving on to the next sensor
info     Sensor : 10.20.30.32 . Disconnected
debug    Beginning to calculate the presence information from the Sensors
debug    All Sensors Down. loop counter 6
debug    0 of 7 are in the coverage of Spot
debug    going sleep for 10 s
debug    Rediscovering Sensor and devices. Loop : 7
debug    Connecting to the CCU to get device list : 10.20.30.25
debug    sending broadcast to discover the sensors
debug    2 sensors discovered : {'10.20.30.28': '10002 ', '10.20.30.32': '10002 '}
debug    checking if : 10.20.30.28 . ready to receive the device list
debug    Sensor ping failed to : 10.20.30.28 . Moving on to the next sensor
info     Sensor : 10.20.30.28 . Disconnected
debug    checking if : 10.20.30.32 . ready to receive the device list
debug    Sensor ping failed to : 10.20.30.32 . Moving on to the next sensor
info     Sensor : 10.20.30.32 . Disconnected
debug    Beginning to calculate the presence information from the Sensors
debug    All Sensors Down. loop counter 7
debug    0 of 7 are in the coverage of Spot
debug    going sleep for 10 s
debug    Rediscovering Sensor and devices. Loop : 8
debug    Connecting to the CCU to get device list : 10.20.30.25
debug    sending broadcast to discover the sensors
debug    2 sensors discovered : {'10.20.30.28': '10002 ', '10.20.30.32': '10002 '}
debug    checking if : 10.20.30.28 . ready to receive the device list
debug    Sensor ping failed to : 10.20.30.28 . Moving on to the next sensor
info     Sensor : 10.20.30.28 . Disconnected
debug    checking if : 10.20.30.32 . ready to receive the device list
debug    Sensor ping failed to : 10.20.30.32 . Moving on to the next sensor
info     Sensor : 10.20.30.32 . Disconnected
debug    Beginning to calculate the presence information from the Sensors
debug    All Sensors Down. loop counter 8
debug    0 of 7 are in the coverage of Spot
debug    going sleep for 10 s
debug    Rediscovering Sensor and devices. Loop : 9
debug    Connecting to the CCU to get device list : 10.20.30.25
debug    sending broadcast to discover the sensors
debug    2 sensors discovered : {'10.20.30.28': '10002 ', '10.20.30.32': '10002 '}
debug    checking if : 10.20.30.28 . ready to receive the device list
debug    Sensor ping failed to : 10.20.30.28 . Moving on to the next sensor
info     Sensor : 10.20.30.28 . Disconnected
debug    checking if : 10.20.30.32 . ready to receive the device list
debug    Sensor ping failed to : 10.20.30.32 . Moving on to the next sensor
info     Sensor : 10.20.30.32 . Disconnected
debug    Beginning to calculate the presence information from the Sensors
debug    All Sensors Down. loop counter 9
debug    0 of 7 are in the coverage of Spot
debug    going sleep for 10 s
debug    Rediscovering Sensor and devices. Loop : 10
debug    Connecting to the CCU to get device list : 10.20.30.25
debug    sending broadcast to discover the sensors
debug    2 sensors discovered : {'10.20.30.28': '10002 ', '10.20.30.32': '10002 '}
debug    checking if : 10.20.30.28 . ready to receive the device list
debug    Sensor ping failed to : 10.20.30.28 . Moving on to the next sensor
info     Sensor : 10.20.30.28 . Disconnected
debug    checking if : 10.20.30.32 . ready to receive the device list
debug    Sensor ping failed to : 10.20.30.32 . Moving on to the next sensor
info     Sensor : 10.20.30.32 . Disconnected
debug    Beginning to calculate the presence information from the Sensors
debug    All Sensors Down. loop counter 10
debug    0 of 7 are in the coverage of Spot
debug    going sleep for 10 s
debug    Rediscovering Sensor and devices. Loop : 11
debug    Connecting to the CCU to get device list : 10.20.30.25
debug    sending broadcast to discover the sensors
debug    2 sensors discovered : {'10.20.30.28': '10002 ', '10.20.30.32': '10002 '}
debug    checking if : 10.20.30.28 . ready to receive the device list
debug    Sensor ping failed to : 10.20.30.28 . Moving on to the next sensor
info     Sensor : 10.20.30.28 . Disconnected
debug    checking if : 10.20.30.32 . ready to receive the device list
debug    Sensor ping failed to : 10.20.30.32 . Moving on to the next sensor
info     Sensor : 10.20.30.32 . Disconnected
debug    Beginning to calculate the presence information from the Sensors
debug    All Sensors Down. loop counter 11
debug    0 of 7 are in the coverage of Spot
debug    going sleep for 10 s
debug    Rediscovering Sensor and devices. Loop : 12
debug    Connecting to the CCU to get device list : 10.20.30.25
debug    sending broadcast to discover the sensors
debug    2 sensors discovered : {'10.20.30.28': '10002 ', '10.20.30.32': '10002 '}
debug    checking if : 10.20.30.28 . ready to receive the device list
debug    Sensor ping failed to : 10.20.30.28 . Moving on to the next sensor
info     Sensor : 10.20.30.28 . Disconnected
debug    checking if : 10.20.30.32 . ready to receive the device list
debug    Sensor ping failed to : 10.20.30.32 . Moving on to the next sensor
info     Sensor : 10.20.30.32 . Disconnected
debug    Beginning to calculate the presence information from the Sensors
debug    All Sensors Down. loop counter 12
debug    0 of 7 are in the coverage of Spot
debug    going sleep for 10 s
debug    Rediscovering Sensor and devices. Loop : 13
debug    Connecting to the CCU to get device list : 10.20.30.25
debug    sending broadcast to discover the sensors
debug    2 sensors discovered : {'10.20.30.28': '10002 ', '10.20.30.32': '10002 '}
debug    checking if : 10.20.30.28 . ready to receive the device list
debug    Sensor ping failed to : 10.20.30.28 . Moving on to the next sensor
info     Sensor : 10.20.30.28 . Disconnected
debug    checking if : 10.20.30.32 . ready to receive the device list
debug    Sensor ping failed to : 10.20.30.32 . Moving on to the next sensor
info     Sensor : 10.20.30.32 . Disconnected
debug    Beginning to calculate the presence information from the Sensors
debug    All Sensors Down. loop counter 13
debug    0 of 7 are in the coverage of Spot
debug    going sleep for 10 s
debug    Rediscovering Sensor and devices. Loop : 14
debug    Connecting to the CCU to get device list : 10.20.30.25
debug    sending broadcast to discover the sensors
debug    2 sensors discovered : {'10.20.30.28': '10002 ', '10.20.30.32': '10002 '}
debug    checking if : 10.20.30.28 . ready to receive the device list
debug    Sensor ping failed to : 10.20.30.28 . Moving on to the next sensor
info     Sensor : 10.20.30.28 . Disconnected
debug    checking if : 10.20.30.32 . ready to receive the device list
debug    Sensor ping failed to : 10.20.30.32 . Moving on to the next sensor
info     Sensor : 10.20.30.32 . Disconnected
debug    Beginning to calculate the presence information from the Sensors
debug    All Sensors Down. loop counter 14
debug    0 of 7 are in the coverage of Spot
debug    going sleep for 10 s
debug    Rediscovering Sensor and devices. Loop : 15
debug    Connecting to the CCU to get device list : 10.20.30.25
debug    sending broadcast to discover the sensors
debug    2 sensors discovered : {'10.20.30.28': '10002 ', '10.20.30.32': '10002 '}
debug    checking if : 10.20.30.28 . ready to receive the device list
debug    Sensor ping failed to : 10.20.30.28 . Moving on to the next sensor
info     Sensor : 10.20.30.28 . Disconnected
debug    checking if : 10.20.30.32 . ready to receive the device list
debug    Sensor ping failed to : 10.20.30.32 . Moving on to the next sensor
info     Sensor : 10.20.30.32 . Disconnected
debug    Beginning to calculate the presence information from the Sensors
debug    All Sensors Down. loop counter 15
debug    0 of 7 are in the coverage of Spot
debug    going sleep for 10 s
debug    Rediscovering Sensor and devices. Loop : 16
debug    Connecting to the CCU to get device list : 10.20.30.25
debug    sending broadcast to discover the sensors
debug    2 sensors discovered : {'10.20.30.28': '10002 ', '10.20.30.32': '10002 '}
debug    checking if : 10.20.30.28 . ready to receive the device list
debug    Sensor ping failed to : 10.20.30.28 . Moving on to the next sensor
info     Sensor : 10.20.30.28 . Disconnected
debug    checking if : 10.20.30.32 . ready to receive the device list
debug    Sensor ping failed to : 10.20.30.32 . Moving on to the next sensor
info     Sensor : 10.20.30.32 . Disconnected
debug    Beginning to calculate the presence information from the Sensors
debug    All Sensors Down. loop counter 16
debug    0 of 7 are in the coverage of Spot
debug    going sleep for 10 s
debug    Rediscovering Sensor and devices. Loop : 1
debug    Connecting to the CCU to get device list : 10.20.30.25
debug    sending broadcast to discover the sensors
debug    2 sensors discovered : {'10.20.30.28': '10002 ', '10.20.30.32': '10002 '}
debug    checking if : 10.20.30.28 . ready to receive the device list
debug    Sensor ping failed to : 10.20.30.28 . Moving on to the next sensor
info     Sensor : 10.20.30.28 . Disconnected
debug    checking if : 10.20.30.32 . ready to receive the device list
debug    Sensor ping failed to : 10.20.30.32 . Moving on to the next sensor
info     Sensor : 10.20.30.32 . Disconnected
debug    Beginning to calculate the presence information from the Sensors
debug    All Sensors Down. loop counter 1
debug    0 of 7 are in the coverage of Spot
debug    going sleep for 10 s
debug    Rediscovering Sensor and devices. Loop : 2
debug    Connecting to the CCU to get device list : 10.20.30.25
debug    sending broadcast to discover the sensors
debug    2 sensors discovered : {'10.20.30.28': '10002 ', '10.20.30.32': '10002 '}
debug    checking if : 10.20.30.28 . ready to receive the device list
debug    Sensor ping failed to : 10.20.30.28 . Moving on to the next sensor
info     Sensor : 10.20.30.28 . Disconnected
debug    checking if : 10.20.30.32 . ready to receive the device list
debug    Sensor ping failed to : 10.20.30.32 . Moving on to the next sensor
info     Sensor : 10.20.30.32 . Disconnected
debug    Beginning to calculate the presence information from the Sensors
debug    All Sensors Down. loop counter 2
debug    0 of 7 are in the coverage of Spot
debug    going sleep for 10 s
debug    Rediscovering Sensor and devices. Loop : 3
debug    Connecting to the CCU to get device list : 10.20.30.25
debug    sending broadcast to discover the sensors
debug    2 sensors discovered : {'10.20.30.28': '10002 ', '10.20.30.32': '10002 '}
debug    checking if : 10.20.30.28 . ready to receive the device list
debug    Sensor ping failed to : 10.20.30.28 . Moving on to the next sensor
info     Sensor : 10.20.30.28 . Disconnected
debug    checking if : 10.20.30.32 . ready to receive the device list
debug    Sensor ping failed to : 10.20.30.32 . Moving on to the next sensor
info     Sensor : 10.20.30.32 . Disconnected
debug    Beginning to calculate the presence information from the Sensors
debug    All Sensors Down. loop counter 3
debug    0 of 7 are in the coverage of Spot
debug    going sleep for 10 s
debug    Rediscovering Sensor and devices. Loop : 4
debug    Connecting to the CCU to get device list : 10.20.30.25
debug    sending broadcast to discover the sensors
debug    2 sensors discovered : {'10.20.30.28': '10002 ', '10.20.30.32': '10002 '}
debug    checking if : 10.20.30.28 . ready to receive the device list
debug    Sensor ping failed to : 10.20.30.28 . Moving on to the next sensor
info     Sensor : 10.20.30.28 . Disconnected
debug    checking if : 10.20.30.32 . ready to receive the device list
debug    Sensor ping failed to : 10.20.30.32 . Moving on to the next sensor
info     Sensor : 10.20.30.32 . Disconnected
debug    Beginning to calculate the presence information from the Sensors
debug    All Sensors Down. loop counter 4
debug    0 of 7 are in the coverage of Spot
debug    going sleep for 10 s

marius.jaworowski@gmail.com
Beiträge: 26
Registriert: 30.04.2016, 11:50

Re: Anwesenheitserkennung mittels BT und RASPBERRY

Beitrag von marius.jaworowski@gmail.com » 15.06.2017, 17:26

Hi,

scheinbar hat sich der Sensor verabschiedet. Konnte aber bisher nicht den Grunde dafür finde. Es kann aber nur mit dem zuletzt hinzugefügten Modul zusammenhängen. Daher habe ich das Modul (rgbled.py) einfach (neu) umgeschrieben. Die ersten Test sehen gut aus, deshalb habe ich die Software hochgeladen.

Wenn Du Spot als "daemon" startest, wird der "-l" (DEBUG) Parameter nicht verarbeitet. Ich hatte bisher keine Zeit mich damit zu beschäftigen, aber eine einfach Lösung ist der folgende Aufruf :

Code: Alles auswählen

nohup python /opt/spot/spot_sensor.py -l > /opt/spot/log/nohup_sensor.out &
mit "tail -f /opt/spot/log/nohup_sensor.out" kannst du die Ausgabe mitverfolgen. Leider hängt die Ausgabe manchmal etwas..

internetty
Beiträge: 28
Registriert: 28.07.2014, 17:15
Hat sich bedankt: 1 Mal

Re: Anwesenheitserkennung mittels BT und RASPBERRY

Beitrag von internetty » 19.07.2017, 12:37

Hallo Marius,

vielen Dank für die tolle Anleitung am Anfang dieses Postings.

Alles funktioniert, aber ...

Beim Einrichten weiterer Handys funktioniert es noch bis zum Pairing, beim Connecting gibt es diese Fehlermeldung"Failed to connect: org.bluez.Error.Failed".

Hast du eine Idee, was ich hier tun kann (außer im Internet nach der Lösung zu suchen, was ich bereits erfolglos getan habe).

Viele Grüße
Ralph

marius.jaworowski@gmail.com
Beiträge: 26
Registriert: 30.04.2016, 11:50

Re: Anwesenheitserkennung mittels BT und RASPBERRY

Beitrag von marius.jaworowski@gmail.com » 20.07.2017, 11:32

Hallo Internetty,

bedeutet es, Du konntest das pairing erfolgreich abschliessen?

[bluetooth]# pair CC:29:F5:67:B5:EC
Attempting to pair with CC:29:F5:67:B5:EC
[CHG] Device CC:29:F5:67:B5:EC Connected: yes
Request confirmation
[agent] Confirm passkey 476717 (yes/no): yes
[CHG] Device CC:29:F5:67:B5:EC Modalias: bluetooth:v004Cp6E00d0930
[CHG] Device CC:29:F5:67:B5:EC UUIDs:
00000000-deca-fade-deca-deafdecacafe
00001000-0000-1000-8000-00805f0b34fb
0000110a-0000-1000-8000-00805f0b34fb
0000110c-0000-1000-8000-00805f0b34fb
0000110e-0000-1000-8000-00805f0b34fb
00001116-0000-1000-8000-00805f0b34fb
0000111f-0000-1000-8000-00805f0b34fb
0000112f-0000-1000-8000-00805f0b34fb
00001132-0000-1000-8000-00805f0b34fb
00001200-0000-1000-8000-00805f0b34fb
[CHG] Device CC:29:F5:67:B5:EC Paired: yes
Pairing successful
Wenn das Paring erfolgreich war, ist die Arbeit eigentlich erledigt. Es ist danach NICHT notwendig die Geräte mit einander zu verbinden.

Du müsstest in der large sein mit l2ping CC:29:F5:67:B5:EC (MAC deines Handy) jederzeit das Handy zu erreichen, wenn das Paring erfolgreich war

internetty
Beiträge: 28
Registriert: 28.07.2014, 17:15
Hat sich bedankt: 1 Mal

Re: Anwesenheitserkennung mittels BT und RASPBERRY

Beitrag von internetty » 21.07.2017, 22:22

Hallo Marius,

danke für die Antwort; ja, das Pairing aller Handys (3) war erfolgreich, aber nur das erste, dass ich nach der Anleitung zu Beginn erfasst habe, wurde erkannt.
Die später Eingerichteten wollten einfach nicht.

Mittlerweile habe ich alles noch einmal aufgesetzt und gleich alle 3 verbunden und siehe da, es funktioniert. Meine Vermutung ist, dass es am root liegt, der laut deiner Anleitung aktiviert wurde (was ich bei den letzten beiden übersehen habe).
Zukünftig werde ich weitere Geräte als root-User anmelden ;-))

Nochmal vielen Dank
Ralph

internetty
Beiträge: 28
Registriert: 28.07.2014, 17:15
Hat sich bedankt: 1 Mal

Re: Anwesenheitserkennung mittels BT und RASPBERRY

Beitrag von internetty » 22.07.2017, 17:03

Hallo Marius,

alles war gut, 2 Tage lang.

Mittlerweile sind die Handys wieder nicht erreichbar, l2ping läuft ins Leere.
Geändert habe ich definitiv nichts. Muss ich jetzt wieder alles neu aufsetzen oder gibt es "Hilfsmittel" für die Rettung :-)))

Vielen Dank für deine Geduld und eine weiterführende Antwort im Voraus,
Ralph

internetty
Beiträge: 28
Registriert: 28.07.2014, 17:15
Hat sich bedankt: 1 Mal

Re: Anwesenheitserkennung mittels BT und RASPBERRY

Beitrag von internetty » 23.07.2017, 08:53

Hallo Marius,

aller Dinge sind drei. Bei der erheuten Installation ist das das Protokoll des spot-Testlaufs.
Ist daraus ersichtlich, woran es hakt?

VG Ralph
2017-07-23 08_42_27-Clipboard.png
2017-07-23 08_42_27-Clipboard.png (22.57 KiB) 2728 mal betrachtet

marius.jaworowski@gmail.com
Beiträge: 26
Registriert: 30.04.2016, 11:50

Re: Anwesenheitserkennung mittels BT und RASPBERRY

Beitrag von marius.jaworowski@gmail.com » 26.07.2017, 15:42

Hi,

der erste Testlauf endet mit einer Fehlermeldung wie dieser.. Es liegt daran dass die Konfigurationsdatei noch nicht gefunden wurde. Diese kannst du aber ignorieren, da eine Standart Konfigurationsdatei sofort automatisch erstellt wird. Diese musst du mit der IP der CCU nur noch aktualisieren. zu finden unter : /opt/spot/spot.cfg
Ein erneutes aufrufen des Befehls sollte ohne Fehler durchlaufen.


Wenn die Telefone sich nicht mehr auf dem Befehl l2ping melden, kannst du den Fehler bei "Spot" eigentlich ausschließen.
Ich würde an deiner stelle die folgenden Dinge ausprobieren:
- BT am Telefon aus und wieder einschalten
- Telefon Neustarten
- Raspbarry Neustarten
- den Pairing Prozess wiederholen

Falls du Raspbarry Zero W verwendest, dieser hat Probleme bei gleichzeitiger WLAN und BT verwendung

Antworten

Zurück zu „Projektvorstellungen“