fredlcore / BSB-LAN

LAN/WiFi interface for Boiler-System-Bus (BSB) and Local Process Bus (LPB) and Punkt-zu-Punkt Schnittstelle (PPS) with a Siemens® controller used by Elco®, Brötje® and similar heating systems
232 stars 84 forks source link

Not logging to SD from 2.0 ver. #336

Closed proasnet closed 3 years ago

proasnet commented 3 years ago

Hello, from version 2.0 I have BSB-LAN on Arduino Due with ethernet shield WZ5100 and 2GB SD card. Before this update, I had BSB-LAN on Arduino Mega with the same ethernet shield. Now from 2.0 my BSB-LAN not logging data to SD card. Yesterday I upgraded to the last version and nothing, in the web UI I have an empty graphs and logs. SD is formated to FAT32, not file. I try re-create file by /D0 parameter to URL and nothing... In the older version 1 on Mega this was working. Can help me somebody? Thank you.

fredlcore commented 3 years ago

Please post your BSB_LAN_config.h, a screenshot of your web configuration (/C) and the output of the serial monitor during startup.

proasnet commented 3 years ago

Hi, I am sorry for later answer. Now I can connect to my BSB Lan. Here is serial debug:

READY
Reading EEPROM
Reading done.
EEPROM schema v.5 Program schema v.5
Address EEPROM option 0: 0
Address EEPROM option 1: 1
Address EEPROM option 2: 2
Address EEPROM option 3: 6
Address EEPROM option 4: 226
Address EEPROM option 5: 306
Address EEPROM option 6: 490
Address EEPROM option 7: 491
Address EEPROM option 8: 492
Address EEPROM option 9: 493
Address EEPROM option 10: 494
Address EEPROM option 11: 495
Address EEPROM option 12: 499
Address EEPROM option 13: 500
Address EEPROM option 14: 660
Address EEPROM option 15: 661
Address EEPROM option 16: 665
Address EEPROM option 17: 825
Address EEPROM option 18: 831
Address EEPROM option 19: 832
Address EEPROM option 20: 836
Address EEPROM option 21: 840
Address EEPROM option 22: 844
Address EEPROM option 23: 848
Address EEPROM option 24: 850
Address EEPROM option 25: 854
Address EEPROM option 26: 858
Address EEPROM option 27: 922
Address EEPROM option 28: 986
Address EEPROM option 29: 987
Address EEPROM option 30: 988
Address EEPROM option 31: 998
Address EEPROM option 32: 999
Address EEPROM option 33: 1159
Address EEPROM option 34: 1160
Address EEPROM option 35: 1164
Address EEPROM option 36: 1165
Address EEPROM option 37: 1166
Address EEPROM option 38: 1167
Address EEPROM option 39: 1171
Address EEPROM option 40: 1203
Address EEPROM option 41: 1235
Address EEPROM option 42: 1267
Address EEPROM option 43: 1299
Address EEPROM option 44: 1301
Address EEPROM option 45: 1302
Address EEPROM option 46: 1303
Address EEPROM option 47: 1304
Address EEPROM option 48: 1336
Address EEPROM option 49: 1400
Address EEPROM option 50: 1420
Address EEPROM option 51: 1440
Address EEPROM option 52: 1460
Address EEPROM option 53: 1461
Address EEPROM option 54: 1462
Address EEPROM option 55: 1463
Logging output to Telnet
Size of cmdtbl1: 29568
Size of cmdtbl2: 38616
Size of cmdtbl3: 26496
free RAM: 85599
Init One Wire bus...
numSensors: 0
PPS settings:
Starting SD..ok
192.168.0.150
255.255.255.0
192.168.0.254
Waiting 3 seconds to give Ethernet shield time to get ready...
Calculating free space on SD...1907 MB free
Start network services
Device family: 123
Device variant: 231

Setup complete

Here is config.h

typedef enum{
// Version 0 (header + PPS values + space for MAX! devices)
  CF_USEEEPROM, //Size: 1 byte. 0x96 - read config from EEPROM. Other values - read predefined values from BSB_lan_config
  CF_VERSION, //Size: 1 byte. Config version Values: 0-254
  CF_CRC32, //Size: 4 byte. CRC32 for list of parameters addressess
  CF_MAX_DEVICES, //Size 11 * 20 bytes.
  CF_MAX_DEVADDR, //Size 4 * 20 bytes.
  CF_PPS_VALUES, //
// Version 1 (parameters which can be changed by URL commands)
  CF_BUSTYPE, //Size: 1 byte. Bus type at start (DROPDOWN selector)
  CF_OWN_BSBADDR, ///Size: 1 byte. BSB bus device address (0x42). Not used. Leaved for compatibility
  CF_OWN_BSBLPBADDR, ///Size: 1 byte. LPB/BSB bus device address (0x42)
  CF_DEST_BSBLPBADDR, ///Size: 1 byte. LPB/BSB bus destination address (0x0)
  CF_PPS_MODE, ///Size: 1 byte. PPS can write
  CF_LOGTELEGRAM, //Size: 1 byte. Bitwise: LOGTELEGRAM_OFF = 0, LOGTELEGRAM_ON = 1, LOGTELEGRAM_UNKNOWN_ONLY = 2, LOGTELEGRAM_BROADCAST_ONLY = 4, LOGTELEGRAM_UNKNOWNBROADCAST_ONLY = 6
  CF_LOGAVERAGES, //Size: 1 byte. Log average values. 0 - disabled, 1 - enabled. Program list will be set in CF_AVERAGESLIST
  CF_AVERAGESLIST, //Size 2 * 40 bytes. Array of prognrs 1-65535. prognr 0 will be ignored
  CF_LOGCURRVALUES, //Size: 1 byte. Log current values. 0 - disabled, 1 - enabled. Program list will be set in CF_CURRVALUESLIST
  CF_LOGCURRINTERVAL, //Size 4 bytes. Unsigned. logging current values interval in seconds
  CF_CURRVALUESLIST, //Size 2 * 40 bytes. Array of prognrs 1-65535. prognr 0 will be ignored
// Version 2 (Web-config)
  CF_MAC, //Size: 6 bytes. MAC address
  CF_DHCP, //Size: 1 byte. DHCP: 0 - disabled, 1 - enabled
  CF_IPADDRESS, //Size: 4 bytes. IP v4 address
  CF_MASK, //Size: 4 bytes. Network mask
  CF_GATEWAY, //Size: 4 bytes. Gateway
  CF_DNS, //Size: 4 bytes. DNS server address
  CF_WWWPORT, //Size: 2 bytes. Port number, 1-65535
  CF_TRUSTEDIPADDRESS,//Size: 4 bytes. First trusted IP v4 address. 0 - disabled
  CF_TRUSTEDIPADDRESS2,//Size: 4 bytes. Second trusted IP v4 address. 0 - disabled
  CF_PASSKEY, //Size 64 bytes. String with PASSKEY
  CF_BASICAUTH, //Size 64 bytes. String with USER_PASS_B64
  CF_WEBSERVER, //Size: 1 byte. External (read files from SD card) webserver: 0 - disabled, 1 - enabled
  CF_ONEWIREBUS, //Size: 1 byte. One wire bus pin. 0 will be ignored
  CF_DHTBUS, //Size: 10 bytes (sizeof(DHT_Pins)). DHT temperature/humidity bus pins. 0 will be ignored
  CF_IPWE, //Size: 1 byte. IPWE extension: 0 - disabled, 1 - enabled
  CF_IPWEVALUESLIST, //Size 2 * 40 bytes. Array of prognrs 1-65535. prognr 0 will be ignored
  CF_MAX, //Size: 1 byte. Enable CUNO/CUNX/modified MAX!Cube
  CF_MAX_IPADDRESS, //Size: 4 bytes. IP v4 address of CUNO/CUNX/modified MAX!Cube.
  CF_WRITEMODE, //Size: 1 byte. 0 - all parameters will be FL_RONLY, 1 - write ordinary programs, 2 - write OEM programs
  CF_DEBUG, //Size: 1 byte. Debug: 0 - disabled, 1 - debug to serial interface, 2 - debug to telnet
  CF_MQTT, //Size: 1 byte. MQTT: 0 - disabled, 1 - enabled, plain text, 2 - enabled, JSON
  CF_MQTT_IPADDRESS, //Size: 4 bytes. MQTT broker IP v4 address
  CF_MQTT_USERNAME, //Size: 32 bytes.
  CF_MQTT_PASSWORD, //Size: 32 bytes.
  CF_MQTT_TOPIC, //Size: 32 bytes.
  CF_MQTT_DEVICE, //Size: 32 bytes.
  CF_ROOM_DEVICE, //Size: 2 bytes. 0x53 = QAA70, 0x52 = QAA50
//Version 3 (Web-config, some forgotten options)
  CF_MONITOR, //Size: 1 byte. bus monitor mode
  CF_VERBOSE, //Size: 1 byte. If set to 1, all messages on the bus are printed to debug interface
  CF_CHECKUPDATE, //Size: 1 byte. If set to 1, check for new version
// Version 4 (WiFi options)
  CF_WIFI_SSID, //Size: 32 byte by standart.
  CF_WIFI_PASSWORD, //Size 64 bytes.
// Version 5 (Room Units 1-3 Emulation)
  CF_RGT1_SENSOR_ID, //Size 2*5 bytes. Programs ID to temperature sensor access
  CF_RGT2_SENSOR_ID, //Size 2*5 bytes. Programs ID to temperature sensor access
  CF_RGT3_SENSOR_ID, //Size 2*5 bytes. Programs ID to temperature sensor access
  CF_TWW_PUSH_PIN_ID, //Size 1 byte. Pin number for "TWW push" button connection. 0 will be ignored
  CF_RGT1_PRES_PIN_ID, //Size 1 byte. Pin number for "Presence" button connection. 0 will be ignored
  CF_RGT2_PRES_PIN_ID, //Size 1 byte. Pin number for "Presence" button connection. 0 will be ignored
  CF_RGT3_PRES_PIN_ID, //Size 1 byte. Pin number for "Presence" button connection. 0 will be ignored

//Maximim version can be 254 (0xFE). In other case initConfigTable() will locked in infinite loop
//Maximum options count can be 253 for same reason (or must changing uint8_t type to uint16_t)
  CF_LAST_OPTION //Virtual option. Must be last in enum. Only for internal usage.
} cf_params;

//according to input_type in configuration_struct
typedef enum {
  CPI_NOTHING,
  CPI_TEXT, // general text field
  CPI_SWITCH,
  CPI_DROPDOWN
} cpi_params;

//according to var_type in configuration_struct
typedef enum {
  CDT_VOID, // byte array
  CDT_BYTE, // unsigned byte. can be various format
  CDT_UINT16, //CPI_TEXT field with format for unsigned integer
  CDT_UINT32, //CPI_TEXT field with format for unsigned long integer
  CDT_STRING, //CPI_TEXT field
  CDT_MAC, //CPI_TEXT field with format for MAC input/output
  CDT_IPV4, //CPI_TEXT field with format for IPv4 input/output
  CDT_PROGNRLIST, //CPI_TEXT field with format for programs list input/output
  CDT_MAXDEVICELIST,//CPI_TEXT field with format for MAX! devices list input/output
  CDT_DHTBUS //CPI_TEXT field with format for DHT bus
} cdt_params;

//according to category in configuration_struct
typedef enum {
  CCAT_GENERAL,
  CCAT_IPV4,
  CCAT_MQTT,
  CCAT_BUS,
  CCAT_IPWE,
  CCAT_DHTBUS,
  CCAT_ONEWIREBUS,
  CCAT_DEBUG,
  CCAT_MAX,
  CCAT_LOGGING,
  CCAT_24HAVG,
  CCAT_RGT_EMUL
} ccat_params;

typedef struct {
    uint8_t id;     // a unique identifier that can be used for the input tag name (cf_params)
  uint8_t version; //config version which can manage this parameter
  uint8_t category; // for grouping configuration options (cdt_params)
  uint8_t input_type;   // input type (text, dropdown etc.) 0 - none 1 - text field, 2 - switch, 3 - dropdown
    uint8_t var_type;   // variable type (string, integer, float, boolean etc.), could maybe be derived from input_type or vice versa
    const char* desc;   // pointer to text to be displayed for option - is text length necessary if we just read until NULL?
  uint16_t size; //data length in EEPROM
} configuration_struct;

typedef struct {
    uint8_t id;     // a unique identifier of param Category
  const char* desc; // pointer to text to be displayed for category of option - is text length necessary if we just read until NULL?
} category_list_struct;

PROGMEM_LATE const category_list_struct catalist[]={
  {CCAT_GENERAL,        CAT_GENERAL_TXT},
  {CCAT_IPV4,           CAT_IPV4_TXT},
  {CCAT_MQTT,           CAT_MQTT_TXT},
  {CCAT_BUS,            CAT_BUS_TXT},
  {CCAT_IPWE,           CAT_IPWE_TXT},
  {CCAT_DHTBUS,         CAT_DHTBUS_TXT},
  {CCAT_ONEWIREBUS,     CAT_ONEWIREBUS_TXT},
  {CCAT_DEBUG,          CAT_DEBUG_TXT},
  {CCAT_MAX,            CAT_MAX_TXT},
  {CCAT_LOGGING,        CAT_LOGGING_TXT},
  {CCAT_24HAVG,         CAT_24HAVG_TXT},
  {CCAT_RGT_EMUL,       CAT_RGT_EMUL_TXT}
};

PROGMEM_LATE const configuration_struct config[]={
  {CF_USEEEPROM,        0, CCAT_GENERAL,  CPI_SWITCH,    CDT_BYTE,           CF_USEEEPROM_TXT, sizeof(UseEEPROM)}, //immediately apply
  {CF_VERSION,          0, CCAT_GENERAL,  CPI_NOTHING,   CDT_VOID,           NULL, sizeof(byte)},
  {CF_CRC32,            0, CCAT_GENERAL,  CPI_NOTHING,   CDT_VOID,           NULL, sizeof(uint32_t)},
#ifdef CONFIG_IN_EEPROM
#ifdef WEBCONFIG
  {CF_WRITEMODE,        2, CCAT_GENERAL,  CPI_DROPDOWN,  CDT_BYTE,           CF_WRITEMODE_TXT, sizeof(programWriteMode)},
  {CF_CHECKUPDATE,      3, CCAT_GENERAL,  CPI_SWITCH,    CDT_BYTE,           CF_CHECKUPDATE_TXT, sizeof(enable_version_check)}, //immediately apply
#endif
  {CF_BUSTYPE,          1, CCAT_BUS,      CPI_DROPDOWN,  CDT_BYTE,           CF_BUSTYPE_TXT, sizeof(bus_type)},//need handler
  {CF_OWN_BSBADDR,      1, CCAT_BUS,      CPI_NOTHING,   CDT_BYTE,           NULL, sizeof(byte)},//Not used. Leaved for compatibility
  {CF_OWN_BSBLPBADDR,   1, CCAT_BUS,      CPI_TEXT,      CDT_BYTE,           CF_OWN_BSBLPBADDR_TXT, sizeof(own_address)},//need handler
  {CF_DEST_BSBLPBADDR,  1, CCAT_BUS,      CPI_TEXT,      CDT_BYTE,           CF_DEST_BSBLPBADDR_TXT, sizeof(dest_address)},//need handler
  {CF_PPS_MODE,         1, CCAT_BUS,      CPI_DROPDOWN,  CDT_BYTE,           CF_PPS_WRITE_TXT, sizeof(pps_write)},//need handler
  {CF_ROOM_DEVICE,      2, CCAT_BUS,      CPI_DROPDOWN,  CDT_UINT16,         CF_QAA_TYPE_TXT, sizeof(pps_values[PPS_QTP])},//immediately apply
#ifdef WEBCONFIG
  {CF_PASSKEY,          2, CCAT_IPV4,     CPI_TEXT,      CDT_STRING,         CF_PASSKEY_TXT, sizeof(PASSKEY)},//immediately apply
  {CF_BASICAUTH,        2, CCAT_IPV4,     CPI_TEXT,      CDT_STRING,         CF_BASICAUTH_TXT, sizeof(USER_PASS)},//immediately apply
  {CF_DHCP,             2, CCAT_IPV4,     CPI_SWITCH,    CDT_BYTE,           CF_DHCP_TXT, sizeof(useDHCP)}, //need reboot
  {CF_IPADDRESS,        2, CCAT_IPV4,     CPI_TEXT,      CDT_IPV4,           CF_IPADDRESS_TXT, sizeof(ip_addr)}, //need reboot
  {CF_MASK,             2, CCAT_IPV4,     CPI_TEXT,      CDT_IPV4,           CF_MASK_TXT, sizeof(subnet_addr)}, //need reboot
  {CF_GATEWAY,          2, CCAT_IPV4,     CPI_TEXT,      CDT_IPV4,           CF_GATEWAY_TXT, sizeof(gateway_addr)}, //need reboot
  {CF_DNS,              2, CCAT_IPV4,     CPI_TEXT,      CDT_IPV4,           CF_DNS_TXT, sizeof(dns_addr)}, //need reboot
  {CF_WWWPORT,          2, CCAT_IPV4,     CPI_TEXT,      CDT_UINT16,         CF_WWWPORT_TXT, sizeof(HTTPPort)}, //need reboot - can't destroy EthernetServer object
  {CF_MAC,              2, CCAT_IPV4,     CPI_TEXT,      CDT_MAC,            CF_MAC_TXT, sizeof(mac)}, //need reboot
  {CF_TRUSTEDIPADDRESS, 2, CCAT_IPV4,     CPI_TEXT,      CDT_IPV4,           CF_TRUSTEDIPADDRESS_TXT, sizeof(trusted_ip_addr)}, //immediately apply
  {CF_TRUSTEDIPADDRESS2,2, CCAT_IPV4,     CPI_TEXT,      CDT_IPV4,           CF_TRUSTEDIPADDRESS_TXT, sizeof(trusted_ip_addr2)},//immediately apply
  {CF_WIFI_SSID,        4, CCAT_IPV4,     CPI_TEXT,      CDT_STRING,         CF_WIFI_SSID_TXT, sizeof(wifi_ssid)}, //need reboot
  {CF_WIFI_PASSWORD,    4, CCAT_IPV4,     CPI_TEXT,      CDT_STRING,         CF_WIFI_PASSWORD_TXT, sizeof(wifi_pass)},//need reboot
  {CF_MQTT,             2, CCAT_MQTT,     CPI_DROPDOWN,  CDT_BYTE,           CF_USE_TXT, sizeof(mqtt_mode)},//need handler
  {CF_MQTT_IPADDRESS,   2, CCAT_MQTT,     CPI_TEXT,      CDT_IPV4,           CF_MQTT_IPADDRESS_TXT, sizeof(mqtt_broker_ip_addr)},//need handler
  {CF_MQTT_USERNAME,    2, CCAT_MQTT,     CPI_TEXT,      CDT_STRING,         CF_MQTT_USERNAME_TXT, sizeof(MQTTUsername)},//immediately apply
  {CF_MQTT_PASSWORD,    2, CCAT_MQTT,     CPI_TEXT,      CDT_STRING,         CF_MQTT_PASSWORD_TXT, sizeof(MQTTPassword)},//immediately apply
  {CF_MQTT_DEVICE,      2, CCAT_MQTT,     CPI_TEXT,      CDT_STRING,         CF_MQTT_DEVICE_TXT, sizeof(MQTTDeviceID)}, //immediately apply
  {CF_MQTT_TOPIC,       2, CCAT_MQTT,     CPI_TEXT,      CDT_STRING,         CF_MQTT_TOPIC_TXT, sizeof(MQTTTopicPrefix)},//immediately apply
#endif
  {CF_LOGAVERAGES,      1, CCAT_24HAVG,   CPI_SWITCH,    CDT_BYTE,           CF_LOGAVERAGES_TXT, sizeof(logAverageValues)},//immediately apply
  {CF_AVERAGESLIST,     1, CCAT_24HAVG,   CPI_TEXT,      CDT_PROGNRLIST,     CF_PROGLIST_TXT, sizeof(avg_parameters)},//immediately apply
  {CF_LOGTELEGRAM,      1, CCAT_LOGGING,  CPI_DROPDOWN,  CDT_BYTE,           CF_LOGTELEGRAM_TXT, sizeof(logTelegram)},//immediately apply
  {CF_LOGCURRVALUES,    1, CCAT_LOGGING,  CPI_SWITCH,    CDT_BYTE,           CF_LOGCURRVALUES_TXT, sizeof(logCurrentValues)},//immediately apply
  {CF_LOGCURRINTERVAL,  1, CCAT_LOGGING,  CPI_TEXT,      CDT_UINT32,         CF_LOGCURRINTERVAL_TXT, sizeof(log_interval)},//immediately apply
  {CF_CURRVALUESLIST,   1, CCAT_LOGGING,  CPI_TEXT,      CDT_PROGNRLIST,     CF_PROGLIST_TXT, sizeof(log_parameters)},//immediately apply
#ifdef WEBCONFIG
  {CF_WEBSERVER,        2, CCAT_GENERAL,  CPI_SWITCH,    CDT_BYTE,           CF_WEBSERVER_TXT, 1},
  {CF_ONEWIREBUS,       2, CCAT_ONEWIREBUS,CPI_TEXT,     CDT_BYTE,           CF_PINS_TXT, sizeof(One_Wire_Pin)}, //need reboot.
//bus and pins: DHT_Pins
  {CF_DHTBUS,           2, CCAT_DHTBUS,   CPI_TEXT,      CDT_DHTBUS,         CF_PINS_TXT, sizeof(DHT_Pins)}, //immediately apply
  {CF_TWW_PUSH_PIN_ID,  5, CCAT_RGT_EMUL, CPI_TEXT,      CDT_BYTE,           CF_TWW_PUSH_PIN_TXT, sizeof(button_on_pin[0])},//need reboot
  {CF_RGT1_SENSOR_ID,   5, CCAT_RGT_EMUL, CPI_TEXT,      CDT_PROGNRLIST,     CF_RGT1_SENSOR_TXT, sizeof(rgte_sensorid)/3},//immediately apply
  {CF_RGT1_PRES_PIN_ID, 5, CCAT_RGT_EMUL, CPI_TEXT,      CDT_BYTE,           CF_RGT1_PRES_PIN_TXT, sizeof(button_on_pin[0])},//need reboot
  {CF_RGT2_SENSOR_ID,   5, CCAT_RGT_EMUL, CPI_TEXT,      CDT_PROGNRLIST,     CF_RGT2_SENSOR_TXT, sizeof(rgte_sensorid)/3},//immediately apply
  {CF_RGT2_PRES_PIN_ID, 5, CCAT_RGT_EMUL, CPI_TEXT,      CDT_BYTE,           CF_RGT2_PRES_PIN_TXT, sizeof(button_on_pin[0])},//need reboot
  {CF_RGT3_SENSOR_ID,   5, CCAT_RGT_EMUL, CPI_TEXT,      CDT_PROGNRLIST,     CF_RGT3_SENSOR_TXT, sizeof(rgte_sensorid)/3},//immediately apply
  {CF_RGT3_PRES_PIN_ID, 5, CCAT_RGT_EMUL, CPI_TEXT,      CDT_BYTE,           CF_RGT3_PRES_PIN_TXT, sizeof(button_on_pin[0])},//need reboot
  {CF_MAX,              2, CCAT_MAX,      CPI_SWITCH,    CDT_BYTE,           CF_USE_TXT, sizeof(enable_max_cul)},//immediately apply
  {CF_MAX_IPADDRESS,    2, CCAT_MAX,      CPI_TEXT,      CDT_IPV4,           CF_MAX_IPADDRESS_TXT, sizeof(max_cul_ip_addr)}, //need reboot. Can use handler to reconfigure in future
#endif
#endif
  {CF_MAX_DEVICES,      0, CCAT_MAX,      CPI_TEXT,      CDT_MAXDEVICELIST,  CF_DEVICES_TXT, sizeof(max_device_list)}, //Need to call UpdateMaxDeviceList() before saving to EEPROM
  {CF_MAX_DEVADDR,      0, CCAT_MAX,      CPI_NOTHING,   CDT_VOID,           NULL, MAX_CUL_DEVICES * sizeof(uint32_t)},
  {CF_PPS_VALUES,       0, CCAT_GENERAL,  CPI_NOTHING,   CDT_VOID,           NULL, sizeof(pps_values)}, //printlnToDebug(PSTR("Reading EEPROM..."));  for (int i=PPS_TWS;i<=PPS_BRS;i++){ ...}
#ifdef CONFIG_IN_EEPROM
#ifdef WEBCONFIG
  {CF_IPWE,             2, CCAT_IPWE,     CPI_SWITCH,    CDT_BYTE,           CF_USE_TXT, sizeof(enable_ipwe)},//immediately apply
  {CF_IPWEVALUESLIST,   2, CCAT_IPWE,     CPI_TEXT,      CDT_PROGNRLIST,     CF_PROGLIST_TXT, sizeof(ipwe_parameters)},//immediately apply
  {CF_DEBUG,            2, CCAT_DEBUG,    CPI_DROPDOWN,  CDT_BYTE,           CF_USE_TXT, sizeof(debug_mode)},
  {CF_VERBOSE,          3, CCAT_DEBUG,    CPI_SWITCH,    CDT_BYTE,           CF_VERBOSE_TXT, sizeof(verbose)},
  {CF_MONITOR,          3, CCAT_DEBUG,    CPI_SWITCH,    CDT_BYTE,           CF_MONITOR_TXT, sizeof(monitor)}
#endif
#endif
};

