Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 8, 2025

PORTDUINO (Linux native) hardware sends host metrics in telemetry packets, but these were not decoded in the UI payload preview.

Changes

Backend (packet_routes.py)

  • Extract host_metrics from TELEMETRY_APP payloads alongside existing device/environment metrics

Frontend (packet_detail.html)

  • Display host metrics with formatting:
    • Uptime: seconds → "12h 17m"
    • Memory/disk: bytes → "17.09 GB" or "189 MB"
    • Load averages: hundredths → "1.25 / 2.00 / 1.50"
    • Optional fields: diskfree2/3, user_string

Tests (test_packet_routes.py)

  • Added unit test covering all host metrics fields

Example

Before: Payload showed "Decoded: Yes" with empty "Decoded Data" section

After:

Host Metrics:
  Uptime:         12h 17m
  Free Memory:    189 MB
  Disk Free (/):  17.09 GB
  Load Average:   1.25 / 2.00 / 1.50 (1/5/15 min)
  User Info:      PORTDUINO device on Ubuntu 22.04

Screenshot

Host metrics preview

Original prompt

This section details on the original issue you should resolve

<issue_title>Feature Request: Add preview for "Host metrics" in Payload Data</issue_title>
<issue_description>PORTDUINO (Linux native) hardware can send host metrics in a telemetry packet, but Malla doesn't show decoded data for:

Image

Host metrics description from protobuf:

/* Linux host metrics */
typedef struct _meshtastic_HostMetrics {
    /* Host system uptime */
    uint32_t uptime_seconds;
    /* Host system free memory */
    uint64_t freemem_bytes;
    /* Host system disk space free for / */
    uint64_t diskfree1_bytes;
    /* Secondary system disk space free */
    bool has_diskfree2_bytes;
    uint64_t diskfree2_bytes;
    /* Tertiary disk space free */
    bool has_diskfree3_bytes;
    uint64_t diskfree3_bytes;
    /* Host system one minute load in 1/100ths */
    uint16_t load1;
    /* Host system five minute load  in 1/100ths */
    uint16_t load5;
    /* Host system fifteen minute load  in 1/100ths */
    uint16_t load15;
    /* Optional User-provided string for arbitrary host system information
 that doesn't make sense as a dedicated entry. */
    bool has_user_string;
    char user_string[200];
} meshtastic_HostMetrics;

Decoded packet example:

{
      "portnum": 67,
      "payload": "420f08cfd902108080bf5e1880a096b044",
      "want_response": null,
      "dest": null,
      "source": null,
      "request_id": null,
      "reply_id": null,
      "emoji": null,
      "parsed_payload": {
        "host_metrics": {
          "uptime_seconds": 44239,
          "freemem_bytes": "198164480",
          "diskfree1_bytes": "18354638848"
        },
        "type": "protobuf",
        "portnum": "TELEMETRY_APP",
        "message_class": "Telemetry"
      }
    }

I think Copilot could easily implement this.</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Add preview for host metrics in payload data Add host metrics preview for TELEMETRY_APP packets Dec 8, 2025
Copilot AI requested a review from zenitraM December 8, 2025 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Add preview for "Host metrics" in Payload Data

2 participants