TuyaAPI / cli

🔧 A CLI for Tuya devices
MIT License
270 stars 44 forks source link

tuya-cli get return strange payloads #97

Closed rzfahm closed 3 years ago

rzfahm commented 4 years ago

Hi, I am trying to run get command with my tuya smart plug, but it seems that the result is somewhat corrupted or simply unreadable. Here's my tuya-cli arguments and the result

tuya-cli get --id XXXXXXX --key XXXXXXX --ip 192.168.100.51 --protocol-version 3.3 -a
�2Z-���6�ϩ�A���)��5U�YT���

And here's the result when on debug mode

DEBUG="*" tuya-cli get --id xxxxxxxxx --key xxxxxxxxxx --ip 192.168.100.51 --protocol-version 3.3 -a
TuyAPI IP and ID are already both resolved. +0ms
  TuyAPI Connecting to 192.168.100.51... +1ms
  TuyAPI Socket connected. +7ms
  TuyAPI GET Payload: +0ms
  TuyAPI { gwId: 'xxxxxxxx',
  TuyAPI   devId: 'xxxxxxxxx',
  TuyAPI   t: '1605421150',
  TuyAPI   dps: {},
  TuyAPI   uid: 'xxxxxxx' } +0ms
  TuyAPI GET Payload: +3ms
  TuyAPI { gwId: 'xxxxxxx',
  TuyAPI   devId: 'xxxxxxx',
  TuyAPI   t: '1605421150',
  TuyAPI   dps: {},
  TuyAPI   uid: 'xxxxxxx' } +0ms
  TuyAPI Received data: 000055aa000000010000000a0000002c00000001fd325a2dde10988236df7308cfa9b741daf8e829bbc3033555fb185954aa8796cfbc52220000aa55 +44ms
  TuyAPI Parsed: +1ms
  TuyAPI { payload: '�2Z-�\u0010��6�s\bϩ�A���)��\u00035U�\u0018YT���',
  TuyAPI   leftover: false,
  TuyAPI   commandByte: 10,
  TuyAPI   sequenceN: 1 } +0ms
  TuyAPI Received data: 000055aa000000020000000a0000002c00000001fd325a2dde10988236df7308cfa9b741daf8e829bbc3033555fb185954aa8796f0772cb70000aa55 +48ms
  TuyAPI Parsed: +0ms
  TuyAPI { payload: '�2Z-�\u0010��6�s\bϩ�A���)��\u00035U�\u0018YT���',
  TuyAPI   leftover: false,
  TuyAPI   commandByte: 10,
  TuyAPI   sequenceN: 2 } +1ms
  TuyAPI Disconnect +0ms
�2Z-���6�ϩ�A���)��5U�YT���
  TuyAPI Socket closed: 192.168.100.51 +1ms
codetheweb commented 4 years ago

The most likely cause is that your device key is wrong. Please double-check it and re-link / fetch if needed (it changes every time the device is linked).

The second most likely cause is that your device uses the 3.2 protocol, which is not currently supported.

codetheweb commented 3 years ago

Closing because of inactivity.