tuyapi icon indicating copy to clipboard operation
tuyapi copied to clipboard

Device registered and Failed at the same time

Open imPDA opened this issue 4 years ago • 10 comments

Hello !

Im trying to get local key for Girier smart plug, I have done everything according to description, I have even linked device via console. Is says that device is registered, and in the next string, device failed to be registerd. However it looks like this smart plug linked, it is in the list of devices on Tuya website.

1 2

What have I done wrong? API key, secret, schema double and triple cheked, it is OK. What should I do next? Thank you in advance!

imPDA avatar Jul 21 '21 12:07 imPDA

I just recently fixed the signing error. Please update @tuyapi/cli to v1.17.2 and try again.

codetheweb avatar Jul 22 '21 02:07 codetheweb

Thanks for fast reply! Everything I have already done were with 1.17.2 I believe. Without update I could do nothing. Should I reinstall it from scratch? 3

imPDA avatar Jul 22 '21 11:07 imPDA

That's odd, because in the screenshot it shows an error from OpenAPI (the old package that I replaced).

I'd try removing and reinstalling @tuyapi/cli just to make sure everything is up to date.

codetheweb avatar Jul 22 '21 23:07 codetheweb

Same Issue here. ✔ Device(s) registered! ✖ Device(s) failed to be registered! Error: sign invalid at OpenAPI._client.got_1.default.extend.hooks.afterResponse (/usr/local/lib/node_modules/@tuyapi/cli/node_modules/@tuyapi/openapi/dist/api.js:74:31) at EventEmitter.<anonymous> (/usr/local/lib/node_modules/@tuyapi/cli/node_modules/got/dist/source/as-promise.js:87:38) at processTicksAndRejections (internal/process/task_queues.js:89:5) version is 1.17.2

okrulik avatar Aug 04 '21 23:08 okrulik

Did you try removing and reinstalling @tuyapi/cli to make sure the sub-dependencies were updated? (Shouldn't be necessary, but again not sure what else could be going on. v0.3.4 of @tuyapi/link which @tuyapi/[email protected] depends on doesn't even reference OpenAPI as a dependency.)

@imPDA were you able to get it working?

codetheweb avatar Aug 06 '21 00:08 codetheweb

Unfortunately, not. Still get the same error. But it actually does something - if you compare previous output and current output:

image

And as I mentioned above, It do registered in Tuya Cloud Project after this error:

√ Device(s) registered!
× Device(s) failed to be registered!
Error: sign invalid
    at OpenAPI._client.got_1.default.extend.hooks.afterResponse (C:\Users\dimax\AppData\Roaming\npm\node_modules\@tuyapi\cli\node_modules\@tuyapi\openapi\dist\api.js:74:31)
    at EventEmitter.<anonymous> (C:\Users\dimax\AppData\Roaming\npm\node_modules\@tuyapi\cli\node_modules\got\dist\source\as-promise.js:87:38)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

Cai local key be obtained only via this register process?

imPDA avatar Aug 06 '21 05:08 imPDA

That output looks really strange as well.

Are you able to try inside a virtual machine so cached dependencies and anything else wouldn't affect it?

You can also get keys with tuya-cli wizard.

codetheweb avatar Aug 06 '21 23:08 codetheweb

Thank you! Tuya-cli wizard has worked as a charm. So device actually registered and this "Fail" looks like some bug - it displayed regardless of the final result.

Unfortunatelly, I have no opportunity to test it in VM at the moment.

imPDA avatar Aug 07 '21 19:08 imPDA

I have the same error here. I can't use the wizard, since it needs the virtual ID of a device, and I'm trying to configure my first device.

ghost avatar Nov 28 '21 17:11 ghost

@galvaof

All devices that you want to use must be registered in either the Tuya Smart app or the Smart Life app.

codetheweb avatar Nov 29 '21 00:11 codetheweb