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] [TuyaOpenAPI] Network error: . Retrying... #508

Open
2 tasks done
bunbunpig opened this issue Nov 17, 2024 · 44 comments
Open
2 tasks done

[Tuya] [TuyaOpenAPI] Network error: . Retrying... #508

bunbunpig opened this issue Nov 17, 2024 · 44 comments
Labels
login issue Failed to login Tuya Cloud

Comments

@bunbunpig
Copy link

Prerequisite

  • Yes

Accounts

  • Yes

Country Code

1

Region Code

AZ (West US)

Logs

[18/11/2024, 2:00:40 am] [Tuya] Child bridge process ended
[18/11/2024, 2:00:40 am] [Tuya] Process Ended. Code: 1, Signal: null
[18/11/2024, 2:00:47 am] [Tuya] Restarting Process...
[18/11/2024, 2:00:48 am] [Tuya] Launched child bridge with PID 150945
[18/11/2024, 2:00:49 am] Registering platform '@0x5e/homebridge-tuya-platform.TuyaPlatform'
[18/11/2024, 2:00:49 am] [Tuya] Loaded @0x5e/homebridge-tuya-platform v1.7.0-beta.54 child bridge successfully
[18/11/2024, 2:00:49 am] Loaded 18 cached accessories from cachedAccessories.0E5E91BC96A1.
[18/11/2024, 2:00:49 am] [Tuya] Loading accessory from cache: Zigbee无线网关
[18/11/2024, 2:00:49 am] [Tuya] Loading accessory from cache: 人体红外传感器
[18/11/2024, 2:00:49 am] [Tuya] Loading accessory from cache: 廳燈
[18/11/2024, 2:00:49 am] [Tuya] Loading accessory from cache: 四鍵無線情景開關(Zigbee)
[18/11/2024, 2:00:49 am] [Tuya] Loading accessory from cache: WifiSmartLock
[18/11/2024, 2:00:49 am] [Tuya] Loading accessory from cache: 萬用IR遙控器 2
[18/11/2024, 2:00:49 am] [Tuya] Loading accessory from cache: Zigbee中繼器
[18/11/2024, 2:00:49 am] [Tuya] Loading accessory from cache: 萬用IR遙控器
[18/11/2024, 2:00:49 am] [Tuya] Loading accessory from cache: 廚房燈
[18/11/2024, 2:00:49 am] [Tuya] Loading accessory from cache: 六键无线开关-Zigbee
[18/11/2024, 2:00:49 am] [Tuya] Loading accessory from cache: SMARTLIGHT
[18/11/2024, 2:00:49 am] [Tuya] Loading accessory from cache: Zigbee门磁
[18/11/2024, 2:00:49 am] [Tuya] Loading accessory from cache: 双键开关
[18/11/2024, 2:00:49 am] [Tuya] Loading accessory from cache: 暖爐
[18/11/2024, 2:00:49 am] [Tuya] Loading accessory from cache: Powerful button
[18/11/2024, 2:00:49 am] [Tuya] Loading accessory from cache: 風扇
[18/11/2024, 2:00:49 am] [Tuya] Loading accessory from cache: Living Room Air Condition
[18/11/2024, 2:00:49 am] [Tuya] Loading accessory from cache: Second Air
[18/11/2024, 2:00:49 am] [Tuya] Log in to Tuya Cloud.
[18/11/2024, 2:00:49 am] [Tuya] [TuyaOpenAPI] Login to: https://openapi.tuyaus.com
[18/11/2024, 2:00:49 am] [Tuya] [TuyaOpenAPI] Request:
method = post
endpoint = https://openapi.tuyaus.com
path = /v1.0/iot-01/associated-users/actions/authorized-login
query = null
headers = {
  "t": "1731866449666",
  "client_id": "********************",
  "nonce": "cad744cb-5499-4955-b721-a4f74a7502b9",
  "Signature-Headers": "client_id",
  "sign": "F347E39686E3CA429AF4B691DCFEF4D1FFE9885D432D5A71AFE7EE26483FD0F1",
  "sign_method": "HMAC-SHA256",
  "access_token": "",
  "lang": "en",
  "dev_lang": "javascript",
  "dev_channel": "homebridge",
  "devVersion": "1.7.0-beta.54"
}
body = {
  "country_code": 1,
  "username": "********@****.com",
  "password": "****************************",
  "schema": "tuyaSmart"
}
[18/11/2024, 2:00:49 am] Homebridge v1.8.5 (HAP v0.12.3) (Tuya) is running on port 38948.
[18/11/2024, 2:00:49 am] 