typedef struct{
  uint16_t eeprom_address;//start address in EEPROM
  byte *option_address; //pointer to parameter variable
} addressesOfConfigOptions;
addressesOfConfigOptions options[CF_LAST_OPTION];

obrazek obrazek obrazek obrazek

Thank you

fredlcore commented 3 years ago

So is logging to SD card working now or not? Try /D instead of /DG to see the raw data. What does the file look like? Also, you were sending the BSB_LAN_EEPROMconfig.h, what I meant was the BSB_LAN_config.h

proasnet commented 3 years ago

Not working. I tried both commands /D and /DG but without solve problem. I tried more cards, not solved. Here is config.h

/************************************************************************************/
/************************************************************************************/
/* Settings -   BEGIN                                                               */
/************************************************************************************/
/************************************************************************************/

// Upon first installation, rename this file from BSB_lan_config.h.default to BSB_lan_config.h and adjust settings accordingly
// Users who still use Arduino Mega2560 boards instead of Arduin Due: Please have a look at the very end of this configuration
// where certain modules are disabled by default due to limited flash memory.

/* Select language; so far German is the most complete, with English following.
 * Available languages are: Czech (CS), German (DE), Danish (DA), English (EN), Spanish (ES), Finnish (FI),
 * French (FR), Greek (EL), Hungarian (HU), Italian (IT), Dutch (NL), Polish (PL), Russian (RU), Swedish (SV),
 * Slovenian (SI) and Turkish (TR).
 * Incomplete languages will automatically be filled up with English translations first, and if no English translation
 * is available, fallback will take place to German.
*/
#define LANG EN

/*
Allow to initialize program configuration by reading settings from EEPROM
byte UseEEPROM = 0; // Configuration is read from this config file.
                    // Configuration can be stored in EEPROM but will not used while UseEEPROM is zero.
                    // Set zero for fallback startup in case EEPROM configuration is broken.
byte UseEEPROM = 1; // Configuration will be read from EEPROM. This is the default.
*/
byte UseEEPROM = 1;

/*
 *  Enter a MAC address, found either on the EthernetShield or use the one below.
 *  Change this if you have more than one BSB-LAN adapter in your LAN, so that there aren't any address conflicts.
 *  MAC address here only affects the LAN shield, it doesn't apply to the WiFi-ESP-solution.
*/
byte mac[6] = { 0x00, 0x80, 0x41, 0x19, 0x69, 0x90 };

/*
 * Initialize the Ethernet server library
 * with the IP address and port you want to use
 * (port 80 is default for HTTP):
*/

uint16_t HTTPPort = 80;
bool useDHCP = true;                 // Set to false if you want to use a fixed IP.
byte ip_addr[4] = {192,168,178,88};     // Please note the commas instead of dots!!!  Set useDHCP to true if you want DHCP.
byte gateway_addr[4] = {192,168,178,1}; // Gateway address. This is usually your router's IP address. Please note the commas instead of dots!!! Ignored if first value is 0.
byte dns_addr[4] = {192,168,178,1};     // DNS server. Please note the commas instead of dots!!! Ignored if first value is 0.
byte subnet_addr[4] = {255,255,255,0};  // Subnet address. Please use commas instead of dots!!! Ignored if first value is 0.

//#define WIFI                          // Activate this definement if you want to use WiFi. Note: MAC address can't be set individually.
char wifi_ssid[32] = "YourWiFiNetwork"; // enter your WiFi network name (SSID) here
char wifi_pass[64] = "YourWiFiPassword";// enter your WiFi password here
#define WIFI_SPI_SS_PIN 12              // defines SPI-SS pin for Arduino-ESP8266 connection

#define MDNS_HOSTNAME "BSB-LAN"         // Advertises the hostname in the local network. Disable this if you don't want your device to be found under this name in your network.

#define DEBUG         // Compile with verbose DEBUG module if defined
byte debug_mode = 1;  // Debug mode: 0 - disabled, 1 - send debug messages to serial interface, 2 - send debug messages to telnet client
byte verbose = 1;     // If set to 1, all messages on the bus are printed to debug interface
byte monitor = 0;     // Bus monitor mode. This is only necessary for in-depth debug sessions.
bool show_unknown = true; // true - show all parameters, false - hide unknown parameters from web display (parameters will still be queried and therefore take time!)

/* SECURITY OPTIONS
 * There are several options to control and protect access to your heating system. However, keep
 * in mind, that even activating all three options are no guarantee that a versatile intruder with
 * access to your (W)LAN won't be able to gain access. In any case, no encryption of data streams
 * is provided from the Arduino itself. Use VPN or a SSL proxy if that is a must for you and connect
 * the Arduino wired to the VPN server or SSL proxy. On the other hand, someone with this amount
 * of criminal activity will probably have it easier just to access your heating system face-to-face ;)
*/

/*
 * if PASSKEY length is non-zero, the URL has to contain the defined passkey as first element
 * e.g.
 * char PASSKEY[64] = "1234";
 * http://192.168.178.88/1234/                - to view the main website (don't forget the trailing slash!)
 * http://192.168.178.88/1234/K               - to list all categories
 * http://192.168.178.88/1234/8700/8740/8741  - to list parameters 8700, 8740 and 8741 in one request
*/
char PASSKEY[64] = "";

/* activate IP-address-based access.
You can set any ip address as trusted.
Not used if first byte is 0
*/
byte trusted_ip_addr[4] = {0,0,0,0};
byte trusted_ip_addr2[4] = {0,0,0,0};

/* Activate HTTP-Auth authentication to provide username/password based access. No encryption!
 * Credentials have to be entered in the form 
 * User:Password
 */
//char USER_PASS[64] = "User:Password";
char USER_PASS[64] = "";      // HTTP-Auth will be disabled if USER_PASS string length is zero

// Compile module with one wire bus support.
#define ONE_WIRE_BUS
bool enableOneWireBus = true;  //true - enable oneWire bus, false - disable
byte One_Wire_Pin = 7;         // Define the pin for one wire temperature sensors

// Compile module with DHT temperature/humidity sensors support
#define DHT_BUS
// Define the pins for DHT temperature/humidity sensors (Up to 10)
byte DHT_Pins[10] = {2, 3};

// Compile module with BME280 temperature/humidity/pressure sensors support on I2C bus.
// Up to two sensors with 0x76 and 0x77 addresses.
// Usage: #define BME280 x, where x - number of BME280 sensors on bus
// #define BME280 1

// Compile module for calculation 24h averages for selected programs
#define AVERAGES
bool logAverageValues = false;  // calculate and save data into averages.txt on SD-card.
// Create 24h averages from these parameters
int avg_parameters[40] = {
  8700,                         // Außentemperatur
  8326                          // Brenner-Modulation
};

