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

Tuya IoT Platform Service IoT Core expired: Battery devices are not synced any more #502

Closed
Ilovegym66 opened this issue Dec 28, 2022 · 13 comments
Labels
fixed-unreleased question Further information is requested

Comments

@Ilovegym66
Copy link

since Version 3.9.x my battery devices T&H 1-5 are not AUTO synced any more, only if I restart the Adapter and set in the config the renew-flag for the credentials, than after the complete sync, are the objects updated.

My setup in the Config:
image

image

image

from 12.11.22 it work fine:
image

from 17,12,22 updated only if I restart the adapter:
image

any hints for me? :)

@Apollon77
Copy link
Owner

not without a debug log ... in fact battery devices can only be updated when using the MQTT connection with the iot cloud from tuya, right? Did you checked there that this has not expotred? It needs to prolonged from time to time. Nothing was changed in 3.9.3 in this regard

Does older versions still work or also not?

@Apollon77 Apollon77 added the question Further information is requested label Dec 28, 2022
@Ilovegym66
Copy link
Author

I monitor the devices and check the logfiles, so far I can see the connection of the wifi battery devices... there are sometimes online.. looks like the temp is changing.. need time to check everything..

@Apollon77
Copy link
Owner

Ok, normally - as in the past, battery devices are not long online to save battery and so the adapter needs to have big luck to get a connection, so getting the values from the cloud via polling is the one solution ... but also this shoukd still work ... if not as said ... full debug log please long enought that local and cloud pollssing intervals are in theat 2-3 times minimum

@Ilovegym66
Copy link
Author

debuglog, logged 16:58 to 17:06:
tuyadebug.log

@Apollon77
Copy link
Owner

Strange ...Bei Dir scheint das ganze App Cloud zeug nicht zu tun. Kannst Du doch noch vom Heim-WLAN ins die App einloggen? und das tut?
Resette mal die App-Cloud-ession (ist eine checkbox im Adapter, dann speichern, restart abwarten). tut das dann?

Sonst versuch mal ein "curl -v https://a1.tuyacn.com/api.json" an der kommandozeile und piste ergebnis bitte

@Ilovegym66
Copy link
Author

Hi, ja, iobroker hat zugriff und kann auch vom Handy mit der App im gleichen Wlan einloggen, ohne Probleme.

Habe wieder ein Debug-log gestartet, um 9.58 umgeschaltet von Info auf Debug, da hat er auch Daten aus der Cloud geholt ( habs am Temp-Verlauf in Grafana gleich gesehen, da sich die Werte stark geaendert haben), dann gewartet und um 10:07 dann mal die App-Cloud-Session resettet.

Hier das Debug-log:
tuyadebug.log

Hier das Ergebnis von dem Curl:
`
ilovegym@iobrokerS /opt/iobroker $ curl -v https://a1.tuyacn.com/api.json

  • Trying 121.5.96.158:443...
  • Connected to a1.tuyacn.com (121.5.96.158) port 443 (#0)
  • ALPN, offering h2
  • ALPN, offering http/1.1
  • successfully set certificate verify locations:
  • CAfile: /etc/ssl/certs/ca-certificates.crt
  • CApath: /etc/ssl/certs
  • TLSv1.3 (OUT), TLS handshake, Client hello (1):
  • TLSv1.3 (IN), TLS handshake, Server hello (2):
  • TLSv1.2 (IN), TLS handshake, Certificate (11):
  • TLSv1.2 (IN), TLS handshake, Server key exchange (12):
  • TLSv1.2 (IN), TLS handshake, Server finished (14):
  • TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
  • TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
  • TLSv1.2 (OUT), TLS handshake, Finished (20):
  • TLSv1.2 (IN), TLS handshake, Finished (20):
  • SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
  • ALPN, server accepted to use h2
  • Server certificate:
  • subject: CN=*.tuyacn.com
  • start date: Aug 22 03:19:29 2022 GMT
  • expire date: Sep 23 03:19:29 2023 GMT
  • subjectAltName: host "a1.tuyacn.com" matched cert's "*.tuyacn.com"
  • issuer: C=US; ST=Arizona; L=Scottsdale; O=GoDaddy.com, Inc.; OU=http://certs.godaddy.com/repository/; CN=Go Daddy Secure Certificate Authority - G2
  • SSL certificate verify ok.
  • Using HTTP2, server supports multi-use
  • Connection state changed (HTTP/2 confirmed)
  • Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
  • Using Stream ID: 1 (easy handle 0x55f522f252c0)

GET /api.json HTTP/2
Host: a1.tuyacn.com
user-agent: curl/7.74.0
accept: /

  • Connection state changed (MAX_CONCURRENT_STREAMS == 128)!
    < HTTP/2 200
    < date: Thu, 29 Dec 2022 09:13:05 GMT
    < content-type: application/json;charset=UTF-8
    < content-length: 112
    < x-request-id: f37fd88aa92646009f1d47c0c73dac3b
    < server: https
    <
    {"errorCode":"API_OR_API_VERSION_WRONG","success":false,"status":"error","errorMsg":"API or API version error"}
  • Connection #0 to host a1.tuyacn.com left intact
    ilovegym@iobrokerS /opt/iobroker $

`

@Apollon77
Copy link
Owner

Also "nach app cloud reset" ist in deinem log nicht drin, das endet 10:07 ... danach müsste adapter restarted haben.

Sonst nimm mal bitte GitHub version ... da ist mehr logging drin

@Ilovegym66
Copy link
Author

debuglog:
tuyadebug.log

@Ilovegym66
Copy link
Author

tuyadebug.log

@Ilovegym66
Copy link
Author

so, hier jetzt nochmal:
tuyadebug.log

@Apollon77
Copy link
Owner

Issue was expired Tuya IoT Cloud service ... I added a fallback cloud polling

@seers84
Copy link

seers84 commented Dec 29, 2022

I think I have the same problem.
Plugged devices are working fine.
The batterie things don't sync.

One question: is this necessary to extend? How long I have to wait?

image

@Apollon77
Copy link
Owner

One question: is this necessary to extend? How long I have to wait?

es you have to, no idea how long you need to wait ... Hopefully not that long?

You can also try the GitHub version/3.12.0 (Beta) which is doing a "app cloud polling fallback" when no mqtt updates were received

@Apollon77 Apollon77 changed the title Battery devices are not synced any more Tuya IoT Platform Service IoT Core expired: Battery devices are not synced any more Dec 29, 2022
@Apollon77 Apollon77 pinned this issue Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed-unreleased question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants