neues Modul: SIEMENS Anbindung / S7 / Siemens Logo

Begonnen von charlie71, 12 August 2014, 15:33:23

Vorheriges Thema - Nächstes Thema

thmarx

Hallo charlie71,

ich habe die cfg exakt wie Du, nur mit einen IP-Adressen. Ich kriege nach wie vor keine Ergebnisse, im log steht immer noch was von "unknow device".


2014.12.07 10:04:11 4: S7: GetUpdate called ...
2014.12.07 10:04:13 4: S7: GetUpdate called ...
2014.12.07 10:04:13 4: S7: readFromPLC  132,0,923,61
2014.12.07 10:04:13 5: logo19 dispatch A db 0 923 61
2014.12.07 10:04:13 3: logo19: Unknown S7_ARead device detected, define one to get detailed information.
2014.12.07 10:04:13 5: logo19 dispatch D db 0 923 61
2014.12.07 10:04:13 3: logo19: Unknown S7_DRead device detected, define one to get detailed information.
2014.12.07 10:04:15 4: S7: GetUpdate called ...
2014.12.07 10:04:17 4: S7: GetUpdate called ...
2014.12.07 10:04:19 4: S7: GetUpdate called ...
2014.12.07 10:04:19 4: S7: readFromPLC  132,0,923,61
2014.12.07 10:04:19 5: logo19 dispatch A db 0 923 61
2014.12.07 10:04:19 3: logo19: Unknown S7_ARead device detected, define one to get detailed information.
2014.12.07 10:04:19 5: logo19 dispatch D db 0 923 61
2014.12.07 10:04:19 3: logo19: Unknown S7_DRead device detected, define one to get detailed information.
2014.12.07 10:04:21 4: S7: GetUpdate called ...
2014.12.07 10:04:23 4: S7: GetUpdate called ...
2014.12.07 10:04:25 4: S7: GetUpdate called ...
2014.12.07 10:04:25 4: S7: readFromPLC  132,0,923,61
2014.12.07 10:04:25 5: logo19 dispatch A db 0 923 61
2014.12.07 10:04:25 3: logo19: Unknown S7_ARead device detected, define one to get detailed information.
2014.12.07 10:04:25 5: logo19 dispatch D db 0 923 61
2014.12.07 10:04:25 3: logo19: Unknown S7_DRead device detected, define one to get detailed information.
2014.12.07 10:04:27 4: S7: GetUpdate called ...


Porsti

#76
Hi,

habe jetzt die Version 1.2.a neu aufgepielt und des lassen sich die Eingänge auslesen und über Ntzwerkeingänge die logo steuern.
Das mit den Analogwerten klappt bei mir leider auch nicht. Bekomme da auch immer die ??? angezeigt.

Daher hatte ich das erst mal wieder deaktiviert. Dabei ist mir aber aufgefallen das dort diese fehlermeldung im log kommt:


2014.12.07 10:22:56 3: S7: reading error from PLC errorcode -1025
2014.12.07 10:22:56 3: maxPDUlength was set to: 960
2014.12.07 10:22:56 3: Communicationtype was set to 2
2014.12.07 10:22:56 3: connect to PLC: 0
2014.12.07 10:22:56 1: returnmessage PLC: 0=ok
2014.12.07 10:23:06 3: S7: reading error from PLC errorcode -1025
2014.12.07 10:23:06 3: maxPDUlength was set to: 960
2014.12.07 10:23:06 3: Communicationtype was set to 2
2014.12.07 10:23:06 3: connect to PLC: 0
2014.12.07 10:23:06 1: returnmessage PLC: 0=ok
2014.12.07 10:23:16 3: S7: reading error from PLC errorcode -1025
2014.12.07 10:23:16 3: maxPDUlength was set to: 960
2014.12.07 10:23:16 3: Communicationtype was set to 2
2014.12.07 10:23:16 3: connect to PLC: 0
2014.12.07 10:23:16 1: returnmessage PLC: 0=ok


Hier ist die Konfiguration dazu

