unfoldedcircle / feature-and-bug-tracker

Feature and bug tracker repository for Unfolded Circle products
22 stars 0 forks source link

[feature request] Downloading Additional Logs from Dock via Web UI #236

Open jstrify opened 6 months ago

jstrify commented 6 months ago

Is there an existing issue for this?

Description

I am trying to troubleshoot an issue where IR commands are not being learned successfully for certain devices. While the remote appears to log most information, the dock does not. Would it be possible to enable additional logging from the docks?

Additional context

No response

zehnm commented 6 months ago

Syslog can be enabled in the dock to send log statements to a syslog server. However, it's only accessible in the Dock WebSocket API and not exposed in the web-configurator. API docs: https://github.com/unfoldedcircle/core-api/blob/v0.8.0-alpha/dock-api/UCD2-asyncapi.yaml#L341-L354

A local WebSocket client is required to communicate with the dock. For example a web-browser extension like WebSocket King Client works. Please note that the online version of WebSocket King Client or Firecamp do NOT work. (The dock uses ws:// communication which is not allowed in the browser when the webpage was loaded with https).

Example:

  1. After a WebSocket connection is established, an authentication request is received:

    {"type":"auth_required","model":"UCD2","revision":5.4,"version":"0.9.2"}
  2. Send an authentication message:

    • token is the code configured when setting up the dock, or 0000 if no code has been set.
      {
      "type": "auth",
      "token": "0000"
      }
  3. Enable a syslog server and set log level to DEBUG (level 7):

    {
    "type": "dock",
    "command": "set_logging",
    "log_level": 7,
    "syslog_enabled": true,
    "syslog_server": "192.168.1.23"
    }

Log messages are now sent to the configured syslog server:

image
jstrify commented 6 months ago

Thank you @zehnm this is really great information, I appreciate you taking the time to explain this to me, I am setting this up now.

That being said - I think it might still be worthwhile to keep this open to add an option to download logs from the dock (assuming the dock has the storage/compute to do so). Understood that the dock does not currently have a syslog server so this change may not be "quick".

Below reflects a current screenshot from the dock web UI:

image

While the below screenshot represents the logging download option under Settings > Development > Logs on the remote web UI:

image

I am helping some users look into issues learning IR codes and while I think I will be able to set this up, it will probably be a pain point for users looking for help. Thoughts?