Page 1 of 1

How initialized a variable by SMS ??

Posted: Tue Jan 31, 2012 9:09 pm
by ahead
I want to know How initialized a variable by sending SMS to mikrotik?

I do these steps:
1-Create a startup script in (\system\schedule) like this:
01.JPG
2-Create another script named SMSScript in (\system\scripts) like this:
02.JPG

3-Send a SMS To mikrotik,such as:
:cmd mypass script SMSScript myvar=value2

After that, the SMS received and the script runs.
But variable (myvar) did not receive the new value.
03.JPG
Where is the problem?????? :( :?
___I also use this Link for my purpose : http://wiki.mikrotik.com/wiki/Manual:Tools/Sms

Re: How initialized a variable by SMS ??

Posted: Fri Feb 10, 2012 8:10 pm
by ahead
wow, More than 50 visitors and no one had any advice. :?: :-|

Re: How initialized a variable by SMS ??

Posted: Sat Feb 11, 2012 1:04 pm
by boen_robot
I don't think you're actually setting a value with the line
:global myvar
to begin with.

Try to explicitly set it to an empty string or whatever you want the new value to be, like:
:global myvar ""

Re: How initialized a variable by SMS ??

Posted: Tue Aug 14, 2012 1:06 am
by marria
Well, you got some advice. How did it work out?

Re: How initialized a variable by SMS ??

Posted: Thu Aug 30, 2012 1:52 pm
by DjM
Hello MikroTik forum,

it is not working also for me with suggested examples. I created Ticket#2012083066000462 for this, let's hope that we will get the solution.

Re: How initialized a variable by SMS ??

Posted: Wed Sep 05, 2012 5:52 pm
by DjM
Hello MikroTik forum members,

there was a bug confirmed by MikroTik team, it should be fixed in next release.

Re: How initialized a variable by SMS ??

Posted: Mon Oct 29, 2012 9:41 am
by vipe
3.30-5.21 the bug very long!! :D

Re: How initialized a variable by SMS ??

Posted: Mon Oct 29, 2012 9:53 am
by DjM
Last reply from MikroTik support is that the bug will be fixed in 6.x version, in next release from 6.0r2, I'm keeping the ticket opened for this :)

Re: How initialized a variable by SMS ??

Posted: Wed Jan 09, 2013 6:01 pm
by DjM
There was no update from MikroTik support team for more than month, I have opened a new ticket for this bug - Ticket#2013010766000731

Re: How initialized a variable by SMS ??

Posted: Thu Jan 31, 2013 1:25 pm
by Largelos
DjM, any news?

Re: How initialized a variable by SMS ??

Posted: Thu Jan 31, 2013 2:22 pm
by DjM
Unfornatelly nothing - no information in changelog of ROS 5.x or 6.x, also no asnwer on both support tickets.

@MikroTik support team: Please provide update on this issue which is open for more than 2 months.

Thank you

Re: How initialized a variable by SMS ??

Posted: Tue Mar 05, 2013 7:09 pm
by HaPe
Any progress?

Re: How initialized a variable by SMS ??

Posted: Mon Jun 03, 2013 10:57 am
by DjM
There is still no update from MikroTik support team's side on [Ticket#2013010766000731]. There was no reply on reminders send on 29/May and 21/May, also no information in releaselog of ROS that the issue has been fixed. I have send another reminder to support team on 03/June, let's hope that there will be an answer. :?

Update on 4/June 2013:
I have received information from MikroTik support team, that bug is reported to developers, but there is no ETA/schedule, when the bug will be fixed :?

Re: How initialized a variable by SMS ??

Posted: Thu Aug 08, 2013 4:20 am
by lelmus
:global FanTempCount;

:if ($FanTempCount >= 0) do={
} else={
:set FanTempCount 0;
}

Re: How initialized a variable by SMS ??

Posted: Sun Aug 18, 2013 12:58 pm
by vipe
hold on!

Re: How initialized a variable by SMS ??

Posted: Mon Sep 09, 2013 11:57 am
by DjM
Hello MikroTik support team,

what is the current status of solving this bug, please?

Thank you

Re: How initialized a variable by SMS ??

Posted: Tue Sep 24, 2013 8:14 am
by vipe
hold on!

Re: How initialized a variable by SMS ??

Posted: Mon Oct 28, 2013 4:43 pm
by vipe
Ticket#2013010766000731

Re: How initialized a variable by SMS ??

Posted: Tue Oct 29, 2013 12:05 am
by DjM
Hi vipe,

can you, please, share more details about your ticket?

Thank you

Re: How initialized a variable by SMS ??

Posted: Wed Nov 06, 2013 4:57 pm
by tomaskir
So, um, has this seriously NOT been working for the last 2 years?
I just tried to implement argument passing from a SMS, but I found it doesnt work.

So right now I dont know if Im doing something wrong, or if this is still broken.

Re: How initialized a variable by SMS ??

Posted: Wed Nov 06, 2013 9:28 pm
by DjM
Hi tomaskir,

unfortunatelly the bug is still here, there is no update from MikroTik support team about ETA or fixing of reported issue :( Bug is confirmed, all technical details were provided in ticket mentioned at the beginning of this topic.

Re: How initialized a variable by SMS ??

Posted: Thu Nov 07, 2013 2:56 am
by tomaskir
So just to confirm, there is currently no way to pass an argument to a script from a SMS?

And this has been broken for 2 years?

Re: How initialized a variable by SMS ??

Posted: Thu Nov 07, 2013 7:48 pm
by DjM
The bug was officially reported by my ticket on 08/2012, from this time I don't have any information about bug fix. I also don't know about any other way how to pass argument via SMS to script.

Re: How initialized a variable by SMS ??

Posted: Sun Nov 10, 2013 8:39 pm
by vipe
up,thx.

Re: How initialized a variable by SMS ??

Posted: Thu Jan 30, 2014 1:33 pm
by DjM
MikroTik support team,

any news on this topic, please?

Re: How initialized a variable by SMS ??

Posted: Mon Feb 16, 2015 5:16 pm
by DjM
After years it seems that we get this working:

1) Make sure that there is no ":local" or ":global" definition of used variables in the script code (variable name used in SMS text cannot be declared/initialized in script source code)

2) Make sure that the variables are not defined in the "/system script variable"

Example code:
:log info ("var1 = $var1, var2 = $var2");

Re: How initialized a variable by SMS ??

Posted: Wed Feb 18, 2015 6:24 am
by cicserver
:o
Dear DjM,
I was looking for it since long. Can you please provide more information? What ROS version you are using? Can you please provide any sample script in which we can pass variable?

Re: How initialized a variable by SMS ??

Posted: Wed Feb 18, 2015 9:32 am
by DjM
:o
Dear DjM,
I was looking for it since long. Can you please provide more information? What ROS version you are using? Can you please provide any sample script in which we can pass variable?
Hello cicserver,

I'm using ROS 6.27, try to use the code which I have provided in my previous post - just the ":log info" statement with two variables, nothing less, nothing more. Then send SMS in correct format (as described on Wiki) and you should see the values in the log entry.

Re: How initialized a variable by SMS ??

Posted: Wed Feb 18, 2015 11:51 am
by cicserver
Ok thank you very much for the update, I will test this in lab at weekends, and will post updates. :lol:

Re: How initialized a variable by SMS ??

Posted: Mon Oct 05, 2015 9:27 am
by vipe
thank you good man ,
the script is run on 6.31?

Re: How initialized a variable by SMS ??

Posted: Sun Dec 27, 2015 3:17 pm
by wcypierre
I've tested it on 6.33 and it works fine.