Bluetooth Anwesendheit neuerdings dauerhaft auf "absent"

Begonnen von MaxStyle, 11 Dezember 2016, 11:47:51

Vorheriges Thema - Nächstes Thema

MaxStyle

Hallo zusammen,

ich verzeifel so langsam.

Ich hatte mir mit den NUT-Tags eine Anwesendheitserkennung gemäß der Anleitung um Wiki aufgebaut. Bis vor ca. 4 Wochen hat diese auch über mehrere Monate einwandfrei funktioniert. Seit ca. 4 Wochen habe ich das Problem, dass die NUT Tags immer als "absend" angezeigt werden, obwohl diese in Reichweite sind.

Meine Fehlersuche blieb bisher erfolglos. Ich bin die Anleitung nochmal komplett durchgegangen. Wenn ich den Bluetooth Service auf dem Raspberry neu starte, dann wird mit kurze Zeit in Fhem ein "enable" angezeigt und 1-10 Min springt der Status wieder auf "absend"

Und mittlerweile habe ich keinen Plan mehr, wo ich den Fehler noch suchen soll.

Habt Ihr eine Idee?


CoolTux

Welche Anleitung hast Du genau genommen. Gibt da ja mehrere für Bluetooth. Dann gibt es sowas wie Logfile. Wäre gut da mal rein zu schauen und hier passende Auszüge zu posten.
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

Gasmast3r

Hast du die mal per hctool gesucht oder per Handy ??? Nicht das die Batterie leer ist
Entschuldige das ich DOOF FRAGE aber ich habe Psychische Probleme und Leide an ADHS mit Kognitiver-Hyperaktivität.

MaxStyle

Also ich bin nach dieser Anleitung "Anleitung für ein LE Device (z.B. Gtags,Pebbles etc.)" mit Hilfe des lepresenced skriptes vorgegangen.

Mit dem Befehl "sudo hcitool lescan" werden meine 2 NUT TAGS auch sofort angezeigt.  Das bedeutet, dass die Batterien noch voll sind.

Meine definition in der fhem.cfg lautet:
define Micha.NUT PRESENCE lan-bluetooth CC:5B:C1:C8:A4:59 127.0.0.1:5333 30 60
attr Micha.NUT event-on-change-reading state
attr Micha.NUT room Zentral
define Mama.NUT PRESENCE lan-bluetooth D5:88:FD:7A:D2:F5 127.0.0.1:5333 30 60
attr Mama.NUT event-on-change-reading state
attr Mama.NUT room Zentral


------------
Auszug aus dem Logfile von heute morgen, als ich noch mal Fehlersuche betrieb und den Befehl sudo hciconfig hci0 reset
ausführte, ist aber immer nur eine temporäre Lösung :

2016.12.11 10:35:32 3: Opening Mama.NUT device 127.0.0.1:5333
2016.12.11 10:35:32 3: Mama.NUT device opened
2016.12.11 10:35:32 3: Mi.Harmony: connected
2016.12.11 10:35:32 3: Opening Micha.NUT device 127.0.0.1:5333
2016.12.11 10:35:32 3: Micha.NUT device opened
2016.12.11 10:35:33 1: usb create starting
2016.12.11 10:35:34 3: Probing CUL device /dev/ttyAMA0
2016.12.11 10:35:34 3: Probing TCM_ESP3 device /dev/ttyAMA0
2016.12.11 10:35:34 3: Probing FRM device /dev/ttyAMA0
2016.12.11 10:35:40 1: usb create end
2016.12.11 10:35:40 0: Featurelevel: 5.7
2016.12.11 10:35:40 0: Server started with 111 defined entities (fhem.pl:12719/2016-12-06 perl:5.020002 os:linux user:fhem pid:772)
2016.12.11 10:35:40 1: SONOS0: Kein UPnP-Server gefunden... Starte selber einen und warte 1 Sekunde(n) darauf...
2016.12.11 10:35:40 3: telnetForBlockingFn_1481448940.28628: port 44815 opened
2016.12.11 10:35:40 3: fbCallMonitor device opened
2016.12.11 10:35:42 1: HMLAN_Parse: HMLAN1 new condition ok
2016.12.11 10:35:42 3: Fritz_Box_Monitor device opened
2016.12.11 10:35:42 3: Opening Sonos device localhost:4711
2016.12.11 10:35:42 3: Can't connect to localhost:4711: Connection refused
2016.12.11 10:35:43 3: myJeeLink: Unknown code , help me!

2016.12.11 10:48:29 1: 127.0.0.1:5333 disconnected, waiting to reappear (Mama.NUT)
2016.12.11 10:48:29 1: 127.0.0.1:5333 disconnected, waiting to reappear (Micha.NUT)

2016.12.11 10:49:15 3: Opening Mama.NUT device 127.0.0.1:5333
2016.12.11 10:49:15 3: Mama.NUT device opened
2016.12.11 10:49:15 3: Mi.Harmony: connected
2016.12.11 10:49:15 3: Opening Micha.NUT device 127.0.0.1:5333
2016.12.11 10:49:15 3: Micha.NUT device opened

2016.12.11 10:56:36 3: Opening Mama.NUT device 127.0.0.1:5333
2016.12.11 10:56:36 3: Mama.NUT device opened
2016.12.11 10:56:36 3: Mi.Harmony: connected
2016.12.11 10:56:36 3: Opening Micha.NUT device 127.0.0.1:5333
2016.12.11 10:56:36 3: Micha.NUT device opened


CoolTux

Dann bitte einmal lepresenced im debug Mode starten. Danach findest Du mehr Infos im syslog File
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

MaxStyle

so im debug modus gestartet, aber viel mehr sehe ich auch nicht, oder doch?

