woersty / loxberry-plugin-ble-scanner Goto Github PK
View Code? Open in Web Editor NEWA LoxBerry Plugin
Home Page: http://plugins.loxberry.de
License: Apache License 2.0
A LoxBerry Plugin
Home Page: http://plugins.loxberry.de
License: Apache License 2.0
Auch mit der Version 0.9 kommt beim Aufruf des Plugin
"Error reading tags from Daemon tcp://127.0.0.1:12345" Connection refused.
Verwendet wurde ein Raspberry 3.
Hallo,
ich habe das Problem das bei meinem neu aufgesetzten Loxberry (Rasp2) der BLE-Scanner die Statusänderung nicht korrekt an den Loxone Miniserver sendet.
Ich habe diesen Fehler sowohl mit billig Tags aus China, als auch mit dem Gigaset Tags.
BLE Scanner ist in der Version 0.14 installiert.
Manchmal startet er Bluetooth auf dem RPi3 nicht richtig
Abend,
ich möchte zwei BLE-scanner einsetzen. (Haus und Carport).
Kann ich irgendwie unterscheiden von welchem Loxberry die Info kommt
PHP Notice: Array to string conversion in /opt/loxberry/webfrontend/html/plugins/ble_scanner/index.php on line 214
Error0004: Array
Nach mehrmonatigem erfolgreichem Betrieb des Plugins werden zur Zeit die bestehenden Bluetooth-Tags vom Scanner immer wieder als neue "Devices" identifiziert.
Bei jedem Scan also erzeugt dies neue Zeilen an "angeblich" neuen Devices mit neuen/anderen MAC-Adressen. Damit "greifen" die bestehenden und in der Vergangenheit erfolgreichen "virtuellen Eingangsdefinitionen" des Miniservers ins "Leere". Woran kann das liegen?
Danke im Voraus.
Keine Ahnung warum aber mir werden plötzlich 20 Tags angezeigt. So viele habe ich gar nicht.
Muss mal schauen was da schief läuft.
Seit v0.24 habe ich das Problem dass nach einigen Tagen die Erkennung aussteigt. Es werden keine Tags erkannt. Es wird dann im Plugin-Log:
2017-11-20 15:01:38 Error reading tags! Reason:UnboundLocalError: local variable 'pkt' referenced before assignment
ausgegeben. Nach einem Neustart des Loxberry funktioniert es dann wieder.
Hi,
i recognized that my logfile is growing very fast until my Loxberry cannot write any files in the tmpfs and i think i found the issue:
Following meassages werde written frequently in both log files (var/log/kern.log and /var/log/syslog):
Jan 27 20:37:12 loxberry kernel: [ 91.112104] Bluetooth: hci0: advertising data len corrected
Jan 27 20:37:13 loxberry kernel: [ 92.453802] Bluetooth: hci0: advertising data len corrected
Jan 27 20:37:15 loxberry kernel: [ 94.463333] Bluetooth: hci0: advertising data len corrected
Jan 27 20:37:16 loxberry kernel: [ 95.126927] Bluetooth: hci0: advertising data len corrected
Jan 27 20:37:16 loxberry kernel: [ 95.470640] Bluetooth: hci0: advertising data len corrected
Jan 27 20:37:17 loxberry kernel: [ 96.473727] Bluetooth: hci0: advertising data len corrected
Jan 27 20:37:18 loxberry kernel: [ 97.481215] Bluetooth: hci0: advertising data len corrected
Jan 27 20:37:19 loxberry kernel: [ 98.486246] Bluetooth: hci0: advertising data len corrected
Jan 27 20:37:20 loxberry kernel: [ 99.137352] Bluetooth: hci0: advertising data len corrected
Jan 27 20:37:22 loxberry kernel: [ 101.492589] Bluetooth: hci0: advertising data len corrected
Is there a way to block this message so that the logfile does not grow that fast?
Best regards,
Dominik
Es wird 0 gesendet statt 1
Bei mir erscheint beim Scannen folgende Fehlermeldung im Log:
2017-01-04 20:12:03 Error reading general config! [direct]
[04-Jan-2017 20:25:05 Europe/Berlin] PHP Warning: syntax error, unexpected '!' in ../../../../config/system/general.cfg on line 16
in /opt/loxberry/webfrontend/html/plugins/ble_scanner/index.php on line 136
2017-01-04 20:25:05 Error reading general config! [direct]
2017-01-04 20:31:29 [OK] Scan: 3 Tag(s) found [http://192.168.3.35/admin/index.cgi]
in der general.cfg steht an der Stelle die SSID des WLans "Fritz!Box". Bei anderen Plugins oder im Loxberry allgemein habe ich keine Probleme erkannt.
When searching for bluetooth tags the error message is shown: Error reading tags from Daemon tcp://127.0.0.1:12345 Connection refused
When using the link: http://loxberry/plugins/ble_scanner/?mode=normal
the following error message is shown:
{"error":"Error reading tags from Daemon tcp://127.0.0.1:12345","result":"Connection refused"}
In the boot screen I can see that the bluetooth stick is recognized. I´m using a rasperry 2.
Manchmal werden vorhandene Tags nicht gefunden.
=> Scandauer erhöhen
Zu Testen ruf ich die Website auf, und bekomme die korrekten Meldungen zurück. Somit sollte der erste MS die Eingänge auf On schalten, tut er aber nicht. Was ich aber als unsinnig empfinde ist, dass, obwohl der zweite Miniserver im Verbund, nicht angehakt ist, trotzdem den "off befehl" bekommt....
Hi,
wenn ich das
http://192.168.2.114/plugins/ble_scanner/?mode=normal
im Browser eingebe bekomme ich folgende Fehlermeldung:
{"error":"Error reading general config!","result":"Cannot open general.cfg config file for reading."}
Hat jamnd eine Idee was das sein könnte??
Danke & Grüße,
Michael
Nachdem Issue 21 gefixt schien, kam jetzt nach ein paar Tagen problemlosen Betrieb wieder ein ähnliches Problem mit anderer Fehlermeldung.
Die Anwesenheitserkennung funktionierte auf einmal wieder nicht und nach zweimaligen Neustart ging es wieder.
Anhängend das ganze Log aus ~/log/plugins/ble_scanner für den betroffenen Zeitraum:
2017-11-25 17:37:03 [OK] Query: 6 Tag(s) processed [direct]
2017-11-25 17:37:14 [OK] Query: 6 Tag(s) processed [direct]
2017-11-25 17:37:25 [OK] Query: 6 Tag(s) processed [direct]
2017-11-25 17:37:47 [OK] Query: 6 Tag(s) processed [direct]
2017-11-25 17:37:57 [OK] Query: 6 Tag(s) processed [direct]
2017-11-25 17:52:08 Error reading tags! Reason:struct.error: unpack requires a string argument of length 3
2017-11-25 17:52:08 Error reading tags struct.error: unpack requires a string argument of length 3
2017-11-25 19:00:03 Error reading tags! Reason:struct.error: unpack requires a string argument of length 3
2017-11-25 19:00:03 Error reading tags struct.error: unpack requires a string argument of length 3
2017-11-25 20:00:03 Error reading tags! Reason:struct.error: unpack requires a string argument of length 3
2017-11-25 20:00:03 Error reading tags struct.error: unpack requires a string argument of length 3
2017-11-25 21:00:03 Error reading tags! Reason:struct.error: unpack requires a string argument of length 3
2017-11-25 21:00:03 Error reading tags struct.error: unpack requires a string argument of length 3
2017-11-25 22:00:03 Error reading tags! Reason:struct.error: unpack requires a string argument of length 3
2017-11-25 22:00:03 Error reading tags struct.error: unpack requires a string argument of length 3
2017-11-25 22:22:59 Error reading tags! Reason:struct.error: unpack requires a string argument of length 3
2017-11-25 22:22:59 Error reading tags struct.error: unpack requires a string argument of length 3
2017-11-25 23:00:03 Error reading tags! Reason:struct.error: unpack requires a string argument of length 3
2017-11-25 23:00:03 Error reading tags struct.error: unpack requires a string argument of length 3
2017-11-25 23:31:49 [LOG] Download logfile [http://192.168.1.46/admin/plugins/ble_scanner/index.cgi]
2017-11-25 23:31:50 Error reading tags! Reason:struct.error: unpack requires a string argument of length 3
2017-11-25 23:31:50 Error reading tags struct.error: unpack requires a string argument of length 3
Sat 25 Nov 23:34:27 CET 2017 - Update remove syslog errors rule but not restarting syslog
Sat 25 Nov 23:34:27 CET 2017 - Create link from ttyAMA0 to serial1...
KERNEL=="ttyAMA0",SYMLINK+="serial1" GROUP="dialout"
Sat 25 Nov 23:34:27 CET 2017 - Reload rules...
Sat 25 Nov 23:34:27 CET 2017 - Trigger rules...
Sat 25 Nov 23:34:28 CET 2017 - Restart Bluetooth...
Sat 25 Nov 23:34:29 CET 2017 - Successful start of hciuart service
â hciuart.service - Configure Bluetooth Modems connected by UART
Loaded: loaded (/lib/systemd/system/hciuart.service; disabled)
Active: inactive (dead)
Nov 25 23:34:28 loxberry systemd[1]: Stopped Configure Bluetooth Modems connected by UART.
Nov 25 23:34:29 loxberry systemd[1]: Started Configure Bluetooth Modems connected by UART.
Sat 25 Nov 23:34:31 CET 2017 - BLE-Scanner Daemon started
2017-11-25 23:34:35 Server listening on port 12345
2017-11-25 23:56:47 Error reading tags! Reason:struct.error: unpack requires a string argument of length 3
2017-11-25 23:56:47 Error reading tags struct.error: unpack requires a string argument of length 3
2017-11-26 01:00:02 Error reading tags! Reason:struct.error: unpack requires a string argument of length 3
2017-11-26 01:00:02 Error reading tags struct.error: unpack requires a string argument of length 3
Sun 26 Nov 01:18:07 CET 2017 - Update remove syslog errors rule but not restarting syslog
Sun 26 Nov 01:18:07 CET 2017 - Create link from ttyAMA0 to serial1...
KERNEL=="ttyAMA0",SYMLINK+="serial1" GROUP="dialout"
Sun 26 Nov 01:18:08 CET 2017 - Reload rules...
Sun 26 Nov 01:18:08 CET 2017 - Trigger rules...
Sun 26 Nov 01:18:09 CET 2017 - Restart Bluetooth...
Sun 26 Nov 01:18:10 CET 2017 - Successful start of hciuart service
â hciuart.service - Configure Bluetooth Modems connected by UART
Loaded: loaded (/lib/systemd/system/hciuart.service; disabled)
Active: inactive (dead)
Nov 26 01:18:09 loxberry systemd[1]: Stopped Configure Bluetooth Modems connected by UART.
Nov 26 01:18:10 loxberry systemd[1]: Started Configure Bluetooth Modems connected by UART.
Sun 26 Nov 01:18:12 CET 2017 - BLE-Scanner Daemon started
2017-11-26 01:18:17 Server listening on port 12345
2017-11-26 01:19:32 Error reading tags! Reason:struct.error: unpack requires a string argument of length 3
2017-11-26 01:19:32 Error reading tags struct.error: unpack requires a string argument of length 3
2017-11-26 01:19:33 [LOG] Download logfile [http://192.168.1.46/admin/plugins/ble_scanner/index.cgi]
2017-11-26 01:23:35 [OK] Query: 6 Tag(s) processed [direct]
2017-11-26 01:24:03 [OK] Query: 6 Tag(s) processed [direct]
2017-11-26 01:24:16 [OK] Query: 6 Tag(s) processed [direct]
Syslog voll damit:
Feb 16 16:46:05 loxberry kernel: [324679.527384] Bluetooth: hci0 advertising data length corrected
Feb 16 16:46:06 loxberry kernel: [324679.736069] Bluetooth: hci0 advertising data length corrected
Feb 16 16:46:06 loxberry kernel: [324680.191592] Bluetooth: hci0 advertising data length corrected
Feb 16 16:46:07 loxberry kernel: [324680.743078] Bluetooth: hci0 advertising data length corrected
Hallo,
zum Hintergrund:
Problem:
Log-Datei:
2017-10-12 22:24:55 [OK] Query: 2 Tag(s) processed [direct]
2017-10-12 22:25:25 [OK] Query: 2 Tag(s) processed [direct]
2017-10-12 22:25:54 [OK] Query: 2 Tag(s) processed [direct]
Da kein error_log
"Can not sent Data to Miniserver! Unable..."
erscheint, wird $LoxLink anscheinend richtig geöffnet. Aber es kommt nichts im Miniserver an, zumindest werden die Virtuellen Eingänge nicht geändert.
tcpdump hat leider kein Ergebnis gebracht, also dort gibt es kein Hinweis auf einen String der $LoxURL ähnlich sieht.
Wie kann ich überprüfen, wie der String hinter $LoxLink aussieht oder warum er nicht aufgerufen wird?!
[28-Apr-2017 07:09:33 Europe/Berlin] PHP Warning: array_unique() expects parameter 1 to be array, null given in /opt/loxberry/webfrontend/html/plugins/ble_scanner/index.php on line 92
[28-Apr-2017 07:09:33 Europe/Berlin] PHP Warning: array_map(): Argument #2 should be an array in /opt/loxberry/webfrontend/html/plugins/ble_scanner/index.php on line 92
and so on.
Habe den Wunsch per PN im Forum bekommen. Geht ja aktuell anscheinend nicht - vielleicht kann man das noch mit unterstützen, falls technisch möglich?
Grüße,
Micha
Seit dem letzten Update von Loxberry (1.4.3) sendet der BLE-Scanner nichtmehr an loxone. Im Log steht eine Fehlermeldung mit:
[24-Nov-2019 21:04:28 Europe/Berlin] [CID:1574625865] ERROR: PHP: BLE_7C_2F_80_AC_9D_CE (Mathias): MS1 (MMlox) Can not sent Data to Miniserver! Unable to open http://xxx:[email protected]:80/dev/sps/io/MMloxBLE_7C_2F_80_AC_9D_CE/1 [direct]
Ich habe neu einen Pi 3 Modell B+ im Einsatz. Nach dem Installieren und auch mehrmaligen Neustart erscheint:
"Fehler0003: Daemon Prozess läuft (noch) nicht"
Fehler nicht als neuen TAG anzeigen...
Ändert man die IP des Miniservers, wird diese vom Plugin BLE-Scanner nicht mit übernommen.
Wenn ich den BLE Scanner installierte habe, muss ich doch nach G-Tag suchen, oder?
Mir wird dann folgender Fehler angezeigt
DB connect error
Access denied for user 'ble_scanner'@'localhost' (using password: YES)
Wo liegt hier der Fehler?
Beim Löschen des Logfiles fehlen die Buttontexte
Ursache war, dass der Symlink "/dev/serial1" auf ttyAMA0 nicht vorhanden war.
Dieser wird allerdings genutzt, da beim Raspberry 3 Bluetooth über uart angebunden ist.
Nachdem ich in "/lib/systemd/system/hciuart.service" an allen Stellen (bei mir 2) "serial1"
durch "ttyAMA0" ersetzt habe funktioniert auch onboard Bluetooth wieder.
Siehe Wiki
Tag-Name und VI am Miniserver sind korrekt formatiert (MAC-Adresse aus dem Seiten-Quellcode kopiert).
Das Tag ist in Reichweite, die Login-Daten des Miniservers am Loxberry sind ebenfalls richtig, da andere Plugins funktionieren.
Ich habe die MAC-Adressen im Log mit "xx" unkenntlich gemacht.
Kurzbeschreibung
Fehler0003: Daemon Prozess läuft (noch) nicht.
loxberry systemd[1]: Dependency failed for Configure Bluetooth Modems connected by UART.
und loxberry systemd[1]: hciuart.service: Job hciuart.service/start failed with result 'dependency'.
hciconfig –a
gibt zurück
hci0: Type: Primary Bus: USB
BD Address: 00:1A:7D:DA:71:15 ACL MTU: 310:10 SCO MTU: 64:8
UP RUNNING
RX bytes:1220 acl:0 sco:0 events:72 errors:0
TX bytes:2788 acl:0 sco:0 commands:72 errors:0
Features: 0xff 0xff 0x8f 0xfe 0xdb 0xff 0x5b 0x87
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH HOLD SNIFF PARK
Link mode: SLAVE ACCEPT
Name: 'loxberry'
Class: 0x000000
Service Classes: Unspecified
Device Class: Miscellaneous,
HCI Version: 4.0 (0x6) Revision: 0x22bb
LMP Version: 4.0 (0x6) Subversion: 0x22bb
Manufacturer: Cambridge Silicon Radio (10)
Logs aus der Installation und des Plugins liegen an.
Bisher durchgeführte Maßnahmen aus Problemen vorherigen Versionen
loxberry@loxberry:~ $ sudo apt-get -y remove raspberrypi-sys-mods && sudo apt-get -y install raspberrypi-sys-mods && sudo reboot
und
loxberry@loxberry:~ $ sudo apt-get -y --reinstall install python python-pip python-dev python-bluez pi-bluetooth bluez bluez-firmware && sudo reboot
Google-Recherche erbrachte leider keine verwertbaren Erkenntnisse.
Ich habe nun schon den dritten RPi3 mit Loxberry aufgesetzt und jedes mal nach dem Installieren des BLE Plugins erscheint bei Nutzung des internen Bluetooth folgende Fehlermeldung:
BLE-Scanner - Fehler bei der Suche
Error reading tags from Daemon tcp://127.0.0.1:12345
Connection refused
https://www.loxforum.com/filedata/fetch?photoid=73540
Wenn ich hingegen ein Logilink Bluetooth BT00015 Dongle nutze, funktioniert es.
Hab das Problem seit dem ich gestern Fritz.Lox mit installiert habe.
Jemand ne Idee was ich machen kann.
Habe aktuell Ble 0.20
Hier Auszug aus dem Logfile wenn der Fehler auftritt:
2017-05-06 08:04:58 [OK] Query: 8 Tag(s) processed [direct]
[06-May-2017 08:05:58 Europe/Berlin] PHP Warning: array_unique() expects parameter 1 to be array, null given in /opt/loxberry/webfrontend/html/plugins/ble_scanner/index.php on line 92
[06-May-2017 08:05:58 Europe/Berlin] PHP Warning: array_map(): Argument #2 should be an array in /opt/loxberry/webfrontend/html/plugins/ble_scanner/index.php on line 92
[06-May-2017 08:05:58 Europe/Berlin] PHP Warning: array_map(): Argument #2 should be an array in /opt/loxberry/webfrontend/html/plugins/ble_scanner/index.php on line 95
[06-May-2017 08:05:58 Europe/Berlin] PHP Warning: Invalid argument supplied for foreach() in /opt/loxberry/webfrontend/html/plugins/ble_scanner/index.php on line 98
2017-05-06 08:05:58 [OK] Query: 8 Tag(s) processed [direct]
DB must be created earlier
Wenn alle registrierten Tags außer Reichweite sind, wird im Log folgendes protokolliert:
2017-01-20 14:47:14 [OK] Query: 4 Tag(s) processed [direct]
2017-01-20 14:49:44 Error, got no results.
2017-01-20 14:51:45 Error, got no results.
2017-01-20 14:53:46 Error, got no results.
2017-01-20 15:00:59 Error, got no results.
2017-01-20 16:00:58 Error, got no results.
2017-01-20 16:25:45 [OK] Query: 4 Tag(s) processed [direct]
Es werden in dem Fall keine Aktualisierungen der Loxone Eingänge vorgenommen. Ein Bewohner bleibt also auf Status "Anwesend" obwohl er nicht mehr anwesend ist.
Wenn sich mindestens ein unregistrierter Tag in Reichweite befindet klappt es problemlos.
Kurzbeschreibung
[18-Dec-2019 23:33:24 Europe/Berlin] [CID:] OK: PHP: Version: 2019.5.17
[18-Dec-2019 23:33:24 Europe/Berlin] [CID:] DEBUG: PHP: Reading Miniservers [http://loxberry/admin/plugins/ble_scanner/]
[18-Dec-2019 23:33:24 Europe/Berlin] [CID:] OK: PHP: Open connection to Daemon [http://loxberry/admin/plugins/ble_scanner/]
[18-Dec-2019 23:33:24 Europe/Berlin] [CID:] WARNING: PHP: Fehler0003: Daemon Prozess läuft (noch) nicht
[18-Dec-2019 23:33:24 Europe/Berlin] [CID:] OK: PHP: Exit with Warning.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.