-
-
Notifications
You must be signed in to change notification settings - Fork 331
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
Setup using CLI-Wizard is throwing an error #48
Comments
Sorry about that. I think what's happening is that the CLI library I'm using is typecasting it to a Number rather than the expected String. As the number's larger than 64 (maximum allowed length), it then fails the validity test.
I'll take a closer look tonight.
… On Aug 9, 2018, at 22:38, kirkbrownOK ***@***.***> wrote:
This work is most impressive. Unfortunately for me I'm having an issue with the SETUP process. I got my API Key and Secret from tuya. Then I attempted the CLI WIZARD steps provided. My wifi password is a 10 digit string and as a result, I believe it is failing a password validity check. This is the error message I get.
[21:51:50] ***@***.***:/etc/openhab2/scripts$ tuya-cli link-wizard
? Make the indicator light on your device flash.
For most devices, this means holding down the main button.
Press return when it's blinking. Yes
? What's your WiFi called? skittles
? What's the password for your WiFi? [hidden]
? How many devices do you want to link? 1
? Do you want to save devices that are successfully linked? Yes
✖ Device(s) failed to be registered!
Error: Invalid WiFi password
at TuyaLink.registerSmartLink ***@***.******@***.***/link/lib/link.js:64:11)
at TuyaLinkWizard.linkDevice ***@***.******@***.***/link/index.js:93:23)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@kirkbrownOK should be working now. Update the CLI tool with |
As there hasn't been any activity in the last 18 days on this, I'm closing it. Feel free to re-open it @kirkbrownOK if you're still having problems. |
Hi Appreciate your help in resolving the below issue.
/etc/openhab2/scripts/node_modules/node-forge/lib/aes.js:203 TypeError: tmp.length is not a function Also wanted to let you know that when I am trying to connect to the device through link wizard, it is throwing an error.
Make the indicator light on your device flash. Device(s) failed to be registered! |
Two things:
|
@codetheweb TypeError: tmp.length is not a function Note : I retrieve the ID of a smart plug from tuya app installed in my phone. Is there any other way to fetch the ID. I tried tuya-cli link-wizard but it did not work. |
@RR2301 that looks like the right ID but still the wrong format for the key. Try following this guide to get the ID and key. |
I already tried following the guide several times but landing at the same place :(. Moreover ' $tuya-cli list-app ' command doesn't return anything.
Also, I wanted to know - I already have got the key pair from tuya and I can pull the device ID from TUya app on smart phone. What else I am missing.
can there be a simple way to resolve the issue? 'sudo tuya-cli link-wizard' is faling almost all the time. There much be something wrong with an environment.
Sent from Outlook<http://aka.ms/weboutlook>
…________________________________
From: Max Isom <notifications@github.com>
Sent: Thursday, October 25, 2018 8:06 AM
To: codetheweb/tuyapi
Cc: RR2301; Mention
Subject: Re: [codetheweb/tuyapi] Setup using CLI-Wizard is throwing an error (#48)
@RR2301<https://github.com/RR2301> that looks like the right ID but still the wrong format for the key. Try following this guide<https://github.com/codetheweb/tuyapi/blob/master/docs/SETUP.md> to get the ID and key.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#48 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AqERIkDP73evhfBXwCmutLKwgje4Sjixks5uodN9gaJpZM4V3icT>.
|
There's no other way to acquire the IDs and keys other than (a) performing a MITM attack on your phone (what All that to say that you have to follow the guide to get the parameters. What's not working with |
@max
Tuya-cli list app command is working fine. I have also trusted the certificate on my IPhone. I can see the transaction in charles proxy app on my desktop.
[Image]
As you see the screenshot above. ‘Tuya-cli link-wizard’ is not registering the device.
Could you please let me know, if I am missing any step.
Rgds/
Get Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
From: Max Isom <notifications@github.com>
Sent: Thursday, October 25, 2018 12:06 PM
To: codetheweb/tuyapi
Cc: RR2301; Mention
Subject: Re: [codetheweb/tuyapi] Setup using CLI-Wizard is throwing an error (#48)
There's no other way to acquire the IDs and keys other than (a) performing a MITM attack on your phone (whattuya-cli list app and the Android method do) or (b) generating an official linking token using Tuya's API and transmitting it to the device. The first method is relatively easy, the second is not and now costs money after Tuya has updated their API.
All that to say that you have to follow the guide to get the parameters. What's not working withlist-app? Do you have an iPhone? Did you trust the certificate (different than installing the certificate)?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#48 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AqERIlRNhmzHwJqz0N0yWHmZxS_TOiDNks5uogvHgaJpZM4V3icT>.
|
People have been having issues with |
Yes , I am able to get the ApiKey and Api secret
Now how do use this to toggle the switch ON/OFF
As I understood from GIt repository - we have two options
Option 1 : pi@raspberrypi:/etc/openhab2/scripts $ tuya-cli set --id 0120057360019492b55d --key w4duxc9v3vkrsajt8gy7 --set false
Option 2:node njstuya.js -ip xx -id xx OFF butnwhen run the command I get an error tmp.length is not a function
at forge.aes.Algorithm.initialize
Let me know if there are any other option available.
Rgds/Rajeev
Get Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
From: Max Isom <notifications@github.com>
Sent: Friday, October 26, 2018 4:59 AM
To: codetheweb/tuyapi
Cc: RR2301; Mention
Subject: Re: [codetheweb/tuyapi] Setup using CLI-Wizard is throwing an error (#48)
People have been having issues with link-wizard. If the list-app command is working, you should be able to get your parameters from that. If not, you said you can see traffic in Charles so I'd advise looking through those requests to get the ID and key.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#48 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AqERIuwL69IMmrBn2iDuSUh4l2WsR0PKks5uovkdgaJpZM4V3icT>.
|
Does the The other option would be to write your own script file in NodeJS using TuyAPI. |
Yes I tried tuya-cli set got an error.
'
pi@raspberrypi:/etc/openhab2/scripts $ sudo tuya-cli set --id 0120057360019492b55d --key w4duxc9v3vkrsajt8gy7 --set false
'
Please find the error response below.
usr/local/lib/node_modules/@tuyapi/cli/node_modules/node-forge/lib/aes.js:203
var len = tmp.length();
^
TypeError: tmp.length is not a function
at forge.aes.Algorithm.initialize (/usr/local/lib/node_modules/@tuyapi/cli/node_modules/node-forge/lib/aes.js:203:19)
at new forge.cipher.BlockCipher (/usr/local/lib/node_modules/@tuyapi/cli/node_modules/node-forge/lib/cipher.js:118:18)
at Object.forge.cipher.createCipher (/usr/local/lib/node_modules/@tuyapi/cli/node_modules/node-forge/lib/cipher.js:42:10)
at new TuyaCipher (/usr/local/lib/node_modules/@tuyapi/cli/node_modules/tuyapi/lib/cipher.js:13:30)
at new TuyaDevice (/usr/local/lib/node_modules/@tuyapi/cli/node_modules/tuyapi/index.js:43:24)
at parseConfig (/usr/local/lib/node_modules/@tuyapi/cli/lib/control.js:24:10)
at Object.set (/usr/local/lib/node_modules/@tuyapi/cli/lib/control.js:50:15)
at Command.program.command.description.option.option.option.option.option.action.options (/usr/local/lib/node_modules/@tuyapi/cli/cli.js:59:11)
at Command.listener (/usr/local/lib/node_modules/@tuyapi/cli/node_modules/commander/index.js:315:8)
at Command.emit (events.js:182:13)
Sent from Outlook<http://aka.ms/weboutlook>
…________________________________
From: Max Isom <notifications@github.com>
Sent: Saturday, October 27, 2018 8:32 AM
To: codetheweb/tuyapi
Cc: RR2301; Mention
Subject: Re: [codetheweb/tuyapi] Setup using CLI-Wizard is throwing an error (#48)
Does the tuya-cli set work? You can do --set false and --set true to respectively turn your device off and on.
The other option would be to write your own script file in NodeJS using TuyAPI.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#48 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AqERIqDj3BGRX5Sp1om_mn7B5my-AeeIks5upHx2gaJpZM4V3icT>.
|
Hmm, your ID looks good but the key still looks too long (should be 16 characters). Could you post a link to the device that you bought? And how did you get those parameters? Also, please make sure that your Node version is >=6.0.0. You can check with |
Here is he link the smart plug I bought from amazon.
https://www.amazon.com/MartinJerry-Compatible-Devices-required-installation/dp/B071Z94F4F
Rgds/Rajee
Get Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
From: Max Isom <notifications@github.com>
Sent: Monday, October 29, 2018 7:32 AM
To: codetheweb/tuyapi
Cc: RR2301; Mention
Subject: Re: [codetheweb/tuyapi] Setup using CLI-Wizard is throwing an error (#48)
Hmm, your ID looks good but the key still looks too long (should be 16 characters). Could you post a link to the device that you bought? And how did you get those parameters?
Also, please make sure that your Node version is >=6.0.0. You can check with node -v.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#48 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AqERIiEoaX8id-rQA5fMtVfa7ylETW9Zks5upxFogaJpZM4V3icT>.
|
Your device looks fine, I have a very similar one. Can you please check your Node version? Did you get the above parameters with |
Here is the node version
pi@raspberrypi:/etc/openhab2/scripts $ node -v
v11.0.0
tuya-cli list-app return no value however tuya-cli list throw below result.
'
pi@raspberrypi:/etc/openhab2/scripts $ tuya-cli list-app
pi@raspberrypi:/etc/openhab2/scripts $ tuya-cli list
{ apiKey: 'w4duxc9v3vkrsajt8gy7',
apiSecret:
'4j5jkjxrtd87v75dwparnx35ygcu87m84j5jkjxrtd87v75dwparnx35ygcu87m84j5jkjxrtd87v75dwparnx35ygcu87m8' }
'
Sent from Outlook<http://aka.ms/weboutlook>
…________________________________
From: Max Isom <notifications@github.com>
Sent: Tuesday, October 30, 2018 8:13 AM
To: codetheweb/tuyapi
Cc: RR2301; Mention
Subject: Re: [codetheweb/tuyapi] Setup using CLI-Wizard is throwing an error (#48)
Your device looks fine, I have a very similar one. Can you please check your Node version? Did you get the above parameters with tuya-cli list-app?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#48 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AqERIscU2tdtIJ-D7umP9h9Hf5Xqg0RWks5uqGyJgaJpZM4V3icT>.
|
The Do you have an iOS or Android smartphone? |
Yes , I have apple IOS phone. I have TuyaSmart app installed on my phone and connected to all smart switch.
Get Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
From: Max Isom <notifications@github.com>
Sent: Wednesday, October 31, 2018 6:58 AM
To: codetheweb/tuyapi
Cc: RR2301; Mention
Subject: Re: [codetheweb/tuyapi] Setup using CLI-Wizard is throwing an error (#48)
The list command just outputs saved API keys and device parameters.
Do you have an iOS or Android smartphone?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#48 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AqERIn2aViD37V5pGtprn-4gE3Xf6yTjks5uqayAgaJpZM4V3icT>.
|
Hi please find the additional details. I tried running both the proxies. Tuya—Cli list-app and Charles.
I got the traffic response only in Charles. Attaching the screenshot for your reference. I couldn’t able to find the tuya Key details. Am I doing any thing wrong?
[Image]
Get Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
From: Rajeev Ranjan <rajeev.ranjan2301@outlook.com>
Sent: Wednesday, October 31, 2018 9:23:59 PM
To: codetheweb/tuyapi; codetheweb/tuyapi
Cc: Mention
Subject: Re: [codetheweb/tuyapi] Setup using CLI-Wizard is throwing an error (#48)
Yes , I have apple IOS phone. I have TuyaSmart app installed on my phone and connected to all smart switch.
Get Outlook for iOS<https://aka.ms/o0ukef>
________________________________
From: Max Isom <notifications@github.com>
Sent: Wednesday, October 31, 2018 6:58 AM
To: codetheweb/tuyapi
Cc: RR2301; Mention
Subject: Re: [codetheweb/tuyapi] Setup using CLI-Wizard is throwing an error (#48)
The list command just outputs saved API keys and device parameters.
Do you have an iOS or Android smartphone?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#48 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AqERIn2aViD37V5pGtprn-4gE3Xf6yTjks5uqayAgaJpZM4V3icT>.
|
It looks like it's only capturing the CONNECT requests for some reason, not actual traffic. Did you trust the certificate? |
This work is most impressive. Unfortunately for me I'm having an issue with the SETUP process. I got my API Key and Secret from tuya. Then I attempted the CLI WIZARD steps provided. My wifi password is a 10 digit string and as a result, I believe it is failing a password validity check. This is the error message I get.
[21:51:50] openhabian@openHABianPi:/etc/openhab2/scripts$ tuya-cli link-wizard
? Make the indicator light on your device flash.
For most devices, this means holding down the main button.
Press return when it's blinking. Yes
? What's your WiFi called? skittles
? What's the password for your WiFi? [hidden]
? How many devices do you want to link? 1
? Do you want to save devices that are successfully linked? Yes
✖ Device(s) failed to be registered!
Error: Invalid WiFi password
at TuyaLink.registerSmartLink (/usr/lib/node_modules/@tuyapi/cli/node_modules/@tuyapi/link/lib/link.js:64:11)
at TuyaLinkWizard.linkDevice (/usr/lib/node_modules/@tuyapi/cli/node_modules/@tuyapi/link/index.js:93:23)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
The text was updated successfully, but these errors were encountered: