GithubHelp home page GithubHelp logo

woersty / loxberry-plugin-ble-scanner Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 1.0 358 KB

A LoxBerry Plugin

Home Page: http://plugins.loxberry.de

License: Apache License 2.0

Shell 10.80% HTML 42.54% Python 9.97% Perl 14.51% PHP 22.18%

loxberry-plugin-ble-scanner's Issues

Fehler: Error reading general config!

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.

Error messages in Logfile

[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.

RPi3 Bluetooth Unterstützung

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.

Virtuelle Eingänge werden nicht geändert

Hallo,

zum Hintergrund:

  • Mac-Adressen copy&paste mit BLE_
  • die IP-Adresse vom Loxberry wird erreicht
  • Tags werden im Loxberry gefunden

Problem:

  • Virtuelle Eingänge werden nicht geändert

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?!

Error reading tags! Reason:struct.error: unpack requires a string argument of length 3

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]

Fehler: Error, got no results. - keine Aktualisierung Loxone Eingang

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.

Raspberry 3 onboard Bluetooth Symlink

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

Spamming of Logfiles

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

Script error Line 92,92,95,98

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]

Nutzen des Raspi3 BT-Moduls

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

Loxone Config erkennt den Status nicht korrekt

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.

Scanning Bluetooth-Tags

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.

Syslog kernel: [324679.527384] Bluetooth: hci0 advertising data length corrected Feb

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

RPi4: Fehler0003: Daemon Prozess läuft (noch) nicht

Kurzbeschreibung

  • Neuer RPi4
  • LoxBerry Version 2.0.0.4 ( is_raspberry.cfg )
  • BLE-Scanner Version 2019.5.17
  • BLE-Scanner auf das frische LB installiert, sonst keine anderen Plugins
  • Integrierte BT-Schnittstelle
  • Bei Aufruf des Plugins erhalte ich Fehler0003: Daemon Prozess läuft (noch) nicht.
  • Das Log zeigt:
[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.

Install log.log
BLE-Scanner.log

RPi 2: Fehler0003: Daemon Prozess läuft (noch) nicht

Kurzbeschreibung

  • Nach defekter SD-Karte musste ich Loxberry neu aufspielen.
  • Alle Updates sind durchgeführt, LB Stand V1.2.5.5
  • BLE-Scanner auf das frische LB installiert, sonst keine anderen Plugins, BLE-Scanner Stand v2018.3.5
  • Verwendeter USB-Dongle LogiLink BT0015 nano USB Bluetooth
  • Bei Aufruf des Plugins erhalte ich Fehler0003: Daemon Prozess läuft (noch) nicht.
  • Das Log zeigt: 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.

BLE INSTALL BLE-Scanner.log
BLE-Scanner.log

Can not sent Data to Miniserver!

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.

BLE-Scanner (1).log

Error reading tags from Daemon tcp://127.0.0.1:12345 Connection refused

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.

Sending data to miniserver not working

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....

Datenbankfehler?

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?

Error0003: Daemon process is not (yet) running

Hello,

I installed the plugin and I get the following error:
error
log

Any advise on this?

I'm using an ASUS usb bluetooth dongle that works fine on my pc and is recognized in the Loxberry system information.

Thanks in advance

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.