Devices won't connect to Wi-Fi (Smart Life/Tuya)

I'm trying to get smart devices (plug sockets and lights) from Smart Life/Tuya to connect to the Wi-Fi network on my WRT32X, but they just won't!

They connect fine when using the stock firmware (which is also OpenWRT)!

Can anyone help??

The requirements are: WPA2-PSK, AES, and broadcasting enabled.
In LuCI I can only select "CCMP (AES)", but I can't work out if that is compatible with plain AES, and so if that's the problem?

I see the devices under Network > Wireless > Associated Stations, but I don't see them under Active DHCP Leases.

In system log I see the following repeated every few minutes:

Mon Aug  6 12:17:52 2018 daemon.info hostapd: wlan1-1: STA BC:DD:C2:E2:19:A4
 IEEE 802.11: associated (aid 1)
Mon Aug  6 12:17:52 2018 daemon.notice hostapd: wlan1-1: AP-STA-CONNECTED BC:DD:C2:E2:19:A4
Mon Aug  6 12:17:52 2018 daemon.info hostapd: wlan1-1: STA BC:DD:C2:E2:19:A4 WPA: pairwise key handshake completed (RSN)
Mon Aug  6 12:17:54 2018 daemon.info hostapd: wlan1-1: STA BC:DD:C2:E2:19:A4 IEEE 802.11: authenticated

I'm running davidc502's latest Lede SNAPSHOT r7581-7880a6f7fe.

1 Like

That is exactly what "AES" is. So yes, it's "compatible."

Can you verify that this SSID is added to you LAN?
A snapshot or a copy of /etc/config/wireless will do.

1 Like

Many thanks for taking the time to reply!

Here's my /etc/config/wireless...

root@OpenWrt:~# cat /etc/config/wireless

config wifi-device 'radio0'
        option type 'mac80211'
        option hwmode '11a'
        option path 'soc/soc:pcie/pci0000:00/0000:00:01.0/0000:01:00.0'
        option htmode 'VHT80'
        option channel 'auto'
        option country 'GB'
        option legacy_rates '1'

config wifi-iface 'default_radio0'
        option device 'radio0'
        option network 'lan'
        option mode 'ap'
        option macaddr 'a1:b1:c1:d1:e1:f1'
        option ssid 'The Internet'
        option encryption 'psk2+ccmp'
        option key 'xxxxxxxxxxxxxxxxxxxxxxx'

config wifi-device 'radio1'
        option type 'mac80211'
        option hwmode '11g'
        option path 'soc/soc:pcie/pci0000:00/0000:00:02.0/0000:02:00.0'
        option channel 'auto'
        option htmode 'HT40'
        option country 'GB'
        option legacy_rates '1'

config wifi-iface 'default_radio1'
        option device 'radio1'
        option network 'lan'
        option mode 'ap'
        option macaddr 'a2:b2:c2:d2:e2:f2'
        option ssid 'The Internet'
        option encryption 'psk2+ccmp'
        option key 'xxxxxxxxxxxxxxxxxxxxxxxxxxx'

config wifi-iface
        option device 'radio1'
        option mode 'ap'
        option ssid 'The Internet Devices'
        option network 'lan'
        option encryption 'psk2+ccmp'
        option key 'xxxxxxxxxxxxxxxxxxxxxxxxxxxx'

Here's the device in Network > Wireless > Associated Stations...
image

Is there a reason you have 2 SSIDs that access the same LAN?

What happens when you disable this?

1 Like

These particular devices need 2.4 GHz. There's a 5 GHz and 2.4 GHz network that share the same SSID (works well).
The mobile companion app needs to be on the 2.4 GHz network to set them up, but my mobile always connects to the 5 GHz network. Hence a specific 2.4 GHz SSID.

Still the same problem with "option legacy_rates '0'" set on all SSIDs.

Have you tried just operating the 2.4ghz radio in 20mhz mode and see if they connected?

option htmode 'HT20'

Can your phone or another device connect to the 2.4ghz radio ok? It's just I noticed you do not have a TX Power, Distance, or Beacon Interval specified for it in your wireless configuration file.

One last thing you can check too is that you're not running out of DHCP leases as well.

1 Like

It's now 20 MHz, but still the same problem. :expressionless:

My phone is connected successfully. It's 192.168.1.211...

The wireless configuration is basically the default that has been slightly modified in LuCI.

I've counted only 18 active DHCP leases, so there should be plenty left.

I'm now seeing this repeated over and over in the System Log (slightly different to the log in the OP)...

