Page 1 of 1
Hotspot trial limit by usage not time
Posted: Wed Aug 14, 2013 6:24 pm
by SapieH
Hi All,
I am wanting to limit the trial on my hotspots by usage mot time.
In other words, A user logs onto my hotspot and receives say 200Mb complimentary service, thereafter he needs to purchase access.
Any ideas??
Re: Hotspot trial limit by usage not time
Posted: Thu Aug 15, 2013 3:23 am
by cstan
Hi,
Have a look at the scrip here -
http://www.mikrotik-routeros.com/2012/1 ... pot-users/
We've used it in a number of locations and found it works well, just read the comments about the multiplication of the data and you'll be fine.
Re: Hotspot trial limit by usage not time
Posted: Thu Aug 15, 2013 8:27 am
by SapieH
Thanks Cstan,
One thing more, to clear the users every 24 hrs how do Imodify the script?
Re: Hotspot trial limit by usage not time
Posted: Fri Aug 16, 2013 7:29 am
by cstan
The second script on that page allows you to clear the users.
Just place it into a script on your device (system -> scripts) and then set up a scheduler entry (system -> scheduler) to run that script every 24hrs (or whatever interval you like)
Re: Hotspot trial limit by usage not time
Posted: Fri Aug 16, 2013 10:19 am
by SapieH
Thanks Stan,
Will give it a whirl
Re: Hotspot trial limit by usage not time
Posted: Fri Aug 16, 2013 11:17 am
by SapieH
The scheduler is working ok.
But how do I apply the complimentary access when a user log onto the hotspot for the first time?
Can you maybe post your setup here. It would be a great help .
Re: Hotspot trial limit by usage not time
Posted: Mon Aug 19, 2013 3:13 am
by cstan
If you have a look at the standard login.html file that is on a Mikrotik with an active hotspot you will see this line of code:
<a href="$(link-login-only)?dst=$(link-orig-esc)&username=T-$(mac-esc)">
You have this link on a button, word, picture, whatever you want. This tells the Mikrotik to log the user in, using the trial user log in method of the hotspot.
So to get it working you need the following:
- A hotspot setup with the trial user log in method enabled
- A login.html file with that line of code somewhere to let the user log in
- Those two scripts setup
When they user connects to the wifi the hotspot serves them the login.html. They then click on the link, attached to a button or image etc. It then passes that to the Mikrotik and creates an active user as in the image below.
Re: Hotspot trial limit by usage not time
Posted: Thu Aug 22, 2013 5:28 am
by ener
this scripts affects any account even in userman as long as its in hotspot server it will also be disconnected when it reaches its qouta.. can anyone share solutions how to prevent account from radius? thanks
Re: Hotspot trial limit by usage not time
Posted: Thu Mar 27, 2014 4:29 pm
by jurgenskrause
this scripts affects any account even in userman as long as its in hotspot server it will also be disconnected when it reaches its qouta.. can anyone share solutions how to prevent account from radius? thanks
I had the same problem, so I updated the script. Whenever I some up with a solution I document it on my blog, the tutorial below will do what you require, I use it extensively myself:
http://binaryheartbeat.blogspot.com/201 ... trial.html
Re: Hotspot trial limit by usage not time
Posted: Fri Aug 14, 2015 7:11 am
by gammy69er
have Just added a Script
http://forum.mikrotik.com/viewtopic.php?f=9&t=99515
this works well for me - and takes away from running scripts every 5-10 mins
Re: Hotspot trial limit by usage not time
Posted: Wed Feb 17, 2016 3:04 pm
by Emile
The script is not working correctly for me. When i test it will limit megabit download and not megabyte download.