# Anbindung Siemens Logo
define mylogo S7 2 0 192.168.10.50 0 0 102 2 960
attr mylogo ReadDB-Config 1 1406 2 10
attr mylogo ReadOutputs-Config 1 0 2 10
attr mylogo WriteDB-Config 1 1246 10
define mylogo_Q1 S7_DRead outputs 1 0
attr mylogo_Q1 alias Ausgang 1
attr mylogo_Q1 room Logo
define mylogo_Q2 S7_DRead outputs 1 1
attr mylogo_Q2 alias Ausgang 2
attr mylogo_Q2 room Logo
define mylogo_Q3 S7_DRead outputs 1 2
attr mylogo_Q3 alias Ausgang 3
attr mylogo_Q3 room Logo
define mylogo_Q4 S7_DRead outputs 1 3
attr mylogo_Q4 alias Ausgang 4
attr mylogo_Q4 room Logo
define mylogo_N1_w S7_DWrite DB 1 9968
attr mylogo_N1_w alias Zentral Aus
attr mylogo_N1_w room Logo
attr mylogo_N1_w webCmd TRIGGER


Kann im Internet leider nicht herausfinden was bei der Libnodave dieser errorcode bedeutet.
Kennt jemand diesen Fehler?

Gruß
Porsti
____________________________________
fhem 6.2  auf Raspberry 3b
Homematic HM-CC-RT-DN / HM-TC-IT-WM-W-EU / HM-SEC-SCo / HM-LC-SW1-PL2
SIGNALduino, KNX (Merten, MDT, Siemens, ABB)

charlie71

Hallo Christoph

ich hab noch einen kleinen Fehler im Modul gefunden. Das Modul läuft bei mir, jedoch habe ich nur eine logo und somit kann ich es nur beschränkt testen.
Bitte um feedback ob es klappt.

Danke und lG
Charlie71

charlie71

Hallo Porsti,

Also die Fehlermeldung bedeutet: "Timeout when waiting for PLC response"

Weißt du bei welchem Reading die Fehlermeldung auftritt?

lG
Charlie71

charlie71

Hallo Thomas,

bitte Poste noch einmal  deine Config.
Die "Unknown S7_ARead device " ist eine FHEM Fehlermeldung wenn S7_ARead nicht definiert ist.

Danke
Charlie71


Zitat von: thmarx am 07 Dezember 2014, 10:17:13
Hallo charlie71,

ich habe die cfg exakt wie Du, nur mit einen IP-Adressen. Ich kriege nach wie vor keine Ergebnisse, im log steht immer noch was von "unknow device".


2014.12.07 10:04:11 4: S7: GetUpdate called ...
2014.12.07 10:04:13 4: S7: GetUpdate called ...
2014.12.07 10:04:13 4: S7: readFromPLC  132,0,923,61
2014.12.07 10:04:13 5: logo19 dispatch A db 0 923 61
2014.12.07 10:04:13 3: logo19: Unknown S7_ARead device detected, define one to get detailed information.
2014.12.07 10:04:13 5: logo19 dispatch D db 0 923 61
2014.12.07 10:04:13 3: logo19: Unknown S7_DRead device detected, define one to get detailed information.
2014.12.07 10:04:15 4: S7: GetUpdate called ...
2014.12.07 10:04:17 4: S7: GetUpdate called ...
2014.12.07 10:04:19 4: S7: GetUpdate called ...
2014.12.07 10:04:19 4: S7: readFromPLC  132,0,923,61
2014.12.07 10:04:19 5: logo19 dispatch A db 0 923 61
2014.12.07 10:04:19 3: logo19: Unknown S7_ARead device detected, define one to get detailed information.
2014.12.07 10:04:19 5: logo19 dispatch D db 0 923 61
2014.12.07 10:04:19 3: logo19: Unknown S7_DRead device detected, define one to get detailed information.
2014.12.07 10:04:21 4: S7: GetUpdate called ...
2014.12.07 10:04:23 4: S7: GetUpdate called ...
2014.12.07 10:04:25 4: S7: GetUpdate called ...
2014.12.07 10:04:25 4: S7: readFromPLC  132,0,923,61
2014.12.07 10:04:25 5: logo19 dispatch A db 0 923 61
2014.12.07 10:04:25 3: logo19: Unknown S7_ARead device detected, define one to get detailed information.
2014.12.07 10:04:25 5: logo19 dispatch D db 0 923 61
2014.12.07 10:04:25 3: logo19: Unknown S7_DRead device detected, define one to get detailed information.
2014.12.07 10:04:27 4: S7: GetUpdate called ...


thmarx

Hallo,

die komplette config:

define telnetPort telnet 7373 global

define WEB FHEMWEB 8383 global
attr WEB longpoll 1

attr global backup_before_update 0
attr global logdir tmp
attr global logfile tmp/fhem-%Y-%m.logo.log
attr global modpath .
attr global nofork 1
attr global sendStatistics onUpdate
attr global statefile tmp/fhem.logo.save
attr global uniqueID ./FHEM/FhemUtils/uniqueID
attr global verbose 5

define logo19 S7 2 0 192.168.178.19 0 0 102 2 960
attr logo19 ReadDB-Config 0 923 61 5
define logo19_AM16_r S7_ARead db 0 982 s16


und das log dazu:

2014.12.07 16:05:41 5: Initializing Type Library:
2014.12.07 16:05:41 1: Including ../logo19.cfg
2014.12.07 16:05:41 5: Cmd: >define telnetPort telnet 7373 global<
2014.12.07 16:05:41 5: Loading ./FHEM/98_telnet.pm
2014.12.07 16:05:41 3: telnetPort: port 7373 opened
2014.12.07 16:05:41 5: Cmd: >define WEB FHEMWEB 8383 global<
2014.12.07 16:05:41 5: Loading ./FHEM/01_FHEMWEB.pm
2014.12.07 16:05:43 3: WEB: port 8383 opened
2014.12.07 16:05:43 5: Cmd: >attr WEB longpoll 1<
2014.12.07 16:05:43 5: Cmd: >attr global backup_before_update 0<
2014.12.07 16:05:43 5: Cmd: >attr global logdir tmp<
2014.12.07 16:05:43 5: Cmd: >attr global logfile tmp/fhem-%Y-%m.logo.log<
2014.12.07 16:05:43 5: Cmd: >attr global modpath .<
2014.12.07 16:05:43 5: Cmd: >attr global sendStatistics onUpdate<
2014.12.07 16:05:43 5: Cmd: >attr global statefile tmp/fhem.logo.save<
2014.12.07 16:05:43 5: Cmd: >attr global uniqueID ./FHEM/FhemUtils/uniqueID<
2014.12.07 16:05:43 5: Cmd: >attr global verbose 5<
2014.12.07 16:05:43 5: Cmd: >define logo19 S7 2 0 192.168.178.19 0 0 102 2 960<
2014.12.07 16:05:43 5: Loading ./FHEM/44_S7.pm
2014.12.07 16:05:43 4: S7 Connect: plcMPI=2, localMPI=0, ip_address=192.168.178.19,rack=0, slot=0, ip_port=102, PDULength= 960
2014.12.07 16:05:43 3: maxPDUlength was set to: 960
2014.12.07 16:05:43 3: Communicationtype was set to 2
2014.12.07 16:05:43 3: connect to PLC: 0
2014.12.07 16:05:43 1: returnmessage PLC: 0=ok
2014.12.07 16:05:43 5: Cmd: >attr logo19 ReadDB-Config 0 923 61 5<
2014.12.07 16:05:43 5: Cmd: >define logo19_AM16_r S7_ARead db 0 982 s16<
2014.12.07 16:05:43 5: Loading ./FHEM/44_S7_ARead.pm
2014.12.07 16:05:45 5: Triggering global (1 changes)
2014.12.07 16:05:45 5: Notify loop for global INITIALIZED
2014.12.07 16:05:45 2: SecurityCheck:  WEB has no basicAuth attribute. telnetPort has no password/globalpassword attribute.  Restart FHEM for a new check if the problem is fixed, or set the global attribute motd to none to supress this message.
2014.12.07 16:05:45 0: Server started with 5 defined entities (version $Id: fhem.pl 7116 2014-12-02 07:05:00Z rudolfkoenig $, os linux, user pi, pid 3152)
2014.12.07 16:05:45 4: Connection accepted from FHEMWEB:192.168.178.50:58065
2014.12.07 16:05:45 4: Connection accepted from FHEMWEB:192.168.178.50:58064
2014.12.07 16:05:46 4: HTTP FHEMWEB:192.168.178.50:58065 GET /fhem?XHR=1&inform=type=status;filter=logo19_AM16_r&timestamp=1417964744415
2014.12.07 16:05:46 4: S7: GetUpdate called ...
2014.12.07 16:05:46 4: S7: readFromPLC  132,0,923,61
2014.12.07 16:05:46 5: logo19 dispatch A db 0 923 61
2014.12.07 16:05:46 3: logo19: Unknown S7_ARead device detected, define one to get detailed information.
2014.12.07 16:05:46 5: logo19 dispatch D db 0 923 61
2014.12.07 16:05:46 3: logo19: Unknown S7_DRead device detected, define one to get detailed information.
2014.12.07 16:05:48 4: S7: GetUpdate called ...
2014.12.07 16:05:48 4: Connection closed for FHEMWEB:192.168.178.50:58064
2014.12.07 16:05:50 4: S7: GetUpdate called ...
2014.12.07 16:05:52 4: S7: GetUpdate called ...
2014.12.07 16:05:52 4: S7: readFromPLC  132,0,923,61
2014.12.07 16:05:52 5: logo19 dispatch A db 0 923 61
2014.12.07 16:05:52 3: logo19: Unknown S7_ARead device detected, define one to get detailed information.
2014.12.07 16:05:52 5: logo19 dispatch D db 0 923 61
2014.12.07 16:05:52 3: logo19: Unknown S7_DRead device detected, define one to get detailed information.
2014.12.07 16:05:54 4: S7: GetUpdate called ...
2014.12.07 16:05:56 4: S7: GetUpdate called ...
2014.12.07 16:05:58 4: S7: GetUpdate called ...
2014.12.07 16:05:58 4: S7: readFromPLC  132,0,923,61
2014.12.07 16:05:58 5: logo19 dispatch A db 0 923 61
2014.12.07 16:05:58 3: logo19: Unknown S7_ARead device detected, define one to get detailed information.
2014.12.07 16:05:58 5: logo19 dispatch D db 0 923 61
2014.12.07 16:05:58 3: logo19: Unknown S7_DRead device detected, define one to get detailed information.
2014.12.07 16:06:00 4: S7: GetUpdate called ...
2014.12.07 16:06:02 5: Triggering global (1 changes)
2014.12.07 16:06:02 5: Notify loop for global SHUTDOWN
2014.12.07 16:06:02 0: Server shutdown


charlie71

Hallo Thomas,

langsam bin ich ratlos.
Ich versuch mal meine Erkenntnisse zusammen zufassen.
1) Die Konfig ist jetzt ok
2) Das Lesen von der Siemens logo funktioniert (funktioniert mit meiner Logo problemlos)
3) Nach dem Lesen wirft FHEM die Fehlermeldung "Unknown S7_ARead device detected". DH es wird das logische Modul nicht gefunden.

Was mir noch einfällt:
a) Hast du auf die letzte Modulversion upgegraded (aktuell V1.3 + update für porsti) ?
b) Welche FHEM Version verwendest Du (Ich verwende: fhem.pl 3872 2013-09-07)

lG
Charlie71


thmarx

Hallo charlie71,

ich verwende "fhem.pl 7116 2014-12-02". Aktuelle Modulversion habe ich.

Gruß
Thomas

goerdi

OK hier mal meine Resultate
(FYI wenn du willst das das mit mehreren Logos funktioniert, dann kannst du mich zum testen hernehmen... ich hab 4 am laufen und es waere nicht schlecht wenn alle 4 laufen wurden :D)

also beim manuellen Start im Terminal kriege ich immer noch
root@smarthome:/opt/fhem# perl fhem.pl fhem.cfg
root@smarthome:/opt/fhem# "my" variable $dmsg masks earlier declaration in same scope at ./FHEM/44_S7.pm line 462, <$fh> line 29.
"my" variable %addvals masks earlier declaration in same scope at ./FHEM/44_S7.pm line 466, <$fh> line 29.
Use of uninitialized value $res in numeric ne (!=) at ./FHEM/44_S7.pm line 229, <$fh> line 29.


Isses dann hochgelaufen

2014.12.07 18:06:54 5: Loading ./FHEM/44_S7.pm
2014.12.07 18:06:54 4: S7 Connect: plcMPI=2, localMPI=0, ip_address=192.168.63.101,rack=0, slot=0, ip_port=102, PDULength= 960
2014.12.07 18:06:54 3: maxPDUlength was set to: 960
2014.12.07 18:06:54 3: Communicationtype was set to 2
2014.12.07 18:06:54 3: connect to PLC: 0
2014.12.07 18:06:54 1: returnmessage PLC: 0=ok
2014.12.07 18:06:54 5: Cmd: >attr mylogo ReadDB-Config 1 1406 2 10<
2014.12.07 18:06:54 5: Cmd: >attr mylogo ReadOutputs-Config 1 0 2 10<
2014.12.07 18:06:54 5: Cmd: >attr mylogo WriteDB-Config 1 1246 10<
2014.12.07 18:06:54 3: S7: count not read initial state from PLC --> failed:
2014.12.07 18:06:54 3: count not read initial state from PLC --> failed
2014.12.07 18:06:54 5: Cmd: >define mylogo_Q1 S7_DRead outputs 1 0<
2014.12.07 18:06:54 5: Loading ./FHEM/44_S7_DRead.pm
2014.12.07 18:06:54 5: Cmd: >attr mylogo_Q1 alias Ausgang 1<
2014.12.07 18:06:54 1: configfile: count not read initial state from PLC --> failed


Und um den Ganzen Durcheinander zu entgehen waere es sinnvoll die neueste Variante in einen Beitrag (sinnvollerweise den ersten) festzupinnen und immer da abuzuaendern...


Gruss Gerd

Porsti

#84
Hallo Charlie71,

hier sind alle befehle aus der Konifuration:

define mylogo S7 2 0 192.168.10.50 0 0 102 2 960
attr mylogo ReadOutputs-Config 1 0 2 10
attr mylogo WriteDB-Config 1 1246 15
define mylogo_Q1 S7_DRead outputs 1 0
define mylogo_Q2 S7_DRead outputs 1 1
define mylogo_Q3 S7_DRead outputs 1 2
define mylogo_Q4 S7_DRead outputs 1 3
define mylogo_Q11 S7_DRead outputs 1 10
define mylogo_N1_w S7_DWrite DB 1 9968
define mylogo_N2_w S7_DWrite DB 1 9975
define mylogo_N3_w S7_DWrite DB 1 9969
define mylogo_N4_w S7_DWrite DB 1 9970
define mylogo_N5_w S7_DWrite DB 1 9971
define mylogo_N6_w S7_DWrite DB 1 9972
define mylogo_N7_w S7_DWrite DB 1 9973
define mylogo_N9_w S7_DWrite DB 1 9976


Wie kann ich denn heraus bekommen welcher der befehle das Timout auslöst.

So sieht zur Zeit der log aus:

2014.12.07 18:41:51 0: Server started with 23 defined entities (version $Id: fhem.pl 6913 2014-11-08 10:32:44Z rudolfkoenig $, os linux, user bananapi, pid 2937)
2014.12.07 18:41:52 1: PERL WARNING: Use of uninitialized value in split at ./FHEM/44_S7.pm line 430.
2014.12.07 18:41:52 1: PERL WARNING: Use of uninitialized value in split at ./FHEM/44_S7.pm line 431.
2014.12.07 18:42:02 3: S7: reading error from PLC errorcode -1025
2014.12.07 18:42:02 3: maxPDUlength was set to: 960
2014.12.07 18:42:02 3: Communicationtype was set to 2
2014.12.07 18:42:02 3: connect to PLC: 0
2014.12.07 18:42:02 1: returnmessage PLC: 0=ok
2014.12.07 18:42:12 3: S7: reading error from PLC errorcode -1025
2014.12.07 18:42:12 3: maxPDUlength was set to: 960
2014.12.07 18:42:12 3: Communicationtype was set to 2
2014.12.07 18:42:12 3: connect to PLC: 0
2014.12.07 18:42:12 1: returnmessage PLC: 0=ok


Gruß
Porsti
____________________________________
fhem 6.2  auf Raspberry 3b
Homematic HM-CC-RT-DN / HM-TC-IT-WM-W-EU / HM-SEC-SCo / HM-LC-SW1-PL2
SIGNALduino, KNX (Merten, MDT, Siemens, ABB)

pc1246

Hallo Karl
Der Weg scheint richtig zu sein! In den Internals tauchen jetzt auf einmal die Inputs und die anderen readings auf! Leider wird nur die Zeit der Inputs aktualisiert, so dass die anderen nicht mehr abgeholt werden! Wenn du Deine Aenderungen ein wenig kennzeichnen wuerdest, koennte ich eventuell selbst weitersuchen!
Trotzdem Danke fuer Deine Muehe
Gruss Christoph
P.S.: Morgen abend habe ich wieder mehr Zeit!
HP T610
Onkyo_AVR;3 Enigma2; SB_Server ; SB_Player; HM-USB mit 15 HM-CC-RT-DN, 3 HM_WDS10_TH_O, 6 HM-Sec-SCo, 4 HM-Sec-MDIR-2, 1 HM-Sen-MDIR-O-2, 8 Ferion 5000 OW ; PhilipsTV; 4 harmony hub; Jeelink mit 9 PCA301; Somfy; S7-300; 3 LGW; HUE; HM-IP auf Charly

AHA1805

Hallo,

auf das Modul habe ich schon lange gewartet   :)

Jetzt habe ich die Version 1.3 installiert.
Ist diese Meldung kritisch oder kann diese vernachlässigt werden?

014.12.07 19:33:40 1: PERL WARNING: Can't locate auto/Nodave/autosplit.ix in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl . ./FHEM) at /usr/share/perl/5.14/AutoLoader.pm line 173.
at /usr/lib/perl/5.14/Nodave.pm line 33
2014.12.07 19:33:40 1: PERL WARNING: "my" variable $dmsg masks earlier declaration in same scope at ./FHEM/44_S7.pm line 462.


Leide bin ich in PERL absolut unerfahren, was mir das sagen soll

Gruß Hannes
AHA 1805 RIP 29.08.2016 --> RUHE IN FRIEDEN
In Gedanken Bei dir HANNES
Dein Bruder Gerd (Inputsammler) Vermisst dich Hannes (AHA1805)

charlie71

Hallo Porsti,

wenn ich mich recht erinnere verwendest du eine Siemens Logo.
Interessanterweise funktioniert deine Config auf meiner Logo.

Änderungsvorschlag für 0BA7:
attr mylogo ReadDB-Config 0 942 2 10
define mylogo_Q1 S7_DRead DB 0 7536
define mylogo_Q2 S7_DRead DB 0 7537
define mylogo_Q3 S7_DRead DB 0 7538
define mylogo_Q4 S7_DRead DB 0 7546
define mylogo_Q11 S7_DRead DB 0 1074

(ich glaub mich erinnern zu können, dass das output reading bei der logo gezickt hat)

Wenns nicht klappt deine Netzwerkkonfig auf der Logo prüfen.

lG
Charlie71
PS: Ich hab V1.4 online gestellt
   

charlie71

Hallo Hannes,

Achtung aktuell ist die V1.4 (ganz am Anfang des Threads) . Hier sollte das zweite Warning bereits gefixt sein. Beim ersten Warning kann ich dir nicht weiterhelfen.

Gruß
Charlie71

charlie71

Hallo Thomas,

ich hab mal mein FEHM auf den letzten Stand gebracht (fhem.pl 7124). Und das S7 Modul (V1.4) läuft fehlerfrei.
Im Moment bin ich wirklich ein wenig ratlos. Aber vieleicht kann jemand anderer helfen.

Gruß
Charlie71