/* Compile module for logging on SD-card.
Requires a FAT32-formatted Micro-SD card inserted into the Ethernet-Shield's card slot
Does: log bus telegrams to file
      log selected values to file
      store to SD and load selected 24h averages*/
#define LOGGER

// Log "raw" bus telegrams. Data saved in journal.txt on SD-card.
// Telegrams logged upon boot:
// int logTelegram = LOGTELEGRAM_OFF; // nothing to log,
// int logTelegram = LOGTELEGRAM_ON;  // log all telegrams,
// int logTelegram = LOGTELEGRAM_ON + LOGTELEGRAM_UNKNOWN_ONLY;           // log unknown telegrams,
// int logTelegram = LOGTELEGRAM_ON + LOGTELEGRAM_BROADCAST_ONLY;         // log broadcast telegrams,
// int logTelegram = LOGTELEGRAM_ON + LOGTELEGRAM_UNKNOWNBROADCAST_ONLY;  // log unknown broadcast telegrams only;
int logTelegram = LOGTELEGRAM_OFF;

// Logging data from parameters
// Interval and list of parameters can be redefined through /L command during runtime
// Data will be written to "datalog.txt"
bool logCurrentValues = false;      // Save data in datalog.txt on SD-card.
unsigned long log_interval = 3600;  // Logging interval (to SD card and MQTT broker) in seconds
int log_parameters[40] = {
  8700, 
  8740,                 
  8326,                   
  8314,                   
  710,                  // Spezialparameter: Brenner-Laufzeit Stufe 1(/B)
  8310,                  // Spezialparameter: Brenner-Takte Stufe 1 (/B)
  9005,                  // Spezialparameter: Brenner-Laufzeit Stufe 2(/B)
  700,
//  20000,                  // Spezialparameter: Brenner-Laufzeit Stufe 1
//  20001,                  // Spezialparameter: Brenner-Takte Stufe 1
//  20002,                  // Spezialparameter: Brenner-Laufzeit Stufe 2
//  20003,                  // Spezialparameter: Brenner-Takte Stufe 2
//  20004,                  // Spezialparameter: TWW-Laufzeit
//  20005,                  // Spezialparameter: TWW-Takte
//  20050,                  // Spezialparameter 20050-20099: 24h-Durchschnittswerte
//  20100,                  // Spezialparameter 20100-20299: DHT22-Sensoren 1-50
//  20300                   // Spezialparameter 20300-20499: DS18B20-Sensoren 1-100
//  20500                   // Spezialparameter 20500-20699: MAX!-Sensoren 1-50
};

// Compile MQTT extension: activate sending log_parameters to MQTT broker every log_interval seconds
#define MQTT
byte mqtt_mode = 0; // MQTT: 0 - disabled, 1 - send messages in plain text format, 2 - send messages in JSON format, 3 - send messages in rich JSON format. Use this if you want a json package of your logging information printed to the mqtt topic
// JSON payload will be of the structure: {"MQTTDeviceID": {"status":{"log_param1":"value1"}}}
// rich JSON payload will be of the structure: {"MQTTDeviceID": {"id": "parmeter number from log values", "name": "parameter name from logvalues", "value": "query result", "desc": "enum value description", "unit": "unit of measurement", "error", error code}}
byte mqtt_broker_ip_addr[4] = {192,168,178,20}; // MQTT broker ip address. Please use commas instead of dots!!!
char MQTTUsername[32] = "User";                 // Set username for MQTT broker here or set empty string if no username/password is used.
char MQTTPassword[32] = "Pass";                 // Set password for MQTT broker here or set empty string if no password is used.
char MQTTTopicPrefix[32] = "BSB-LAN";           // Optional: Choose the "topic" for MQTT messages here. In case of empty string, default topic name will be used
char MQTTDeviceID[32] = "MyHeater";         // Optional: Define a device name to use as header in json payload. In case of empty string, "BSB-LAN" will be used.

// Compile IPWE extension
#define IPWE
bool enable_ipwe = false;  // true - activate IPWE extension (http://xxx.xxx.xxx.xxx/ipwe.cgi)
// Parameters to be displayed in IPWE extension
int ipwe_parameters[40] = {
  8700,                   // Außentemperatur
  8743,                   // Vorlauftemperatur
  8314,                   // Rücklauftemperatur
//  8750,                   // Gebläsedrehzahl
//  8830,                   // Warmwassertemperatur
//  8740,                   // Raumtemperatur Ist
//  8741,                   // Raumtemperatur Soll
//  8326,                   // Brenner-Modulation
//  8337,                   // Startzähler Brenner
//  8703,                   // Aussentemperatur gedämpft
//  8704                    // Aussentemperatur gemischt
};

// Compile CUNO/CUNX/modified MAX!Cube extension.
#define MAX_CUL
bool enable_max_cul = false;                // enable or disable connection to CUNO/CUNX/modified MAX!Cube;
byte max_cul_ip_addr[4] = {192,168,178,5};     // IP of CUNO/CUNX/modified MAX!Cube. Please use commas instead of dots!!!
char max_device_list[20][11] = {               // list of MAX! wall/heating thermostats that should be polled
  "KEQ0502326",                                // use MAX! serial numbers here which have to have exactly 10 characters
  "KEQ0505080"
};

// defines the number of retries for the query command
#define QUERY_RETRIES  3

// Setting bus pins and bus type

byte bus_pins[2] = {0,0}; //First value - RX pin, second value - TX pin. 0,0 - auto select (19,18 for Due and 68,69 for Mega).
uint8_t bus_type = 0;  // set bus system at boot: 0 = BSB, 1 = LPB, 2 = PPS
// BSB:
// - 'own_address' sets own address, defaults to 0x42 (LAN in serial monitor)
// - 'dest_address' sets destination address, defaults to 0 for heating system.
// LPB:
// - 'own_address and 'dest_address' set own and destination address (high nibble = segment, low nibble = device minus 1)
// - defaults to 0x42 for own address and 0x00 for destination address, i.e. segment 4, device 3 for Arduino/BSB-LAN and segment 0, device 1 for heating system
byte own_address = 0x42;
byte dest_address = 0x00;
// PPS:
// - set 'pps_write' to "1" to enable writing to heater - only use this if there is no other room controller (such as QAA50/QAA70) active.
bool pps_write = 0;
byte QAA_TYPE = 0x53;  // 0x53 = QAA70, 0x52 = QAA50

#if defined(__AVR__) // Mega2560
// Protect these pins from accidental GPIO access
// Bit-coded list of protected GPIO pins. 0 - pin unprotected, 1 - pin protected
//              pins list:   7  --  0,  15 --  8,  23 -- 16,  31 -- 24,  39 -- 32,  47 -- 40,  55 -- 48,  63 -- 56,  71 -- 64,  79 -- 72,
byte protected_GPIO[10] = {0b00000000,0b00111100,0b00000000,0b00000000,0b00000000,0b00000000,0b00111100,0b11000000,0b00111111,0b00000000};
#elif defined(__arm__)  // Due
// Protect these pins from accidental GPIO access
// Bit-coded list of protected GPIO pins. 0 - pin unprotected, 1 - pin protected
//              pins list:   7  --  0,  15 --  8,  23 -- 16,  31 -- 24,  39 -- 32,  47 -- 40,  55 -- 48,  63 -- 56,  71 -- 64,  79 -- 72,
byte protected_GPIO[10] = {0b00001011,0b00111100,0b11111100,0b00000000,0b00000000,0b00000000,0b00111100,0b11000000,0b00111111,0b00000000};
#elif defined(ESP32)
byte protected_GPIO[10] = {0b00110100,0b11110000,0b11101100,0b00001110,0b10011111,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000};
#else
#error "Protected pins not defined for this platform"
#endif

/* Set the device family and device variant of your heating system. Only change this if you _really_ know what you are doing!
 * Set fixed_device_family and fixed_device_variant to your device family and variant (parameters 6225 and 6226) here
 * if heating system is not running when Arduino is powered on.
*/
static const int fixed_device_family = 123;
static const int fixed_device_variant = 231;

// defines default flag for parameters
// use "#define DEFAULT_FLAG FL_SW_CTL_RONLY" to control read/write functionality via configuration in web interface.
// use "#define DEFAULT_FLAG 0" to make (almost) all parameters writeable
// use #define DEFAULT_FLAG FL_RONLY to run the program always in read-only mode.
#define DEFAULT_FLAG 0
// include commands from BSB_lan_custom.h to be executed at the end of each main loop
//#define CUSTOM_COMMANDS

/*
 * Check for new versions when accessing BSB-LAN's main page.
 * Doing so will poll the most recent version number from the BSB-LAN server.
 * In this process, it is unavoidable that your IP address will be transferred to the server, obviously.
 * We nevertheless mention this here because this constitutes as 'personal data' and this feature is therefore disabled by default.
 * Activating this feature means you are consenting to transmitting your IP address to the BSB-LAN server where it will be stored
 * for up to two weeks in the server's log files to allow for technical as well as abuse analaysis.
 * No other data (such as anything related to your heating system) is transmitted in this process, as you can see in the source code.
*/
#define VERSION_CHECK
bool enable_version_check = false;

// "External" web server. Read files from SD-card. Only static content: html, js, css, jpg, etc.
//#define WEBSERVER

// Configuration will be stored in EEPROM
#define CONFIG_IN_EEPROM

// Compile web-based configuration and EEPROM config store module extension.
#define WEBCONFIG

// Compile JSON-based configuration and EEPROM config store module extension.
#define JSONCONFIG

#define RGT_EMULATOR
int rgte_sensorid[3][5] = {{0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}}; //Temperature sensor program IDs for RGT1 - RGT3. If zero then RGT will not be emulated. If more than one program set per RGT then average will be calculated and used.

//Enable presence buttons and TWW/DHW push on selected pins.
// Pins on Mega can be (Digital) 2, 3, 18, 19, 20, 21
// On Due any Digital pins can be selected excluding 12, 16-21, 31, 33, 53. 
// Make sure you aren't using pins which are already in use for sensors (default: 2, 3, 7) or change them accordingly.
#define BUTTONS
uint8_t button_on_pin[4] = {0, 0, 0, 0}; //Order: TWW push, presence ROOM1, presence ROOM2, presence ROOM3

// Variables for future use:
// Compile room unit replacement extension
#define ROOM_UNIT
byte UdpIP[4] = {0,0,0,0}; // (destination IP address for sending UDP packets to, the room unit replacement of FHEM user @fabulous uses that)
uint16_t UdpDelay = 15;    // (interval in seconds to send UDP packets)

// Compile off-site logger extension
#define OFF_SITE_LOGGER
byte destinationServer[128] = "";   // URL string to periodically send values to an off-site logger
uint16_t destinationPort = 80;      // port number for abovementioned server
uint32_t destinationDelay = 84600;  // interval in seconds to send values

/*
 * For Arduino Mega users:
 *
 * If you use CONFIG_IN_EEPROM and WEBCONFIG modules then
 * you can enable I_DO_NOT_WANT_URL_CONFIG for saving flash memory (~1.2Kb).
 * This will disable configuration through URL commands (/A, /L, /P)
 * #define I_DO_NOT_WANT_URL_CONFIG
 *
 * Enable I_WILL_USE_EXTERNAL_INTERFACE for saving flash memory (~6,8Kb). /DG command will be disabled
 * #define I_WILL_USE_EXTERNAL_INTERFACE
 *
 * Enabling I_DO_NOT_NEED_NATIVE_WEB_INTERFACE will eliminate native web interface and save up to 13 Kb of flash memory.
 * /N[E] and /Q command still work
 * You can use this if you are using third-party software for BSB-LAN management. Do not forget to enable other required modules (JSONCONFIG, MQTT, WEBSERVER).
 * #define I_DO_NOT_NEED_NATIVE_WEB_INTERFACE
 */

// By default, the following modules are disabled for the Arduino Mega2560 due to lack of memory.
// This overwrites any definements above.
// You are of course free to make changes here so that they fit your needs and the Mega's memory constraints.
#if defined(__AVR__)
//#undef CONFIG_IN_EEPROM
//#undef WEBCONFIG
#undef JSONCONFIG
//#undef WEBSERVER
#undef AVERAGES
#undef DEBUG
#undef IPWE
#undef MQTT
#undef MDNS_HOSTNAME
#undef OFF_SITE_LOGGER
#undef ROOM_UNIT
#undef VERSION_CHECK
#undef MAX_CUL
#undef BME280
#endif
/************************************************************************************/
/************************************************************************************/
/* Settings -   END                                                                 */
/************************************************************************************/
/************************************************************************************/
fredlcore commented 3 years ago

Config looks ok. The thing is that your card gets detected (it says 1907 MB free space in your first post), so I don't know what could be wrong as logging works here on my system. Could you try again an older version (1.1 or 0.44) from releases and see if it works there?

1coderookie commented 3 years ago

Looking at the config.h, you have these settings:

and the screenshot of your webconfig shows

My suggestion: Switch off "Read config from EEPROM" in the webconfig, adjust the settings within the config.h to your needs, then flash again so that it reads the settings from the config.h and have a look if it works. Maybe something got tangled up there somewhere.. General note: Check before by querying the parameters, if your system really supports the parameters (e.g. the burner state and stages).

proasnet commented 3 years ago

Okay. In webconfig, I had all parameters ( 8700, 8740, 8326, 8314, 710, 8310, 9005, 700), before some testings. No effect. Then I edit it to 8700 only for test. Then I made screenshot. Today after some works I try your reqiements, about afternoon

fredlcore commented 3 years ago

@1coderookie: The settings in _config.h are overridden if UseEEPROM is set to 1 and Reading from EEPROM in web-config is "on". Both is the case with proasnet, so it should work. But to be sure, it might help to try as you suggest.

1coderookie commented 3 years ago

Yes, I know ;) But maybe he missed clicking on the submit button at one point or something got tangled up somewhere - so I thought I'll make that suggestion, just to make sure that everything gets written correctly in the EEPROM..

dukess commented 3 years ago

@proasnet

..ethernet shield WZ5100... Before this update, I had BSB-LAN on Arduino Mega with the same ethernet shield.

Can this shield be incompatible with Due?

Can you flash current version to Mega and try Logging?

proasnet commented 3 years ago

Hi, today I have a time for experiments. I do, what 1coderookie wrote. I tried reflash due with using config.h, logging to SD card with test interval 360s, nothing data. I tried two cards, FAT32 format, the first 512MB, the second 2GB. Used device is Baxi Luna Platinum with LMS15, with version of BSB lan under v.2 was logging work. Now not... But If I thing, I have a Home Assistant on RPI with InfluxDB, but I am banana and I cant set it for using with BSB lan directly, I see that in config.h is some setting for use external logger.

proasnet commented 3 years ago

Oh, what I see now ! I removed a card from a BSB Lan device, and I instert to a PC reader. On the card is 3 files. In datalog is data from today, but this data I not see in a graph of webUI and not see in Download data

1coderookie commented 3 years ago
dukess commented 3 years ago

In datalog is data from today, but this data I not see in a graph of webUI and not see in Download data

Which errors was shown? (Error 404 or something else?)

fredlcore commented 3 years ago

@proasnet: If you want us to help you, it would be helpful (and polite) if we didn't have to wait days or a week until we get (useful) feedback from you. Please get back to our questions, several of which are not answered yet. Otherwise I'll close this issue because this does not seem to be a problem that other users are facing.

proasnet commented 3 years ago

I am sory for this waiting. In my Job, my boss send me to big industrial automation project and I am only one programmer in our company. No free time. If is possible, after done this we can write about it.

Dne ne 28. 2. 2021 22:38 uživatel fredlcore notifications@github.com napsal:

@proasnet https://github.com/proasnet: If you want us to help you, it would be helpful (and polite) if we didn't have to wait days or a week until we get (useful) feedback from you. Please get back to our questions, several of which are not answered yet. Otherwise I'll close this issue because this does not seem to be a problem that other users are facing.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/fredlcore/BSB-LAN/issues/336#issuecomment-787527639, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASIIEIVJTXRYIQJGYSGWBVTTBKZWVANCNFSM4XV6AOWA .

fredlcore commented 3 years ago

Ok, sure, just wanted to make sure your're still onto this issue...

proasnet commented 3 years ago

Yes I am still. But my bsb lan I have at home and is my private problem, but in a my job I am very bussy this two week. If will be possible I return to. Thank you for understand.

Dne po 1. 3. 2021 10:55 uživatel fredlcore notifications@github.com napsal:

Ok, sure, just wanted to make sure your're still onto this issue...

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/fredlcore/BSB-LAN/issues/336#issuecomment-787818345, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASIIEIUCDDQ7QAF6J6AW5I3TBNP7PANCNFSM4XV6AOWA .

proasnet commented 3 years ago

Hi fredlcore, I am back now. I am sorry for long waiting, now I am at home. Now I removed a card from LAN shield and I am put in a PC. I see three files: averages.txt datalog.txt journal.txt All three files has date of edit 1.1.2000 averages.txt averages.txt datalog.txt Here is code, from /D command and serial monitor:

GET /D HTTP/1.1

Duration: 1
POST /JQ?Parameter=700,710,711,712,714,730,900,8000,8740,8749 HTTP/1.1

LAN->HEIZ QUR  700 Heating circuit 1 - Operating mode: 
DC C2 00 0B 06 3D 2D 05 74 9C 4B 
HEIZ->LAN ANS  700 Heating circuit 1 - Operating mode: 3 - Komfort
DC 80 42 0D 07 2D 3D 05 74 00 03 87 10 
#700: 3 - Komfort
LAN->HEIZ QUR  710 Heating circuit 1 - Room temperature Comfort setpoint: 
DC C2 00 0B 06 3D 2D 05 8E D2 1E 
HEIZ->LAN ANS  710 Heating circuit 1 - Room temperature Comfort setpoint: 22.0 &deg;C
DC 80 42 0E 07 2D 3D 05 8E 00 05 80 10 E3 
#710: 22.0 &deg;C
LAN->HEIZ QUR  711 Heating circuit 1 - Komfortsollwert Maximum: 
DC C2 00 0B 06 3D 2D 05 A5 47 17 
HEIZ->LAN ANS  711 Heating circuit 1 - Komfortsollwert Maximum: 24.0 &deg;C
DC 80 42 0E 07 2D 3D 05 A5 00 06 00 FD 69 
#711: 24.0 &deg;C
LAN->HEIZ QUR  712 Heating circuit 1 - Room temp reduced setpoint: 
DC C2 00 0B 06 3D 2D 05 90 21 E1 
HEIZ->LAN ANS  712 Heating circuit 1 - Room temp reduced setpoint: 18.0 &deg;C
DC 80 42 0E 07 2D 3D 05 90 00 04 80 9A 2F 
#712: 18.0 &deg;C
LAN->HEIZ QUR  714 Heating circuit 1 - Room temp frost protection setpoint: 
DC C2 00 0B 06 3D 2D 05 92 01 A3 
HEIZ->LAN ANS  714 Heating circuit 1 - Room temp frost protection setpoint: 6.0 &deg;C
DC 80 42 0E 07 2D 3D 05 92 00 01 80 88 B2 
#714: 6.0 &deg;C
LAN->HEIZ QUR  730 Heating circuit 1 - Summer/winter changeover temp: 
DC C2 00 0B 06 3D 2D 05 FD 9C EA 
HEIZ->LAN ANS  730 Heating circuit 1 - Summer/winter changeover temp: 18.0 &deg;C
DC 80 42 0E 07 2D 3D 05 FD 00 04 80 FA 7B 
#730: 18.0 &deg;C
LAN->HEIZ QUR  900 Heating circuit 1 - Operating mode: 
DC C2 00 0B 06 3D 05 07 BE AD 48 
HEIZ->LAN ANS  900 Heating circuit 1 - Operating mode: 4 - Automatik
DC 80 42 0D 07 05 3D 07 BE 00 04 C3 E3 
#900: 4 - Automatik
LAN->HEIZ QUR 8000 Status - Status heating circuit 1: 
DC C2 00 0B 06 3D 05 07 A3 6E D4 
HEIZ->LAN ANS 8000 Status - Status heating circuit 1: 114 - Heizbetrieb Komfort
DC 80 42 0D 07 05 3D 07 A3 00 72 DC 80 
#8000: 114 - Heizbetrieb Komfort
LAN->HEIZ QUR 8740 Diagnosis consumer - Room temp 1 actual value: 
DC C2 00 0B 06 3D 2D 05 1E 51 A7 
HEIZ->LAN ANS 8740 Diagnosis consumer - Room temp 1 actual value: 22.2 &deg;C
DC 80 42 0E 07 2D 3D 05 1E 00 05 8E 37 B2 
#8740: 22.2 &deg;C
LAN->HEIZ QUR 8749 Diagnosis consumer - Raumthermostat 1: 
DC C2 00 0B 06 3D 05 0C 7D 98 9D 
HEIZ->LAN ANS 8749 Diagnosis consumer - Raumthermostat 1: 0 - Kein Bedarf
DC 80 42 0D 07 05 3D 0C 7D 00 00 E2 DF 
#8749: 0 - Kein Bedarf

In the browser I have not any blocker. I not see any data on any PC connected to BSB_LAN. After putting a cards to reader, I try /D0 on all cards before testing.

fredlcore commented 3 years ago

Ok, please send the logs from right where the Arduino starts (start the logging and press the reset button). I will say something about starting the SD card and the free space. Also, can you confirm that the data in the SD card files is correct? So if you log every x seconds, you also have entries in datalog.txt every x seconds?

