Wenn dies dein erster Besuch hier ist, lies bitte zuerst die Hilfe - Häufig gestellte Fragen durch. Du musst dich vermutlich registrieren, bevor du Beiträge verfassen kannst. Klicke oben auf 'Registrieren', um den Registrierungsprozess zu starten. Du kannst auch jetzt schon Beiträge lesen. Suche dir einfach das Forum aus, das dich am meisten interessiert.
Hab mir jetzt mal das Wireshark Capture angeschaut, aber leider hast die die Antworten nicht mit gelogged...
Also nicht mit Source x.x.x.65 Dest x.x.x.200, deshalb kann man da auch nichts erkennen.
Hab mir jetzt mal das Wireshark Capture angeschaut, aber leider hast die die Antworten nicht mit gelogged...
Ja meine Unwissenheit mal wieder...
Gefiltert habe ich nichts aber die Daten werden nur zwischen Edomi und dem Wechselrichter übertragen.
Fritzbox hat zwar auch ne Capturefuntion aber da wurde Modbus nicht aufgezeichnet/erkannt.
Deshalb habe ich Wireshark auf CentOS installiert und da aufgezeichnet.
Hm, kann leider nichts ungewöhnliches feststellen außer das die Verbindung wohl Hart beendet wird wenn der Fehler auftritt.
Leider benutzte ich die Modbus library auch nur und hab im Moment nicht die Zeit das selber zu implementieren...
Ich versuche mal dieses Wochenende noch die Fehlerbehandlung einzubauen aber viel mehr kann ich dann leider auch nicht mehr tun.
gulp2k aber ich sehe das richtig, dass die Antworten meines Wechselrichters immer die Gleichen sind und die Fehler wahrscheinlich durch die eingebunden library entstehen?
Kommen solche Fehler nur bei mir?
Und wenn ja, an was könnte das liegen?
Wie gesagt steck ich da selber nicht tief genug drin... Bei mir ist sowas noch nicht aufgetreten und ich lauf mir 5 Werten pro Sekunde stabil.
Ich kann leider von meiner Seite nicht viel mehr machen als den Fehler zu versuchen abzufangen... und dann zu "ignorieren".
INSTALLATION: This LBS requires phpmodbus.php to be present on Edomi. You can either copy the included zip file and extract the content to /usr/local/edomi/main/include/php/ or download phpModbus yourself. The version included is slightly modified to reduce logging output.
USAGE: This LSB allows to query up to 5 Values from a Modbus TCP Slave. It can either run once on a trigger or run continously. E2 is the IP or Hostname, E3 the Port wich should default to 502. E4 is TCP or UDP Connection and E5 is the Slave ID which is usually not changed. E6: Sets the Logging Level meinly 0 or 8 for debug. In debug mode it will write a lot so be warned! E7: Loop or no Loop E8 is the delay in ms between loops, default is 1000 which is 1s. E9 is mandatory address where we start to read. Be aware that addresses are counted from 0 but not all documentation take this into account. You might need to play with Address+-1 to get good values. E10 is the length of data we read in Dword! Meaning 1 is 2 bytes long. Again check the device doc. E11 is the data type that is returned so the LBS can convert accordingly. E12 is the Function to use, at the moment only F03 is implemented! From now it just repeats for differents inputs. The Result is the put to A1 to A5. A9 is a trigger that can be used to cascade several LBS. After each run but before the delay starts it will be triggerd with a 1. A10 indicates an error which usually means the LBS has stopped and need to be restarted.
E1: Autostart, Default=1 E2: Host or IP of Modbus Slave E3: Port (Currently not used) E4: Mode: 0=UDP, 1=TCP E5: Modbus Slave ID, Default=1 E6: Logging, 0=none, 8=Debuggen E7: Loop, Default=0, 0=False=Run once,1=True=Run till Edomi END E8: Delay between runs in ms, Default=1000 (1sec) E9: Address1 Datapoint E10: Lenght to read 1, Default=1 (1=1 Dword=2 Bytes) E11: Type of Data returned 1, 0=Int, 1=uInt, 2=Float, 3=Byte, 4=Bit, 5=String, 6=Swap Float E12: Function to use (Currently only FC3 Read_Multiple_Registers is implemented) E13: Address2 (see E9) E14: Length2 (see E10) E15: Type2 (see E11) E16: Function2 (see E12) E17: Address3 (see E9) E18: Length3 (see E10) E19: Type3 (see E11) E20: Function3 (see E12) E21: Address4 (see E9) E22: Length4 (see E10) E23: Type4 (see E11) E24: Function4 (see E12) E25: Address5 (see E9) E26: Length5 (see E10) E27: Type5 (see E11) E28: Function5 (see E12)
A1: Result of Query 1 A2: Result of Query 2 A3: Result of Query 3 A4: Result of Query 4 A5: Result of Query 5 A9: Trigger ext, Can be used to chain LBS together, will send a 1 at the end of each loop A10: Triggers on Daemon Error 1=Generic Error, 2=Timeout Error
V1: Indicator whether daemon is running V2: PID of EXEC Daemon V3: Array of used Inputs V4: Endianness 0/1 V5: Timout Counter V100: Version V101: LBS Number V102: Log file name V103: Log level V104: One log file per LBS instance V105: log ID in each log entry
#Changelog v0.1 Initial version v0.2 small bugfix + new Datatype "Swap Float" v0.3 "Swap Float" fix v0.4 Implemented Endianess Setting in V4 v0.5 Refactoring of EXEC part to avoid potential Memory Leak. EXEC Part is not a daemon anymore. increased Debug Output. v0.6 Suppress wrong data due to corrupted Modbus Message ###[/HELP]###
if ($E=logic_getInputs($id)) { $loop=$E[7]['value']; $delay=$E[8]['value']; if (logic_getState($id)==1 && $E[1]==0){ logic_setState($id,0); LB_LBSID_logging($id, 'LBS ended'); } else { setLogicElementVar($id, 103, $E[6]['value']); // set loglevel to #VAR 103 if (logic_getState($id)==0) { LB_LBSID_logging($id, 'LBS started'); } $activeInputs=array(); if ($E[9]['value']!=""){ $activeInputs[]=9; } if ($E[13]['value']!=""){ $activeInputs[]=13; } if ($E[17]['value']!=""){ $activeInputs[]=17; } if ($E[21]['value']!=""){ $activeInputs[]=21; } if ($E[25]['value']!=""){ $activeInputs[]=25; }
setLogicElementVar($id,3,implode(";",$activeInputs)); if (getLogicElementVar($id,1)!=1) { setLogicElementVar($id,5,1); setLogicElementVar($id,1,1); //setzt V1=1, um einen mehrfachen Start des EXEC-Scripts zu verhindern callLogicFunctionExec(LBSID,$id); //EXEC-Script starten (garantiert nur einmalig) } elseif (logic_getVar($id,5)>9){ setLogicElementVar($id,5,0); setLogicElementVar($id,1,0); logic_SetOutput($id,10,2); } else { $v5=logic_getVar($id,5); logic_setVar($id,5,$v5+1); } if ($loop=1){ logic_setState($id,1,$delay); } }
} } ?> ###[/LBS]### ###[EXEC]### <? require(dirname(__FILE__)."/../../../../main/include/php/incl_lbsexec.php"); require_once(dirname(__FILE__)."/../../../../main/include/php/ModbusMaster.php"); set_time_limit(0); //Wichtig! Script soll endlos laufen sql_connect(); logging($id, "START ModbusMaster Exec",null,6); setLogicElementVar($id, 2, getmypid()); $suppressModBusError='0'; // // error_off() : switch off error reporting // error_on() : switch on error reporting // function myErrorHandler($errno, $errstr, $errfile, $errline) { global $id; if(($errfile=='/usr/local/edomi/main/include/php/ModbusMaster.php' AND $errno=='8' AND $errline='506')OR($errfile=='/usr/local/edomi/main/include/php/ModbusMaster.php' AND $errno=='2048')OR($errfile=='/usr/local/edomi/main/include/php/IecType.php' AND $errno=='2048')){return;}
logging($id, "File: $errfile | Error: $errno | Line: $errline | $errstr ",null,4); } function myErrorHandlerModBus($errno, $errstr, $errfile, $errline) { global $id; if(($errfile=='/usr/local/edomi/main/include/php/ModbusMaster.php' AND $errno=='8')){ $GLOBALS["suppressModBusError"]='1'; return;}
Wir verarbeiten personenbezogene Daten über die Nutzer unserer Website mithilfe von Cookies und anderen Technologien, um unsere Dienste bereitzustellen. Weitere Informationen findest Du in unserer Datenschutzerklärung.
Indem Du unten auf "ICH stimme zu" klickst, stimmst Du unserer Datenschutzerklärung und unseren persönlichen Datenverarbeitungs- und Cookie-Praktiken zu, wie darin beschrieben. Du erkennst außerdem an, dass dieses Forum möglicherweise außerhalb Deines Landes gehostet wird und bist damit einverstanden, dass Deine Daten in dem Land, in dem dieses Forum gehostet wird, gesammelt, gespeichert und verarbeitet werden.
Kommentar