NOTICE TO USERS AND PLUGIN DEVELOPERS
> Homebridge 2.0 is on the way and brings some breaking changes to existing plugins.
> Please visit the following link to learn more about the changes and how to prepare:
> https://github.com/homebridge/homebridge/wiki/Updating-To-Homebridge-v2.0

[18/11/2024, 2:00:50 am] [Tuya] [TuyaOpenAPI] Network error: . Retrying...
[18/11/2024, 2:00:51 am] [Tuya] [TuyaOpenAPI] Network error: . Retrying...
[18/11/2024, 2:00:52 am] [Tuya] [TuyaOpenAPI] Network error: . Retrying...
[18/11/2024, 2:00:53 am] [Tuya] [TuyaOpenAPI] Network error: . Retrying...
[18/11/2024, 2:00:55 am] [Tuya] [TuyaOpenAPI] Network error: . Retrying...
[18/11/2024, 2:00:58 am] [Tuya] [TuyaOpenAPI] Network error: . Retrying...
[18/11/2024, 2:01:02 am] [Tuya] [TuyaOpenAPI] Network error: . Retrying...
[18/11/2024, 2:01:09 am] [Tuya] [TuyaOpenAPI] Network error: . Retrying...
[18/11/2024, 2:01:23 am] [Tuya] [TuyaOpenAPI] Network error: . Retrying...
[18/11/2024, 2:01:49 am] [Tuya] [TuyaOpenAPI] Network error: . Retrying...
AggregateError: 
    at internalConnectMultiple (node:net:1118:18)
    at internalConnectMultiple (node:net:1186:5)
    at Timeout.internalConnectMultipleTimeout (node:net:1712:5)
    at listOnTimeout (node:internal/timers:583:11)
    at processTimers (node:internal/timers:519:7)

Other Infomations

No response

@bunbunpig bunbunpig added the login issue Failed to login Tuya Cloud label Nov 17, 2024
@samralck
Copy link

samralck commented Dec 12, 2024

Same issue started for me today. Tried uninstalling, reconfiguring, and no luck.

Central European server, located in aus.

@jadonbaker
Copy link

ping openapi.tuyaeu.com
PING openapi.tuyaeu.com (3.69.78.245): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3
Request timeout for icmp_seq 4
^C
--- openapi.tuyaeu.com ping statistics ---
6 packets transmitted, 0 packets received, 100.0% packet loss

@jadonbaker
Copy link

jadonbaker commented Dec 12, 2024

ping openapi.tuyaus.com
PING openapi.tuyaus.com (44.224.48.198): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3
Request timeout for icmp_seq 4
Request timeout for icmp_seq 5
^C
--- openapi.tuyaus.com ping statistics ---
7 packets transmitted, 0 packets received, 100.0% packet loss

Same for your region

@amybiyuliu
Copy link

Same issue is happening for the EU data center.

@jadonbaker
Copy link

@amybiyuliu have you found any resolution? I tried using a different data center and testing with an incorrect username and password and I'm getting the right authentication failure response. With EU data center there is no network response.

@fuhckos-98
Copy link

fuhckos-98 commented Dec 13, 2024

I read an earlier thread that said this happened to them (months ago) and it was a network issue with Tuya I believe... Unfortunately I think this might be one of those wait for it to sort itself out situations.

#208

@bradleyayers
Copy link

I'm also experiencing this issue, I'm also in Australia.

@chewbanger
Copy link

chewbanger commented Dec 15, 2024

Hey I fixed mine.

I think this is what fixed it… I tried a few things prior to this also. Like updating node js.
I went into the config and disabled IPv6

Goto terminal
Type sudo hb-config
Enter your password
Go in to network menu and edit the wired connection
Disabled IPv6
Restart homebridge server
Type sudo reboot

@fuhckos-98
Copy link

Hey @chewbanger - I just tried this and unfortunately it didn't work for me

@chewbanger
Copy link

Hey @fuhckos-98 damn… before disabling IPV6, i did also update the hb-config tool - it’s one of the menu options in hb-config.

@fuhckos-98
Copy link

Just gave that a try and still didn't work - hopefully something changes soon

@mynameisbrendan
Copy link

Same issue for me has recently started, also located in Australia

@chewbanger
Copy link

Try unlinking your tuya account from the iot project, then link it back again. There restart HB

@fuhckos-98
Copy link

Still not working after trying that, still getting a network error

@mynameisbrendan
Copy link

Try unlinking your tuya account from the iot project, then link it back again. There restart HB

I am not sure where in the Dev Platform i do this? Is it from the project page?

@chewbanger
Copy link

@mynameisbrendan Click on Cloud open your project, click Devices tab, Link App Account.

Mine stopped working for a couple of days, I tried all these things I have mentioned above ... so difficult to tell which particular thing fixed it.

Working now though.

@mynameisbrendan
Copy link

@mynameisbrendan Click on Cloud open your project, click Devices tab, Link App Account.

Mine stopped working for a couple of days, I tried all these things I have mentioned above ... so difficult to tell which particular thing fixed it.

Working now though.

Thanks, unfortunately that hasn't fixed it for me.

@emzpasha
Copy link

emzpasha commented Dec 16, 2024

@chewbanger Disabling IPV6 fixed this discovery for me after I had to restart the whole HB Server, not just the HB service. However, just moments later, it keeps throwing the error again and Hombridge keeps restarting. so, couldn't fix still.

@chewbanger
Copy link

@emzpasha Ah great! Yes, should have clarified, restart whole server not Homebridge service. :)

@bradleyayers
Copy link

Disabling IPv6 worked for me too.

sudo hb-config
# disable IPv6 networking
sudo reboot

@fuhckos-98
Copy link

Thanks, disabling IPv6 has now worked for me. I was only restarting the service not doing a full reboot, I'll report back if anything changes.
I should note that my Homebridge is setup on a RPi with a wireless connection so I needed to change the network settings for my wireless connection, not the wired.

@andrewastley85
Copy link

Disabling IPV6 also fixed this for my setup. I am using an Orangepi Zero (some regrets) but incase anyone else is in the same boat you need to switch the terminal user using the switch user command "su", then use the "nmtui" command to change the netwok settings. Reboot and all is back to normal.

@jadonbaker
Copy link

I've disabled IPv6 and can also confirm that the plugin works again. Make sure you reboot after making the change.
Thank you to everyone in this thread for solving this problem.

@VioletArcade
Copy link

I’m also experiencing this issue on macOS. Should I disable IPv6 in the system settings?

@mynameisbrendan
Copy link

I already had IP6 disabled on my Synology container network when I got this issue. Not sure what action resolved it, but I think it was when I updated the available network interfaces in my Homebridge UI to only the local lan eth0. It may have just been the restart of the synology NAS that resolved it also.

image

@bobsmith523
Copy link

I'm running homebridge on docker and have tried running the container on a network I've created with IPv6 disabled (docker network create --ipv6=false disable_ipv6) but this hasn't seemed to fix the issue. In the UI I can see an IPV6 address is still assigned. Any ideas?

@bunbunpig
Copy link
Author

bunbunpig commented Dec 18, 2024 via email

@mynameisbrendan
Copy link

I'm running homebridge on docker and have tried running the container on a network I've created with IPv6 disabled (docker network create --ipv6=false disable_ipv6) but this hasn't seemed to fix the issue. In the UI I can see an IPV6 address is still assigned. Any ideas?

This is the same setup as me. I went into the setting in my Homebridge UI and selected the network interface I want (it was on auto before) then rebooted my parent docker server. No idea what change fixed it, but its now working. Maybe just try restarting your docker server?

@bobsmith523
Copy link

How did you change the network interface? Is that using hb-config? I tried that but it said command not found.

@mynameisbrendan
Copy link

How did you change the network interface? Is that using hb-config? I tried that but it said command not found.

In the homebridge UI. Settings > Network Interfaces.

@chrisltft
Copy link

chrisltft commented Dec 20, 2024

I am also in Australia, connecting via https://openapi.tuyaeu.com, getting the exact same errors as the OP continuously. I am using docker on hyper-v, it worked fine until a few weeks ago. I have tried everything listed here (except waiting longer) but nothing is working. I am now looking into Tuya alternatives since it is fully dead in the water at this point.

@luxxed
Copy link

luxxed commented Dec 20, 2024

How did you change the network interface? Is that using hb-config? I tried that but it said command not found.

If you're using a raspberry pi, you can change it globally to removed IPv6 which worked for me instantly.

@amybiyuliu
Copy link

I'm running homebridge on a Ubuntu machine, disabling ipv6 worked well for me

@chrisltft
Copy link

Mine is working now too, I am not sure what of the thousand things I did that helped. I removed the plugin, updated as many things in my Hyper-V docker as I could work out how to do, re-installed and re-setup the plugin from scratch. It has nicer icons and stuff now so something has definitely changed.