Mon Aug  6 17:21:53 2018 daemon.notice hostapd: wlan1-1: AP-STA-DISCONNECTED bc:dd:c2:e2:19:a4
Mon Aug  6 17:21:53 2018 daemon.info hostapd: wlan1-1: STA bc:dd:c2:e2:19:a4 IEEE 802.11: disassociated
Mon Aug  6 17:21:53 2018 kern.debug kernel: [20500.086865] ieee80211 phy1: staid 11 deleted
Mon Aug  6 17:21:54 2018 daemon.info hostapd: wlan1-1: STA bc:dd:c2:e2:19:a4 IEEE 802.11: deauthenticated due to inactivity (timer DEAUTH/REMOVE)
Mon Aug  6 17:21:56 2018 daemon.info hostapd: wlan1-1: STA bc:dd:c2:e2:19:a4 IEEE 802.11: associated (aid 2)
Mon Aug  6 17:21:56 2018 daemon.notice hostapd: wlan1-1: AP-STA-CONNECTED bc:dd:c2:e2:19:a4
Mon Aug  6 17:21:56 2018 daemon.info hostapd: wlan1-1: STA bc:dd:c2:e2:19:a4 WPA: pairwise key handshake completed (RSN)
Mon Aug  6 17:21:58 2018 daemon.info hostapd: wlan1-1: STA bc:dd:c2:e2:19:a4 IEEE 802.11: authenticated

Mon Aug  6 17:22:52 2018 daemon.notice hostapd: wlan1-1: AP-STA-DISCONNECTED bc:dd:c2:e2:19:a4
Mon Aug  6 17:22:52 2018 daemon.info hostapd: wlan1-1: STA bc:dd:c2:e2:19:a4 IEEE 802.11: disassociated
Mon Aug  6 17:22:52 2018 kern.debug kernel: [20559.209422] ieee80211 phy1: staid 11 deleted
Mon Aug  6 17:22:53 2018 daemon.info hostapd: wlan1-1: STA bc:dd:c2:e2:19:a4 IEEE 802.11: deauthenticated due to inactivity (timer DEAUTH/REMOVE)
Mon Aug  6 17:22:55 2018 daemon.info hostapd: wlan1-1: STA bc:dd:c2:e2:19:a4 IEEE 802.11: associated (aid 2)
Mon Aug  6 17:22:55 2018 daemon.notice hostapd: wlan1-1: AP-STA-CONNECTED bc:dd:c2:e2:19:a4
Mon Aug  6 17:22:55 2018 daemon.info hostapd: wlan1-1: STA bc:dd:c2:e2:19:a4 WPA: pairwise key handshake completed (RSN)
Mon Aug  6 17:22:55 2018 daemon.info hostapd: wlan1-1: STA bc:dd:c2:e2:19:a4 IEEE 802.11: authenticated

Mon Aug  6 17:23:51 2018 daemon.notice hostapd: wlan1-1: AP-STA-DISCONNECTED bc:dd:c2:e2:19:a4
Mon Aug  6 17:23:51 2018 daemon.info hostapd: wlan1-1: STA bc:dd:c2:e2:19:a4 IEEE 802.11: disassociated
Mon Aug  6 17:23:51 2018 kern.debug kernel: [20618.324035] ieee80211 phy1: staid 11 deleted
Mon Aug  6 17:23:52 2018 daemon.info hostapd: wlan1-1: STA bc:dd:c2:e2:19:a4 IEEE 802.11: deauthenticated due to inactivity (timer DEAUTH/REMOVE)
Mon Aug  6 17:23:54 2018 daemon.info hostapd: wlan1-1: STA bc:dd:c2:e2:19:a4 IEEE 802.11: associated (aid 2)
Mon Aug  6 17:23:54 2018 daemon.notice hostapd: wlan1-1: AP-STA-CONNECTED bc:dd:c2:e2:19:a4
Mon Aug  6 17:23:54 2018 daemon.info hostapd: wlan1-1: STA bc:dd:c2:e2:19:a4 WPA: pairwise key handshake completed (RSN)
Mon Aug  6 17:23:58 2018 daemon.info hostapd: wlan1-1: STA bc:dd:c2:e2:19:a4 IEEE 802.11: authenticated

Mon Aug  6 17:24:50 2018 daemon.notice hostapd: wlan1-1: AP-STA-DISCONNECTED bc:dd:c2:e2:19:a4
Mon Aug  6 17:24:50 2018 daemon.info hostapd: wlan1-1: STA bc:dd:c2:e2:19:a4 IEEE 802.11: disassociated
Mon Aug  6 17:24:50 2018 kern.debug kernel: [20677.226830] ieee80211 phy1: staid 11 deleted
Mon Aug  6 17:24:51 2018 daemon.info hostapd: wlan1-1: STA bc:dd:c2:e2:19:a4 IEEE 802.11: deauthenticated due to inactivity (timer DEAUTH/REMOVE)
Mon Aug  6 17:24:53 2018 daemon.info hostapd: wlan1-1: STA bc:dd:c2:e2:19:a4 IEEE 802.11: associated (aid 2)
Mon Aug  6 17:24:53 2018 daemon.notice hostapd: wlan1-1: AP-STA-CONNECTED bc:dd:c2:e2:19:a4
Mon Aug  6 17:24:53 2018 daemon.info hostapd: wlan1-1: STA bc:dd:c2:e2:19:a4 WPA: pairwise key handshake completed (RSN)
Mon Aug  6 17:24:56 2018 daemon.info hostapd: wlan1-1: STA bc:dd:c2:e2:19:a4 IEEE 802.11: authenticated

Under the wifi-iface section for the 2.4ghz radio try adding:

option dissasoc_low_ack '0'

Also, it's weird that the signal level is 0 for them. They aren't in a dead spot or too far from the router? You could try adding:

option distance 'xx'

Where xx is a little over twice the distance in meters of your furthest device in the wifi-device section.

1 Like

I don't know If this will help you at all, but you can try give to the devices you require to connect to the router a static dhcp lease. :slight_smile:

1 Like

Yea, it really is weird. The devices are only 4 meters away from the router! :smile:
My config now stands at:

config wifi-iface
        option device 'radio1'
        option mode 'ap'
        option ssid 'The Internet Devices'
        option network 'lan'
        option encryption 'psk2+ccmp'
        option key 'xxxxxxxxxxxxxxxxxxxx'
        option dissasoc_low_ack '0'
        option distance '10'

But the problem persists! :tired_face:

Ahhhh haaaaa! Good idea!
However, I've done that and the problem is still there.

The devices themselves have a flash LED which means they are not connected to a network.

Are they still being disassociated every couple of minutes still in the System Log?

1 Like

Unfortunately yes. Still the same.

You never answered my question. Both SSIDs I inquired about are on radio1.

I would try 20 MHz mode, especially if you keep legacy rates enabled.

Change to 100, ten is way too short; and has always failed in my testing.

Try adding this to the failing SSIDs:

        # Will change multicast group rekey to 24 hours
        option wpa_group_rekey '86400'                                 
1 Like

Try disabling the other wifi interfaces for now just to test.

2 Likes

I tried to answer it, but perhaps I wasn't clear.
Originally I used one SSID ("The Internet") on both radio0 (5 GHz) and radio1 (2.4GHz).
My phone always connects to the 5 GHz interface.
The app for these smart devices requires that the phone be on 2.4 GHz wifi (which the smart devices require).
So I ended up adding an extra SSID ("The Internet Devices") on the 2.4 GHz radio1 just so I could connect my phone to it and therfore add the devices to it.

All other wifi interfaces have now been disabled.

I've made the suggested changes (many thanks!):

config wifi-iface
        option device 'radio1'
        option mode 'ap'
        option ssid 'The Internet Devices'
        option network 'lan'
        option encryption 'psk2+ccmp'
        option key 'xxxxxxxxxxxxxxxxxxxx'
        option dissasoc_low_ack '0'
        option distance '100'
        option wpa_group_rekey '86400'

But I'm still seeing the disassociated messages in the System Log, the device is still flashing to say it's not connected, and it's still missing the signal and other information in the tx/rx rate. :sleepy:

image

Just drop the distance setting alltogether, you're just shooting yourself into the foot by micro-managing this (changing the distance setting is only need for long range links, way above 100m).

3 Likes

How exactly do you input to these devices to connect to your WiFi initially (i.e. the SSID to connect to and the key)? I know you say there's an app that controls them, but how do you get them to initially connect, so they can use the app? Maybe go through that process again, clearing any old settings.

Also, the spaces in the SSID could be causing issues. Older devices that run older software/firmware do not seem to like SSID's with special characters in them.

option distance 'xx'

Should be under the "config wifi-device 'radio1'" section as well, not "config wifi-iface" in your /etc/config/wireless.

1 Like