SD Card Logging with BSB-Lan

Begonnen von akashkumar, 14 Mai 2019, 20:28:54

Vorheriges Thema - Nächstes Thema

akashkumar

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

akashkumar

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!

DerFrischling

#2
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?

DerFrischling

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...

Schotty

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
Handbuch zur BSB-LAN Hard- & Software (Anbindung v. Heizungsreglern, u.a. von Brötje & Elco):
https://1coderookie.github.io/BSB-LPB-LAN/

freetz

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.
Alle Infos zur Anbindung von Heizungssystemen mit PPS-, LPB- bzw. BSB-Bus ans LAN gibt es hier:
https://github.com/fredlcore/bsb_lan

Alle Infos zum WLAN-Interface "Robotan" für Ambrogio/Stiga/Wolf und baugleiche Rasenmähroboter:
https://github.com/fredlcore/robotan