DoorPi-Projekt

Begonnen von Syntaxterror, 25 Februar 2016, 18:39:59

Vorheriges Thema - Nächstes Thema

no_Legend

ich hab momentan wieder da problem, das fhem nicht erreichbar ist, wenn ich das DoorPi Modul laufen habe.

Bekomme dann folgenden Fehlermeldung im LOG:
2016.10.07 10:38:56 1: PERL WARNING: keys on reference is experimental at ./FHEM/70_DoorPi.pm line 531.
2016.10.07 10:38:56 1: PERL WARNING: keys on reference is experimental at ./FHEM/70_DoorPi.pm line 550.
ok 1
ok 2
2016.10.07 10:38:56 1: [DoorPi_GetHistory] Warning - has found an empty snapshot history
Not an ARRAY reference at ./FHEM/70_DoorPi.pm line 766.
# Tests were run but no plan was declared and done_testing() was not seen.
# Looks like your test exited with -1 just after 2.


Sofort nach der Definition des Devices geht beim FHEM Web nichts mehr.

Hat da jemand eine Erklärung für?

Gruß Robert
Docker FHEM immer aktuell,4x HMLAN, CUL443, CUL868 -homekit/siri -tablet ui -homebridge
Device, diverse:
Homematic, Shelly, Tasmota, MQTT, Unifi Network usw.

Prof. Dr. Peter Henning

Äh - sicher, dass das die aktuelle Version ist ?

Das habe ich eigentlich längst abgefangen.

LG

pah

no_Legend

Die Aktuelle Version im Contrib ist V1.2:
https://sourceforge.net/p/fhem/code/HEAD/tree/trunk/fhem/contrib/DoorPi/70_DoorPi.pm

diese habe ich in Verwendung.

Gruß Robert
Docker FHEM immer aktuell,4x HMLAN, CUL443, CUL868 -homekit/siri -tablet ui -homebridge
Device, diverse:
Homematic, Shelly, Tasmota, MQTT, Unifi Network usw.

no_Legend

@pah hab ich die falsche Version in Gebrauch?
Docker FHEM immer aktuell,4x HMLAN, CUL443, CUL868 -homekit/siri -tablet ui -homebridge
Device, diverse:
Homematic, Shelly, Tasmota, MQTT, Unifi Network usw.

Prof. Dr. Peter Henning

Sorry, heute bei mir Land unter, Sitzungen und Vorträge bis abends. Dann mehr.

LG

pah

lising

Hallo,
ich würde DoorPi gerne in Fhem einbinden, habe aber zuvor noch folgendes Problem:
Es wird nur auf jeden zweiten Anruf der Türsprechstelle reagiert.
Log schreibt folgendes:
[root] reset inputfile will not fire event (/usr/local/etc/DoorPi/keyboard/inputs/anruf_gigaset) 
Da ich jetzt schon lange gesucht und nichts gefunden habe, wäre es nett, wenn mir jemand einen Anstoß in die richtige Richtung geben könnte.
In der doorpi.ini habe ich schon alle Möglichkeiten durchprobiert:
pressed_on_keydown = True bzw. False
reset_input = True bzw. False


no_Legend

Zitat von: lising am 12 Oktober 2016, 12:08:00
Hallo,
ich würde DoorPi gerne in Fhem einbinden, habe aber zuvor noch folgendes Problem:
Es wird nur auf jeden zweiten Anruf der Türsprechstelle reagiert.
Log schreibt folgendes:
[root] reset inputfile will not fire event (/usr/local/etc/DoorPi/keyboard/inputs/anruf_gigaset) 
Da ich jetzt schon lange gesucht und nichts gefunden habe, wäre es nett, wenn mir jemand einen Anstoß in die richtige Richtung geben könnte.
In der doorpi.ini habe ich schon alle Möglichkeiten durchprobiert:
pressed_on_keydown = True bzw. False
reset_input = True bzw. False

Geh dazu lieber ins DoorPi Forum.
Der Post hier ist nur für die integration von DoorPi in FHEM.
Dort sollte du aber deine gesamte Config offenlegen.

Zitat von: Prof. Dr. Peter Henning am 12 Oktober 2016, 11:30:43
Sorry, heute bei mir Land unter, Sitzungen und Vorträge bis abends. Dann mehr.

LG

pah

Kein Stress, wenn es erst morgen wird, ist auch gut.
Es scheint ja bisher nur ich betroffen zu sein.

Gruß Robert
Docker FHEM immer aktuell,4x HMLAN, CUL443, CUL868 -homekit/siri -tablet ui -homebridge
Device, diverse:
Homematic, Shelly, Tasmota, MQTT, Unifi Network usw.

Prof. Dr. Peter Henning

#247
Anbei die neueste Version des DoorPi-Moduls - hat ein paar Verbesserungen beim Update der Anzeige erhalten. Außerdem die Version von FHEMHelper.sh mit den Änderungen von no_Legend.

Bitte testen (sind beide bei mir im produktiven Betrieb).

LG

pah

Edit: Ups, peinlicher Fehler: http und https vertauscht im FHEMHelper.sh. Anbei die korrigierte Version

Prof. Dr. Peter Henning

Ich habe eine neue Version 1.4 des 70_DoorPi.pm eingecheckt, ebenso aktualisierte Versionen von doorpi.ini und FHEMHelper.sh => /contrib/DoorPi

LG

pah

karlj

#249
Hallo zusammen,

ich habe aktuell die selbe Fehlermeldung wie no_legend. Und mein FHEM Webinterface ist nicht erreichbar.

2016.10.30 15:54:42 1: Including fhem.cfg
2016.10.30 15:54:42 3: telnetPort: port 7072 opened
2016.10.30 15:54:44 3: WEB: port 8083 opened
2016.10.30 15:54:44 3: WEBphone: port 8084 opened
2016.10.30 15:54:44 3: WEBtablet: port 8085 opened
2016.10.30 15:54:44 2: eventTypes: loaded 0 events from ./log/eventTypes.txt
2016.10.30 15:54:46 1: PERL WARNING: keys on reference is experimental at ./FHEM/70_DoorPi.pm line 534.
2016.10.30 15:54:46 1: PERL WARNING: keys on reference is experimental at ./FHEM/70_DoorPi.pm line 553.
2016.10.30 15:54:46 1: Including ./log/fhem.save
2016.10.30 15:54:46 1: usb create starting
2016.10.30 15:54:48 3: Probing CUL device /dev/ttyAMA0
2016.10.30 15:54:49 3: Can't open /dev/ttyAMA0: Permission denied
2016.10.30 15:54:49 1: usb create end
2016.10.30 15:54:49 2: SecurityCheck:  WEB,WEBphone,WEBtablet has no associated allowed device with basicAuth. telnetPort has no associated allowed device with password/globalpassword.  Restart FHEM for a new check if the problem is fixed, or set the global attribute motd to none to supress this message.
2016.10.30 15:54:49 0: Featurelevel: 5.7
2016.10.30 15:54:49 0: Server started with 10 defined entities (fhem.pl:12423/2016-10-24 perl:5.020002 os:linux user:fhem pid:4493)
ok 1
2016.10.30 15:54:51 1: [DoorPi_GetConfig] virtual keyboard is named defined as "webservice"
ok 2
ok 3
2016.10.30 15:54:51 1: [DoorPi_GetHistory] Warning - has found an empty snapshot history
Not an ARRAY reference at ./FHEM/70_DoorPi.pm line 769.
# Tests were run but no plan was declared and done_testing() was not seen.
# Looks like your test exited with -1 just after 3.


Die USB Fehlermeldung habe ich bis jetzt ignoriert, da ich ohnehin keinen CUL angeschlossen habe. Im Moment handelt es sich bei mir um ein Testsystem bei dem DoorPi und FHEM beide auf einem raspberry B+ laufen.

Folgende Dateien sind in Verwendung:
doorpi.ini:
[DoorPi]
base_path = /usr/local/etc/DoorPi
snapshot_path = /home/doorpi/records
number_of_snapshots = 10
eventlog = /home/doorpi/log/eventlog.db
is_alive_led = 
last_snapshot =

[DoorPiWeb]
indexfile = index.html
loginfile = login.html
#online_fallback = http://192.168.178.64:8083/fhem?detail=A.Door.Pi
port = 80
public = AREA_public
www = /home/doorpi/records

[AREA_public]
.*

[AREA_config]
/control/config_value_get
/control/config_value_set
/control/config_value_delete
/control/config_save
/control/config_get_configfile

[AREA_dashboard]
/dashboard/pages/.*html

[AREA_status]
/status
/mirror

[AREA_control]
.*

[User]
admin = admin
visitor = visitor

[Group]
administrators = admin
guests = visitor

[WritePermission]
administrators = dashboard,status,config

[ReadPermission]
guests = dashboard

[AdminNumbers]
**622 = active

[DTMF]


####################### SIP phone #######################
[SIP-Phone]
identity = DoorPi
local_port = 5060
firewallpolicy = PolicyNoFirewall
#
sipphonetyp = linphone
sipserver_password = doorpi
sipserver_realm = fritz.box
sipserver_server = 192.168.178.1
sipserver_username = 625
stun_server =
#
max_call_time = 300
call_timeout = 60
ua.max_calls = 2
#
audio_codecs = PCMA,PCMU
record_while_dialing = False
records = /home/doorpi/records/%Y-%m-%d_%H-%M-%S.wav
#

####################### Events #######################
[EVENT_OnStartup]
10 = sleep:1
20 = os_execute:/home/doorpi/FHEMHelper.sh init
20 = os_execute:/home/doorpi/FHEMHelper.sh call init
#30 = out:audio,1

[EVENT_BeforeSipPhoneMakeCall]
10 = out:irlight,1
20 = take_snapshot
30 = os_execute:/home/doorpi/FHEMHelper.sh call started
40 = out:irlight,0
#30 = mailto:haus271828@henning-weingarten.de,DoorPi,DoorPi initiating call

#[EVENT_OnCallStateConnect]
#10 = out:audio,0

[EVENT_OnCallStateDisconnect]
10 = os_execute:/home/doorpi/FHEMHelper.sh call ended
#20 = out:audio,1

[EVENT_OnCallStateDismissed]
10 = os_execute:/home/doorpi/FHEMHelper.sh call dismissed
#20 = out:audio,1

[EVENT_OnCallStateReject]
10 = os_execute:/home/doorpi/FHEMHelper.sh call rejected
20 = out:audio,1

[EVENT_OnTimeMinuteEvery5]
10 = statuswatchdog:/tmp/doorpi.watchdog
#20 = out:audio,1

####################### Keyboards ##############################
[keyboards]
webservice = filesystem
onboardpins = gpio

####################### Virtual keyboard #######################
[webservice_keyboard]
base_path_input = /home/doorpi/keyboard/inputs/
base_path_output = /home/doorpi/keyboard/outputs/
reset_input=false

[webservice_InputPins]
dooropen        = sleep:0
doorlocked      = sleep:0
doorunlocked    = sleep:0
snapshot        = sleep:0
streamon        = sleep:0
streamoff       = sleep:0
lighton         = sleep:0
#lightonfortimer = out:light,1,0,60
lightoff        = sleep:0
dashlighton     = sleep:0
dashlightoff    = sleep:0
gettarget       = sleep:0
purge           = sleep:0
clear           = sleep:0
button1         = sleep:0
button2         = sleep:0

#-- communicate to FHEM that a snapshot has been taken
[EVENT_OnKeyPressed_webservice.snapshot]
10 = out:irlight,1
20 = os_execute:/home/doorpi/FHEMHelper.sh call snapshot
30 = take_snapshot
40 = out:irlight,0

