Page 1 of 1

SMS receiving now supported, can run scripts

Posted: Fri May 08, 2009 4:32 pm
by normis
Now it's possible for you to send an SMS to your router, tell it to run a script (parameters supported) and the router can even respond, as it also supports SMS sending! More here:

http://wiki.mikrotik.com/wiki/Sms

Re: SMS receiving now supported, can run scripts

Posted: Fri May 22, 2009 1:50 am
by dormador
go a head mikrotik

you are the best if you continuous ....

Re: SMS receiving now supported, can run scripts

Posted: Sun May 24, 2009 2:26 am
by QpoX
Now it's possible for you to send an SMS to your router, tell it to run a script (parameters supported) and the router can even respond, as it also supports SMS sending! More here:

http://wiki.mikrotik.com/wiki/Sms
And it works like a charm!

Re: SMS receiving now supported, can run scripts

Posted: Sun May 24, 2009 9:31 pm
by xezen
does anyone know were i can buy a gsm modem in south africa?

as i cant seem to find anything

does anyone know if it works with usb gsm modem?

Re: SMS receiving now supported, can run scripts

Posted: Sun May 24, 2009 9:37 pm
by QpoX
does anyone know were i can buy a gsm modem in south africa?

as i cant seem to find anything

does anyone know if it works with usb gsm modem?
It works great with USB modems... i use a Huawei E180...
http://www.pricecheck.co.za/search/?search=huawei

Re: SMS receiving now supported, can run scripts

Posted: Sun May 24, 2009 9:39 pm
by xezen
how can i tell if mikrotik installes my modem?

if it is picked up and how can i test it?

Re: SMS receiving now supported, can run scripts

Posted: Sun May 24, 2009 10:28 pm
by QpoX
how can i tell if mikrotik installes my modem?

if it is picked up and how can i test it?
Just insert it in your USB port and wait a bit then look under /ports if there is something new.

Mine looks like this and usb3 is my modem.
And remember the settings for it (9600/8/n/1/n).
[admin@dev] /port> print
Flags: I - inactive 
 #   NAME                      CHANNELS   USED-BY                     BAUD-RATE
 0   serial0                   1                                      9600     
 1   serial1                   1                                      9600     
 2   usb3                      2                                      9600     
And under /system resource usb
[admin@dev] /system resource usb> print
 # DEVICE VENDOR                   NAME                  SPEED                 
 0 1:1                             OHCI Host Controller  12 Mbps               
 1 1:2    HUAWEI Technology        HUAWEI Mobile         12 Mbps               
After this run: /tool sms send usb3 1234567890 message="This is a test!!!"
Change usb3 this to your port and 1234567890 to your cell number.

Re: SMS receiving now supported, can run scripts

Posted: Mon May 25, 2009 4:37 am
by melwong
Hi,

Once i enable read-running=yes.... to enable sms receiving, i cannot disable it to no anymore. How to disable it ?
Is this a bug ? i am using x86 pkg.

Re: SMS receiving now supported, can run scripts

Posted: Mon May 25, 2009 5:01 am
by QpoX
Just use:
/tool sms set reader-running=no

Re: SMS receiving now supported, can run scripts

Posted: Mon May 25, 2009 5:25 am
by melwong
Just use:
/tool sms set reader-running=no

I have tried before posting this. It runs for a while and It gave me this error ...action timeout - try again. if error continues, please contact Mikrotik Support and a supout file (13)

Re: SMS receiving now supported, can run scripts

Posted: Mon May 25, 2009 5:27 am
by melwong
Just use:
/tool sms set reader-running=no

I have tried before posting this. It runs for a while and It gave me this error ...action timeout - try again. if error continues, please contact Mikrotik Support and a supout file (13)

I suspect its a rights issue. I configure this as a admin user. But the ports configuration is all under *sys user. Which i presume is the root user.
Please verify if this is an oversight by mikrotik on the port rights.

Re: SMS receiving now supported, can run scripts

Posted: Mon May 25, 2009 6:01 am
by QpoX
i have no problem on x86.

Re: SMS receiving now supported, can run scripts

Posted: Mon May 25, 2009 8:25 am
by melwong
Ok i have found the a workaround way.

Apparently, when i enable reader-running to yes the first time, the configuration has sort of change. And i cannot reset it back to no. So i do a /system reset-configuration.

Then i import my backup.rsc back and NOW everything is working fine. I can set and reset reader-running config. Thanks a lot.

Anyway info i can learn on the command syntax for the script ?

The wiki :cmd var etc is too simple.

Re: SMS receiving now supported, can run scripts

Posted: Tue May 26, 2009 11:53 pm
by xezen
can you maybe post a script as anexample and what message you sent to the server to run it as i cant get that right


modemworks100%

Re: SMS receiving now supported, can run scripts

Posted: Wed May 27, 2009 12:07 am
by QpoX
Here is something simple...

Make a script called "smsbackup"
/export file=sms-backup
/tool sms send usb3 004512345678 message="SMS Backup is done..."
Change usb3 and 004512345678 to your cell-phone number.

Then send a SMS with this
:cmd 1234 script smsbackup
Change 1234 to the pin set on RouterOS to receive.

You will get a sms back when the backup command is done (and not if it is successful!).

Re: SMS receiving now supported, can run scripts

Posted: Tue Jun 02, 2009 6:48 pm
by conjurer
Can anyone recomend some usb gsm device?
I don't need anys 3g or even gprs connectivity. I want to use it only for dude sms alerts, and i want it cheap, because i don't want to waste money on 3g. but i down know shich one can go with ROS.
It can be vie usb or serial cable.
I have tried to connect my old siemens via db9 serial cable, which works with my windows pc, but doesn't worked with dude.

Re: SMS receiving now supported, can run scripts

Posted: Tue Jun 02, 2009 7:29 pm
by QpoX
Can anyone recomend some usb gsm device?
I don't need anys 3g or even gprs connectivity. I want to use it only for dude sms alerts, and i want it cheap, because i don't want to waste money on 3g. but i down know shich one can go with ROS.
It can be vie usb or serial cable.
I have tried to connect my old siemens via db9 serial cable, which works with my windows pc, but doesn't worked with dude.
I've tried some Siemens modems all work fine on PC but on ROS some don't!
But the USB 3G modems are some time cheap and a great SMS modem.
A Huawei E180 costs about €100,00 and some of the new Siemens modems costs from €125,00.

Re: SMS receiving now supported, can run scripts

Posted: Wed Jun 03, 2009 8:49 am
by conjurer
Anything for < 50 €? <30€?
Maybe anyone used old cellphone and it worked fine?

Re: SMS receiving now supported, can run scripts

