[BUG] switch wallplug _TZ3000_ww6drja5 TS011F Received an exception while passing frame to API

オープン
#267 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python

調査の方向性

The traceback points to frame parsing in zigpy_znp/types/commands.py and delivery in zigpy_znp/uart.py. Start by tracing how the ZDO Routes response is decoded when its status is NOT_SUPPORTED; the reported frame contains only the source and status fields. Reproduce or add coverage for this truncated response, and consider the issue done when it no longer raises an uncaught parsing exception or logs a misleading warning.

索引モデルが issue の本文から書いたものです。

説明

Bug description

I have a zigbee device described as TS011F (manufacturer _TZ3000_ww6drja5). From time to time is causing a warning in HA logs:
Received an exception while passing frame to API: TransportFrame(payload=GeneralFrame(header=CommandHeader(id=0xB2, subsystem=Subsystem.ZDO, type=CommandType.AREQ), data=b'\x42\xCA\x84'))

Steps to reproduce

Using a TS011F (manufacturer _TZ3000_ww6drja5) device (switch wallplug).

Expected behavior

No errors or warnings in HA logs.

Screenshots/Video
Screenshots/Video

[Paste/upload your media here]

Diagnostics information

zha-01JA3C587FESACD24EWJEE741W-_TZ3000_ww6drja5 TS011F-861c358c31e9c0d9fe774fab068d0cc1.json

Device signature
Device signature

{
  "node_descriptor": {
    "logical_type": 1,
    "complex_descriptor_available": 0,
    "user_descriptor_available": 0,
    "reserved": 0,
    "aps_flags": 0,
    "frequency_band": 8,
    "mac_capability_flags": 142,
    "manufacturer_code": 4107,
    "maximum_buffer_size": 66,
    "maximum_incoming_transfer_size": 66,
    "server_mask": 11264,
    "maximum_outgoing_transfer_size": 66,
    "descriptor_capability_field": 0
  },
  "endpoints": {
    "1": {
      "profile_id": "0x0104",
      "device_type": "0x0051",
      "input_clusters": [
        "0x0000",
        "0x0003",
        "0x0004",
        "0x0005",
        "0x0006",
        "0x000a",
        "0x0702",
        "0x0b04",
        "0x1000",
        "0x1888",
        "0xe000"
      ],
      "output_clusters": [
        "0x0019"
      ]
    }
  },
  "manufacturer": "_TZ3000_ww6drja5",
  "model": "TS011F",
  "class": "zhaquirks.tuya.ts011f_plug.Plug_v3_NoGP"
}

Logs
Logs

Rejestrator: zigpy_znp.uart
Źródło: /usr/local/lib/python3.13/site-packages/zigpy_znp/uart.py:58
Pierwsze zdarzenie: 21:50:24 (2 wystąpienia)
Ostatnio zalogowany: 21:52:33

Received an exception while passing frame to API: TransportFrame(payload=GeneralFrame(header=CommandHeader(id=0xB2, subsystem=Subsystem.ZDO, type=CommandType.AREQ), data=b'\x42\xCA\x84'))
Received an exception while passing frame to API: TransportFrame(payload=GeneralFrame(header=CommandHeader(id=0xB2, subsystem=Subsystem.ZDO, type=CommandType.AREQ), data=b'\x7D\x40\x84'))
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/zigpy_znp/types/commands.py", line 417, in from_frame
    params[param.name], data = param.type.deserialize(data)
                               ~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/usr/local/lib/python3.13/site-packages/zigpy/types/struct.py", line 336, in deserialize
    fields, data = cls._deserialize_internal(cls.fields, data)
                   ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/zigpy/types/struct.py", line 322, in _deserialize_internal
    value, data = field.type.deserialize(data)
                  ~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/usr/local/lib/python3.13/site-packages/zigpy/types/basic.py", line 189, in deserialize
    raise ValueError(f"Data is too short to contain {byte_size} bytes")
ValueError: Data is too short to contain 1 bytes

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/zigpy_znp/uart.py", line 56, in data_received
    self._api.frame_received(frame.payload)
    ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/zigpy_znp/api.py", line 860, in frame_received
    command = command_cls.from_frame(frame, align=self.nvram.align_structs)
  File "/usr/local/lib/python3.13/site-packages/zigpy_znp/types/commands.py", line 424, in from_frame
    raise ValueError(
    ...<2 lines>...
    )
ValueError: Frame data is truncated (parsed {'Src': 0xCA42, 'Status': <Status.NOT_SUPPORTED: 132>}), required parameter remains: Param(name='Routes', type=<class 'zigpy.zdo.types.Routes'>, description='Routes', optional=False)

Additional information

No response

主要言語
Python
スター
172
フォーク
49
平均マージ
3分
マージ済み PR(30日)
1

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

zigpy/zigpy-znp のほかの issue

zigpy/zigpy-znp の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。