Page 1 of 1

XML output

Posted: Thu Feb 09, 2012 7:04 pm
by Deckoz2302
Hmm...I know I saw it somewhere..where there was a xml file that is stored on the wifi module...and you just need to parse the information...thinking of writing a dedicated app for Android...as it happens I just got a replacement Droid2G.... and then decided to upgrade to the Nexus..so I have a 1 day old phone Im thinking about using as a secondary screen...where oh where has that thread with the address gone

Re: XML output

Posted: Thu Feb 09, 2012 7:26 pm
by rimai
just use http://ipaddress:2000/r99
Here is a sample of the new XML data that will be released soon:

Code: Select all

  <RA>
  <T1>770</T1> 
  <T2>919</T2> 
  <T3>768</T3> 
  <PH>823</PH> 
  <R>188</R> 
  <RON>32</RON> 
  <ROFF>255</ROFF> 
  <R1>61</R1> 
  <RON1>0</RON1> 
  <ROFF1>255</ROFF1> 
  <R2>0</R2> 
  <RON2>0</RON2> 
  <ROFF2>255</ROFF2> 
  <R3>0</R3> 
  <RON3>0</RON3> 
  <ROFF3>255</ROFF3> 
  <R4>0</R4> 
  <RON4>0</RON4> 
  <ROFF4>255</ROFF4> 
  <R5>0</R5> 
  <RON5>0</RON5> 
  <ROFF5>255</ROFF5> 
  <R6>0</R6> 
  <RON6>0</RON6> 
  <ROFF6>255</ROFF6> 
  <R7>0</R7> 
  <RON7>0</RON7> 
  <ROFF7>255</ROFF7> 
  <R8>0</R8> 
  <RON8>0</RON8> 
  <ROFF8>255</ROFF8> 
  <ATOLOW>1</ATOLOW> 
  <ATOHIGH>0</ATOHIGH> 
  <EM>11</EM> 
  <REM>1</REM> 
  <PWMA>0</PWMA> 
  <PWMD>0</PWMD> 
  <SAL>347</SAL> 
  <PWME0>20</PWME0> 
  <PWME1>20</PWME1> 
  <PWME2>100</PWME2> 
  <PWME3>40</PWME3> 
  <PWME4>0</PWME4> 
  <PWME5>0</PWME5> 
  <RFM>4</RFM> 
  <RFS>140</RFS> 
  <RFD>15</RFD> 
  <RFW>0</RFW> 
  <RFRB>0</RFRB> 
  <RFR>0</RFR> 
  <RFG>0</RFG> 
  <RFB>0</RFB> 
  <RFI>0</RFI> 
  </RA>

Re: XML output

Posted: Thu Feb 09, 2012 8:04 pm
by binder
Feel free to take a look at my Android Status app for ideas of how I do things. :)

https://github.com/curtbinder/AndroidStatus

Re: XML output

Posted: Fri Feb 10, 2012 12:41 pm
by Deckoz2302
Thank you both for the input ;D...rimai next Thursday...wifi module..word lol..

Binder the status app is great and will be using it soon for my mobile. I just want something more graphical to use as a dedicated secondary screen on a dock...

Re: XML output

Posted: Fri Feb 10, 2012 1:54 pm
by binder
Cool. If you develop a more graphical app or simpler app for monitoring only and would like it to be published on the android market, I can publish it for you if you didn't want to pay the fee for becoming a developer. It's just an open offer and you don't have to take me up on it at all. Just trying to help out if possible.

Re: XML output

Posted: Fri Feb 10, 2012 6:18 pm
by Deckoz2302
I appreciated it binder - I will let you know

I dont know if you ever used the custom clock widget. basically you have a menu system where you pick what you want and create a custom widget

What I think my process will be is first
-create a 8x8 grid
-Menu to choose xml tag(ill label them as what they are in menu)
-once tag is chosen, text input for label
example: Choice - Tempurature
How many? - 1 - 2 - 3?
if one - which sensor?
style - Temp 1: 78.9
Temp 1
78.9
color wheel - choose text color, choose parameter color
Placement on grid
-background choice
one of the things i was talking to roberto about was an animation, similar to grandfather clocks with the sun/moon dial. basically create what kind of looks like a timelapse of sun moving across the sky(background) from bottom right to bottom left. Then for the moon do the opposite(since they rotate the opposite) and have the moon rise on bottom left, and set on bottom right. Easiest way based off the xml roberto posted will be if you choose animation, we would have to chose a single pwm channel for each sun and moon check off of. If over 0 animation will start. however this poses a problem as to how to create the arc. Most people use a Set time that is programmed into the controller, which I could easily create a setting to tell the animation what times the rise/set are.

But for me with a suncycle - or anyone that creates something similar, I would need to create 4 variables(risehour & min, set hour & min)(or 2 variables in seconds, one rise one set) that would need to get added to the output of the xml. whether it be 2 or 4 variables(4 being easier for the user) it could work for any user provided we have the code on the RA side (ill have to look at RA's wifi libraries and mimic some code to make the 4 variables that get pulled for XML output). If the variable is the same for everyone aka add it to libraries.

Code: Select all

byte RiseHour;
byte RiseMinute;
byte SetHour;
byte SetMinute;
And then for whatever we're using whether it be standard lights, SetDaylight(),SetActinic(), PWM 0-5... same variable xml output....animation, in the background of things you wanna display...

come to think of it...pretty much what you have binder...except customizable gui..thats what android is to me anyway...same as arduino

less talking...more working.

Binder, have you started making widgets for status yet?

Re: XML output

Posted: Fri Feb 10, 2012 6:38 pm
by binder
Feel free to take a look at the main activity in my Android Status app to give you an idea of how I handle things. It may be a little confusing with me using a service and all but it should be helpful.

No, I have not started on any widgets yet. I have the framework setup to handle them. The service broadcasts all the data so there's no need to communicate with the controller as long as my app is installed. In the next release, I'm going to add in the ability to query the controller on an interval (and to start at boot, etc). Then you will just have to have the widget register to receive the messages from my update service. So you just listen for data and then update appropriately. Super simple :)

I was going to include a generic / basic widget that displays like the temperature of the tank. Very basic. Just as an example for people. Dave (dmolton) was also talking about writing a widget too. I say the more widgets (choices) the better.

Feel free to PM me or email me directly and we can talk more instead of on here if you want.

Re: XML output

Posted: Sat Feb 11, 2012 9:38 am
by Deckoz2302
Ok cool - It may be worth it to take a look at your code and design a couple widgets for you to add vs reinventing the wheel of what you already have. Possibly a full screen widget. Ima take a look at your code today

Re: XML output

Posted: Sat Feb 11, 2012 9:47 am
by binder
Yeah, I'd be more than happy to either include widgets with the app or have a separate app of widgets only.