Community discussions

MikroTik App
 
SapieH
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 51
Joined: Wed May 13, 2009 9:44 pm

Hotspot trial limit by usage not time

Wed Aug 14, 2013 6:24 pm

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??
 
cstan
just joined
Posts: 22
Joined: Fri Mar 22, 2013 9:24 am
Location: Queensland, Australia

Re: Hotspot trial limit by usage not time

Thu Aug 15, 2013 3:23 am

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.
 
SapieH
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 51
Joined: Wed May 13, 2009 9:44 pm

Re: Hotspot trial limit by usage not time

Thu Aug 15, 2013 8:27 am

Thanks Cstan,
One thing more, to clear the users every 24 hrs how do Imodify the script?
 
cstan
just joined
Posts: 22
Joined: Fri Mar 22, 2013 9:24 am
Location: Queensland, Australia

Re: Hotspot trial limit by usage not time

Fri Aug 16, 2013 7:29 am

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)
 
SapieH
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 51
Joined: Wed May 13, 2009 9:44 pm

Re: Hotspot trial limit by usage not time

Fri Aug 16, 2013 10:19 am

Thanks Stan,
Will give it a whirl
 
SapieH
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 51
Joined: Wed May 13, 2009 9:44 pm

Re: Hotspot trial limit by usage not time

Fri Aug 16, 2013 11:17 am

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 .
 
cstan
just joined
Posts: 22
Joined: Fri Mar 22, 2013 9:24 am
Location: Queensland, Australia

Re: Hotspot trial limit by usage not time

Mon Aug 19, 2013 3:13 am

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.
You do not have the required permissions to view the files attached to this post.
 
ener
Frequent Visitor
Frequent Visitor
Posts: 62
Joined: Fri May 10, 2013 4:47 pm

Re: Hotspot trial limit by usage not time

Thu Aug 22, 2013 5:28 am

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
 
jurgenskrause
newbie
Posts: 30
Joined: Thu Feb 27, 2014 1:30 pm

Re: Hotspot trial limit by usage not time

Thu Mar 27, 2014 4:29 pm

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
 
gammy69er
Frequent Visitor
Frequent Visitor
Posts: 91
Joined: Sun May 18, 2014 3:01 am

Re: Hotspot trial limit by usage not time

Fri Aug 14, 2015 7:11 am

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
 
Emile
Frequent Visitor
Frequent Visitor
Posts: 54
Joined: Thu Jul 24, 2014 12:39 pm
Location: Oudtshoorn, South Africa

Re: Hotspot trial limit by usage not time

Wed Feb 17, 2016 3:04 pm

The script is not working correctly for me. When i test it will limit megabit download and not megabyte download.