doCommandJump

Forum for discussing building user interfaces for controlling MLServer using the iPhone or iPod Touch.
tntwebguy
New Member
New Member
Posts: 33
Joined: Wed Nov 18, 2009 9:48 am
Contact:

doCommandJump

Postby tntwebguy » Wed Oct 05, 2011 9:43 am

I am trying to get this macro to work on my iphone scene and am having difficulty.
On my mlserver I have buttons on the home page for tracking my daughters nap, feeding, wake, diaper times. The macro works great and logs to a file. I am trying to setup it up to work from my iphone..I can log the time and display it...but it does not write to file..here ..I am using the same buttons at the bottom of the weather.html page

this part of the code works fine:
doCommand('MLServeCmd.Macro|SetVariable|NapDate~{{currentmonthstrshort}} {{currentdayofmonth}}~!SetVariable|NapTime~{{currenthm}}~{{currentampm}}

it is when I add in this to end of {{currentampm}}
~!MLScript|WriteFile~Write~C:\OliviaDailySchedule.txt~append~NAP {{currentdayofweekshort}} {{currentmonthstrshort}} {{currentdayofmonth}} {{currenthm}} {{currentampm}}___________________________________________________________<CR><LF>');"

that it breaks...this code works on the pc server running MLServer just fine...

Do I need to put in a better file path from the iphone instead of C:\OliviaDailySchedule.txt
like 192.168.x.x:81\C:\OliviaDailySchedule.txt??

here is the whole code below...the lines"_______________" are there for writing when it is printed out.

Please help

-TNT


<span id="tabbar" style="visibility:visible;">
<img src="images/tabbar.png" style="z-index:100;position:absolute;top:412px;left:0px;" />
<img onclick="doCommand('MLServeCmd.Macro|SetVariable|NapDate~{{currentmonthstrshort}} {{currentdayofmonth}}~!SetVariable|NapTime~{{currenthm}}~{{currentampm}}~!MLScript|WriteFile~Write~C:\OliviaDailySchedule.txt~append~NAP {{currentdayofweekshort}} {{currentmonthstrshort}} {{currentdayofmonth}} {{currenthm}} {{currentampm}}___________________________________________________________<CR><LF>');" src="images/tEmpty.png" style="z-index:101;position:absolute;top:410px;left:0px;" /><img onclick="doCommand('MLServeCmd.Macro|SetVariable|AwakeDate~{{currentmonthstrshort}} {{currentdayofmonth}}~!SetVariable|AwakeTime~{{currenthm}}~{{currentampm}}~!MLScript|WriteFile~Write~C:\OliviaDailySchedule.txt~append~Awake {{currentdayofweekshort}} {{currentmonthstrshort}} {{currentdayofmonth}} {{currenthm}} {{currentampm}}___________________________________________________________<CR><LF>');" src="images/tEmpty.png" style="z-index:101;position:absolute;top:410px;left:80px;" /><img onclick="doCommand('MLServeCmd.Macro|SetVariable|FeedDate~{{currentmonthstrshort}} {{currentdayofmonth}}~!SetVariable|FeedTime~{{currenthm}}~{{currentampm}}~!MLScript|WriteFile~Write~C:\OliviaDailySchedule.txt~append~ATE {{currentdayofweekshort}} {{currentmonthstrshort}} {{currentdayofmonth}} {{currenthm}} {{currentampm}}___________________________________________________________<CR><LF>');" src="images/tEmpty.png" style="z-index:101;position:absolute;top:410px;left:160px;" /><img onclick="doCommand('MLServeCmd.Macro|SetVariable|DiaperDate~{{currentmonthstrshort}} {{currentdayofmonth}}~!SetVariable|DiaperTime~{{currenthm}}~{{currentampm}}~!MLScript|WriteFile~Write~192.168.1.105:81\C:\OliviaDailySchedule.txt~append~Diaper {{currentdayofweekshort}} {{currentmonthstrshort}} {{currentdayofmonth}} {{currenthm}} {{currentampm}}___________________________________________________________<CR><LF>');" src="images/tEmpty.png" style="z-index:101;position:absolute;top:410px;left:240px;" /></span>

User avatar
CinemarDave
Site Admin
Site Admin
Posts: 10535
Joined: Fri Feb 07, 2003 8:56 am
Location: Planet Earth
Contact:

Re: doCommandJump

Postby CinemarDave » Wed Oct 05, 2011 10:12 am

I think you have an extra ~ in your macro. Every ! is prefixed with a ~ like ~!MLScript and that shouldn't be there. Are the <CR><LF> there to show me where your carriage return linefeed is or do you have the actual carriage return and linefeeds embedded in the macro? If the later then it would be better to move that into your MLScript.

tntwebguy
New Member
New Member
Posts: 33
Joined: Wed Nov 18, 2009 9:48 am
Contact:

Re: doCommandJump

Postby tntwebguy » Wed Oct 05, 2011 8:53 pm

I took them out ~ and the " _____CF
' its still not working

Any suggestions
<img onclick="doCommand('MLServeCmd.Macro|SetVariable|DiaperDate~{{currentmonthstrshort}} {{currentdayofmonth}}!SetVariable|DiaperTime~{{currenthm}}~{{currentampm}}!MLScript|WriteFile~Write~C:\OliviaDailySchedule.txt~append~Diaper {{currentdayofweekshort}} {{currentmonthstrshort}} {{currentdayofmonth}} {{currenthm}} {{currentampm}}');" src="images/tEmptyDiaper.png" style="z-index:101;position:absolute;top:410px;left:240px;" /></span>

-TNT

User avatar
CinemarDave
Site Admin
Site Admin
Posts: 10535
Joined: Fri Feb 07, 2003 8:56 am
Location: Planet Earth
Contact:

Re: doCommandJump

Postby CinemarDave » Wed Oct 05, 2011 10:15 pm

What does the MLServer event log look like when you press the button?

tntwebguy
New Member
New Member
Posts: 33
Joined: Wed Nov 18, 2009 9:48 am
Contact:

Re: doCommandJump

Postby tntwebguy » Thu Oct 06, 2011 7:25 am

here is a snippet of my event log with the errors....I also noticed processes that are happening that I do not need....Can I disable them to run more efficiently..Like the Elktstat and Kenwood sirius, mlphonebook etc..I will highlight in red below....there is also an error #2590 happening every few seconds...Thanks for all your help...I love this community!


10/6/2011 6:03:42 AM Processing (1029) System.Startup
10/6/2011 6:03:42 AM Processing (1030)

Macro|SetVariable|compnameXML~http://{{server_servername}}:6246/text.xml!SetVariable|currMap~1!SetVariable|WebDemoClient~{{server_servername}}!SetVariable|MLSirius_Device~Kenwood_1!SetVariable|mlphonebook_AlphaName~Last_name!SetVariable|mlelkm1_tstat_01_currenttemp~72!SetVariable|mlelkm1_tstat_01_heatsetpoint~72~!SetVariable|mlelkm1_tstat_01_coolsetpoint~70!SetVariable|mlelkm1_zone_018_statusmsg~Open!MLAlarmClock|Alarm~001~Off10/6/2011 6:03:42 AM Processing (1031)
SetVariable|compnameXML~http://{{server_servername}}:6246/text.xml
10/6/2011 6:03:42 AM Processing (1031) SetVariable|currMap~1
10/6/2011 6:03:42 AM Processing (1031)
SetVariable|WebDemoClient~{{server_servername}}
10/6/2011 6:03:42 AM Processing (1031) SetVariable|MLSirius_Device~Kenwood_1
10/6/2011 6:03:42 AM Processing (1031)
SetVariable|mlphonebook_AlphaName~Last_name
10/6/2011 6:03:42 AM Processing (1031)
SetVariable|mlelkm1_tstat_01_currenttemp~72
10/6/2011 6:03:42 AM Processing (1031)
SetVariable|mlelkm1_tstat_01_heatsetpoint~72~
10/6/2011 6:03:42 AM Processing (1031)
SetVariable|mlelkm1_tstat_01_coolsetpoint~70
10/6/2011 6:03:42 AM Processing (1031)
SetVariable|mlelkm1_zone_018_statusmsg~Open
10/6/2011 6:03:42 AM Processing (1031) MLAlarmClock|Alarm~001~Off
10/6/2011 6:03:42 AM System MLProcess Error at line #2590 - Object
variable or With block variable not set
10/6/2011 6:03:42 AM Processing (1030) W192.168.1.113
MLServeCmd.Macro|SetVariable|AwakeDate~Oct
6!SetVariable|AwakeTime~06:03~am!MLScript|WriteFile~Write~C:OliviaDailySchedule.txt~append~Awake
Thu Oct 6 06:03 am
10/6/2011 6:03:42 AM Processing (1031) W192.168.1.113
SetVariable|AwakeDate~Oct 6
10/6/2011 6:03:42 AM Processing (1031) W192.168.1.113
SetVariable|AwakeTime~06:03~am
10/6/2011 6:03:42 AM Processing (1031) W192.168.1.113
MLScript|WriteFile~Write~C:OliviaDailySchedule.txt~append~Awake Thu
Oct 6 06:03 am
10/6/2011 6:03:43 AM Processing (1030) System.Startup
10/6/2011 6:03:43 AM Processing (1031)
Macro|SetVariable|compnameXML~http://{{server_servername}}:6246/text.xml!SetVariable|currMap~1!SetVariable|WebDemoClient~{{server_servername}}!SetVariable|MLSirius_Device~Kenwood_1!SetVariable|mlphonebook_AlphaName~Last_name!SetVariable|mlelkm1_tstat_01_currenttemp~72!SetVariable|mlelkm1_tstat_01_heatsetpoint~72~!SetVariable|mlelkm1_tstat_01_coolsetpoint~70!SetVariable|mlelkm1_zone_018_statusmsg~Open!MLAlarmClock|Alarm~001~Off
10/6/2011 6:03:43 AM Processing (1032)
SetVariable|compnameXML~http://{{server_servername}}:6246/text.xml

Top part
10/6/2011 6:03:34 AM System MLProcess Error at line #2590 - Object
variable or With block variable not set
10/6/2011 6:03:34 AM Processing (1024) W192.168.1.113
MLConditional|IsNE####1##Macro|SetVariableFast|movies_showallcontent_W192.168.1.113~1!SetVariableFast|movies_similarinit_W192.168.1.113~0!SetVariableFast|movies_thumbsinit_W192.168.1.113~0!SetVariableFast|W192.168.1.113_web_init~1##
10/6/2011 6:03:34 AM Processing (1025) W192.168.1.113
Macro|SetVariableFast|movies_showallcontent_W192.168.1.113~1!SetVariableFast|movies_similarinit_W192.168.1.113~0!SetVariableFast|movies_thumbsinit_W192.168.1.113~0!SetVariableFast|W192.168.1.113_web_init~1
10/6/2011 6:03:34 AM Processing (1026) W192.168.1.113
SetVariableFast|movies_showallcontent_W192.168.1.113~1
10/6/2011 6:03:34 AM Processing (1026) W192.168.1.113
SetVariableFast|movies_similarinit_W192.168.1.113~0
10/6/2011 6:03:34 AM Processing (1026) W192.168.1.113
SetVariableFast|movies_thumbsinit_W192.168.1.113~0
10/6/2011 6:03:34 AM Processing (1026) W192.168.1.113
SetVariableFast|W192.168.1.113_web_init~1
10/6/2011 6:03:35 AM Processing (1024) System.Startup

User avatar
CinemarDave
Site Admin
Site Admin
Posts: 10535
Joined: Fri Feb 07, 2003 8:56 am
Location: Planet Earth
Contact:

Re: doCommandJump

Postby CinemarDave » Thu Oct 06, 2011 10:49 am

Wow that is a heap of bad. What is in your System.Startup macro? Do you need any of it? Second thing is why is it being called so often? System.Startup should only be called once. See the numbers in ()? Like (1032). That is the nesting level that keeps track of how many times MLProcess has called itself. It should normally range from (1) to (5) with (1) being the normal. Your numbers are so high because MLProcess keeps erroring out because of trying to execute the MLAlarmClock command. Do you use MLAlarmclock? You should resolve these issues first and then get the other things working.

tntwebguy
New Member
New Member
Posts: 33
Joined: Wed Nov 18, 2009 9:48 am
Contact:

Re: doCommandJump

Postby tntwebguy » Thu Oct 06, 2011 12:43 pm

Hahaha Thank you so much for the professional technical analysis of "heap of bad" going on..

That was funny! Ok...So..I am still in newbie town..getting better..

I would uncheck plugins that I am not using(MlAlarmclock) that seem to be loading..AND do I delete their .dll file if any in my Ml Server folder as well?

What plugin controls the elk thermostats?(i don't need that) What about the Sirius Kenwood process called above...I am using the sirius plugin but do not own a kenwood receiver, using the pc speakers. Can I turn something off in the plugin settings tabs?


THEN...Restart MlServer and look at process events...to only be between 1 to 5

I will get back to you

-TNT

User avatar
CinemarDave
Site Admin
Site Admin
Posts: 10535
Joined: Fri Feb 07, 2003 8:56 am
Location: Planet Earth
Contact:

Re: doCommandJump

Postby CinemarDave » Thu Oct 06, 2011 1:19 pm

Geek humor.

For any plugin that you are not using simply move the .dll from the \plugins folder into a different folder like \offline.

Go into the macro editor and edit the System.Startup macro. Delete anything in there that you do not use. Most likely it will be okay to delete the entire macro.

shakey
Intermediate
Intermediate
Posts: 285
Joined: Sat Jun 28, 2008 9:55 pm
Contact:

Re: doCommandJump

Postby shakey » Thu Oct 06, 2011 2:47 pm

I once heard a rumor Dave removed a "heap of bad" programing for some very important guidance systems. I sleep a little better an night knowing Dave's Cinemar programming is running my house and his other work is helping to guard our nation.


Return to “iPhone / iPod Touch Beta”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest