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

Permission Deny error #13

Open
mjpoo opened this issue Oct 26, 2022 · 5 comments
Open

Permission Deny error #13

mjpoo opened this issue Oct 26, 2022 · 5 comments

Comments

@mjpoo
Copy link

mjpoo commented Oct 26, 2022

When I try to connect to the Central Europe server to get the device as per the "getting started" code I get a 1106 permission deny error. The gateway device that I am trying to connect to has "Read, write, and Manage" permissions.

import { TuyaContext  } from '@tuya/tuya-connector-nodejs';

const tuya = new TuyaContext({
  baseUrl: 'https://openapi.tuyaeu.com',
  accessKey: process.env['ACCESSID'],
  secretKey: process.env['ACCESSSECRET'],
});

export const getDevice = async () => {
    const device = await tuya.device.detail({
      device_id: process.env['DEVICEID']
    });
}
@mjpoo
Copy link
Author

mjpoo commented Nov 4, 2022

After some digging in the node_module I think this is caused by /iot-o3 being included in the EU (and other locales?) paths.

@nostalgie
Copy link

Same problem. Solution for me - call API via context.request

Really, no one nodejs library for Tuya not working as described.

@magisystem0408
Copy link

same problem. not working
raise permission error

> [email protected] dev
> ts-node main.ts

{
  code: 1106,
  msg: 'permission deny',
  success: false,
  t: 1717465595107,
  tid: '46xxxxxxxx'
}

@magisystem0408
Copy link

magisystem0408 commented Jun 4, 2024

@funnybunnyQAQ

also offical postman request sample is not working.

https://developer.tuya.com/en/docs/iot/set-up-postman-environment?id=Ka7o385w1svns

@Evenshen1202
Copy link

same problem. not working raise permission error

> [email protected] dev
> ts-node main.ts

{
  code: 1106,
  msg: 'permission deny',
  success: false,
  t: 1717465595107,
  tid: '46xxxxxxxx'
}

Data centers have rules, and they belong to the data center according to the user's country code.
For specific country codes corresponding to data centers, please refer to: https://developer.tuya.com/en/docs/iot/oem-app-data-center-distributed?id=Kafi0ku9l07qb

Japan belongs to the US West data center, please modify it to: baseUrl: 'https://openapi.tuyaus.com',
If you have any other questions, please get Tech support on the IoT platform:https://service.console.tuya.com/8/3/list?source=support_center

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants