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
222 stars 84 forks source link

[BUG] wrong mday in logging #527

Closed DE-cr closed 1 year ago

DE-cr commented 1 year ago

BSB-LAN Version 3.0.3-20221119003550 (copied from github master on 2022-11-23 ca. 10:16 MEZ)

Architecture ESP32 NodeMCU

Bus system BSB

Describe the bug In logging (both /D and UDP broadcast) the day given in "Date" is one day too early:

Milliseconds;Date;Parameter;Description;Value;Unit
600408;22.11.2022 10:33:34;8700;Aussentemperatur;2.5;°C

The system date, as displayed on the boiler's ISR unit, is (correctly) given as 23.11.2022, though. Checking /0 also correctly reports 0 Uhrzeit - Aktuelles Datum / Aktuelle Uhrzeit: 23.11.2022 10:36:37.

Additional context The code responsible for logging the date should be BSB-LAN.ino line 6644, which looks ok to me - as well as the GetDateTime function called there, which I've found in lines 2997ff. However, the problem is reproducible on my system, even with the latest build (c.f. above) and after resetting the BSB-LAN unit.

fredlcore commented 1 year ago

Thanks for mentioning this. @dukess, if I'm not mistaken, you submitted a change for setTime() where it says in line 9:

t.tm_mday = day - 1;     //Day of week, 0 - 6. Sunday = 0

But mday is probably not day of week but rather day of month. So I guess this change is at the wrong place, isn't it?

dukess commented 1 year ago

Yes, it is my fault.

t.tm_mday = day; fredlcore @.***> 23 ноября 2022 г. 13:18:13 написал:

Thanks for mentioning this. @dukess, if I'm not mistaken, you submitted a change for setTime() where it says in line 9:

t.tm_mday = day - 1; //Day of week, 0 - 6. Sunday = 0

But mday is probably not day of week but rather day of month. So I guess this change is at the wrong place, isn't it?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.

DE-cr commented 1 year ago

fixed, and successfully tested on my system, thank you!