#-- start video stream
[EVENT_OnKeyPressed_webservice.streamon]
10 = os_execute:/etc/init.d/mjpg_streamer start

#-- stop video stream
[EVENT_OnKeyPressed_webservice.streamoff]
10 = os_execute:/etc/init.d/mjpg_streamer stop

#-- obtain the target call number from FHEM
[EVENT_OnKeyPressed_webservice.gettarget]
10 = os_execute:/home/doorpi/FHEMHelper.sh gettarget

#-- purge all files older than current PID file
[EVENT_OnKeyPressed_webservice.purge]
10 = os_execute:/home/doorpi/FHEMHelper.sh purge

#-- clear all files
[EVENT_OnKeyPressed_webservice.clear]
10 = os_execute:/home/doorpi/FHEMHelper.sh clear

[EVENT_OnKeyPressed_webservice.button1]
10 = os_execute:/home/doorpi/FHEMHelper.sh sabotage

[EVENT_OnKeyPressed_webservice.button2]
10 = file_call_value:/home/doorpi/calltarget

####################### Real keyboard #######################
[onboardpins_keyboard]
pull_up_down = PUD_UP

[onboardpins_OutputPins]
40 = irlight

[onboardpins_InputPins]
37 = sleep:0
11 = sleep:0


FHEMHelper.sh und 70_DoorPi.pm in der aktuellsten Version von GitHub

Habe also das gleiche Problem wie no_legend. Irgendwelche Tipps, wie ich das beheben kann?

Viele Grüße
Karl

Prof. Dr. Peter Henning

OK,

ich habe gerade Version 1.41 eingecheckt - die steigt nicht mehr aus, wenn GetHistory kein Ergebnis liefert. Somit ist der o.a. Fehler nicht mehr kritisch.

Zur Wurzel des Problems: Die offiziell verteilte Version von DoorPi hat immer noch den Fehler, dass in die Datenbank eigentlich gar nichts geschrieben wird. Tom wird das vermutlich erst in der nächsten Major-Release-Version beheben.

Also muss man die beiden Dateien handler.py und history_event.py aus dem FHEM-Ordner contrib/DoorPi an Stelle der ursprünglichen Dateien handler.py und history_event.py im DoorPi-Code schreiben. Dann DoorPi neu starten, und schon sollte das funktionieren.

Die Funktion kann man auch ohne FHEM testen. Mit dem URL-Aufruf
<url von doorpi>/status?module=history_event
bekommt man die gesamte Liste der bisherigen Events. Bei einer korrekt befüllten Datenbank ist das relativ viel Zeug. Das kann man filtern, etwa indem nur nach OnCallStateChange gesucht wird:
<url von doorpi>/status?module=history_event&name=OnCallStateChange
Schließlich kann die ordentliche Löschfunktion (bei gepatchtem Datenbank-Handler, siehe oben) überprüft werden mit
<url von doorpi>/status?module=history_event&name=purge&value=1.0
Dieser Aufruf löscht alles aus der Event-Datenbank, was älter ist als 1.0 Tage = 24 Stunden.

Ob die Snapshots richtig gespeichert werden, prüft man mit dem Aufruf
<url von doorpi>/status?module=history_snapshot

LG

pah



karlj

Danke für die schnelle Hilfe!
Im Github wird die neue Version noch nicht angezeigt, aber ich erinnere mich mal was gelesen zu haben, dass das etwas dauert. Also denke ich mal ab ca. morgen wird es dann sichtbar sein?

Ich versuche dann mal mein Glück mit den geänderten handler.py und history_event.py

Viele Grüße
Karl

FhemDav

Hallo,
kann ich ein Bluetooth Lautsprecher mit Mikrofon (diese Handy Freisprecher) mit doorpi in fhem einbinden ??
Gruß
David


Rasp 3 / CUL / FHEM

Prof. Dr. Peter Henning

#253
Na, dann hänge ich die aktuelle Version mal hier an.

@FhemDav: Nein. Bitte erst einmal lesen, um welches Projekt es hier geht.

