MyCSVMessage save is failing at 3 am during windows 11 maintenance

Support forum for MegunoLink
Post Reply
JohnM
Posts: 8
Joined: Sat Jun 10, 2023 4:14 pm

Wed Oct 18, 2023 4:04 am

I am writing an hourly MyCSVMessage data string from a data logger Arduino program on the start of each hour (minute()=0). The save to the .txt file occurs hourly except at 3am, when Windows 11 is doing automatic maintenance. At 3am, the message appears in the Megunolink monitor, but there is no record in the text file on the computer for that hour. Apparently the Windows11 automatic maintenance is blocking access to the text file at that time.

I am using the RequestSync() method to set the Arduino clock with the PC clock. I don't think that has any effect on this problem, since the monitor shows that the MyCSVMessage was triggered correctly and appeared in the monitor log.

Any suggestions as to how to get around this problem?

Does anyone from Megunolink scan these posts to answer questions? I have posted 2 other messages here in the past few months and have never received a response from anyone, especially from someone who works for Megunolink.

Thanks, John
philr
Posts: 446
Joined: Mon May 26, 2014 10:58 am

Wed Oct 18, 2023 8:12 am

Hi John, I have no idea what would be causing this one. Can you try doing it more regularly to pinpoint more accurately when its happening and for how long? Is it possible to disable windows maintenance?

Cheers
Phil
JohnM
Posts: 8
Joined: Sat Jun 10, 2023 4:14 pm

Wed Oct 18, 2023 2:25 pm

Phil,

Thanks for replying.

I am trying some different trigger times, like 2 minutes before the hour. No results yet.

I am also trying a save to WordPad rather than Notepad in the file properties. No results yet.

The missing record occurred for example on 10/17/23 at 3:00:01.791 AM when the Windows event log reports:
Maintenance state changed to 3 (Last Run: ‎10/‎17/‎2023 3:00 AM).

The record does get saved at 3:00AM on some days. I can't tell why it works sometimes, but it must be whatever Windows Maintenance is doing on that day. It was saved at 3AM on 10/16 and 10/18, but not on 10/17.

Microsoft says that Windows maintenance can run for up to 1 hour, so how can I bracket the times to avoid this problem if I want data every hour?

One setting for maintenance is to "Allow scheduled maintenance to wake up my computer at the scheduled time". This is checked in the Automatic Maintenance dialog. It doesn't seem to affect this problem either way. Also, you can select a time to run the maintenance daily at any hour, but only at the top of any hour.

I used to log serial data to a text file and never ran into this problem. The log just continued to accumulate. I have only seen this happen with MyCSVMessage saves from Megunolink.

Curiously, the Monitor continues to store all its messages in Log to File every day during the 3:00 AM hour. Is there something special about how MyCSVMessage saves its data?

Thanks for your help!
John
JohnM
Posts: 8
Joined: Sat Jun 10, 2023 4:14 pm

Wed Oct 25, 2023 2:23 pm

Phil,

Somehow the 3 am fail to log a record problem has disappeared. What I changed was to split two CSV data streams into two separate channels. Before, I was just using the default channel settings and mixing the streams. I also changed the once an hour stream into an every 30 minute CSV write.

I also went through the procedure to "repair" my installation of Microsoft Notepad. However, Windows did not report any problems with NotePad when doing that repair. I am using Windows 11 Pro for the operating system.

I went through the entire setup to create separate channels, and so far (3 days) the Monitor visualizers and the Logger visualizers have recorded a record every 30 minutes on one channel, and once a day on the other channel (at midnight).

I am very happy to have things working now. I don't know if I had just not set everything up properly, or if using all the defaults settings ("MyCSVMessage") and the default channel name was the problem.

Thanks for your suggestions of things to try. Megunolink continues to amaze me with its power and versatility, along with it's complexity. Your documentation is awsome, but can also be obscure just where you need some little detail, like creating separate channels. There is not a good code example showing how to code that.

John
JohnM
Posts: 8
Joined: Sat Jun 10, 2023 4:14 pm

Fri Oct 27, 2023 1:30 am

Oops!

Just a soon as I bragged that the CSV messages were being continuously written to disk, I get this last night in the .txt file on disk - notice how the records for 2:30 and 3:00 AM are missing:

2023-10-26 00:01:18 Half Hour Log,2023/10/26 00:01:10,-8.98,0.00,573.22,35592.18,637.06,35598.24,-
2023-10-26 00:30:34 Half Hour Log,2023/10/26 00:30:25,-8.06,0.00,-191.78,-0.00,573.22,35592.18,-4.37,9.66,-
2023-10-26 01:01:01 Half Hour Log,2023/10/26 01:00:53,-7.87,0.00,-392.95,-0.00,573.22,35592.18,-3.82,9.19,-
2023-10-26 01:30:17 Half Hour Log,2023/10/26 01:30:08,-8.22,0.00,-587.86,-0.00,573.22,35592.18,-3.27,9.91,-
2023-10-26 02:00:44 Half Hour Log,2023/10/26 02:00:36,-8.58,0.00,-790.12,-0.00,573.22,35592.18,-4.03,10.19,-
2023-10-26 03:30:54 Half Hour Log,2023/10/26 03:30:45,-8.11,0.00,-1377.95,-0.00,573.22,35592.18,-3.80,10.81,-
2023-10-26 04:00:08 Half Hour Log,2023/10/26 04:00:00,-8.09,0.00,-1570.37,-0.00,573.22,35592.18,-3.69,9.04,-
2023-10-26 04:30:36 Half Hour Log,2023/10/26 04:30:27,-8.45,0.00,-1770.99,-0.00,573.22,35592.18,-3.91,8.48,-
2023-10-26 05:01:04 Half Hour Log,2023/10/26 05:00:55,-7.90,0.00,-1971.13,-0.00,573.22,35592.18,-3.90,8.57,-
2023-10-26 05:30:17 Half Hour Log,2023/10/26 05:30:08,-7.45,0.00,-2160.66,-0.00,573.22,35592.18,-4.01,7.55,-

Here is the same span of records in the monitor visualizer - All the records were sent from the Arduino:
Half Hour Log,2023/10/26 00:01:10,-8.98,0.00,573.22,35592.18,637.06,35598.24,-
Half Hour Log,2023/10/26 00:30:25,-8.06,0.00,-191.78,-0.00,573.22,35592.18,-4.37,9.66,-
Half Hour Log,2023/10/26 01:00:53,-7.87,0.00,-392.95,-0.00,573.22,35592.18,-3.82,9.19,-
Half Hour Log,2023/10/26 01:30:08,-8.22,0.00,-587.86,-0.00,573.22,35592.18,-3.27,9.91,-
Half Hour Log,2023/10/26 02:00:36,-8.58,0.00,-790.12,-0.00,573.22,35592.18,-4.03,10.19,-
Half Hour Log,2023/10/26 02:31:03,-7.40,0.00,-987.62,-0.00,573.22,35592.18,-4.03,11.10,-
Half Hour Log,2023/10/26 03:00:18,-8.20,0.00,-1179.93,-0.00,573.22,35592.18,-3.70,10.62,
Half Hour Log,2023/10/26 03:30:45,-8.11,0.00,-1377.95,-0.00,573.22,35592.18,-3.80,10.81,-
Half Hour Log,2023/10/26 04:00:00,-8.09,0.00,-1570.37,-0.00,573.22,35592.18,-3.69,9.04,-
Half Hour Log,2023/10/26 04:30:27,-8.45,0.00,-1770.99,-0.00,573.22,35592.18,-3.91,8.48,-
Half Hour Log,2023/10/26 05:00:55,-7.90,0.00,-1971.13,-0.00,573.22,35592.18,-3.90,8.57,-
Half Hour Log,2023/10/26 05:30:08,-7.45,0.00,-2160.66,-0.00,573.22,35592.18,-4.01,7.55,-

There has to be a bug in Megunolink that is causing this. My Windows settings allow for "automatic maintenance" to occur at 2:00 for up to an hour.

Who can solve this for me?
John
philr
Posts: 446
Joined: Mon May 26, 2014 10:58 am

Fri Nov 17, 2023 8:40 am

Hi John, no good answer from us on this one. We havent seen the same thing. Have you got another computer you could try? If you disable updates does it stop failing (not even sure you can disable them these days).
admin
Site Admin
Posts: 20
Joined: Mon May 26, 2014 10:53 am

Fri Nov 17, 2023 8:45 am

Hi John,

This is very surprising; I wouldn't expect windows maintenance to affect MegunoLink, but great job tracking down that connection! I'll need to study more closely, but one question occurs: does the log destination have any impact? For example, is the log file going to a network drive? Does sending it to a different drive (e.g., usb memory stick if you have nothing else) have any impact?

Kind regards
Paul.
Post Reply