FHEM Forum

FHEM - Anwendungen => Heizungssteuerung/Raumklima => Thema gestartet von: akashkumar am 14 Mai 2019, 20:28:54

Titel: SD Card Logging with BSB-Lan
Beitrag von: akashkumar am 14 Mai 2019, 20:28:54
Hello,

I have just started using the lovely BSB-Lan system (https://github.com/fredlcore/bsb_lan/blob/master/HOWTO.md) using Arduino Mega, Ethernet Shield and the BSB-board. It works perfect except that I am not able to write the data values to the SD Card. I am using a 16GB Sandisk SD Card formatted with FAT32. I also tried making a smaller partition of 2GB in FAT16. It is able to write the header line after calling /D0. But no data is written thereafter. Strangely enough, when I update the logging parameters and interval using /L=x,y1,y2... command, the changes are lost after some time (a few minutes, seems to be the time when it attempts to write the data) and the default values are restored.

Did anyone experience a similar problem before? Any suggestions on troubleshooting would be really welcome!

Thanks.
Akash
Titel: Antw:SD Card Logging with BSB-Lan
Beitrag von: akashkumar am 15 Mai 2019, 11:47:11
A quick update:

I had a look at the SD card on the computer. In addition to 'datalog.txt' which only contains the header, there is another file created called 'averages.txt' which has roughly 100 lines each containing one number. No information about value/parameter is mentioned in it.

Thanks!
Titel: Antw:SD Card Logging with BSB-Lan
Beitrag von: DerFrischling am 06 Juni 2019, 10:16:56
I've got the very same problem and situation and just posted into the most recent 'LAN-Anbindung für BSB-Bus (Brötje, Elco Thision etc.)' thread... which is german though. I'll be happy to keep you updated as MY issue is solved.


Zitat.. command, the changes are lost after some time (a few minutes, seems to be the time when it attempts to write the data)

Watch the serial monitor within your Arduino IDE. I'm pretty damn sure it does reboot on any attempt to write to the SD card (or resetting the ethernet shield ... or ~ dunno). In other qords the reboot frequency of setup matches the log interval you have specified in your boot config.


If you do /L=0,0, logging is disabled and it will run stable forever, does it?
Titel: Antw:SD Card Logging with BSB-Lan
Beitrag von: DerFrischling am 07 Juni 2019, 22:51:13
Hi akashkumar,


with support of admin freetz I was able to spot the issue in my setup.

You may try to edit your BSB_lan.ino file accordingly and uncomment line 2423 with two slashes:

char *GetDateTime(char date[]){
  sprintf(date,"%02d.%02d.%d %02d:%02d:%02d",day(),month(),year(),hour(),minute(),second());
//  date[20] = 0;    //Causes issue for my, BR Torsten
  return date;
}

If it does not work for you on a lucky try, please respond and I will try to troubleshoot with you what user freetz did for me before...
Titel: Antw:SD Card Logging with BSB-Lan
Beitrag von: Schotty am 20 Juni 2019, 07:57:56
Hi akash, hi Frischling,

if the problem still exists, please report it in the main BSB-LAN-thread: https://forum.fhem.de/index.php/topic,29762.0.html

Thanks
Titel: Antw:SD Card Logging with BSB-Lan
Beitrag von: freetz am 20 Juni 2019, 08:02:53
The issue of DerFrischling has been resolved, this was a buffer overflow as
date[20] = 0;
should be
date[19] = 0;

This is fixed in the most recent version on the project's GitHub site, so please update and check if your problem is solved as well, akashkumar.