LG

pah

karlj

Danke pah,

habe die neue 70_DoorPi.pm ausprobiert, da ist laut FHEM ein Syntaxfehler drin:
2016.10.30 19:32:38 1: reload: Error:Modul 70_DoorPi deactivated:
syntax error at ./FHEM/70_DoorPi.pm line 767, near "$mga
     return"
syntax error at ./FHEM/70_DoorPi.pm line 772, near "$mga
     return"

2016.10.30 19:32:38 0: syntax error at ./FHEM/70_DoorPi.pm line 767, near "$mga
     return"
syntax error at ./FHEM/70_DoorPi.pm line 772, near "$mga
     return"


Mit der Version 1.4 scheint es erstmal zu laufen. Die Daten von GetConfig sind zwar invalid, aber vielleicht habe ich auch noch irgendwo einen Fehler in der Config, das schaue ich mir gleich mal an. Wollte hier nur schnell Rückmeldung geben.

2016.10.30 19:32:38 1: usb create starting
2016.10.30 19:32:40 3: Probing CUL device /dev/ttyAMA0
2016.10.30 19:32:41 3: Can't open /dev/ttyAMA0: Permission denied
2016.10.30 19:32:41 1: usb create end
2016.10.30 19:32:41 2: Messages collected while initializing FHEM: configfile: Cannot load module DoorPi ./log/fhem.save: Please define DoorStation first Please define DoorStation first Please define DoorStation first Please define DoorStation first Please define DoorStation first Please define DoorStation first
2016.10.30 19:32:41 0: Featurelevel: 5.7
2016.10.30 19:32:41 0: Server started with 9 defined entities (fhem.pl:12423/2016-10-24 perl:5.020002 os:linux user:fhem pid:2604)
2016.10.30 19:34:27 0: Server shutdown
2016.10.30 19:34:32 1: Including fhem.cfg
2016.10.30 19:34:33 3: telnetPort: port 7072 opened
2016.10.30 19:34:34 3: WEB: port 8083 opened
2016.10.30 19:34:34 3: WEBphone: port 8084 opened
2016.10.30 19:34:34 3: WEBtablet: port 8085 opened
2016.10.30 19:34:34 2: eventTypes: loaded 4 events from ./log/eventTypes.txt
2016.10.30 19:34:36 1: PERL WARNING: keys on reference is experimental at ./FHEM/70_DoorPi.pm line 537.
2016.10.30 19:34:36 1: PERL WARNING: keys on reference is experimental at ./FHEM/70_DoorPi.pm line 556.
2016.10.30 19:34:36 1: Including ./log/fhem.save
2016.10.30 19:34:36 1: usb create starting
2016.10.30 19:34:38 3: Probing CUL device /dev/ttyAMA0
2016.10.30 19:34:39 3: Can't open /dev/ttyAMA0: Permission denied
2016.10.30 19:34:39 1: usb create end
2016.10.30 19:34:39 2: SecurityCheck:  WEB,WEBphone,WEBtablet has no associated allowed device with basicAuth. telnetPort has no associated allowed device with password/globalpassword.  Restart FHEM for a new check if the problem is fixed, or set the global attribute motd to none to supress this message.
2016.10.30 19:34:39 0: Featurelevel: 5.7
2016.10.30 19:34:39 0: Server started with 10 defined entities (fhem.pl:12423/2016-10-24 perl:5.020002 os:linux user:fhem pid:3088)
not ok 1
#   Failed test at ./FHEM/70_DoorPi.pm line 523.
# Input was not valid JSON:
#
# malformed JSON string, neither array, object, number, string or atom, at character offset 17 (before "<head>\n            ...") at /usr/local/share/perl/5.20.2/JSON/Any.pm line 592.
2016.10.30 19:34:40 1: [DoorPi_GetConfig] but data is invalid
2016.10.30 19:34:40 1: [DoorPi_GetHistory] cannot be called, no connection


Schönen Abend noch
Karl