Skip to content

Commit

Permalink
Schönere Fehlermeldung beim Start
Browse files Browse the repository at this point in the history
-Schönere Fehlermeldung beim Start
-Logleveldateirechteanpassung
  • Loading branch information
Woersty committed Mar 3, 2018
1 parent d395d7f commit faf063d
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 8 deletions.
4 changes: 4 additions & 0 deletions daemon/daemon
Expand Up @@ -119,6 +119,10 @@ case "${1:-''}" in
exit 1
else
echo "`date` - BLE-Scanner Daemon started" >>$logfile 2>&1
echo "$output" > /tmp/BLE-Scanner.daemon.pid
chown loxberry /tmp/BLE-Scanner.daemon.pid
chgrp loxberry /tmp/BLE-Scanner.daemon.pid
chmod 660 /tmp/BLE-Scanner.daemon.pid
log_daemon_msg "BLE-Scanner Daemon started" "OK"
log_end_msg 0
exit 0
Expand Down
2 changes: 1 addition & 1 deletion plugin.cfg
Expand Up @@ -10,7 +10,7 @@ NAME=Christian Woerstenfeld
EMAIL=git@loxberry.woerstenfeld.de

[PLUGIN]
VERSION=v2018.3.3.1
VERSION=v2018.3.3.2
NAME=BLE-Scanner
FOLDER=ble_scanner
TITLE=BLE-Scanner
Expand Down
6 changes: 3 additions & 3 deletions prerelease.cfg
Expand Up @@ -6,10 +6,10 @@
# If your plugin offers automatic updates, please enable the following option.

# Version of the new release
VERSION=v2018.3.3.1
VERSION=v2018.3.3.2

# Download URL of the ZIP Archive
ARCHIVEURL=https://github.com/Woersty/LoxBerry-Plugin-BLE-Scanner/archive/v2018.3.3.1.zip
ARCHIVEURL=https://github.com/Woersty/LoxBerry-Plugin-BLE-Scanner/archive/v2018.3.3.2.zip

# URL for further information about this release
INFOURL=https://github.com/Woersty/LoxBerry-Plugin-BLE-Scanner/releases/tag/v2018.3.3.1
INFOURL=https://github.com/Woersty/LoxBerry-Plugin-BLE-Scanner/releases/tag/v2018.3.3.2
2 changes: 2 additions & 0 deletions templates/lang/language_de.ini
Expand Up @@ -7,6 +7,8 @@ ERR_SUCCESS_TEMPLATE_NOT_READABLE="Das success Template ist nicht lesbar. Wir m
ERR_SAVE_CONFIG_FILE="Kann die Konfiguration nicht speichern."
ERR_BUTTON_BACK="Zurück"
ERR_NO_CONFIG_FILE="Keine Konfigurationsdatei gefunden."
DEAMON_NOT_YET_RUNNING="Daemon Prozess läuft nicht"
DEAMON_NOT_YET_RUNNING_SUGGESTION="Bitte warte einen Moment. Wenn der Fehler bestehen bleibt, versuche deinen LoxBerry neu zu starten."

[LOGGING]
LOG_AREA="Protokollierung"
Expand Down
2 changes: 2 additions & 0 deletions templates/lang/language_en.ini
Expand Up @@ -10,6 +10,8 @@ ERR_SUCCESS_TEMPLATE_NOT_READABLE="The success template file is not readable. We
ERR_SAVE_CONFIG_FILE="Unable to save config file."
ERR_BUTTON_BACK="Back"
ERR_NO_CONFIG_FILE="No configuration file found. I try to create a default configuration file."
DEAMON_NOT_YET_RUNNING="Daemon process is not running"
DEAMON_NOT_YET_RUNNING_SUGGESTION="Please wait a moment. If the error persists, try to reboot your LoxBerry."

[LOGGING]
LOG_AREA="Logging"
Expand Down
15 changes: 12 additions & 3 deletions webfrontend/html/index.php
Expand Up @@ -66,7 +66,7 @@ function debug($message = "", $loglevel = 7)
}
if ( $loglevel < 4 )
{
#if ( isset($message) && $message != "" ) notify ( LBPPLUGINDIR, $L['CC.MY_NAME'], $message);
#if ( isset($message) && $message != "" ) notify ( LBPPLUGINDIR, $L['BLE.MY_NAME'], $message);
}
}
return;
Expand Down Expand Up @@ -109,8 +109,17 @@ function convert_tag_format ($value)
$client = stream_socket_client("tcp://$daemon_addr:$daemon_port", $errno, $errorMessage);
if ($client === false)
{
debug( "Error0002: reading tags from Daemon at tcp://$daemon_addr:$daemon_port! Reason:".$errorMessage, 2);
die(json_encode(array("error"=>"Error0002: Problem reading tags from Daemon tcp://$daemon_addr:$daemon_port","result"=>"$errorMessage")));

if ( file_exists("/tmp/BLE-Scanner.daemon.pid") )
{
debug( "Error0002: reading tags from Daemon at tcp://$daemon_addr:$daemon_port! Reason:".$errorMessage, 2);
die(json_encode(array("error"=>"Error0002: Problem reading tags from Daemon tcp://$daemon_addr:$daemon_port","result"=>"$errorMessage")));
}
else
{
debug( $L['ERRORS.DEAMON_NOT_YET_RUNNING'], 4);
die(json_encode(array("error"=>$L['ERRORS.DEAMON_NOT_YET_RUNNING'],"result"=>$L['ERRORS.DEAMON_NOT_YET_RUNNING_SUGGESTION'])));
}
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion webfrontend/htmlauth/bin/daemon.php
Expand Up @@ -22,7 +22,7 @@
$max_wait_python = 3; // Maximum time in seconds to wait for first results after BLE scan start
file_put_contents("/tmp/BLE-Scanner.loglevel", 3);
// Enable loglevel changes on the fly and in Python
chmod("/tmp/BLE-Scanner.loglevel", 666);
chmod("/tmp/BLE-Scanner.loglevel", 0660);
chown("/tmp/BLE-Scanner.loglevel", "loxberry");
chgrp("/tmp/BLE-Scanner.loglevel", "loxberry");

Expand Down

0 comments on commit faf063d

Please sign in to comment.