/** * #define for all files StromLog * Version 7.04 * 28.06.2024 P. Rebesky * author Creator P.Rebesky * Copyright (©): 2022-2032 by Peter Rebesky * This code can use in private cases only. Every business or companies using of this codes or codes parts is required an approval of us (me) * Every private using can exchange some parts of code or modify some code-lines. This code is allowed change for private use only. * This software is basicly owned by Peter Rebesky and any comercial using is forbidden without approval of us (me). **/ #ifndef GLOBAL_H_ #define GLOBAL_H_ //*** here select the meter by define target type *** #define SML_DIN //#define VDE_DIN //#define LG_E350 //#define ISKRA_MT174 //#define ZE311_DR //#define MBUS_DLMS //#define PAF_EC3 //#define LG_E320 //#define DIN_EBZ //*** select meter end *** #define _SAVE_PROT_MAX 56 // _SAVE_PROT_MAX = (memory-space - 22528) / (_SAVE_PROT_MAX * 4096) #define _BOARDTASTER 0 #define _LED 14 #define _RECEIVE485 12 #define _ON 1 #define _OFF 0 #define _FLASHTIME 300 #define _MESZ 0 // summer-time = 1 else winter-time = 0 #define _UTCOFFSET 3600 #ifdef MBUS_DLMS #define _MAXBUFFER 512 // maximum buffer for received bytes #else #define _MAXBUFFER 800 // maximum buffer for received bytes #endif #define _POLYNOM 0x1021 // x16 + x12 + x5 + 1 0x1021 #define _TIMEOF2021 1640998800 #define _WATT 0x1b #define _VOLTAMP 0x1c #define _VAR 0x1d #define _WATTH 0x1e #define _VOLTAMPH 0x1f #define _VARH 0x20 #define _AMPERE 0x21 #define _VOLTAGE 0x23 #define _HERTZ 0x2c #define _YEAR 0 #define _MONTH 1 #define _DAY 2 #define _HOUR 3 #define _MINUTE 4 #define _SECOND 5 #define _ADJUST_HTTP 1000 #define _ADJUST_HTTPS 982 #define _U_L1 0 #define _U_L2 1 #define _U_L3 2 #define _I_L1 3 #define _I_L2 4 #define _I_L3 5 #define _P_L1 6 #define _P_L2 7 #define _P_L3 8 #define _CONSUMPTION 9 #define _FREQ 10 #define _FROMGRID_0 0 #define _FROMGRID_1 1 #define _FROMGRID_2 2 #define _FEEDIN 3 #define _MID0 0 #define _MID1 1 #define _MID2 2 #define _DETECT_prot 0 #define _SML_prot 1 #define _DIN_prot 2 const char HTTP_ANSWER[] = "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n"; //header of http without mixed content const char HTTP_ANSWERJSON[] = "HTTP/1.1 200 OK\r\nAccess-Control-Allow-Origin: *\r\nContent-Type: text/json\r\n\r\n"; //header of http with mixed content, only for JSON const char HTTP_ANSWER_LENGTH[] = "Content-length: \r\n"; const char HTTP_HEAD_DTZ[] = "\r\n\r\n"; const char HTTP_HEAD_DTZ_REFRESH[] = "\r\n\r\n"; #ifdef SML_DIN const char PROTOCOL_ERROR[] PROGMEM ="

Verbindungsfehler zum Lesekopf / Zähler. Protokoll wird nicht erkannt. Stecker und Lesekopf prüfen: Links Netzteil, rechts Lesekopf. Anschlüsse nach unten und Logo nach vorne.

"; #else const char PROTOCOL_ERROR[] PROGMEM ="

Verbindungsfehler zum Lesekopf / Zähler. Protokoll wird nicht erkannt. Stecker und Position des Lesekopfes prüfen.

"; #endif const char HTTP_BODYSTYLE_DTZ[] PROGMEM = ""; const char HTTP_SETUP_BUTTON[] = "

"; const char HTTP_DIV_FIELD[] = "
"; const char HTTP_TEXT_END[] ="
\n"; const char HTTP_JS_SETUP[] PROGMEM =""; const char HTTP_JS_SCRIPT[] PROGMEM =""; String GENERETIC = "Generetic SML-Protokol"; String NOT_DETECT = "Zähler nicht erkannt"; const byte DaysPerMonth[] = {31,28,31,30,31,30,31,31,30,31,30,31}; String _crypt="none"; int _date_time[6]; //[_YEAR][_MONTH][_DAY][_HOUR][_MINUTE][_SECOND] int _act_date_time[6]; //[_YEAR][_MONTH][_DAY][_HOUR][_MINUTE][_SECOND] int _ShowProtocolTime = 0; int _mqttBrokerOK = 0; int _newProtocol=1; int _mqttWaitTime2Connect = 120; uint32_t _protocolCheck=0; bool _protocolError=false; int _CRC_CHECK = 0; // 0 = CRC on, 1 = CRC off uint32_t _timestamp = 0; uint32_t _millis4Reciever = 0; uint32_t _previousMillis = 0; uint32_t _secondMillis =0; uint32_t _timestampFromServer =0; int _httpMarker = 0; int _flashCounter = 0; uint _secAdjust=1000; int _serialType = 0; bool _sendingOK = false; char _receivedByte[2]; int _dataPointer = 0; char _dataDTZ[_MAXBUFFER]; String _transmitResult; #endif //***GLOBAL_H_