Open posul opened 5 years ago
are you able to find them with tuya-cli again from the same machine? as it may be a more common problem (for me 2 lightbulbs stopped to appear in HB)
I'm having this issue too. Still working yesterday but not now. I can still find it via tuya-cli.
I have figured it out that ufw is blocking homebrige from discovering tuya devices. Anyone know which port does tuya api uses to discover devices on network?
Hey, did you work out a fix for this? I've just set up HomeBridge on a Mac for the first time to use with 2 Teckin plugs and get this every time I run HomeBridge.
Hey, did you work out a fix for this? I've just set up HomeBridge on a Mac for the first time to use with 2 Teckin plugs and get this every time I run HomeBridge.
Currently I'm disabling ufw to get it worked.
@posul, this happens when these device don't reply back and that happens because: 1) network problems (let's hope this is not the case) 2) Tuya app is open and has a lock on the devices; kill the Tuya app and try restarting Homebridge.
@rangerek, do you still have trouble with 2 devices not showing up?
@haepiyang, the port that is used for discovery is 6666 over UDP. To talk to each device, a TCP connection is made to port 6668 of the device.
@Nuarton, there is a certain firmware version of these Teckin devices that is using a newer form of communication which I haven't been able to decode yet. I havn't been able to source one locally to figure out the problem.
I'm having the same errors as others. I'm using this device: https://www.brilliantsmart.com.au/smart-products/electrical/wifi-plug-with-usb-charger/
Same error: Fails to discover..... I don't have a firewall installed on my home bridge server.
Hi, I've update firmware of two Teckin outlets and now Hombridge not discover the devices.. same error. solution?
Thanks.
@rcapolino there’s some kind of issue with the new firmware on the Teckin plugs. I think fix is being worked on, it’ll be worth keeping an eye on this thread: https://github.com/AMoo-Miki/homebridge-tuya-lan/issues/23
@rcapolino there’s some kind of issue with the new firmware on the Teckin plugs. I think fix is being worked on, it’ll be worth keeping an eye on this thread:
23
Thanks..
What about the brilliant plugs?
Some devices don't respond to discovery. Alter your config for the device by adding `"ip": "
Some devices don't respond to discovery. Alter your config for the device by adding `"ip": ""; this will tell the plugin to ignore the fact that it didn't discover the device on its own and try to connect using the IP. Lemme know if that solves the problem for you.
Unfortunately not. I added in "ip": "192.168.0.48" but there is no console feedback that indicates it's tried to connect direct to the IP. And eventually I still get the failed to discover message.
Hi,
First off, thank you so much for your hard work I use your plugin for two light switches and it works perfectly.
Unfortunately I recently purchased a dimmer switch, pulled the latest (which I think supports dimmer switches, not dimmer bulbs) and am experiencing the same discovery issue noted above. I read through this thread and added the ip property to my device config but then I get the following error:
Config:
{
"name": "Light",
"type": "SimpleDimmer",
"manufacturer": "OITTM",
"model": "Dimmer Switch",
"id": "55430317b4e62d6590a1",
"key": "xxxxxxxxxxxxxx",
"ip": "10.0.0.53"
}
Error:
[TuyaLan] Failed to discover Light (55430317b4e62d6590a1) in time but will connect via 10.0.0.53.
[TuyaLan] Connected to Light
[TuyaAccessory] Socket had a problem and will reconnect to Light (Error: ERR_PING_TIMED_OUT)
[TuyaAccessory] Closed connection with Light
I've tried changing the type to SimpleLight as well just to see if I could get it working but run into the same errors. I am able to ping the device ip successfully from my homebridge server via ping 10.0.0.53
Any suggestions would be much appreciated
Just a little extra information for mine: port 6668 is open: nc -zv 192.168.0.48 6667-6669 nc: connect to 192.168.0.48 port 6667 (tcp) failed: Connection refused *Connection to 192.168.0.48 6668 port [tcp/] succeeded!** nc: connect to 192.168.0.48 port 6669 (tcp) failed: Connection refused
Same problem here. I'm trying to connect the following outlet to HB: https://www.dx.com/p/smart-socket-eu-power-plug-wifi-smart-plug-mobile-app-remote-control-usb-output-works-with-amazon-alexa-google-home-j15-eu-plug-white-2077653#.XMNPQZMzamk
Tried adding the "ip" option in the config.json of homebridge, when I discovered this option is not being used in the npm version of homebridge-tuya-lan, so I replaced it with the latest commit (#8088d86)
{ "name": "Plug 1", "type": "Outlet", "manufacturer": "BVA", "model": "Smart Wifi Plug", "ip": "192.168.1.129", "id": "23042036b4e62d578fc4", "key": "XXXXXXXXXXXX" },
The outlets I'm using only have port 6668 open:
Starting Nmap 7.70 ( https://nmap.org ) at 2019-04-26 19:45 CEST Nmap scan report for ESP_578FC4 (192.168.1.129) Host is up (0.0036s latency). Not shown: 999 closed ports PORT STATE SERVICE 6668/tcp open irc
Nmap done: 1 IP address (1 host up) scanned in 7.65 seconds
It will show up in HomeKit this way, but it doesn't work, keep getting the following error:
4/26/2019, 6:26:01 PM] [TuyaLan] Connected to Plug 1
[TuyaAccessory] Socket had a problem and will reconnect to Plug 1 (EPIPE)
[TuyaAccessory] Closed connection with Plug 1
[TuyaAccessory] Odd message from Plug 1 with command 8: { cmd: 8, data: 'í;¶\u001a´Q!¬È*°¨ÑßY²' }
[TuyaAccessory] Odd message from Plug 1 with command 8: { cmd: 8, data: 'í;¶\u001a´Q!¬È*°¨ÑßY²' }
[TuyaAccessory] Socket had a problem and will reconnect to Plug 1 (Error: ERR_PING_TIMED_OUT)
[TuyaAccessory] Closed connection with Plug 1
@NickB23 Yeah, it is exactly the same for me – whilst using some Teckin outlets.
@AMoo-Miki Please do tell me if there is anything I can do to help you resolve this.
Same problem here. I'm trying to connect the following outlet to HB: https://www.dx.com/p/smart-socket-eu-power-plug-wifi-smart-plug-mobile-app-remote-control-usb-output-works-with-amazon-alexa-google-home-j15-eu-plug-white-2077653#.XMNPQZMzamk
Tried adding the "ip" option in the config.json of homebridge, when I discovered this option is not being used in the npm version of homebridge-tuya-lan, so I replaced it with the latest commit (#8088d86)
What command did you use to install the latest commit?
@9SL9 I think I used this one:
sudo npm install -g git+https://github.com/AMoo-Miki/homebridge-tuya-lan.git
Thanks that worked. I'm getting the same errors as you guy's (Error: ERR_PING_TIMED_OUT)
@NickB23 Yeah, it is exactly the same for me – whilst using some Teckin outlets.
@AMoo-Miki Please do tell me if there is anything I can do to help you resolve this.
@AMoo-Miki Yes me too! Let me know if I can do anything. I'd be happy to help :-)
@9SL9, @ryan86: ERR_PING_TIMED_OUT
happens when the device doesn't reply to my checking if the connection is alive. I have a feeling that yours are not; let's test this and see.
Locate the plugin installation location; on my RPi, it is /var/lib/npm/lib/node_modules/homebridge-tuya-lan
. Edit the file lib\TuyaAccessory.js
and comment out line 90 this._socket._ping();
by adding //
to the beginning of the line. Restart homebridge and see if you can control your device.
If you can't find the file, lemme know and I will think of something else.
@NickB23: your device is using a different mode of encryption. I will need to get my hands on one of these devices to be able to figure them out.
@AMoo-Miki Found the file and commented out ln 90, restarted homebridge.
Log:
[TuyaLan] Failed to discover Light (55430317b4e62d6590a1) in time but will connect via 10.0.0.53.
[TuyaLan] Connected to Light
Light shows up in accessories even shows up in the home app, but with 'No Response' and I can click it, but it does not control the light.
Here is the light by the way.
Hey,
i just tested your solutions to get my Switch working. The Switch is not reacting, since there is a Problem with a reconnection like this:
[2019-5-4 01:37:34] [TuyaLan] Failed to discover Wohnzimmer (73675161cc50e346b170) in time but will connect via 192.168.178.35. [2019-5-4 01:37:34] [TuyaLan] Connected to Wohnzimmer [TuyaAccessory] Socket had a problem and will reconnect to Wohnzimmer (ECONNRESET)
While homebridge tries to reconnect to the switch, i just used the Tuya App to switch the Lights on and off and got this messages in homebridge console:
[TuyaAccessory] Odd message from Wohnzimmer with command 8: { cmd: 8, data: '²^ö\u0006Ýâ>lûá@ W¢H' } [TuyaAccessory] Odd message from Wohnzimmer with command 8: { cmd: 8, data: ',ÄjMöôwô\u000e¨>4ELI' } [TuyaAccessory] Odd message from Wohnzimmer with command 8: { cmd: 8, data: 'dÿǦ£AÙJ\u0003¥]\u0001è' } m and will reconnect to Wohnzimmer (ECONNRESET) [TuyaAccessory] Closed connection with Wohnzimmer [TuyaAccessory] Odd message from Wohnzimmer with command 8: { cmd: 8, data: 'g\u0001²uL,!\u0015Ðé*ÂÜX\fc' }
I got this Switch:
Any Ideas?
I updated the first switch by mistake. When you use the old firmware with the Tuya-Lan Plugin everthing's fine! I just tested it successfully with another switch :-) I have some reconnects and i don't know why.. it does not affect the switch, it reacts to every command.
[TuyaAccessory] Socket had a problem and will reconnect to Wohnzimmer (ECONNRESET) [TuyaAccessory] Closed connection with Wohnzimmer [TuyaAccessory] Socket had a problem and will reconnect to Wohnzimmer (ECONNRESET) [TuyaAccessory] Closed connection with Wohnzimmer [TuyaAccessory] Sending Wohnzimmer {"1":true} [TuyaAccessory] SimpleLight changed: {"1":true} [TuyaAccessory] Sending Wohnzimmer {"1":false} [TuyaAccessory] SimpleLight changed: {"1":false}
I had to reinstall Homebridge jail on my FreeNAS and have the same problem with 11.2 jail (I suspect some changes in network stack in iocage) So IP entry made the trick - great :) But for 2 bulbs that updated it ends with ECONNRESET - any chances it is fixed (or update breaks the api)?
Any update on this? Just bought 4 plugs today and upgraded the firmware straight away...
Today I bought 2x smart outlets (https://www.brilliantsmart.com.au/smart-products/electrical/wifi-plug-with-usb-charger/).
One is working great- I'm so impressed with the plugin in, thank you! :)
But the second one is running the latest firmware, and doesn't work. I'm getting the same errors as above, see below.
Any updates on how to fix this?
[5/30/2019, 10:07:00 PM] [TuyaLan] Starting discovery... [5/30/2019, 10:07:00 PM] Homebridge is running on port 51826. [TuyaAccessory] Discovery started. [5/30/2019, 10:07:03 PM] [TuyaLan] Discovered Porch Lights (04761182600194b8e913) [5/30/2019, 10:07:03 PM] [TuyaLan] Connected to Porch Lights [5/30/2019, 10:07:03 PM] [TuyaLan] Ready to handle Porch Lights with signature {"1":true} [TuyaAccessory] Sending Porch Lights {"1":false} [TuyaAccessory] Sending Porch Lights {"1":true} [5/30/2019, 10:08:00 PM] [TuyaLan] Failed to discover Backyard Lights (88138834600194cb1089) in time but will connect via 192.168.86.61. [5/30/2019, 10:08:00 PM] [TuyaLan] Connected to Backyard Lights [TuyaAccessory] Socket had a problem and will reconnect to Backyard Lights (ECONNRESET) [TuyaAccessory] Closed connection with Backyard Lights [TuyaAccessory] Socket had a problem and will reconnect to Backyard Lights (ECONNRESET) [TuyaAccessory] Closed connection with Backyard Lights [TuyaAccessory] Socket had a problem and will reconnect to Backyard Lights (ECONNRESET) [TuyaAccessory] Closed connection with Backyard Lights [TuyaAccessory] Socket had a problem and will reconnect to Backyard Lights (ECONNRESET) [TuyaAccessory] Closed connection with Backyard Lights [TuyaAccessory] Socket had a problem and will reconnect to Backyard Lights (ECONNRESET) [TuyaAccessory] Closed connection with Backyard Lights [TuyaAccessory] Socket had a problem and will reconnect to Backyard Lights (ECONNRESET) [TuyaAccessory] Closed connection with Backyard Lights [TuyaAccessory] Socket had a problem and will reconnect to Backyard Lights (ECONNRESET)
Is there any update on this as I was hoping to buy some of the Brilliant Smart Plugs
Unfortunately no recent response to any posts on this issue from the repo owner. Perhaps this is the end of the line for this functionality now that the Tuya firmware’s have broken connectivity.
I’ve noticed that on most of the issues. Maybe he’s just not had time recently. Who knows.
On 2 Jun 2019, at 5:16 am, 9SL9 notifications@github.com wrote:
Unfortunately no recent response to any posts on this issue from the repo owner. Perhaps this is the end of the line for this functionality now that the Tuya firmware’s have broken connectivity.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
Agree. Many factors could be contributing to the delay. Perhaps he is waiting on code changes in other dependencies.
Same problem on my side, rolling shutter button buy some weeks ago
I have been having the same or similar problems. https://github.com/AMoo-Miki/homebridge-tuya-lan/issues/72 I have removed the plugin from homebrisge and I'm going to wait an see if he ever comes back. Im only going to buy HomeKit compatible tech from now on.
probably duplicates
@TheHomekitWayFinder and @9SL9 yeah, work and life got turned over all at the same time. I will have some free time to solve problems now.
I have started working on the new API but need to get my hands on some. If you know of any on Amazon US, please send me a link so I can buy.
Please give the latest rc
release a shot by doing npm i -g homebridge-tuya-lan@rc
. It includes logic to understand this newer API.
A known issue is that the current state is not reported by some devices; they however work fine as soon as you interact with them. I have reached out to Tuya for a solution.
The Setup Instructions have changed in case you need to obtain a fresh id
and key
.
I was able to replace the the homebridge-tuya-lan package in HOOBS with the homebridge-tuya-lan@rc, after that both of my new gosund light bulbs worked, before I had the: (Error: ERR_PING_TIMED_OUT)
Logs report:
12/15/2020, 4:23:24 PM [TuyaLan] Discovered Light-Game-1 (******) identified as SimpleLight (3.3)
12/15/2020, 4:23:24 PM [TuyaAccessory] Changing ping gap for Light-Game-1 to 9s
12/15/2020, 4:23:24 PM [TuyaLan] Connected to Light-Game-1
12/15/2020, 4:23:24 PM [TuyaAccessory] Sending first query to Light-Game-1 (3.3)
12/15/2020, 4:23:24 PM [TuyaLan] Discovered Light-Game-2 (*******) identified as SimpleLight (3.3)
12/15/2020, 4:23:24 PM [TuyaAccessory] Changing ping gap for Light-Game-2 to 9s
12/15/2020, 4:23:24 PM [TuyaLan] Connected to Light-Game-2
12/15/2020, 4:23:24 PM [TuyaAccessory] Sending first query to Light-Game-2 (3.3)
12/15/2020, 4:23:24 PM [TuyaAccessory] Heard back from Light-Game-1 with command 10
12/15/2020, 4:23:24 PM [TuyaAccessory] Heard back from Light-Game-2 with command 10
12/15/2020, 4:23:24 PM [TuyaLan] Ready to handle Light-Game-1 (SimpleLight:3.3) with signature {"1":false,"3":255}
12/15/2020, 4:23:24 PM [TuyaLan] Ready to handle Light-Game-2 (SimpleLight:3.3) with signature {"1":false,"3":255}
If one of the accesories gets disconnected (turned off for example), the plugin continues trying to connect and leaks memory, eventually causing a heap error in javascript and killing homebridge, it actually happens quick (less than an hour)
12/16/2020, 9:37:18 AM [TuyaAccessory] Slowing down retry attempts; if you see this happening often, it could mean some sort of incompatibility.
12/16/2020, 9:37:18 AM [TuyaAccessory] Socket had a problem and will reconnect to Light-Entrance-1 (EHOSTDOWN)
12/16/2020, 9:37:18 AM [TuyaAccessory] Slowing down retry attempts; if you see this happening often, it could mean some sort of incompatibility.
12/16/2020, 9:37:18 AM [TuyaAccessory] Socket had a problem and will reconnect to Light-Entrance-1 (EHOSTDOWN)
12/16/2020, 9:37:18 AM [TuyaAccessory] Slowing down retry attempts; if you see this happening often, it could mean some sort of incompatibility.
12/16/2020, 9:37:18 AM [TuyaAccessory] Socket had a problem and will reco
12/16/2020, 9:38:12 AM [291:0x1046c6000] 2192367 ms: Mark-sweep (reduce) 2040.6 (2051.9) -> 2040.0 (2053.4) MB, 2443.4 / 0.9 ms (average mu = 0.036, current mu = 0.004) allocation failure scavenge might not succeed
12/16/2020, 9:38:12 AM <--- JS stacktrace --->
12/16/2020, 9:38:12 AM FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
12/16/2020, 9:38:12 AM 1: 0x1012e2bc5 node::Abort() (.cold.1) [/usr/local/bin/node]
12/16/2020, 9:38:12 AM 2: 0x1000a5cb9 node::Abort() [/usr/local/bin/node]
12/16/2020, 9:38:12 AM 3: 0x1000a5e1f node::OnFatalError(char const*, char const*) [/usr/local/bin/node]
12/16/2020, 9:38:12 AM 4: 0x1001e83e7 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
12/16/2020, 9:38:12 AM 5: 0x1001e8383 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
12/16/2020, 9:38:12 AM 6: 0x100397275 v8::internal::Heap::FatalProcessOutOfMemory(char const*) [/usr/local/bin/node]
12/16/2020, 9:38:12 AM 7: 0x100398d3a v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [/usr/local/bin/node]
12/16/2020, 9:38:12 AM 8: 0x100394409 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/usr/local/bin/node]
12/16/2020, 9:38:12 AM 9: 0x100391ca1 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/local/bin/node]
12/16/2020, 9:38:12 AM 10: 0x1003a053a v8::internal::Heap::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/bin/node]
12/16/2020, 9:38:12 AM 11: 0x1003a05c1 v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/bin/node]
12/16/2020, 9:38:12 AM 12: 0x10036de23 v8::internal::Factory::AllocateRawWithAllocationSite(v8::internal::Handle<v8::internal::Map>, v8::internal::AllocationType, v8::internal::Handle<v8::internal::AllocationSite>) [/usr/local/bin/node]
12/16/2020, 9:38:12 AM 13: 0x100371396 v8::internal::Factory::NewJSObjectFromMap(v8::internal::Handle<v8::internal::Map>, v8::internal::AllocationType, v8::internal::Handle<v8::internal::AllocationSite>) [/usr/local/bin/node]
12/16/2020, 9:38:12 AM 14: 0x10057dfc6 v8::internal::JSObject::New(v8::internal::Handle<v8::internal::JSFunction>, v8::internal::Handle<v8::internal::JSReceiver>, v8::internal::Handle<v8::internal::AllocationSite>) [/usr/local/bin/node]
12/16/2020, 9:38:12 AM 15: 0x1003478cc v8::internal::(anonymous namespace)::GetStackFrames(v8::internal::Isolate*, v8::internal::Handle<v8::internal::FixedArray>) [/usr/local/bin/node]
12/16/2020, 9:38:12 AM 16: 0x1003466da v8::internal::ErrorUtils::FormatStackTrace(v8::internal::Isolate*, v8::internal::Handle<v8::internal::JSObject>, v8::internal::Handle<v8::internal::Object>) [/usr/local/bin/node]
12/16/2020, 9:38:12 AM 17: 0x100257b7f v8::internal::Accessors::ErrorStackGetter(v8::Local<v8::Name>, v8::PropertyCallbackInfo<v8::Value> const&) [/usr/local/bin/node]
12/16/2020, 9:38:12 AM 18: 0x10045181e v8::internal::PropertyCallbackArguments::BasicCallNamedGetterCallback(void (*)(v8::Local<v8::Name>, v8::PropertyCallbackInfo<v8::Value> const&), v8::internal::Handle<v8::internal::Name>, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>) [/usr/local/bin/node]
12/16/2020, 9:38:12 AM 19: 0x1005cb4e1 v8::internal::PropertyCallbackArguments::CallAccessorGetter(v8::internal::Handle<v8::internal::AccessorInfo>, v8::internal::Handle<v8::internal::Name>) [/usr/local/bin/node]
12/16/2020, 9:38:12 AM 20: 0x1005ca471 v8::internal::Object::GetPropertyWithAccessor(v8::internal::LookupIterator*) [/usr/local/bin/node]
12/16/2020, 9:38:12 AM 21: 0x1005c9c5b v8::internal::Object::GetProperty(v8::internal::LookupIterator*, bool) [/usr/local/bin/node]
12/16/2020, 9:38:12 AM 22: 0x1006fadfc v8::internal::Runtime::GetObjectProperty(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, bool*) [/usr/local/bin/node]
12/16/2020, 9:38:12 AM 23: 0x10070004c v8::internal::Runtime_GetProperty(int, unsigned long*, v8::internal::Isolate*) [/usr/local/bin/node]
12/16/2020, 9:38:12 AM 24: 0x100a795f9 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit [/usr/local/bin/node]
12/16/2020, 9:38:12 AM 25: 0x228cdc0cabc1
12/16/2020, 9:38:12 AM 26: 0x100a129a2 Builtins_InterpreterEntryTrampoline [/usr/local/bin/node]
12/16/2020, 9:38:12 AM 27: 0x228cdbffce2b
12/16/2020, 9:38:12 AM 28: 0x100a0c8d9 Builtins_ArgumentsAdaptorTrampoline [/usr/local/bin/node]
Hi, Thanks for your work... After successfully homebridge-tuya-lan plugin, I am unable to discover my two smart plugs. I get the error "[3/23/2019, 7:26:45 PM] [TuyaLan] Failed to discover Plug 1 (40525238600194bba1db) in time but will keep looking. [3/23/2019, 7:26:45 PM] [TuyaLan] Failed to discover Plug 2 (40525238600194bb7967) in time but will keep looking." Appreciate any advice you can give. Thanks
My config (keys removed is as follows; { "platform": "TuyaLan", "devices": [ { "name": "Plug 1", "type": "Outlet", "manufacturer": "Brilliant", "model": "Smart WiFi Plug with USB Charger 20676/05", "id": "40525238600194bba1db", "key": "XXXXXXXXXX" }, { "name": "Plug 2", "type": "Outlet", "manufacturer": "Brilliant", "model": "Smart WiFi Plug with USB Charger 20676/05", "id": "40525238600194bb7967", "key": "XXXXXXXXXX" } ] }