New Windows Gadget

Community contributed apps

Posts: 182
Joined: Tue Mar 22, 2011 11:08 am
PostPosted: Tue Jun 28, 2011 8:13 am
Spent some free time working on a new Windows Gadget and wanted to share with the community.

It is designed to work over wifi and can be installed on any number of computers you want. Everybody's environment is a little bit different, but the idea is you enter the url and port for your wifi adapter in the settings screen. Every 15 seconds the gadget will poll your controller for the latest data.

Requirements:
- ReefAngel WiFi adapter
- Curt's dev libraries 0.8.5.14 or later
- #define wifi inside Features.h file.
- Windows Vista or 7

To Install:
Download the ReefAngelGadget.zip file to your desktop and extract the .gadget file. Double click it and allow the unsigned gadget to install and you should be good to go.

Make sure the url you are attempting to use in the settings screen is a valid url and successfully communicates with your controller from inside an internet browser. By that I mean, first type the full url into your browser of choice and make sure the response looks like:

"ReefAngel Controller Web Server".. Or something similar. If you append "/r99" on the end of it you should see a response similar to:

Image



In my case, at home I use the following url in the settings screen:

"http://192.168.1.110:2000"

Away at work, I need to use my dyndns hostname and some port forwarding, but it looks similar.

"http://MyTestDynDNs.org:2000" (Looks similar to this)


Screenshots:

Image

Image

Image

^^^^Older screenshot - before the addition of the Actinic/Daylight PWM %^^^^^^


With "#define RelayExp" enabled, the gadget will show you one additional relay box statuses:
Image

Settings screen:
Image

Windows Installed Gadgets screen. The ReefAngel one uses the same icon as the ClientSuite:
Image


It's only a read-only gadget for now and has only been tested on two different Win7 x64 machines. Not sure how it will behave on other setups, but let me know.
Attachments
ReefAngelGadget.zip
Zipped up .gadget file.
(22.49 KiB) Downloaded 490 times

Posts: 12288
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Tue Jun 28, 2011 8:46 am
Nice!!
Downloading :D
Roberto.

Posts: 182
Joined: Tue Mar 22, 2011 11:08 am
PostPosted: Tue Jun 28, 2011 9:19 am
rimai wrote:Nice!!
Downloading :D


Cool, interested to see how well it works out for you. It might take a few seconds after saving from the settings screen for the ui to update. It's on a 15 second timer and doesn't update immediately like it probably should..

Also, I should mention what inspired me to finally put it together is I saw a post from Curt a little while ago where he linked the javascript you use to update the /wifi web page. I saw your Ajax code and thought I could probably use it in the gadget. I ended up using pretty much the whole thing :lol: . So, thank you for that!!

Posts: 12288
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Tue Jun 28, 2011 9:33 am
Yeah :)
Nice job!!!
I'm reading parameters from my little nano at home, here at the office :)
Roberto.

Posts: 182
Joined: Tue Mar 22, 2011 11:08 am
PostPosted: Tue Jun 28, 2011 9:41 am
Groovy!

Wondering if I should slow the timer down a bit. For some reason 15 seconds sounds excessive to me, but not sure.

Posts: 27
Joined: Thu May 26, 2011 6:28 am
PostPosted: Tue Jun 28, 2011 9:46 am
Sweet nice, works like a charm.

I have the RelayExp enabled but it still only returns 8 ports back from an /r99

How do you get all 16 ports if you have an expansion relay to show in the xml? And yes, I have the dev libraries.

Code: Select all
#define RelayExp
#define InstalledRelayExpansionModules   1

Posts: 182
Joined: Tue Mar 22, 2011 11:08 am
PostPosted: Tue Jun 28, 2011 10:33 am
chrome wrote:Sweet nice, works like a charm.

I have the RelayExp enabled but it still only returns 8 ports back from an /r99

How do you get all 16 ports if you have an expansion relay to show in the xml? And yes, I have the dev libraries.

Code: Select all
#define RelayExp
#define InstalledRelayExpansionModules   1


I think all you need is #define RelayExp to get everything back, thats all that I have in my Features file, although the #define InstalledRelayExpansionModules doesn't look familiar to me. I've never used that before so not sure if it effects what comes back.

In the returned xml, <R>,<RON> and <ROFF> represent the first relay box statuses. <R0>,<RON0> and <ROFF0> represent the second relay box worth of data. What are you seeing coming back in the xml?

Posts: 27
Joined: Thu May 26, 2011 6:28 am
PostPosted: Tue Jun 28, 2011 11:21 am
dmolton wrote:I think all you need is #define RelayExp to get everything back, thats all that I have in my Features file, although the #define InstalledRelayExpansionModules doesn't look familiar to me. I've never used that before so not sure if it effects what comes back.

In the returned xml, <R>,<RON> and <ROFF> represent the first relay box statuses. <R0>,<RON0> and <ROFF0> represent the second relay box worth of data. What are you seeing coming back in the xml?


Ok, I see. So is there documentation on what a 254 bitflag is? Or is it up to us to figure out?

Posts: 182
Joined: Tue Mar 22, 2011 11:08 am
PostPosted: Tue Jun 28, 2011 11:35 am
chrome wrote:Ok, I see. So is there documentation on what a 254 bitflag is? Or is it up to us to figure out?


I'm not sure if there is any documentation out there, though it was brought up awhile ago on the google group and it is up to us to convert it.. 254 is the byte representation of the binary octet string indicating the statuses and masks applied to a relay box..

When converted to binary form, the byte 255 looks like "11111111". If this were the status of the <R> element, it would mean each of the 8 relays are on. The binary string 11101110 shows the 4th and 8th relays are off and the rest on, but I'm not sure off hand what that would look like represented as a byte. Similarly, you need to do some bitwise operations against both masks and the R value to find out which relays are truly on and off.

Posts: 27
Joined: Thu May 26, 2011 6:28 am
PostPosted: Tue Jun 28, 2011 11:41 am
Ahh Ok I follow you. Thanks so much.
Next

Return to Apps

Who is online

Users browsing this forum: No registered users and 2 guests

cron