Log Error times and 'Stop's

Give it a try, it costs you nothing !
Post Reply
User avatar
Electroguard
Posts: 891
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 287 times
Been thanked: 330 times

Log Error times and 'Stop's

Post by Electroguard »

  • Could the time be included with any 'Halt On Error' messages if possible, please ?
  • And would it be possible for the Stop button to wlog a Stop message (preferably including the stop time) ?

started.jpg

It is easy to wlog 'Startup's, but then difficult to tell if the program has since been stopped, or has hung, or is still running.
This is especially a problem when reconnecting to multiple devices which have been on 24/7.

nodes.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
cicciocb
Site Admin
Posts: 2105
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 451 times
Been thanked: 1391 times
Contact:

Re: Log Error times and 'Stop's

Post by cicciocb »

OK, I'll see what can be done
BeanieBots
Posts: 351
Joined: Tue Jun 21, 2022 2:17 pm
Location: South coast UK
Has thanked: 187 times
Been thanked: 113 times

Re: Log Error times and 'Stop's

Post by BeanieBots »

Don't forget, you can use the watchdog timer to detect for hangs.
Only issue is that bas.resetreason reports watchdog timeout and not the reason for the hang but is a clue in itself.
User avatar
cicciocb
Site Admin
Posts: 2105
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 451 times
Been thanked: 1391 times
Contact:

Re: Log Error times and 'Stop's

Post by cicciocb »

Do a WLOG for start and stop is not a hard, this info is already sent on the serial port so it is just a question to send in the wlog window.
Include the time, I could just take the time/date from the web browser and show it for each message printed.

BUT, In case of error, this is another story as the problem is "where" the message should be sent because, to receive the message, the web browser should be connected on the module.

What I could do is to implement something to have a status of the name of the program loaded and its status (running / stopped).
User avatar
Electroguard
Posts: 891
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 287 times
Been thanked: 330 times

Re: Log Error times and 'Stop's

Post by Electroguard »

Do a WLOG for start and stop is not a hard, this info is already sent on the serial port so it is just a question to send in the wlog window.
Include the time, I could just take the time/date from the web browser and show it for each message printed.
Anything helpful would be a welcome improvement, Francesco.

To be honest, I guessed the browser wlog window might be an issue, cos all contents would be lost on browser re-connection anyway.
But anything the script can send to the wlog window could also be saved to a variable or file, so even if unable to display in the browser, it would be available later, even after a reboot.

I've actually got an Annex LogServer where devices can log time-stamped messages to, which also doubles as the network TimeServer and WatchServer... it being more optimal for the WatchServer to periodically send a Watch instruction to prevent watchdog timer resets of all listening devices rather than have them all keep pinging.

But now I see the browser Stop feedback message problem from your developers eyes - clicking Start or Stop in the browser will cause an appropriate wifi instruction to be sent back to the device firmware to actually start or stop the script running... but how can the firmware make that status info (plus local esp time) available to the script.

A possible solution:
Could a special Wlog$ variable (similar to HtmlEventVar$) be used to hold the last wlog message that was sent to the browser ?
The variable probably already exists for wlog messages anyway, so might just be a matter of making it accessible.
Perhaps this could allow OnError to catch and handle a Stop message as if it was an error, plus similarly any other time-stamped wlog error messages.
Post Reply