Losing Intraday Stats on serial port connection failure

Frågor kring om hur man installerar och konfigurerar Statlink.

Moderator: Peter

Losing Intraday Stats on serial port connection failure

Postby Beardymarrow » Fri Oct 03, 2014 14:12

Hi there,
I have StatLink on my PC set to automatically start when my PC does. This means that in the event of power failure or reboot in the night to apply updates, it carries on collecting data automatically.

A few times I have found that the Serial port has not connected correctly after a reboot, and so StatLink is unable to see my Rego. When it does this, StatLink resets the IntraDay stats back to zero, and so when I resolve the problem with the serial port, the daily reports and logs are not correct.

Is there a way to stop StatLink from resetting the daily stats when it fails to connect to the serial port?

Thanks

Beardy
IVT Greenline HT+ E9
Beardymarrow
Junior
 
Posts: 25
Joined: Thu May 01, 2014 11:31

Re: Losing Intraday Stats on serial port connection failure

Postby Peter » Mon Jan 12, 2015 19:52

Hi.

I have checked the code and there is no process in where the intraday stat is deleted by thar reason.
The only way to telet that is in the File menu, Reset statistics or if Computer date changes to a new day.

BR
/Peter
Driver detta forum samt www.husdata.se med produkter.
Husdata onlinelogg: http://www2.husdata.se/UserInfo.asp?ID_ ... View=Pulse
Stalink logg: http://www2.husdata.se/demo
User avatar
Peter
Site Admin
 
Posts: 364
Joined: Tue Mar 14, 2006 15:30
Location: Piteå

Re: Losing Intraday Stats on serial port connection failure

Postby Beardymarrow » Tue Jan 13, 2015 15:07

Hi Peter,
Glad to see you back and active. I may have used the wrong term in saying Intraday stats.

I can replicate this problem every time by un-plugging my USB-Serial adapter and re-starting StatLink. Please find below some screenshots which show the problem.

My StatLink statistics before :-
Image

I then Unplug my USB-Serial adapter and restart StatLink and get this error (as expected) :-
Image

I click OK, and then get this screen :-
Image
I can then click Save or Cancel or this screen. It doesn't matter which

Then StatLink starts, but is unable to see my Rego (obviously) :-
Image

Then I re-connect my USB-Serial port and re-start StatLink and I have lost the history (hours of operation, kWh used etc.):-
Image

Image

Hope this helps describe the problem better and that you can see the issue.
IVT Greenline HT+ E9
Beardymarrow
Junior
 
Posts: 25
Joined: Thu May 01, 2014 11:31

Re: Losing Intraday Stats on serial port connection failure

Postby Peter » Tue Jan 13, 2015 17:25

Ok I know why.
When StatLink shuts down, the current date is stored to a file.
When StatLink start up it compares the computer date with the date in file. If it is a different day the Intrastat is reset.

As the Com port error occurs, StatLink crashes and therefore it dows not store the date to file as it does on a proper shutdown.
Therefore, when i starts again the dates missmatches and the Intraday stat is reset.

This could be redisigned i think, I have to look in to it.
Driver detta forum samt www.husdata.se med produkter.
Husdata onlinelogg: http://www2.husdata.se/UserInfo.asp?ID_ ... View=Pulse
Stalink logg: http://www2.husdata.se/demo
User avatar
Peter
Site Admin
 
Posts: 364
Joined: Tue Mar 14, 2006 15:30
Location: Piteå

Re: Losing Intraday Stats on serial port connection failure

Postby Beardymarrow » Tue Jan 13, 2015 18:14

Peter wrote:Ok I know why.
When StatLink shuts down, the current date is stored to a file.
When StatLink start up it compares the computer date with the date in file. If it is a different day the Intrastat is reset.

As the Com port error occurs, StatLink crashes and therefore it dows not store the date to file as it does on a proper shutdown.
Therefore, when i starts again the dates missmatches and the Intraday stat is reset.

This could be redisigned i think, I have to look in to it.


Thanks Peter, This would be really good to fix, as it causes me to lose my IntraDay stats fairly frequently (many power cuts, computer upgrades etc.) and my serial port often does not re-connect before StatLink starts. Is there anything I can do manually if I notice that StatLink has not connected, before I re-connect the serial port and restart StatLink. Can I add the date manually to a file myself?
IVT Greenline HT+ E9
Beardymarrow
Junior
 
Posts: 25
Joined: Thu May 01, 2014 11:31

Re: Losing Intraday Stats on serial port connection failure

Postby Peter » Tue Jan 13, 2015 19:23

yes you can.
It is the Intraday.xml file.
Change the date (Key Datum) to the current date.

<KvArray><KeyValue><Key>Datum</Key><Value>2015-01-13</Value>
Driver detta forum samt www.husdata.se med produkter.
Husdata onlinelogg: http://www2.husdata.se/UserInfo.asp?ID_ ... View=Pulse
Stalink logg: http://www2.husdata.se/demo
User avatar
Peter
Site Admin
 
Posts: 364
Joined: Tue Mar 14, 2006 15:30
Location: Piteå

Re: Losing Intraday Stats on serial port connection failure

Postby Beardymarrow » Tue Jan 13, 2015 21:58

Peter wrote:yes you can.
It is the Intraday.xml file.
Change the date (Key Datum) to the current date.

<KvArray><KeyValue><Key>Datum</Key><Value>2015-01-13</Value>


Hi Peter,
Sorry, but that didn't work for me. :(

I shutdown StatLink, and my Intraday.xml file had this in it :-
Code: Select all
<KvArray><KeyValue><Key>Datum</Key><Value>2015-01-13</Value></KeyValue><KeyValue><Key>1,1</Key><Value>292</Value></KeyValue><KeyValue><Key>1,2</Key><Value>298</Value></KeyValue><KeyValue><Key>1,3</Key><Value>0</Value></KeyValue><KeyValue><Key>1,4</Key><Value>292,</Value></KeyValue><KeyValue><Key>2,1</Key><Value>29</Value></KeyValue><KeyValue><Key>2,2</Key><Value>29</Value></KeyValue><KeyValue><Key>2,3</Key><
etc. etc.

I then disconnected the USB and restarted StatLink and the Intraday.xml file then changed to :-
Code: Select all
<KvArray><KeyValue><Key>Datum</Key><Value>2015-01-13</Value></KeyValue><KeyValue><Key>1,1</Key><Value>0</Value></KeyValue><KeyValue><Key>1,2</Key><Value>0</Value></KeyValue><KeyValue><Key>1,3</Key><Value>0</Value></KeyValue><KeyValue><Key>2,1</Key><Value>0</Value></KeyValue><KeyValue>


So, at this point, obviously my stats have gone, and then when I restart StatLink my stats are still gone.

I have found a little trick though. If I find StatLink in this state :-
Image

Then I can take a copy of Intraday.xml to a different filename "Intraday-Copy.xml", then Click OK and allow StatLink to open and close and to delete the stats itself. Then I can manually delete Intraday.xml and rename Intraday-Copy.xml to Intraday.xml, re-connect the USB and start StatLink and then it's all good!

Does this help you work out how to code a fix?
IVT Greenline HT+ E9
Beardymarrow
Junior
 
Posts: 25
Joined: Thu May 01, 2014 11:31


Return to Installation och konfiguration av StatLink

Who is online

Users browsing this forum: No registered users and 4 guests

cron