TuyaAPI / cloud

🌨 🎁 A NodeJS wrapper for Tuya's cloud API. Documentation: https://tuyaapi.github.io/cloud/.
MIT License
32 stars 15 forks source link

Recieving "SING_VALIDATE_FALED_4" error #2

Closed Arunbalajik closed 5 years ago

Arunbalajik commented 5 years ago

File I run : const apiKeys = require('./keys.json'); const Cloud = require('./index.1.js'); const is = require('is'); const api = new Cloud({key: apiKeys.key, secret: apiKeys.secret}); const apiResult = api.login({email: 'arunbalajik47@gmail.com', password: 'March121998'});

Error I get on Compilation: (node:10648) UnhandledPromiseRejectionWarning: Error: Parameter or Data Error at TuyaCloud.request (C:\Users\ArunMK\Desktop\Pro\cloud-master\index.js:176:13) at at process._tickCallback (internal/process/next_tick.js:188:7) (node:10648) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:10648) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

By using various console.log() between codes: Sending parameters: { a: 'tuya.m.user.email.password.login', deviceId: 'm5eb1dokbs3pqdew1v2u4ugfcn1zuuicplfp73os8b3d', os: 'Linux', lang: 'en', v: '1.0', clientId: '8ma9sqfcdn94sjvtx48q', time: 1551026789, postData: '{"countryCode":"AZ","email":"arunbalajik47@gmail.com","passwd":"edaba93167f75d31a2efd2bea4653cdf"}', sign: 'fa3e98bbb76473a0570ea4bc731436e6' } Received response: {"t":1551026796259,"success":false,"errorCode":"SING_VALIDATE_FALED_4","status":"error","errorMsg":"Parameter or Data Error"}

Err: Error: Parameter or Data Error LoginErrorError: Parameter or Data Error (node:12340) UnhandledPromiseRejectionWarning: Error: Parameter or Data Error at TuyaCloud.request (C:\Users\ArunMK\Desktop\Pro\cloud-master\index.1.js:181:13) at at process._tickCallback (internal/process/next_tick.js:188:7) (node:12340) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:12340) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

codetheweb commented 5 years ago

Why are you doing require('./index.1.js') instead of require('@tuyapi/cloud')?

Please post the output of DEBUG=* node yourscript.js.

codetheweb commented 5 years ago

Closing this because of inactivity.

Feel free to reopen if you're still seeing issues.