Generating hotspot passwords and sending them via sms

Hello to all

I have wireless network in my company where is guest network using Mikrotik hotspot. Now we try to build User friendly password generation
and we thought abaut sms sending passwords to our costumers.
Is there any chance to do it with user manager in mikrotik?


thank you

here is the sample of working code

/tool sms set receive-enabled=yes

:local smsPhone
:local smsMessage

delay 2;

:foreach i in=[/tool sms inbox find] do={

#Password generation
:local date [/system clock get time]

:local hour [:pick $date 0 2]
:local min [:pick $date 3 5]
:local sec [:pick $date 6 8]

:local pass 27394

:set pass ($hour * $min * $sec)

:if ($pass = 0) do {
:set pass 6524
}

:log info $pass
:log info $date
#End password generation

:set smsPhone [/tool sms inbox get $i phone];

:log info $smsPhone

#Create voucher
/tool user-manager user remove [/tool user-manager user find username=$smsPhone]

:log info “2”

/tool user-manager user add customer=admin disabled=no name=$smsPhone password=$pass shared-users=1 phone=$smsPhone

:log info “3”

#TODO set profile!!!
/tool user-manager user create-and-activate-profile user=$smsPhone customer=admin profile=hour

:log info “4”

#End create voucher

:set smsMessage “Login: $smsPhone Password: $pass”

:log info $smsMessage

:if ([:len $smsPhone]>10) do {
/tool sms send usb3 $smsPhone message=“$smsMessage”
}

:log info “5”

/tool sms inbox remove $i

:log info “6”

delay 10

}

hi mr samir
can i have your email address?
my email is amirreza.keshvari@gmail.com.

i have hotspot on my network,i want guest insert mobile number in text box and click submit buttom and system auto send username and password to that mobile number,
please help me

Thats ok script. But ruter has SMS option only for one “allowed number”. Does have some another option in this script for generate usernames?

any ideas how to make:

  1. HotSpot welcome page telling you to enter your phone number
  2. You enter your phone number, press “submit”
  3. You recieve sms and enter a password to a field “access code”?

To save the cost of SMS to the user, you may have corresponding phone number to login and the message text to be chosen as a password.
Auto activation!

Have a nice day Samir!

I see your script and i think this what i want, can you help me? i want authorization via sms (generated and send voucher via usb modem).

1 - User connect to Hotspot
2 - See login page
3 - Write his number in to login page and press submit button
4 - Receive password via sms and login with him
5 - Phone number write in log to disk with date&time authorization

Sorry for my English, i study now)

my email: nagobi@icloud.com
my Skype: posians

Recently We done the SMS Solutions for Mikrotik Hotspot using the radius

  1. User Connected to FREE-WIFI AP
  2. When he trying to browse automatically redirected to Login Page
  3. He Registered himself entering their mobile Number and name
  4. He will get OTP for Authorization after success
  5. He will Get the SMS of Username and Password with 30 Min Free usage
  6. After that he need to refill using Recharge Coupon or Payment Gateway.

Good news!

How you can do it? sms send via usb stick in mikrotik or another service? captive portal hosting on mikrotik or another place?

Developed using with freeradius Server, captive portal & SMS Every thing work from the same server

It will be very nice if you make some tutorial … maybe on wiki :smiley:

How do you run the script? by the scheduler?
Thanks.

Yes am also interested in this solution. For SMS sending i want to use SMS gateway api.

something new on this thing? Would be interested too

could you please give me this script ?
i need the users enter their mobile No. and get their generated password through SMS,
i know that the GSM modem is needed.
how can i do that ?

Hello, i´m interested, can you tell me more about it and cost please?.

Hi,
How can one get the code(cost). Can you also integrate other forms of payment to the system. Thanks

We have something similiar. We are sending a link in SMS. User click on the link, and a web browser autheticate him into the system. Of course there is possibility to collect phone numbers and use it for operators data retention.

It seems #rajeshrouthu just showing up to us what he did. didn’t come for help. I am looking for this solution too. Any guys can help??

Yes , I think he did great research for what he did or paid someone who know how to do that . You can find some solution on internet or find someone .