2016.12.11 14:49:54 1: 127.0.0.1:5333 disconnected, waiting to reappear (Micha.NUT)
2016.12.11 14:49:54 1: 127.0.0.1:5333 disconnected, waiting to reappear (Mama.NUT)
2016.12.11 14:49:58 3: SONOS0: Connection accepted from localhost:52612
2016.12.11 14:50:28 3: SONOS0: Connection accepted from localhost:52624
2016.12.11 14:50:58 3: SONOS0: Connection accepted from localhost:52642
2016.12.11 14:51:28 3: SONOS0: Connection accepted from localhost:52654
2016.12.11 14:51:54 1: 127.0.0.1:5333 reappeared (Micha.NUT)
2016.12.11 14:51:58 1: 127.0.0.1:5333 reappeared (Mama.NUT)
2016.12.11 14:51:58 3: SONOS0: Connection accepted from localhost:52672
2016.12.11 14:52:05 1: 127.0.0.1:5333 disconnected, waiting to reappear (Mama.NUT)
2016.12.11 14:52:05 1: 127.0.0.1:5333 disconnected, waiting to reappear (Micha.NUT)
2016.12.11 14:52:28 3: SONOS0: Connection accepted from localhost:52688
2016.12.11 14:52:58 3: SONOS0: Connection accepted from localhost:52702
2016.12.11 14:53:06 1: 127.0.0.1:5333 reappeared (Mama.NUT)
2016.12.11 14:53:06 1: 127.0.0.1:5333 reappeared (Micha.NUT)

CoolTux

Danach findest Du mehr Infos im syslog File

/var/log/syslog != fhem.log
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

MaxStyle

Okay. Hab Sie mal als Anhang dran gemacht.

Wie wäre ich am besten mit deiner Codezeile umgegangen? Das Terminal konnte damit nichts anfangen, deswegen habe ich die ganze Datei angehängt.

CoolTux

Das war keine Codezeile sondern sollte nur heißen

/var/log/syslog ist nicht fhem.log

Du hattest fhem.log gepostet gehabt aber die relevanten Ergebnisse stehen ja in syslog
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

CoolTux


Dec 11 15:12:16 raspberrypi lepresenced[671]: [tid:0] main: Sending update for mac address cc:5b:c1:c8:a4:59, age: 3, max age: 60, result: present.
Dec 11 15:12:17 raspberrypi lepresenced[671]: [tid:0] main: Sending update for mac address d5:88:fd:7a:d2:f5, age: 1, max age: 60, result: present.
Dec 11 15:12:40 raspberrypi lepresenced[671]: [tid:0] main::stats_task: Active clients: 2, known devices: 6 (min/max age: 0/186)
Dec 11 15:13:16 raspberrypi lepresenced[671]: [tid:0] main: Sending update for mac address cc:5b:c1:c8:a4:59, age: 1, max age: 60, result: present.
Dec 11 15:13:17 raspberrypi lepresenced[671]: [tid:0] main: Sending update for mac address d5:88:fd:7a:d2:f5, age: 3, max age: 60, result: present.


Alles schick. present steht da. So sollte es auch im presence Modul ankommen.
Gib mal bitte ein list von einem present Device

list DEVICENAME

in der FHEM Commandline eingeben
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

CoolTux

Ach und mach mal bitte in der bash ein

ps ax | grep lepresenced
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

MaxStyle

Okay verstehe.Jetzt im Moment werden die Tags als present angezeigt.


Internals:
   ADDRESS    CC:5B:C1:C8:A4:59
   CHANGED
   DEF        lan-bluetooth CC:5B:C1:C8:A4:59 127.0.0.1:5333 30 60
   DeviceName 127.0.0.1:5333
   FD         24
   MODE       lan-bluetooth
   NAME       Micha.NUT
   NOTIFYDEV  global
   NR         114
   NTFY_ORDER 50-Micha.NUT
   PARTIAL
   STATE      present
   TIMEOUT_NORMAL 30
   TIMEOUT_PRESENT 60
   TYPE       PRESENCE
   Readings:
     2016-12-11 14:53:06   command_accepted yes
     2016-12-11 15:32:14   device_name     nut
     2016-12-11 15:32:14   presence        present
     2016-12-11 15:32:14   state           present
   Helper:
     CURRENT_TIMEOUT present
Attributes:
   event-on-change-reading state
   room       Zentral


Zitatpi@raspberrypi:~ $ ps ax | grep lepresenced
  666 ?        S      0:00 sudo /opt/fhem/scripts/lepresenced --loglevel LOG_EMERG
  675 ?        Sl     0:10 /usr/bin/perl /opt/fhem/scripts/lepresenced --loglevel LOG_EMERG
  991 pts/1    S+     0:00 grep --color=auto lepresenced

CoolTux

2 sind einer zu viel

pi@raspberrypi:~ $ ps ax | grep lepresenced
  666 ?        S      0:00 sudo /opt/fhem/scripts/lepresenced --loglevel LOG_EMERG
  675 ?        Sl     0:10 /usr/bin/perl /opt/fhem/scripts/lepresenced --loglevel LOG_EMERG


Am besten mal beide killen

kill -15 666
kill -15 675

danach einfach als root ein

/usr/bin/perl /opt/fhem/scripts/lepresenced --loglevel LOG_EMERG

ausführen und bei einem presence device auf DEF drücken und gleich wieder modify
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

MaxStyle

Also das ist bis jetzt die längste presence zeit seit 4 Wochen.

Kann es etwas geholfen haben, die lepresenced im debug modus zu starten? viel mehr hatte ich ja jetzt nicht geändert...*confused*

CoolTux

eigentlich nicht. vielleicht eher das es überhaupt irgendwie gestartet wurde.

Hast jetzt wenigstens nur einen lepresenced Prozess?
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net