GithubHelp home page GithubHelp logo

devid not found on v3.4 Gateway about tuyapi HOT 11 OPEN

mjpoo avatar mjpoo commented on June 16, 2024
devid not found on v3.4 Gateway

from tuyapi.

Comments (11)

Apollon77 avatar Apollon77 commented on June 16, 2024

Please run with "DEBUG=Tuyapi* node ..." and provide a full log

from tuyapi.

mjpoo avatar mjpoo commented on June 16, 2024

Sure thing @Apollon77

Here are the logs. It's interesting to see that the payload.version is 3.3 even though I'm feeding it version 3.4

  TuyAPI Finding missing IP undefined or ID abc +0ms
  TuyAPI Received UDP message. +1s
  TuyAPI UDP data: +7ms
  TuyAPI {
  TuyAPI   payload: {
  TuyAPI     ip: '192.168.999.999',
  TuyAPI     gwId: 'abc',
  TuyAPI     active: 2,
  TuyAPI     ablilty: 0,
  TuyAPI     encrypt: true,
  TuyAPI     productKey: 'xyz',
  TuyAPI     version: '3.3',
  TuyAPI     token: true
  TuyAPI   },
  TuyAPI   leftover: false,
  TuyAPI   commandByte: 19,
  TuyAPI   sequenceN: 0
  TuyAPI } +1ms
  TuyAPI Connecting to 192.168.999.999... +18ms
  TuyAPI Socket connected. +11ms
Connected to Silvercrest
  TuyAPI GET Payload: +4ms
  TuyAPI {
  TuyAPI   gwId: 'abc',
  TuyAPI   devId: 'abc',
  TuyAPI   t: '1669285486',
  TuyAPI   dps: {},
  TuyAPI   uid: 'abc'
  TuyAPI } +0ms
  TuyAPI Received data: XXX +13ms
  TuyAPI Parsed: +2ms
  TuyAPI {
  TuyAPI   payload: 'devid not found',
  TuyAPI   leftover: false,
  TuyAPI   commandByte: 10,
  TuyAPI   sequenceN: 1
  TuyAPI } +2ms
  TuyAPI Received DATA packet +3ms
  TuyAPI data: 10 : "devid not found" +1ms

The log is obfuscations are:

  • abc = device ID
  • xyz = device key
  • 192.168.999.999 = gateway IP
  • XXX = data

from tuyapi.

Apollon77 avatar Apollon77 commented on June 16, 2024

Cna you show your code please?

from tuyapi.

Apollon77 avatar Apollon77 commented on June 16, 2024

BTW: In fcat the version tag from the UDP message wins against whatever you initially set in the constructor because UDP is "devicee self declaration".

Do you have the localkey ?

from tuyapi.

mjpoo avatar mjpoo commented on June 16, 2024

Cna you show your code please?

I am using the boilerplate Asynchronous Basic Usage example code and, yes, I'm using the local device key (xyz in my obfuscated example). I am able to get the childIDs from the gateway as a result. I just thought it would be useful to know about this error message being returned in the data.

from tuyapi.

Apollon77 avatar Apollon77 commented on June 16, 2024

I guess the error goes away if you use issueGetOnConnect = false in the constructor options. By default 8as per docs) it tries to issue a get after connect biut if this is a gateway then mpst likel ythere are no data to get on the gateway.

from tuyapi.

mjpoo avatar mjpoo commented on June 16, 2024

Yes, if I specify issueGetOnConnect: false then the error goes away but I don't get the child data that I get otherwise (because it is not listening for data because of the flag).

I have no problem but the devid not found message will be confusing to others as it makes it sound as if the gateway could not be found when in fact it is connected and supplying child data.

from tuyapi.

Apollon77 avatar Apollon77 commented on June 16, 2024

What you mean with "getting child data"? I do not see anything in the debug log above and the error is the respinse to the GET call

from tuyapi.

mjpoo avatar mjpoo commented on June 16, 2024

What you mean with "getting child data"? I do not see anything in the debug log above and the error is the respinse to the GET call

I was referring to being able to get the data from the child devices using a gateway.get (despite the devid not found message).

from tuyapi.

Apollon77 avatar Apollon77 commented on June 16, 2024

The topic is the following: the "default get" can only use the main device id and sets that as gwid and as devId as it is in defaulz.

If you do a manual get you are free to set gwId and devId differently to get the real data - but the "automatic get on connect" can not handle that because it do not have the information. So simply use that flag and do a manual get after connect ith the correct parameters

from tuyapi.

mjpoo avatar mjpoo commented on June 16, 2024

Yes, I get (pardon the pun!) this. The topic of this issue is simply the confusing devid not found message that is returned as data. It did not phase me but others might find it confusing and so either documenting it or handling it for them (as you were previously) may be helpful.

index.js:171

data === 'json obj data unvalid' || data === 'data format error' /* || data === 'devid not found' */

from tuyapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.