Page 1 of 1

How to create a free hotspot?

Posted: Thu Dec 29, 2016 10:08 am
by haccks
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?

Re: How to create a free hotspot?

Posted: Thu Dec 29, 2016 10:28 am
by normis
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.

Re: How to create a free hotspot?

Posted: Thu Dec 29, 2016 10:33 am
by haccks
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?

Re: How to create a free hotspot?

Posted: Thu Dec 29, 2016 10:46 am
by normis
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

Re: How to create a free hotspot?

Posted: Thu Dec 29, 2016 10:50 am
by haccks
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.

Re: How to create a free hotspot?

Posted: Thu Dec 29, 2016 10:53 am
by normis
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.

Re: How to create a free hotspot?

Posted: Thu Dec 29, 2016 11:14 am
by haccks
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.

Re: How to create a free hotspot?

Posted: Thu Dec 29, 2016 12:16 pm
by nichky
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

Re: How to create a free hotspot?

Posted: Thu Dec 29, 2016 3:36 pm
by haccks
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?

Re: How to create a free hotspot?

Posted: Thu Dec 29, 2016 4:02 pm
by normis
Since this information about MAC addresses is stored in RAM, not database, it will clear after reboot.
Try to not reboot the router :)

Re: How to create a free hotspot?

Posted: Thu Dec 29, 2016 4:05 pm
by normis
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.

Re: How to create a free hotspot?

Posted: Thu Dec 29, 2016 4:24 pm
by haccks
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 :)

Re: How to create a free hotspot?

Posted: Thu Dec 29, 2016 4:35 pm
by haccks
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?

Re: How to create a free hotspot?

Posted: Wed Jan 04, 2017 6:24 pm
by drumme
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