Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decryption of MQ failed: Input length not multiple of 16 bytes / #319, #577 #578

Open
florianrohde opened this issue May 17, 2024 · 4 comments
Labels
stale An issue is marked stale after four weeks without activity and will be closed one week later.

Comments

@florianrohde
Copy link

florianrohde commented May 17, 2024

Referencing Issues #319 and #577 which seem to be the same.

Tuya Account is connected and device discovery working. Channels were added manually.
I can see communication to the Tuya Gateway on my network but the status is not updated. Device is shown ONLINE indeed.

Environment: OpenHAB 4.0.3, Binding 4.0.2
Platform: Windows

Things and Items were deleted and recreated without success. Local Key did not change in this process on OH side.

Strange: The dev platform of tuya does show an EMPTY local key, but OH does have an key and does not accept "empty" local key. Maybe because this is 434 mhz sub device of the gateway?

From TUYA #API Explorer:
{ "result": { "active_time": 1715696606, "bind_space_id": "192111482", "category": "sfkzq", "create_time": 1715692336, "custom_name": "vorne", "icon": "smart/icon/bay1604286101943tD7U/1709028379af92bea864c.png", "id": "bf82e49de2093a8687dkfm", "ip": "", "is_online": true, "lat": "xxx", "local_key": "", "lon": "xxx", "model": "TTV203W", "name": "WiFi intelligente Zwei-Wege Bewässerung Timing Ventil", "product_id": "pjnbcfv3bzwg4yyo", "product_name": "TTV203FRF_wifi智能双路灌溉定时阀", "sub": true, "time_zone": "+02:00", "update_time": 1715697660, "uuid": "bf82e49de2093a8687dkfm" }, "success": true, "t": 1715963057681, "tid": "e87bbda6146911efb2424a20391ad943" }

From OH Error Log:

2024-05-17 18:10:43.622 [WARN ] [.internal.local.handlers.TuyaDecoder] - bff710b97b3242e7dbbl4b/10.10.23.25:6668 failed to parse JSON: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $ 2024-05-17 18:10:47.501 [WARN ] [inding.tuya.internal.util.CryptoUtil] - Decryption of MQ failed: Input length not multiple of 16 bytes 2024-05-17 18:10:47.502 [WARN ] [inding.tuya.internal.util.CryptoUtil] - Decryption of MQ failed: Invalid AES key length: 1 bytes 2024-05-17 18:10:47.591 [WARN ] [inding.tuya.internal.util.CryptoUtil] - Decryption of MQ failed: Input length not multiple of 16 bytes 2024-05-17 18:10:47.593 [WARN ] [inding.tuya.internal.util.CryptoUtil] - Decryption of MQ failed: Invalid AES key length: 1 bytes 2024-05-17 18:10:49.832 [WARN ] [inding.tuya.internal.util.CryptoUtil] - Decryption of MQ failed: Input length not multiple of 16 bytes 2024-05-17 18:10:49.834 [WARN ] [inding.tuya.internal.util.CryptoUtil] - Decryption of MQ failed: Invalid AES key length: 1 bytes 2024-05-17 18:10:50.217 [WARN ] [inding.tuya.internal.util.CryptoUtil] - Decryption of MQ failed: Invalid AES key length: 1 bytes 2024-05-17 18:10:50.220 [WARN ] [inding.tuya.internal.util.CryptoUtil] - Decryption of MQ failed: Input length not multiple of 16 bytes 2024-05-17 18:10:51.253 [DEBUG] [rnal.influx1.InfluxDB1RepositoryImpl] - query returned no series 2024-05-17 18:10:56.168 [WARN ] [inding.tuya.internal.util.CryptoUtil] - Decryption of MQ failed: Input length not multiple of 16 bytes 2024-05-17 18:10:56.170 [WARN ] [inding.tuya.internal.util.CryptoUtil] - Decryption of MQ failed: Invalid AES key length: 1 bytes 2024-05-17 18:10:56.547 [WARN ] [inding.tuya.internal.util.CryptoUtil] - Decryption of MQ failed: Input length not multiple of 16 bytes 2024-05-17 18:10:56.548 [WARN ] [inding.tuya.internal.util.CryptoUtil] - Decryption of MQ failed: Invalid AES key length: 1 bytes

@florianrohde
Copy link
Author

Update: The local key discovered is the gateway's local key which looks fine. Both gateway and sub device are not working (channels showing NULL)

@florianrohde
Copy link
Author

TRACE Log:

2024-05-17 18:43:40.111 [TRACE] [rnal.local.handlers.HeartbeatHandler] - bfe6ea39c92052273ayrch/10.10.23.27:6668: Sending ping 2024-05-17 18:43:40.112 [DEBUG] [.internal.local.handlers.TuyaEncoder] - bfe6ea39c92052273ayrch/10.10.23.27:6668: Sending HEART_BEAT, payload {devId=bfe6ea39c92052273ayrch, uid=bfe6ea39c92052273ayrch, t=1715964220, dps=, gwId=bfe6ea39c92052273ayrch} 2024-05-17 18:43:40.112 [TRACE] [.internal.local.handlers.TuyaEncoder] - bfe6ea39c92052273ayrch/10.10.23.27:6668: Sending encoded '000055AA0000001400000009000000817B226465764964223A2262666536656133396339323035323237336179726368222C22756964223A2262666536656133396339323035323237336179726368222C2274223A313731353936343232302C22647073223A22222C2267774964223A2262666536656133396339323035323237336179726368227D4B3E5F1B0000AA55' 2024-05-17 18:43:40.116 [TRACE] [.internal.local.handlers.TuyaDecoder] - bfe6ea39c92052273ayrch/10.10.23.27:6668: Received encoded '000055AA00000000000000090000000C00000000B051AB030000AA55' 2024-05-17 18:43:40.116 [TRACE] [.internal.local.handlers.TuyaDecoder] - bfe6ea39c92052273ayrch/10.10.23.27:6668: Decoded raw payload: 2024-05-17 18:43:40.116 [DEBUG] [.internal.local.handlers.TuyaDecoder] - bfe6ea39c92052273ayrch/10.10.23.27:6668: Received MessageWrapper{commandType=HEART_BEAT, content='[B@6a27a953'} 2024-05-17 18:43:40.116 [TRACE] [rnal.local.handlers.HeartbeatHandler] - bfe6ea39c92052273ayrch/10.10.23.27:6668: Received pong

Copy link

stale bot commented Jul 13, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale An issue is marked stale after four weeks without activity and will be closed one week later. label Jul 13, 2024
@stale stale bot closed this as completed Jul 26, 2024
@J-N-K J-N-K reopened this Jul 26, 2024
@stale stale bot removed the stale An issue is marked stale after four weeks without activity and will be closed one week later. label Jul 26, 2024
Copy link

stale bot commented Sep 21, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale An issue is marked stale after four weeks without activity and will be closed one week later. label Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale An issue is marked stale after four weeks without activity and will be closed one week later.
Projects
None yet
Development

No branches or pull requests

2 participants