[APP][Pro] Ubiquiti UniFi Network

Hi,

I have just installed this app to my homey and seem to be having connection issues.
It keeps connecting and immediately loose connection.
Unifi controller running on raspberry pi version: 6.2.26
Homey version: 7.1.1

Screenshot:

Log:
27-8-2021 16:44:50 : [debug] EVENT: ctrl.close
27-8-2021 16:44:50 : [debug] EVENT: ctrl.error Error: write EPROTO 1996132352:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:…/deps/openssl/openssl/ssl/record/ssl3_record.c:332:
27-8-2021 16:44:50 : [debug] Updating status to Disconnected
27-8-2021 16:44:50 : [debug] Error: Error: write EPROTO 1996132352:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:…/deps/openssl/openssl/ssl/record/ssl3_record.c:332:
27-8-2021 16:44:50 : [debug] EVENT: ctrl.function.connect.connected
27-8-2021 16:44:50 : [debug] EVENT: ctrl.function._login
27-8-2021 16:44:50 : [debug] EVENT: ctrl.function._getCSRFToken
27-8-2021 16:44:50 : [debug] EVENT: ctrl.function.connect
27-8-2021 16:44:50 : [debug] EVENT: ctrl.reconnect
27-8-2021 16:44:47 : [debug] Updating status to Disconnected
27-8-2021 16:44:47 : [debug] StatusCodeError: 401 - {“meta”:{“rc”:“error”,“msg”:“api.err.NoSiteContext”},“data”:}
27-8-2021 16:44:47 : [debug] Error while fetching usergroup list
27-8-2021 16:44:47 : [debug] StatusCodeError: 401 - {“meta”:{“rc”:“error”,“msg”:“api.err.NoSiteContext”},“data”:}
27-8-2021 16:44:47 : [debug] Error while fetching ap list
27-8-2021 16:44:47 : [debug] StatusCodeError: 401 - {“meta”:{“rc”:“error”,“msg”:“api.err.NoSiteContext”},“data”:}
27-8-2021 16:44:47 : [debug] Error while fetching client list:
27-8-2021 16:44:47 : [debug] EVENT: ctrl.close
27-8-2021 16:44:47 : [debug] EVENT: ctrl.connect
27-8-2021 16:44:47 : [debug] Fetching user group list
27-8-2021 16:44:47 : [debug] Updating status to Connected
27-8-2021 16:44:47 : [debug] Connection success!
27-8-2021 16:44:46 : [debug] EVENT: ctrl.function.connect.connected
27-8-2021 16:44:46 : [debug] EVENT: ctrl.nocsrftoken.[object Object]
27-8-2021 16:44:46 : [debug] Updating status to Disconnected
27-8-2021 16:44:46 : [debug] disconnect initialized
27-8-2021 16:44:46 : [debug] Updating unifi connection params.
27-8-2021 16:44:46 : [debug] Updating status to Connecting
27-8-2021 16:44:46 : [debug] Connecting to unifi controller unifi
27-8-2021 16:44:46 : [debug] initializeConnection called
27-8-2021 16:44:46 : [debug] EVENT: ctrl.function._login
27-8-2021 16:44:46 : [debug] Updating status to Disconnected
27-8-2021 16:44:46 : [debug] Updating unifi connection params.
27-8-2021 16:44:45 : [debug] Updating status to Connecting
27-8-2021 16:44:45 : [debug] Connecting to unifi controller 192.168.2.46
27-8-2021 16:44:45 : [debug] EVENT: ctrl.close
27-8-2021 16:44:45 : [debug] EVENT: ctrl.error Error: write EPROTO 1996132352:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:…/deps/openssl/openssl/ssl/record/ssl3_record.c:332:
27-8-2021 16:44:45 : [debug] Updating status to Disconnected
27-8-2021 16:44:45 : [debug] Error: Error: write EPROTO 1996132352:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:…/deps/openssl/openssl/ssl/record/ssl3_record.c:332:
27-8-2021 16:44:45 : [debug] EVENT: ctrl.function.connect.connected
27-8-2021 16:44:45 : [debug] EVENT: ctrl.function._login
27-8-2021 16:44:45 : [debug] EVENT: ctrl.function._getCSRFToken
27-8-2021 16:44:45 : [debug] EVENT: ctrl.function.connect

I hope you are able to help me out.
Tristan

Hi @Trissie666,

+1 I have exactly the same issue. I run the controller on a Mac.

When i am back from my vacation, can i look with you on your network? i have the same configuraction without any problems.

Got the same problem here, Unifi Controller ( ver 6.2.26.0 ) running on Ubuntu esxi server.

15.9.2021, 13:03:58 : [debug] Error: Error: Unexpected server response: 401

15.9.2021, 13:03:58 : [debug] EVENT: ctrl.function.connect.connected

15.9.2021, 13:03:57 : [debug] EVENT: ctrl.function._login

15.9.2021, 13:03:57 : [debug] EVENT: ctrl.function._getCSRFToken

15.9.2021, 13:03:57 : [debug] EVENT: ctrl.function.connect

15.9.2021, 13:03:57 : [debug] EVENT: ctrl.reconnect

15.9.2021, 13:03:56 : [debug] EVENT: ctrl.close

15.9.2021, 13:03:56 : [debug] EVENT: ctrl.error Error: Unexpected server response: 401

15.9.2021, 13:03:56 : [debug] Updating status to Disconnected

15.9.2021, 13:03:56 : [debug] Error: Error: Unexpected server response: 401

15.9.2021, 13:03:56 : [debug] EVENT: ctrl.function.connect.connected

15.9.2021, 13:03:55 : [debug] EVENT: ctrl.function._login

15.9.2021, 13:03:55 : [debug] EVENT: ctrl.function._getCSRFToken

15.9.2021, 13:03:55 : [debug] EVENT: ctrl.function.connect

15.9.2021, 13:03:55 : [debug] EVENT: ctrl.reconnect

15.9.2021, 13:03:53 : [debug] EVENT: ctrl.close

15.9.2021, 13:03:53 : [debug] EVENT: ctrl.error Error: Unexpected server response: 401

15.9.2021, 13:03:52 : [debug] Updating status to Disconnected

15.9.2021, 13:03:52 : [debug] Error: Error: Unexpected server response: 401

15.9.2021, 13:03:52 : [debug] EVENT: ctrl.function.connect.connected

15.9.2021, 13:03:52 : [debug] EVENT: ctrl.function._login

15.9.2021, 13:03:52 : [debug] EVENT: ctrl.function._getCSRFToken

15.9.2021, 13:03:52 : [debug] EVENT: ctrl.function.connect

15.9.2021, 13:03:52 : [debug] EVENT: ctrl.reconnect

15.9.2021, 13:03:52 : [debug] EVENT: ctrl.close

15.9.2021, 13:03:52 : [debug] EVENT: ctrl.close

15.9.2021, 13:03:52 : [debug] EVENT: ctrl.error Error: Unexpected server response: 401

15.9.2021, 13:03:52 : [debug] Updating status to Disconnected

15.9.2021, 13:03:52 : [debug] Error: Error: Unexpected server response: 401

15.9.2021, 13:03:52 : [debug] EVENT: ctrl.function.connect.connected

15.9.2021, 13:03:51 : [debug] Got usergroup back Default/604e0b1da452ed362cc4b1fe

15.9.2021, 13:03:51 : [debug] Accesspoints received

15.9.2021, 13:03:51 : [debug] Accesspoint U6-LR-S (xx:xx:xx:xx:xx:xx) has 0 clients

15.9.2021, 13:03:51 : [debug] Accesspoint U6-L -D (xx:xx:xx:xx:xx:xx) has 0 clients

15.9.2021, 13:03:51 : [debug] Accesspoint U6-L-K (xx:xx:xx:xx:xx:xx) has 0 clients

15.9.2021, 13:03:51 : [debug] Analyze AP flows

15.9.2021, 13:03:51 : [debug] Clients connected: before:0, now:0 -

15.9.2021, 13:03:51 : [debug] Checking for *_device_o(n|ff)line

15.9.2021, 13:03:51 : [debug] Got client back iPod with mac xx:xx:xx:xx:xx:xx, idle: 32 proto: ng

15.9.2021, 13:03:51 : [debug] Got client back UVC-G4-Doorbell with mac xx:xx:xx:xx:xx:xx, idle: 0 proto: ng

15.9.2021, 13:03:51 : [debug] Got client back Beijing Xiaomi with mac xx:xx:xx:xx:xx:xx, idle: 2 proto: ng

15.9.2021, 13:03:51 : [debug] Got client back Canon MF633C/635C with mac xx:xx:xx:xx:xx:xx, idle: 10 proto: ng

15.9.2021, 13:03:51 : [debug] Got client back Netatmo with mac xx:xx:xx:xx:xx:xx, idle: 1 proto: ng

Is the local account an administrator?

Please use default als SiteID in the settings page

Yes that would be great!

controller got updated to the latest version (6.4.54) and it still shows connected, with debug I still see clients passing by but for some reason it doesn’t seem to work anymore.

It doesn’t change / update the connection to the AP. Anyone else experiences the same?

My devices neatly show that they are disconnected or connected. Or do you mean something else?

What I now did is remove the wifi client and readd it. Had to modify lot’s of flows, but it now shows disconnected and connected again… You are just a bit to fast with your reply :wink: I will see if this solves it. I’ll keep you posted.

Little feature request, and I don’t know if this is the place for it, but do let me know if you want it on github. Would it be possible to 1) add the AP name within the device? and 2) would it be possible to have the tag AP with the ‘connected’ trigger?

You are using apple devices ?

Yup I do. I know of the (highly annoying) feature called Private address, but my problem was it kept sticking to one AP. It didn’t move anymore, it didn’t disconnect or connect either when I turned off the wifi on my device. Now I removed the wifi client and added it again and it connects and disconnects again. I’ll go and grap a cup of coffee and I’ll see if it roams again too.

Samsung has dynamic MAC addresses, too. Should be set to “phone MAC” to keep the same MAC for private Wifi networks.

Hehe, I have friends where such devices filled the DHCP table until no new device could connect :grin:

Use private Wi-Fi addresses in iOS 14, iPadOS 14, and watchOS 7 - Apple Support

You must turn this of, otherwise the mac address will rotate!

Give your own devices static lease / ip address and set the default dhcp lease time to one day. :upside_down_face:

Yes, I know. But others don’t know such things and I have to “repair” their wifi and router to get wifi working again.

1 Like

Yes, I know… annoying feature. But I am aware of this. Hopefully it was just a minor issue and is now solved.

Worked fine for a few hours, now it is broken again. It just keeps saying my phone is connected. Even when turning off wifi, it stays connected according to the wifi devices. Got this on both my phone as my wife’s phone. Both are iphones but with private IP turned of and reserved static IP’s.

the app always worked really reliable, but it just doesn’t anymore. Only thing changed is the unifi version. Any thoughts?

I’d had the same problem, but after rebooting the app unify app in homey it worked. For now i have a flow that reboots the app every night.
Seemed to solve my problem for now :smiley:

1 Like