Community discussions

MikroTik App
 
haccks
newbie
Topic Author
Posts: 34
Joined: Tue Mar 29, 2016 2:10 pm

How to create a free hotspot?

Thu Dec 29, 2016 10:08 am

I tried to create a free WiFi hotspot for a coffee shop with customised login page which asks user to enter some details. I created a User "admin" and set it's limit-uptime to 1hr. In user profiles I created a user profile "uprof1" and set uncheck "shared users" so that any number of users can login.

But the problem with this approach is some users get 1hr time while other gets less than the uptime limit time. Some even logout just after login.

Is there any other approach that I can use?
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 24493
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: How to create a free hotspot?

Thu Dec 29, 2016 10:28 am

You could use the Trial function:

http://wiki.mikrotik.com/wiki/Manual:IP/Hotspot/Profile
http://wiki.mikrotik.com/wiki/Manual:Trial_user_limits

It would be the same, except your user will be identified by MAC, so limits will not be shared like you have now.
Just rename "trial" option to "log in", and hide the other login form.
No answer to your question? How to write posts
 
haccks
newbie
Topic Author
Posts: 34
Joined: Tue Mar 29, 2016 2:10 pm

Re: How to create a free hotspot?

Thu Dec 29, 2016 10:33 am

You could use the Trial function:

http://wiki.mikrotik.com/wiki/Manual:IP/Hotspot/Profile
http://wiki.mikrotik.com/wiki/Manual:Trial_user_limits

It would be the same, except your user will be identified by MAC, so limits will not be shared like you have now.
Just rename "trial" option to "log in", and hide the other login form.
Thanks for the reply. It says there that: trial - client is allowed to use internet without HotSpot login for the specified amount of time
In that case user will bypass the login page, is it?
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 24493
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: How to create a free hotspot?

Thu Dec 29, 2016 10:46 am

No, he will have to click a button "Trial" on the login page. You can edit the login page, rename this button "Use internet" and hide the regular login forms. For the user, he will still see the login page. Just no login field, only a button
No answer to your question? How to write posts
 
haccks
newbie
Topic Author
Posts: 34
Joined: Tue Mar 29, 2016 2:10 pm

Re: How to create a free hotspot?

Thu Dec 29, 2016 10:50 am

No, he will have to click a button "Trial" on the login page. You can edit the login page, rename this button "Use internet" and hide the regular login forms. For the user, he will still see the login page. Just no login field, only a button
I customised the login page which asks user for -Name, Email and Mobile number for OTP verification. I want user to fill this form, and then use wifi for 1hr/1day.
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 24493
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: How to create a free hotspot?

Thu Dec 29, 2016 10:53 am

Where would this data be sent and stored?

You could probably make some kind of intermediary redirect, that submits your data, and then continues to log in via trial.
No answer to your question? How to write posts
 
haccks
newbie
Topic Author
Posts: 34
Joined: Tue Mar 29, 2016 2:10 pm

Re: How to create a free hotspot?

Thu Dec 29, 2016 11:14 am

Where would this data be sent and stored?

You could probably make some kind of intermediary redirect, that submits your data, and then continues to log in via trial.
I save this data in a MySQL database.
 
User avatar
nichky
Long time Member
Long time Member
Posts: 559
Joined: Tue Jun 23, 2015 2:35 pm

Re: How to create a free hotspot?

Thu Dec 29, 2016 12:16 pm

Hi normis

Can you give us advice, how can we are accessing on hotspot via https? Yes it needs certificate, i l've been doing before but wasn't go, can you help us?

Thanks
Nikola Suminoski
MikroTik Consultan
MTCRE l MTCWE

!) Safe Mode is your friend;
 
haccks
newbie
Topic Author
Posts: 34
Joined: Tue Mar 29, 2016 2:10 pm

Re: How to create a free hotspot?

Thu Dec 29, 2016 3:36 pm

Where would this data be sent and stored?

You could probably make some kind of intermediary redirect, that submits your data, and then continues to log in via trial.
OK. I did what you said. Now trial user is redirected to my custom login page and time limit is working fine, but the only problem is once the router restart then users can login again for 1hr for same day. How to solve this issue?
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 24493
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: How to create a free hotspot?

Thu Dec 29, 2016 4:02 pm

Since this information about MAC addresses is stored in RAM, not database, it will clear after reboot.
Try to not reboot the router :)
No answer to your question? How to write posts
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 24493
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: How to create a free hotspot?

Thu Dec 29, 2016 4:05 pm

As an alternative, you could use the MAC address and send it to a RADIUS server, which would register this as a new account and put it in the RADIUS database. But it sounds like your setup already works.
No answer to your question? How to write posts
 
haccks
newbie
Topic Author
Posts: 34
Joined: Tue Mar 29, 2016 2:10 pm

Re: How to create a free hotspot?

Thu Dec 29, 2016 4:24 pm

Since this information about MAC addresses is stored in RAM, not database, it will clear after reboot.
Try to not reboot the router :)
Can't ignore power failure :)
 
haccks
newbie
Topic Author
Posts: 34
Joined: Tue Mar 29, 2016 2:10 pm

Re: How to create a free hotspot?

Thu Dec 29, 2016 4:35 pm

As an alternative, you could use the MAC address and send it to a RADIUS server, which would register this as a new account and put it in the RADIUS database. But it sounds like your setup already works.
I came with another alternative. In user profiles I put the following script in the "script" menu under "On Login" section:
:local "hotspot_user" $user;

:if ("$[/ip hotspot user get [find name=$"hotspot_user"] limit-bytes-total]" < "200") do={ /ip hotspot user remove $user }

/ip hotspot user add name="$user" limit-bytes-total=1073741824 limit-uptime=01:00:00 server=hotspot1 profile=trialUser mac-address="$[/ip hotspot active get [find user=$"hotspot_user"] mac-address]"

:if ("$[/ip hotspot active get [find user=$"hotspot_user"] limit-bytes-total]" < "200") do={ /ip hotspot host remove [find mac-address="$[/ip hotspot active get [find user=$"hotspot_user"] mac-address]"]}
This creates and stores the new trial "Users". This solved the relogin after reboot :D
I don't know it's a good way. What do you say?
 
drumme
just joined
Posts: 8
Joined: Fri Nov 09, 2012 5:26 am

Re: How to create a free hotspot?

Wed Jan 04, 2017 6:24 pm

No, he will have to click a button "Trial" on the login page. You can edit the login page, rename this button "Use internet" and hide the regular login forms. For the user, he will still see the login page. Just no login field, only a button
I customised the login page which asks user for -Name, Email and Mobile number for OTP verification. I want user to fill this form, and then use wifi for 1hr/1day.

Hi hacks
can you please send me your login page configuration scripts? this is exactly what am looking for.
i want ask user for -Name, Email and Mobile number for OTP verification.

please post here or send to drumme2000@yahoo.com

Who is online

Users browsing this forum: tdw and 112 guests