Posted: Wed Jun 03, 2009 9:22 am
by QpoX
Anything for < 50 €? <30€?
Maybe anyone used old cellphone and it worked fine?
Did just try with my SonyEricsson T310 via serial cable, did not work :(

Re: SMS receiving now supported, can run scripts

Posted: Wed Jun 03, 2009 9:39 am
by conjurer
Also siemens mc60 doesn't work.

Re: SMS receiving now supported, can run scripts

Posted: Mon Jun 08, 2009 3:37 pm
by fly
I'm trying to pass variables but with no success.

sms text:
:cmd password 1234567890 smsScript var="test"

script:
:log info $var

What is wrong?

Re: SMS receiving now supported, can run scripts

Posted: Thu Jun 11, 2009 4:54 pm
by asus
can we set warning sms for those whose account is going to expire within 2 days & remind him to pay I'm using usermanager

Re: SMS receiving now supported, can run scripts

Posted: Thu Jul 02, 2009 8:28 pm
by Antixx
Thanks to MT team for this great feature.
btw it would be great idea if it works with http sms gateways.

Re: SMS receiving now supported, can run scripts

Posted: Tue Jul 07, 2009 2:38 pm
by Chupaka
it would be great idea if it works with http sms gateways.
examples?..

Re: SMS receiving now supported, can run scripts

Posted: Tue Jul 07, 2009 3:26 pm
by Muqatil
I gave it a try:
My goal was to reiceve a sms with a user, dig into userman, retrieve a password and send back a sms with the username and the pass..
I failed, mostly because i don't have a clue about ROS scripting and it gave me more problems than expected.
Then i placed my huawei usb modem into an Ubuntu machine (recognized automatically [as ROS did]), installed gnokii, and i made a php script that parse the received sms, dig into usermanager via php api, get the password and insert the phone number into the phone field of the user requested, and finally send back an sms using a sms gateway provider that accepts phonenumber@smsgateway as mail destination.
It works like a charm. It's a shame i wasn't unable to make it all inside ROS. (I admit it, it's mostly my fault)
Tell me if i should make a wiki of it and ofc get a L6 license :D

Re: SMS receiving now supported, can run scripts

Posted: Wed Jul 08, 2009 4:17 am
by dencow
very nice new feature 8)

Re: SMS receiving now supported, can run scripts

Posted: Wed Jul 08, 2009 1:02 pm
by Antixx
it's cool, you can do more with MK. ;)

SMS receiving now supported,

Posted: Thu Jul 09, 2009 11:38 pm
by Joshiii
Hi Normis
I am looking for someway of connecting a cell our cell router to mikrotik to enable friends on the farm to send and receive sms. There is no telephone and cell reception is 10 kilometers away, and cell repeaters are way to costly. Any help will be appreciated and can be extended to a few farms here in Namibia

Re: SMS receiving now supported, can run scripts

Posted: Fri Jul 10, 2009 10:45 am
by normis
routeros can't receive and send SMS messages if there is no cell tower nearby, it is not a cell "AP" (or what do you call them?) just another station, like your phone. if it's not connected to the GSM provider, it can't receive sms messages, so you can't use RouterOS to extend cell coverage.

Re: SMS receiving now supported, can run scripts

Posted: Fri Jul 10, 2009 11:50 am
by hilton
Joshiii, you need to attach a 3G modem to the router which in turn needs a cell tower nearby.

You could host a server somewhere and set-up a jabber server and let the farmers use that for comms?

Re: SMS receiving now supported, can run scripts

Posted: Fri Jul 10, 2009 11:54 am
by normis
if they can use internet, why bother with the 3G modems? just send your SMS messages from some website

Re: SMS receiving now supported, can run scripts

Posted: Fri Jul 10, 2009 12:04 pm
by hilton
Normis, sms in this country (South Africa/Nambia) is not free.

They would need to use something like this;

http://www.winsms.co.za/

And then route the replies back to their email which is available via the Mikrotik router.

Re: SMS receiving now supported, can run scripts

Posted: Fri Jul 10, 2009 12:35 pm
by Joshiii
Hi Hilton

My aim is to have a mikrotik with solar power on the mountain, connect a cell to the mikrotik and beam the mikrotik to the farm house. Our cell towers in the country side does not cater for 3G, just normal phoning and sms'ing. I need to have the people send a sms via the mikrotik to the nearest cell tower, the signal about 10km from the house on a mountain top is very good. Currently the farmer needs to drive very far to get to the point where he receives a signal. And on farm roads that consist of nothing more than 2 tracks can take up to 45 min to drive.

Re: SMS receiving now supported, can run scripts

Posted: Fri Jul 10, 2009 12:41 pm
by hilton
Joshiii, this is not possible. The Mikrotik router is an IP based device and NOT a GSM device.

Re: SMS receiving now supported, can run scripts

Posted: Fri Jul 10, 2009 12:50 pm
by Joshiii
Hilton

I fully understand the workings of the mikrotik, I want the user using a laptop to send via the wireless network through the cell a sms.

Re: SMS receiving now supported, can run scripts

Posted: Fri Jul 10, 2009 12:53 pm
by normis
if the laptop user has internet from the MikroTik AP, he could FTP a text file with the SMS contents to the router, the router could use the contents in a script which then could send an SMS .. you could even write a small program that FTPs files to the MT router :)

Re: SMS receiving now supported, can run scripts

Posted: Fri Jul 10, 2009 1:01 pm
by Joshiii
Thanks, will do it this way, consider my request closed.

Re: SMS receiving now supported, can run scripts

Posted: Fri Jul 10, 2009 2:47 pm
by xezen
where do i put the gps sim pin in?


i put it in secret: "xxxx"

but still asks for a pin

Re: SMS receiving now supported, can run scripts

Posted: Fri Jul 10, 2009 2:48 pm
by normis
Turn off PIN request for your SIM card, it makes the life much easier. Do it in a phone if you do not know the correct AT command.
from http://wiki.mikrotik.com/wiki/Option_Gl ... _USB_Modem

Re: SMS receiving now supported, can run scripts

Posted: Fri Jul 24, 2009 11:48 am
by xezen
i got it right to send a sma byt when i reply to the sms i gey nothing


iv set my password
xxxx
and number with area code

+27xxxxxxxx

and i have a script called

sms

so if i reply to the sms sent from the server

:cmd xxxx script sms
it should run the script but nothing comes in the indox

can anyone help me with this?

Re: SMS receiving now supported, can run scripts

Posted: Mon Feb 28, 2011 2:10 pm
by CyberT
is your receive-enabled: yes
secret is only for if you want to run scripts with the sms to device "cmd: <<pass>> script $nameofscript <aka reboot>


[admin@cybert] > tool sms pr
receive-enabled: yes
port: usb2
channel: 3
secret: ""
allowed-number: ""
keep-max-sms: 20


be sure to check that your receiving is on aka used by also always states (sms tool && PPP) ::=>
[admin@cybert] > /port pr
Flags: I - inactive
# NAME CHANNELS USED-BY BAUD-RATE
0 serial0 1 Serial Console auto
1 usb2 7 sms tool, PPP <ppp-out1> 9600


then u can find your sms's in /tool sms inb pr

after that im not to sure what to do with the sms :-/

[admin@cybert] > /tool sms inbox pr
# SRC TIMESTAMP TEXT
0 27820099892 Feb/15/2011 09:31:25 GMT -0 MYGIG 2.3 bundle purchased. 2355.00MB is available in the NEXT S
20110331. Your account has been debited with R389.00. Loyalty Po

Re: SMS receiving now supported, can run scripts

Posted: Thu Dec 13, 2012 7:56 am
by tombee79
Hi

I don't want to sound funny but why do you need the GSM modem to send and receive SMSs?

You MT router is connected to Internet ISP ex. Bell Canada, do you still need to GSM modem to send and receive SMS/

Thanks for in-lighting me.

Re: SMS receiving now supported, can run scripts

Posted: Thu Dec 13, 2012 8:06 am
by normis
Internet and the mobile phone network are two different things. Yes, you need a GSM modem to send GSM SMS messages. If you have internet, you can send emails.

Re: SMS receiving now supported, can run scripts

Posted: Thu Dec 13, 2012 5:51 pm
by QpoX
Some CellPhone providers allow Email->SMS
ex. 1234567890@sms.myprovider.tld
Then when sending a mail to an email address, the user will get an sms.

Re: SMS receiving now supported, can run scripts

Posted: Fri Dec 21, 2012 12:12 pm
by el berto
[admin@dev] /port> print
Flags: I - inactive 
 #   NAME                      CHANNELS   USED-BY                     BAUD-RATE
 0   serial0                   1                                      9600     
 1   serial1                   1                                      9600     
 2   usb3                      2                                      9600     
And under /system resource usb
[admin@dev] /system resource usb> print
 # DEVICE VENDOR                   NAME                  SPEED                 
 0 1:1                             OHCI Host Controller  12 Mbps               
 1 1:2    HUAWEI Technology        HUAWEI Mobile         12 Mbps               
In "resource" menu I can see USB modem (device 1:2, vendor, name, and so on....).
But, how can I detect which port (usb1, usb2, usb3, ....) is associated to USB modem?


Then, if I'm using USB modem for internet connection (let's suppose I use modem set as Data Channel=0, Info Channel=1), which channel should I use to receive SMS?
Or SMS receiving is disabled while ppp-client (USB modem internet connection) is running?
Thanks.

Re: SMS receiving now supported, can run scripts

Posted: Thu Oct 29, 2015 4:18 pm
by vipe
use in ros 6.32.2



[m@s] /tool sms> /system serial-terminal serial0 channel=0

[Ctrl-A is the prefix key]

at+cpin?
+CPIN: READY

at+cfun=0
OK
at+cfun=1
OK
at+cpin=1234
OK
at+cpin?
+CPIN: READY

at+gmi
WAVECOM MODEM

OK
at+gmm
MULTIBAND 900E 1800

OK
ati
WAVECOM MODEM

MULTIBAND 900E 1800

OK
at+gmr
532a09gg.2C2 1828120 040802 18:22

at+cmgs="2222222***"
> test
>
+CMGS: 1

OK




[m@s] /tool sms> send serial0 channel=0 phone-number=2222**** message=go
failure: timeout



I'm just like you, I don't know what you are.
What is the solution.