codetheweb / tuyapi

šŸŒ§ An easy-to-use API for devices that use Tuya's cloud services. Documentation: https://codetheweb.github.io/tuyapi.
MIT License
2.04k stars 332 forks source link

Cross Region access not allowed #574

Open gogreenpower opened 2 years ago

gogreenpower commented 2 years ago

Describe the bug Following the guide results in an error:

āœ– Device(s) failed to be registered! Error: your ip(XXX.XXX.XXX.XXX) cross-region access is not allowed at OpenAPI._client.got_1.default.extend.hooks.afterResponse.response (/usr/local/lib/node_modules/@tuyapi/cli/node_modules/@tuyapi/link/node_modules/@tuyapi/openapi/dist/api.js:68:31) at EventEmitter.emitter.on (/usr/local/lib/node_modules/@tuyapi/cli/node_modules/got/dist/source/as-promise.js:87:38) at process._tickCallback (internal/process/next_tick.js:68:7)

To Reproduce

on step 7:

On the command line, run tuya-cli link --api-key --api-secret --schema <your schema/Channel ID> --ssid --password --region us. For the region parameter, choose the two-letter country code from us, eu, and cn that is geographically closest to you.

Expected behavior My tuya device to be linked.

Debug Output āœ– Device(s) failed to be registered! Error: your ip(XXX.XXX.XXX.XXX) cross-region access is not allowed at OpenAPI._client.got_1.default.extend.hooks.afterResponse.response (/usr/local/lib/node_modules/@tuyapi/cli/node_modules/@tuyapi/link/node_modules/@tuyapi/openapi/dist/api.js:68:31) at EventEmitter.emitter.on (/usr/local/lib/node_modules/@tuyapi/cli/node_modules/got/dist/source/as-promise.js:87:38) at process._tickCallback (internal/process/next_tick.js:68:7)

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.