Guest Autorisation Sessions Dropping Randomly #196
-
Hello, I'm running a custom captive portal for a guest wifi. The portal runs on the api-client version 1.1.80 and authorises guests on a UniFi Network Server ver. 7.4.162 running on Windows. The authorisation works just fine until it randomly drops out after a fraction of the defined authorisation duration. The dropout can occur after a few minutes to one or two hours. But I rarely have a session that lasts the full duration (8h). The devices just get kicked out of the wifi. Where is the error and is there a possible solution to it? Thank you in advance and have a nice evening! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
There are many things that can have an effect on the authorisations. From my experience, as long as the device's MAC remains the same, the authorisation will last as expected. Can you share as much of the actual code your are using for the authorisations? Make sure to double-check the events collection ( |
Beta Was this translation helpful? Give feedback.
-
Thank you for your fast response! Sure, here is the (empty) config file with all the settings used later on in the authorisation code. //UniFi Controller credentials
$controlleruser = ''; // user name for access to the UniFi Controller
$controllerpassword = ''; // password for access to the UniFi Controller
$controllerurl = 'https://'; // full url to the UniFi Controller, eg. 'httpS://22.22.11.11:8443',
//for UniFi OS-based controllers a port suffix isn't required, no trailing slashes should be added
$controllerversion = ''; // version of the Controller software, e.g. '4.6.6' (must be at least 4.0.0)
//Toggle debug mode for UniFi connection
$debug = false;
//Set authentication duration
$authduration = 480;
//Set site ID
$site_id = 'default'; And this is the code used to authorize the guest. $unifi_connection = new UniFi_API\Client($controlleruser, $controllerpassword, $controllerurl, $site_id, $controllerversion);
$set_debug_mode = $unifi_connection->set_debug($debug);
$loginresults = $unifi_connection->login();
$auth_result = $unifi_connection->authorize_guest($mac, $authduration); I will have a look at the events and authorisation collections. |
Beta Was this translation helpful? Give feedback.
-
The code looks fine to me. I suspect the controller is acting up. It will be important to figure out why the devices are being kicked off. You might consider assigning a specific value to the upload speed, download speed and data transfer limit. Maybe something strange is happening in the controller when no values are passed. |
Beta Was this translation helpful? Give feedback.
-
I've now changed the api request and added specific values to all parameters. |
Beta Was this translation helpful? Give feedback.
The code looks fine to me. I suspect the controller is acting up. It will be important to figure out why the devices are being kicked off. You might consider assigning a specific value to the upload speed, download speed and data transfer limit. Maybe something strange is happening in the controller when no values are passed.