fredlcore commented 3 years ago

Also, can you check that after issuing /D0, the data logs are reset (deleted and created anew)?

proasnet commented 3 years ago

datalog.txt Only in datalog was new logs from now. This is serial monitor from reset and boot:

RGT1->Hin Bedarf
S 8749 Diagnosis consumer - Raumthermostat 1: 0 - Kein Bedarf
DC 80 42 0D 07 05 3D 0C 7D 00 00 E2 DF 
#8749: 0 - Kein Bedarf
READY
Using settings from config file
Reading done.
EEPROM schema v.0 Program schema v.5
Address EEPROM option 0: 0
Address EEPROM option 1: 1
Address EEPROM option 2: 2
Address EEPROM option 3: 6
Address EEPROM option 4: 226
Address EEPROM option 5: 306
Address EEPROM option 6: 490
Address EEPROM option 7: 491
Address EEPROM option 8: 492
Address EEPROM option 9: 493
Address EEPROM option 10: 494
Address EEPROM option 11: 495
Address EEPROM option 12: 499
Address EEPROM option 13: 500
Address EEPROM option 14: 660
Address EEPROM option 15: 661
Address EEPROM option 16: 665
Address EEPROM option 17: 825
Address EEPROM option 18: 831
Address EEPROM option 19: 832
Address EEPROM option 20: 836
Address EEPROM option 21: 840
Address EEPROM option 22: 844
Address EEPROM option 23: 848
Address EEPROM option 24: 850
Address EEPROM option 25: 854
Address EEPROM option 26: 858
Address EEPROM option 27: 922
Address EEPROM option 28: 986
Address EEPROM option 29: 987
Address EEPROM option 30: 988
Address EEPROM option 31: 998
Address EEPROM option 32: 999
Address EEPROM option 33: 1159
Address EEPROM option 34: 1160
Address EEPROM option 35: 1164
Address EEPROM option 36: 1165
Address EEPROM option 37: 1166
Address EEPROM option 38: 1167
Address EEPROM option 39: 1171
Address EEPROM option 40: 1203
Address EEPROM option 41: 1235
Address EEPROM option 42: 1267
Address EEPROM option 43: 1299
Address EEPROM option 44: 1301
Address EEPROM option 45: 1302
Address EEPROM option 46: 1303
Address EEPROM option 47: 1304
Address EEPROM option 48: 1336
Address EEPROM option 49: 1400
Address EEPROM option 50: 1420
Address EEPROM option 51: 1440
Address EEPROM option 52: 1460
Address EEPROM option 53: 1461
Address EEPROM option 54: 1462
Address EEPROM option 55: 1463
Size of cmdtbl1: 29568
Size of cmdtbl2: 38616
Size of cmdtbl3: 26496
free RAM: 85595
Init One Wire bus...
numSensors: 0
PPS settings:
Starting SD..ok
0.0.0.0
0.0.0.0
0.0.0.0
Waiting 3 seconds to give Ethernet shield time to get ready...
Calculating free space on SD...1907 MB free
Start network services
Device family: 123
Device variant: 231

Setup complete
READY
Using settings from config file
Reading done.
EEPROM schema v.0 Program schema v.5
Address EEPROM option 0: 0
Address EEPROM option 1: 1
Address EEPROM option 2: 2
Address EEPROM option 3: 6
Address EEPROM option 4: 226
Address EEPROM option 5: 306
Address EEPROM option 6: 490
Address EEPROM option 7: 491
Address EEPROM option 8: 492
Address EEPROM option 9: 493
Address EEPROM option 10: 494
Address EEPROM option 11: 495
Address EEPROM option 12: 499
Address EEPROM option 13: 500
Address EEPROM option 14: 660
Address EEPROM option 15: 661
Address EEPROM option 16: 665
Address EEPROM option 17: 825
Address EEPROM option 18: 831
Address EEPROM option 19: 832
Address EEPROM option 20: 836
Address EEPROM option 21: 840
Address EEPROM option 22: 844
Address EEPROM option 23: 848
Address EEPROM option 24: 850
Address EEPROM option 25: 854
Address EEPROM option 26: 858
Address EEPROM option 27: 922
Address EEPROM option 28: 986
Address EEPROM option 29: 987
Address EEPROM option 30: 988
Address EEPROM option 31: 998
Address EEPROM option 32: 999
Address EEPROM option 33: 1159
Address EEPROM option 34: 1160
Address EEPROM option 35: 1164
Address EEPROM option 36: 1165
Address EEPROM option 37: 1166
Address EEPROM option 38: 1167
Address EEPROM option 39: 1171
Address EEPROM option 40: 1203
Address EEPROM option 41: 1235
Address EEPROM option 42: 1267
Address EEPROM option 43: 1299
Address EEPROM option 44: 1301
Address EEPROM option 45: 1302
Address EEPROM option 46: 1303
Address EEPROM option 47: 1304
Address EEPROM option 48: 1336
Address EEPROM option 49: 1400
Address EEPROM option 50: 1420
Address EEPROM option 51: 1440
Address EEPROM option 52: 1460
Address EEPROM option 53: 1461
Address EEPROM option 54: 1462
Address EEPROM option 55: 1463
Size of cmdtbl1: 29568
Size of cmdtbl2: 38616
Size of cmdtbl3: 26496
free RAM: 85595
Init One Wire bus...
numSensors: 0
PPS settings:
Starting SD..ok
192.168.0.150
255.255.255.0
192.168.0.254
Waiting 3 seconds to give Ethernet shield time to get ready...
Calculating free space on SD...1907 MB free
Start network services
Device family: 123
Device variant: 231

Setup complete
Connect to MQTT broker, updating will topic
Will topic: BSB-LAN/status
HEIZ->EM1 INF      05040227 00 00 00 00 
DC 80 03 0F 02 05 04 02 27 00 00 00 00 D8 E6 
POST /JQ?Parameter=700,710,711,712,714,730,900,8000,8740,8749 HTTP/1.1

LAN->HEIZ QUR  700 Heating circuit 1 - Operating mode: 
DC C2 00 0B 06 3D 2D 05 74 9C 4B 
HEIZ->LAN ANS  700 Heating circuit 1 - Operating mode: 1 - Automatik
DC 80 42 0D 07 2D 3D 05 74 00 01 A7 52 
#700: 1 - Automatik
LAN->HEIZ QUR  710 Heating circuit 1 - Room temperature Comfort setpoint: 
DC C2 00 0B 06 3D 2D 05 8E D2 1E 
HEIZ->LAN ANS  710 Heating circuit 1 - Room temperature Comfort setpoint: 22.0 &deg;C
DC 80 42 0E 07 2D 3D 05 8E 00 05 80 10 E3 
#710: 22.0 &deg;C
LAN->HEIZ QUR  711 Heating circuit 1 - Komfortsollwert Maximum: 
DC C2 00 0B 06 3D 2D 05 A5 47 17 
HEIZ->LAN ANS  711 Heating circuit 1 - Komfortsollwert Maximum: 24.0 &deg;C
DC 80 42 0E 07 2D 3D 05 A5 00 06 00 FD 69 
#711: 24.0 &deg;C
LAN->HEIZ QUR  712 Heating circuit 1 - Room temp reduced setpoint: 
DC C2 00 0B 06 3D 2D 05 90 21 E1 
HEIZ->LAN ANS  712 Heating circuit 1 - Room temp reduced setpoint: 18.0 &deg;C
DC 80 42 0E 07 2D 3D 05 90 00 04 80 9A 2F 
#712: 18.0 &deg;C
LAN->HEIZ QUR  714 Heating circuit 1 - Room temp frost protection setpoint: 
DC C2 00 0B 06 3D 2D 05 92 01 A3 
HEIZ->LAN ANS  714 Heating circuit 1 - Room temp frost protection setpoint: 6.0 &deg;C
DC 80 42 0E 07 2D 3D 05 92 00 01 80 88 B2 
#714: 6.0 &deg;C
LAN->HEIZ QUR  730 Heating circuit 1 - Summer/winter changeover temp: 
DC C2 00 0B 06 3D 2D 05 FD 9C EA 
HEIZ->LAN ANS  730 Heating circuit 1 - Summer/winter changeover temp: 18.0 &deg;C
DC 80 42 0E 07 2D 3D 05 FD 00 04 80 FA 7B 
#730: 18.0 &deg;C
LAN->HEIZ QUR  900 Heating circuit 1 - Operating mode: 
DC C2 00 0B 06 3D 05 07 BE AD 48 
HEIZ->LAN ANS  900 Heating circuit 1 - Operating mode: 4 - Automatik
DC 80 42 0D 07 05 3D 07 BE 00 04 C3 E3 
#900: 4 - Automatik
LAN->HEIZ QUR 8000 Status - Status heating circuit 1: 
DC C2 00 0B 06 3D 05 07 A3 6E D4 
HEIZ->LAN ANS 8000 Status - Status heating circuit 1: 114 - Heizbetrieb Komfort
DC 80 42 0D 07 05 3D 07 A3 00 72 DC 80 
#8000: 114 - Heizbetrieb Komfort
LAN->HEIZ QUR 8740 Diagnosis consumer - Room temp 1 actual value: 
DC C2 00 0B 06 3D 2D 05 1E 51 A7 
HEIZ->LAN ANS 8740 Diagnosis consumer - Room temp 1 actual value: 22.4 &deg;C
DC 80 42 0E 07 2D 3D 05 1E 00 05 97 B4 AA 
#8740: 22.4 &deg;C
LAN->HEIZ QUR 8749 Diagnosis consumer - Raumthermostat 1: 
DC C2 00 0B 06 3D 05 0C 7D 98 9D 
HEIZ->LAN ANS 8749 Diagnosis consumer - Raumthermostat 1: 0 - Kein Bedarf
DC 80 42 0D 07 05 3D 0C 7D 00 00 E2 DF 
#8749: 0 - Kein Bedarf
HEIZ->EM1 INF      0504024E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
DC 80 03 1B 02 05 04 02 4E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 1B 
fredlcore commented 3 years ago

Ok, so everything looks good so far, the SD card is detected, it says that there is 1.9GB free space left and it seems that the files are created correctly. Can you please check and call /D0 and see (on the PC) if the files are created correctly and post the content of datalog.txt here?

Then, could you please search for the line while (chars_read == logbuflen) { in BSB_LAN.ino (around line 6245) and put above it these lines:

Serial.print("Chars read: ");
Serial.println(chars_read);
Serial.print("logbuflen: ");
Serial.println(logbuflen);
Serial.print("bigBuff: ");
Serial.println(bigBuff);

And then flash it and call /D again and post the output of the serial log here.

proasnet commented 3 years ago

datalog.txt file I attached in my post before your. Now I am going reflash it. Please wait.

proasnet commented 3 years ago

Here is serial output after insert code and reflash, restart:

READY
Using settings from config file
Reading done.
EEPROM schema v.0 Program schema v.5
Address EEPROM option 0: 0
Address EEPROM option 1: 1
Address EEPROM option 2: 2
Address EEPROM option 3: 6
Address EEPROM option 4: 226
Address EEPROM option 5: 306
Address EEPROM option 6: 490
Address EEPROM option 7: 491
Address EEPROM option 8: 492
Address EEPROM option 9: 493
Address EEPROM option 10: 494
Address EEPROM option 11: 495
Address EEPROM option 12: 499
Address EEPROM option 13: 500
Address EEPROM option 14: 660
Address EEPROM option 15: 661
Address EEPROM option 16: 665
Address EEPROM option 17: 825
Address EEPROM option 18: 831
Address EEPROM option 19: 832
Address EEPROM option 20: 836
Address EEPROM option 21: 840
Address EEPROM option 22: 844
Address EEPROM option 23: 848
Address EEPROM option 24: 850
Address EEPROM option 25: 854
Address EEPROM option 26: 858
Address EEPROM option 27: 922
Address EEPROM option 28: 986
Address EEPROM option 29: 987
Address EEPROM option 30: 988
Address EEPROM option 31: 998
Address EEPROM option 32: 999
Address EEPROM option 33: 1159
Address EEPROM option 34: 1160
Address EEPROM option 35: 1164
Address EEPROM option 36: 1165
Address EEPROM option 37: 1166
Address EEPROM option 38: 1167
Address EEPROM option 39: 1171
Address EEPROM option 40: 1203
Address EEPROM option 41: 1235
Address EEPROM option 42: 1267
Address EEPROM option 43: 1299
Address EEPROM option 44: 1301
Address EEPROM option 45: 1302
Address EEPROM option 46: 1303
Address EEPROM option 47: 1304
Address EEPROM option 48: 1336
Address EEPROM option 49: 1400
Address EEPROM option 50: 1420
Address EEPROM option 51: 1440
Address EEPROM option 52: 1460
Address EEPROM option 53: 1461
Address EEPROM option 54: 1462
Address EEPROM option 55: 1463
Size of cmdtbl1: 29568
Size of cmdtbl2: 38616
Size of cmdtbl3: 26496
free RAM: 85595
Init One Wire bus...
numSensors: 0
PPS settings:
Starting SD..ok
192.168.0.150
255.255.255.0
192.168.0.254
Waiting 3 seconds to give Ethernet shield time to get ready...
Calculating free space on SD...1907 MB free
Start network services
Device family: 123
Device variant: 231

Setup complete
Connect to MQTT broker, updating will topic
Will topic: BSB-LAN/status
HEIZ->EM1 INF      05040227 00 00 00 00 
DC 80 03 0F 02 05 04 02 27 00 00 00 00 D8 E6 
HEIZ->ALL  INF 10103 User defined - INFO HK2 - TBD: 00 00 FF FF FF FF FF FF 00 00 
DC 80 7F 15 02 2E 00 02 11 00 00 FF FF FF FF FF FF 00 00 F8 F1 
HEIZ->EM1 INF      0504024E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
DC 80 03 1B 02 05 04 02 4E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 1B 
Connect to MQTT broker, updating will topic
Will topic: BSB-LAN/status
GET /D HTTP/1.1

Chars read: -1
logbuflen: 1024
bigBuff: Milliseconds;Date;Parameter;Description;Value;Unit
361578;26.02.2021 07:10:35;8700;Outside temp sensor local;-1.3;&deg;C
361769;26.02.2021 07:10:35;8740;Room temp 1 actual value;21.7;&deg;C
361962;26.02.2021 07:10:35;8326;Relative output;30;&#037;
362156;26.02.2021 07:10:35;8314;Return temp actual value;49.5;&deg;C
362373;26.02.2021 07:10:36;710;Room temperature Comfort setpoint;22.0;&deg;C
362594;26.02.2021 07:10:36;8310;Boiler temp actual value;58.1;&deg;C
362762;26.02.2021 07:10:36;9005;Wasserdruck H1;1.5;bar
362970;26.02.2021 07:10:36;700;Operating mode;1;
723200;26.02.2021 07:16:36;8700;Outside temp sensor local;-1.3;&deg;C
723389;26.02.2021 07:16:37;8740;Room temp 1 actual value;21.6;&deg;C
723597;26.02.2021 07:16:37;8326;Relative output;35;&#037;
723774;26.02.2021 07:16:37;8314;Return temp actual value;49.2;&deg;C
723965;26.02.2021 07:16:37;710;Room temperature Comfort setpoint;22.0;&deg;C
724182;26.02.2021 07:16:37;8310;Boiler temp actual value;58.4;&deg;C
724398;26.02.2021 07:16:38;900
Duration: 82
RGT1->HEIZ INF      3D2D0215 05 98 00 
DC 86 00 0E 02 3D 2D 02 15 05 98 00 83 5D 
proasnet commented 3 years ago

And then I use /D0 and /D, serial:

READY
Using settings from config file
Reading done.
EEPROM schema v.0 Program schema v.5
Address EEPROM option 0: 0
Address EEPROM option 1: 1
Address EEPROM option 2: 2
Address EEPROM option 3: 6
Address EEPROM option 4: 226
Address EEPROM option 5: 306
Address EEPROM option 6: 490
Address EEPROM option 7: 491
Address EEPROM option 8: 492
Address EEPROM option 9: 493
Address EEPROM option 10: 494
Address EEPROM option 11: 495
Address EEPROM option 12: 499
Address EEPROM option 13: 500
Address EEPROM option 14: 660
Address EEPROM option 15: 661
Address EEPROM option 16: 665
Address EEPROM option 17: 825
Address EEPROM option 18: 831
Address EEPROM option 19: 832
Address EEPROM option 20: 836
Address EEPROM option 21: 840
Address EEPROM option 22: 844
Address EEPROM option 23: 848
Address EEPROM option 24: 850
Address EEPROM option 25: 854
Address EEPROM option 26: 858
Address EEPROM option 27: 922
Address EEPROM option 28: 986
Address EEPROM option 29: 987
Address EEPROM option 30: 988
Address EEPROM option 31: 998
Address EEPROM option 32: 999
Address EEPROM option 33: 1159
Address EEPROM option 34: 1160
Address EEPROM option 35: 1164
Address EEPROM option 36: 1165
Address EEPROM option 37: 1166
Address EEPROM option 38: 1167
Address EEPROM option 39: 1171
Address EEPROM option 40: 1203
Address EEPROM option 41: 1235
Address EEPROM option 42: 1267
Address EEPROM option 43: 1299
Address EEPROM option 44: 1301
Address EEPROM option 45: 1302
Address EEPROM option 46: 1303
Address EEPROM option 47: 1304
Address EEPROM option 48: 1336
Address EEPROM option 49: 1400
Address EEPROM option 50: 1420
Address EEPROM option 51: 1440
Address EEPROM option 52: 1460
Address EEPROM option 53: 1461
Address EEPROM option 54: 1462
Address EEPROM option 55: 1463
Size of cmdtbl1: 29568
Size of cmdtbl2: 38616
Size of cmdtbl3: 26496
free RAM: 85595
Init One Wire bus...
numSensors: 0
PPS settings:
Starting SD..ok
192.168.0.150
255.255.255.0
192.168.0.254
Waiting 3 seconds to give Ethernet shield time to get ready...
Calculating free space on SD...1907 MB free
Start network services
Device family: 123
Device variant: 231

Setup complete
Connect to MQTT broker, updating will topic
Will topic: BSB-LAN/status
HEIZ->EM1 INF      0504024E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
DC 80 03 1B 02 05 04 02 4E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 1B 
Connect to MQTT broker, updating will topic
Will topic: BSB-LAN/status
RGT1->HEIZ INF      3D2D0215 05 89 00 
DC 86 00 0E 02 3D 2D 02 15 05 89 00 B3 1F 
GET /D HTTP/1.1

Chars read: 52
logbuflen: 1024
bigBuff: Milliseconds;Date;Parameter;Description;Value;Unit
tf-8
Cache-Control: max-age=60, public

Duration: 2
HEIZ->ALL  INF      05000219 00 4A 00 0A 5A 7E FF FF FF FF 00 00 
DC 80 7F 17 02 05 00 02 19 00 4A 00 0A 5A 7E FF FF FF FF 00 00 30 D5 
HEIZ->EM1 INF      05040227 00 00 00 00 
DC 80 03 0F 02 05 04 02 27 00 00 00 00 D8 E6 
fredlcore commented 3 years ago

Ok, this looks good: As you can see, bigBuff has the contents of your datalog.txt. Can you have a look at the source of the HTML page when you open /D? Is it empty or what does it look like? If there is any content, please post it here. @dukess: What is strange to me is that the initial dataFile.read(bigBuff, logbuflen) returns -1, but bigBuff still contains the beginning of the logfile. If chars_read is less than 1, then transmitFile won't output the contents of the file to the browser. So that would explain the problem. But after resetting the file with /D0, chars_read is 52, so it should send bigBuff to the browser. Any ideas?

proasnet commented 3 years ago

If I use IP/D, i see an empty page now. I have a log interval 360 and next parameters: 8700,8740,8326,8314,710,8310,9005,700 After end of interval is not any data...

proasnet commented 3 years ago

I have a teamviewer if will be easy. Connected BSB. But login I can send via email. May be?

dukess commented 3 years ago

Chars read: -1 - file not exist? fredlcore notifications@github.com 5 марта 2021 г. 18:41:39 написал:

Ok, this looks good: As you can see, bigBuff has the contents of your datalog.txt. Can you have a look at the source of the HTML page when you open /D? Is it empty or what does it look like? If there is any content, please post it here. @dukess: What is strange to me is that the initial dataFile.read(bigBuff, logbuflen) returns -1, but bigBuff still contains the beginning of the logfile. If chars_read is less than 1, then transmitFile won't output the contents of the file to the browser. So that would explain the problem. But after resetting the file with /D0, chars_read is 52, so it should send bigBuff to the browser. Any ideas? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

fredlcore commented 3 years ago

That's what I thought as well, but if you look at the serial output, "bigBuff" clearly contains the beginning of the datalog.txt file...

fredlcore commented 3 years ago

@proasnet: Could you open a port for both the webinterface and the telnet client and select telnet for debug output? That wold probably be easier. E-Mail is bsb (ät) code-it.de

proasnet commented 3 years ago

If I change in WebUI config from EEPROM, save Then debug from serial to telnet, save a webUI dont work and telnet dont work... Then I must reset it by button on shield and then WebUI working again. Few days ago, I am tried telnet and worked it. I dont know why dont work today. From yesterday is BSB reflashed. So I am sending you adresses, I am still here.

what I remember, a few days ago, I was in config.h reading setting from eeprom, now is from config.h, but I dont know if this is reason...

dukess commented 3 years ago

You need to enable EEPROM using in WebUI too (option on top of list).

dukess commented 3 years ago

@fredlcore

bigBuff: Milliseconds;Date;Parameter;Description;Value;Unit
tf-8
Cache-Control: max-age=60, public

looks like string was copied without zero.

fredlcore commented 3 years ago

Yes, now that you mention it - interesting! Why would this line come without a \0? chars_read seems to include it, however, with 52 counts.

proasnet commented 3 years ago

You need to enable EEPROM using in WebUI too (option on top of list).

I wrote upward, that I have selected in config.h for use config from file, but in the webUI I tried select config from EEPROM, this is working. But, than I select debug from serial to telnet, both crash and only one way is reset by button. After reset by button, option read config from EEPROM is selected back to file and debug to serial. BSB not member settings from eeprom.

fredlcore commented 3 years ago

Ok, that's strange, I just got onto your webinterface and made the changes (before I read about the crash problem), and indeed, now I can't access the webinterface anymore. We need to investigate this crash separately and for that we would need the serial logs right before and after you make these changes that lead to the crash. Can you reset the board remotely or do you have to do it when you are back home?

proasnet commented 3 years ago

I am at home. I can reset now, with serial protocol, wait a moment please

proasnet commented 3 years ago

Reseted with this debug:

READY
Using settings from config file
Reading done.
EEPROM schema v.0 Program schema v.5
Address EEPROM option 0: 0
Address EEPROM option 1: 1
Address EEPROM option 2: 2
Address EEPROM option 3: 6
Address EEPROM option 4: 226
Address EEPROM option 5: 306
Address EEPROM option 6: 490
Address EEPROM option 7: 491
Address EEPROM option 8: 492
Address EEPROM option 9: 493
Address EEPROM option 10: 494
Address EEPROM option 11: 495
Address EEPROM option 12: 499
Address EEPROM option 13: 500
Address EEPROM option 14: 660
Address EEPROM option 15: 661
Address EEPROM option 16: 665
Address EEPROM option 17: 825
Address EEPROM option 18: 831
Address EEPROM option 19: 832
Address EEPROM option 20: 836
Address EEPROM option 21: 840
Address EEPROM option 22: 844
Address EEPROM option 23: 848
Address EEPROM option 24: 850
Address EEPROM option 25: 854
Address EEPROM option 26: 858
Address EEPROM option 27: 922
Address EEPROM option 28: 986
Address EEPROM option 29: 987
Address EEPROM option 30: 988
Address EEPROM option 31: 998
Address EEPROM option 32: 999
Address EEPROM option 33: 1159
Address EEPROM option 34: 1160
Address EEPROM option 35: 1164
Address EEPROM option 36: 1165
Address EEPROM option 37: 1166
Address EEPROM option 38: 1167
Address EEPROM option 39: 1171
Address EEPROM option 40: 1203
Address EEPROM option 41: 1235
Address EEPROM option 42: 1267
Address EEPROM option 43: 1299
Address EEPROM option 44: 1301
Address EEPROM option 45: 1302
Address EEPROM option 46: 1303
Address EEPROM option 47: 1304
Address EEPROM option 48: 1336
Address EEPROM option 49: 1400
Address EEPROM option 50: 1420
Address EEPROM option 51: 1440
Address EEPROM option 52: 1460
Address EEPROM option 53: 1461
Address EEPROM option 54: 1462
Address EEPROM option 55: 1463
Size of cmdtbl1: 29568
Size of cmdtbl2: 38616
Size of cmdtbl3: 26496
free RAM: 85595
Init One Wire bus...
numSensors: 0
PPS settings:
Starting SD..ok
192.168.0.150
255.255.255.0
192.168.0.254
Waiting 3 seconds to give Ethernet shield time to get ready...
Calculating free space on SD...1907 MB free
Start network services
Device family: 123
Device variant: 231

Setup complete
Connect to MQTT broker, updating will topic
Will topic: BSB-LAN/status
HEIZ->EM1 INF      0504024E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
DC 80 03 1B 02 05 04 02 4E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 1B 
POST /JQ?Parameter=700,710,711,712,714,730,900,8000,8740,8749 HTTP/1.1

LAN->HEIZ QUR  700 Heating circuit 1 - Operating mode: 
DC C2 00 0B 06 3D 2D 05 74 9C 4B 
HEIZ->LAN ANS  700 Heating circuit 1 - Operating mode: 1 - Automatik
DC 80 42 0D 07 2D 3D 05 74 00 01 A7 52 
#700: 1 - Automatik
LAN->HEIZ QUR  710 Heating circuit 1 - Room temperature Comfort setpoint: 
DC C2 00 0B 06 3D 2D 05 8E D2 1E 
HEIZ->LAN ANS  710 Heating circuit 1 - Room temperature Comfort setpoint: 22.0 &deg;C
DC 80 42 0E 07 2D 3D 05 8E 00 05 80 10 E3 
#710: 22.0 &deg;C
LAN->HEIZ QUR  711 Heating circuit 1 - Komfortsollwert Maximum: 
DC C2 00 0B 06 3D 2D 05 A5 47 17 
HEIZ->LAN ANS  711 Heating circuit 1 - Komfortsollwert Maximum: 24.0 &deg;C
DC 80 42 0E 07 2D 3D 05 A5 00 06 00 FD 69 
#711: 24.0 &deg;C
LAN->HEIZ QUR  712 Heating circuit 1 - Room temp reduced setpoint: 
DC C2 00 0B 06 3D 2D 05 90 21 E1 
HEIZ->LAN ANS  712 Heating circuit 1 - Room temp reduced setpoint: 18.0 &deg;C
DC 80 42 0E 07 2D 3D 05 90 00 04 80 9A 2F 
#712: 18.0 &deg;C
LAN->HEIZ QUR  714 Heating circuit 1 - Room temp frost protection setpoint: 
DC C2 00 0B 06 3D 2D 05 92 01 A3 
HEIZ->LAN ANS  714 Heating circuit 1 - Room temp frost protection setpoint: 6.0 &deg;C
DC 80 42 0E 07 2D 3D 05 92 00 01 80 88 B2 
#714: 6.0 &deg;C
LAN->HEIZ QUR  730 Heating circuit 1 - Summer/winter changeover temp: 
DC C2 00 0B 06 3D 2D 05 FD 9C EA 
HEIZ->LAN ANS  730 Heating circuit 1 - Summer/winter changeover temp: 18.0 &deg;C
DC 80 42 0E 07 2D 3D 05 FD 00 04 80 FA 7B 
#730: 18.0 &deg;C
LAN->HEIZ QUR  900 Heating circuit 1 - Operating mode: 
DC C2 00 0B 06 3D 05 07 BE AD 48 
HEIZ->LAN ANS  900 Heating circuit 1 - Operating mode: 4 - Automatik
DC 80 42 0D 07 05 3D 07 BE 00 04 C3 E3 
#900: 4 - Automatik
LAN->HEIZ QUR 8000 Status - Status heating circuit 1: 
DC C2 00 0B 06 3D 05 07 A3 6E D4 
HEIZ->LAN ANS 8000 Status - Status heating circuit 1: 114 - Heizbetrieb Komfort
DC 80 42 0D 07 05 3D 07 A3 00 72 DC 80 
#8000: 114 - Heizbetrieb Komfort
LAN->HEIZ QUR 8740 Diagnosis consumer - Room temp 1 actual value: 
DC C2 00 0B 06 3D 2D 05 1E 51 A7 
HEIZ->LAN ANS 8740 Diagnosis consumer - Room temp 1 actual value: 22.1 &deg;C
DC 80 42 0E 07 2D 3D 05 1E 00 05 87 A6 9B 
#8740: 22.1 &deg;C
LAN->HEIZ QUR 8749 Diagnosis consumer - Raumthermostat 1: 
DC C2 00 0B 06 3D 05 0C 7D 98 9D 
HEIZ->LAN ANS 8749 Diagnosis consumer - Raumthermostat 1: 0 - Kein Bedarf
DC 80 42 0D 07 05 3D 0C 7D 00 00 E2 DF 
#8749: 0 - Kein Bedarf
proasnet commented 3 years ago

I can set reading from eeprom in config.h and reflash if help this.

fredlcore commented 3 years ago

Ok, we've just had a TeamViewer session and I could see that everything works fine until the log file is 1024 bytes long. I then increased the size of bigBuff to 4096 to see if the limit to 1024 bytes was the problem, but it was not. I then realized that dataFile.read() returns -1 only after the file is larger than 1024 bytes. So I assume that the problem is with the file system. @proasnet said that the card has been formatted with FAT32 and that it was working with version 1.0. I'm not sure, @dukess, whether we changed the SD card library sometime in between and that this may be the reason? But it would be strange if a newer version would no longer support FAT32 if it was working before. Since he tried two cards, I also don't think that it's a mechanical error.

He will check and see if the card is still working with version 1.0 and afterwards reformat with FAT16 to see if that makes a change.

proasnet commented 3 years ago

I reflash to saved older version without any changes, v0.44 and logging working. Card is not reformated from our session. You can see here obrazek

proasnet commented 3 years ago

Than I return to v2, updated with you and logging not working, screenshot after one minute from start with FAT16 card formated. As you see here obrazek

fredlcore commented 3 years ago

Well, it does display the log file header - that's more than before. Have you set logging parameters to 5 seconds / parameter 8700 to get the log file filled quickly? Also use CTRL+R to reload the datalog page. The problem only occurred before if the log file was larger than 1024 bytes, so please wait until it's filled with a few more entries.

fredlcore commented 3 years ago

One more thing you can try please: Remove the folder /src/SdFat from the BSB-LAN v2.0 directory and replace it with the src/SdFat folder from 0.44 version. We changed the SD library at some point, so maybe the new one has some issues.

fredlcore commented 3 years ago

Oh, and one more thing first before changing the library: Please open /src/SdFat/FatLib/FatVolume.h and search for line

define DEBUG_MODE 0

and change it from 0 to 1 and flash again and have serial monitor running. Then wait until the log file gets large enough so that it no longer shows in the browser. Then there should be an error message in the serial monitor.

dukess commented 3 years ago

Yes, now that you mention it - interesting! Why would this line come without a \0? chars_read seems to include it, however, with 52 counts.

It can be "bug" or we can ignore it: In transmitFile() we read and write to client defined number of bytes, so here no problem. But when Serial.println(bigBuff); called it print string until first zero.

fredlcore commented 3 years ago

Thanks, yes, I figured out that this is no problem because of the defined number of bytes. The problem lies elsewhere...

dukess commented 3 years ago

whether we changed the SD card library sometime in between and that this may be the reason? But it would be strange if a newer version would no longer support FAT32 if it was working before.

I have no problem with FAT32 (8 Gb on Mega, 16 on Due).