Then finally I added the following lines to the homebridge web interface: settings -> startup script (inspired by Amy's comment above):

sysctl -w net.ipv6.conf.all.disable_ipv6=1
sysctl -w net.ipv6.conf.default.disable_ipv6=1
sysctl -w net.ipv6.conf.lo.disable_ipv6=1
sysctl -p

Theoretically this should kill any attempt to use ipv6 right where I need it killed. I noticed that Hyper-V kept turning ipv6 back on in its windows network connections vethernet (default switch), no matter how many times I tried to remove it.

Anyway I am happy now. Good luck to everyone else still struggling with this

@slandells
Copy link

Is anyone else having this issue on a Synology? I've tried all of the above suggestions, even completely removed and re-installed Homebridge (I did restore from backup, as I don't want to have to start again)...
I'm still getting the timeouts if "Container Manager" is running... (Synology's Docker)
I've removed IPv6, re-created the Docker network to ensure no IPv6 is available as an option in HomeBridge, but as soon as I run Docker (even with all containers stopped) I get the time outs...
I actually end up with a SIGTERM error and HB restarts and continues to loop...
I think I'll need to report the fault to one of the packages along the way, but wanted to see if anyone had come across this on a Synology, as it's too much of a coincidence that it's happened at the same time...

@micah500
Copy link

I was experiencing this issue from Australia while connecting to the EU server and can confirm that disabling IPv6 via the Ubuntu GUI, followed by a reboot, resolved it.

@GoodPie
Copy link

GoodPie commented Jan 1, 2025

Confirming that disabling IPv6 and rebooting worked. Seems to be an issue for Australians connecting to the EU servers. I was also having issues with the homebridge-ring plugin and that issue was also resolved.

It was down for a few days, starting 22/12/2024 and given the Christmas period, I was just hoping it would resolved itself.

@ckeech
Copy link

ckeech commented Jan 1, 2025

Confirming that disabling IPv6 and rebooting worked. Seems to be an issue for Australians connecting to the EU servers. I was also having issues with the homebridge-ring plugin and that issue was also resolved.

It was down for a few days, starting 22/12/2024 and given the Christmas period, I was just hoping it would resolved itself.

Exactly the same for me. Even thinking after Christmas it might sort itself!

I disabled ipv6 on my router in the ISP settings. It seemed to get it half working. I could turn things on and off using Homekit but I was still getting network errors in the Tuya plugin. After disabling IPv6 on my Ubuntu server, it appears to be fully resolved.

@theouitdenwaal
Copy link

I'm having the same issue, running homebridge in a docker container on a RPI in Australia, which all worked fine until a few weeks ago.

I've disabled ipv6 on both router and RPI (for the wired connection that I am using, as well as the bridge I created for docker to use). After that, the error changed from Network Error into the infamous 1106 (can't authenticate), assuming something has improved, but no succes yet.

Does anyone have a similar setup and found the answer for the network error turned 1106 error? What I've tried:

  1. disable ipv6 on host (RPI) for all interfaces
  2. change Tuya password
  3. create new Tuya project
  4. Triple checked the username, password, country code (61), appSchema is correct, and app account is linked with cloud project in the Tuya config file.

@theouitdenwaal
Copy link

  1. Triple checked the username, password, country code (61), appSchema is correct, and app account is linked with cloud project in the Tuya config file.

For future reference, there's a difference in Tuya Smart (app) password and Tuya.com (developer) password. Resetting the Tuya Smart app resolved the authentication 1106 error and we're back in business.

@techycardiac
Copy link

I confirm that disabling the IPv6 on both interfaces (wired and wireless) fixed the issue for me.. But that's strange, who would that disable Tuya API login?

@teh-hippo
Copy link

I've had this just happen again after fixing it. Seems that the way I disabled IPv6 before on the Pi wasn't persisted.
Followed https://www.howtoraspberry.com/2020/04/disable-ipv6-on-raspberry-pi/. Without a reboot, the bridge found the devices and we're back in business.

@lesterchan
Copy link

lesterchan commented Jan 25, 2025

Hmm I am getting this today. If you are using the Synology package version of Homebridge, you can run SSH into NAS itself and run it in sudo.

sudo su
sysctl -w net.ipv6.conf.all.disable_ipv6=1
sysctl -w net.ipv6.conf.default.disable_ipv6=1
sysctl -w net.ipv6.conf.lo.disable_ipv6=1
sysctl -p

@thetelik
Copy link

As weird as it can sound in the context of the whole thread. For me, nothing worked, until i ENABLED IPv6 on my router 🤦

Literally days of trying it out - I setup HB on mymac, I bought small thin client where I setup Ubuntu and installed HB there - couldnt make it work until I found this thread and none of the options worked, but when I ENABLED IPv6 in ISP settings on my router it started working.

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

No branches or pull requests