**BETA Release!** Demo ReefAngel Client suite

Discussion in 'General Reef Topics' started by crank2211, Aug 10, 2010.

to remove this notice and enjoy 3reef content with less ads. 3reef membership is free.

  1. crank2211

    crank2211 Purple Spiny Lobster

    Joined:
    Jan 13, 2009
    Messages:
    460
    Well when I first received the ReefAngel controller and wrote a Review on it, I mentioned I would be doing some custom development for it in hopes of sharing with the reefing community. Since then, I've been working on a few applications targeted towards making monitoring our tanks easier and providing more beneficial information on demand.



    The first week or so was solely dedicated to learning the Arduino environment and working with the custom libraries that Roberto and Curt have worked so hard on. Since then, the latest beta4 libraries available from Curt on his github account, by far provide the best interaction with the controller yet. The nested menus work very well and all settings are again stored on the controller board as expected. Additionally, the library separation makes custom tweaks and development very easy to do. As such, I was able to extend the wavemaker functionality with new options as well as create a new menu item that controls the dumping of all parameters off the controller, over the wire, based on user input.. Sweet!

    It didn't take long to realize the shortcomings of the method by which communication took place between the controller and our PC's. We would need to programatically open a serial port on a defined COM port and baud rate. This made communication easy to do with one and only one program running and communicating on the PC at a time. I initially knew I wanted at least 3 or 4 separate processes running to do different things.

    - Remote web access to parameters
    - Parameter logging for reporting.
    - A local client running to display real time parameters and turn On/Off outlets from the PC.
    - Windows Gadget

    Some of this could be bundled up into one large app. But some had to run separate as their own process to work (Windows Gadget)

    There are a few ways to skin this cat, but the best way I could think of was to create a WCF Windows Service that runs 24/7 in the background which handles sole communication to the controller via the COM port. it's only function is to receive data from the controller, format it and pass it on to subscribed clients using the Observer or Publisher/Subscriber design pattern. Because its a WCF service, a data contract ensures all subscribed clients receive the same formatted data. This takes the load off one app to do everything and lets individual subscribers decide what they want to do with the data when they receive it.

    So far at a high level I have:

    -Custom Arduino code to allow user to choose how often to dump parameters to listener.
    -WCF Listener service running and listening in on COM port. When data is received it is pushed to all subscribed clients.
    -Logger Win service which subscribes to the listener and logs received data to a SQLServer Compact database every 6 minutes - 24/7.
    -Winform client that also subscribes for realtime updates as well as connects to the compact database to report on historical data.

    The video below shows most of this in action. It is still very alpha stage and there's a lot of work left to do before I'm comfortable releasing it to test.

    Left to do:
    -Display historic data on graph
    -Log alerts and relay toggles from controller
    -Error handling
    -Export data to excel / graphs to jgeg
    -Spruce up user interface
    -Enable live On/Off toggling of outlets from PC
    -Finish installer
    -Lots of code organizing.

    However, here is what we have so far:
    Use 720P and expand for more detail...


    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]



    I'll keep you guys updated with what's going on, as I know there are a few Angel users.

    Also, if anyone has any suggestions, feedback, comments, critiques or functionality that would like see built in, please let me know.
     
    Last edited: Sep 25, 2010
    3 people like this.
  2. Click Here!

  3. Dingo

    Dingo Giant Squid

    Joined:
    Aug 1, 2009
    Messages:
    4,767
    Location:
    New Freedom, PA
    wow dude this is awesome!
    so umm do you mind sharing the code for the mobile updates :) that is sweet!
    is this for windows based OS only though?

    fyi, you just took reef angel to the next level!
     
  4. jonjonwells

    jonjonwells Great Blue Whale

    Joined:
    Dec 9, 2008
    Messages:
    2,835
    Location:
    SE Kansas
    That is a fantastic job...

    This will make the RA a very viable option, almost on par with RKE... and a whole hell of a lot cheaper.

    Major Props to you...
     
  5. crank2211

    crank2211 Purple Spiny Lobster

    Joined:
    Jan 13, 2009
    Messages:
    460
    Thanks Dingo, I wouldn't mind sharing the code at all. Are you more interested in the actual .NET code itself or the client application?

    As far as notifications go, the way it works currently is the application will use GMail as an email relay for both texts and emails. This is to avoid paying for an SMS gateway and GMail has a pretty high cap on the number of relay's an account is allowed per day or per hour. Each user will need a valid GMail account for the relay to work but can send notification emails to any number of different email accounts on different domains.

    Now that I think about it though, it might be beneficial to just create a generic ReefAngel account to handle all the relays for all users but if the user base grows too high and too many notifications get sent out - the account might get marked by Google as spam.

    Also it might be possible to use Yahoo or MSN for this job but I haven't looked into that yet and not even sure if they offer such a service.

    The client is designed to work on Windows machines for now. I'm developing on a Win 7 x64 machine but plan to test on a x86 as well as Windows XP x86 SP3 also before I release. The only prerequisite for running this whole suite is the .NET 3.5 framework. Even the compact database gets bundled up in the installer and the required libraries are already included so the user shouldn't have to worry about anything extra. I might be able to get something working on Linux but don't have a Mac and will need some help from other developers for that user base.


    Thanks jonjon, that's what I'm shooting for. Hopefully with enough users we can develop something very unique and capable.
     
  6. Dingo

    Dingo Giant Squid

    Joined:
    Aug 1, 2009
    Messages:
    4,767
    Location:
    New Freedom, PA
    Good stuff... I am on a Mac so I'll be a test person if you get it developed for Linux
     
  7. crank2211

    crank2211 Purple Spiny Lobster

    Joined:
    Jan 13, 2009
    Messages:
    460
    Updated videos to use YouTube.. Using 720P setting and expanding the video shows better details than the original Vimeo link..
     
  8. Click Here!

  9. Droopster

    Droopster Fire Worm

    Joined:
    Jun 10, 2010
    Messages:
    157
    Location:
    Greencastle, PA
    Im looking at getting a controller in the next week or two and the RA was brought to my attention. Sounds like if i have trouble your the person to talk to.
     
  10. Matt Rogers

    Matt Rogers Kingfish

    Joined:
    Dec 31, 2000
    Messages:
    13,466
    Location:
    Berkeley, CA
    I am surprised more haven't responded to this post crank. As a Web Developer by trade, I am floored by your efforts and results so far. What you have done here is really impressive and some big league code. When Roberto approached me about this controller, I was excited about the possibilities. You have taken the theoretical and made it reality with your efforts here. I look forward to your updates.

    Bravo!

    matt
     
  11. crank2211

    crank2211 Purple Spiny Lobster

    Joined:
    Jan 13, 2009
    Messages:
    460
    Thanks Matt, I'm a little surprised as well. I chalk it up to not many people own the controller yet and might still be on the fence about it. I expect others still want to see what the reviews look like after an extended period before they're ready to let it control their reef and as such aren't really interested just yet in the software side.


    Admittedly, I've owned the controller for a few weeks now and just lastnight actually hooked up all my equipment to the relay box. This was really for two reasons. I wanted to monitor the behavior of the controller for awhile to make sure it everything worked as expected - and also I was doing alot of testing/debugging with the code.

    I switched gears a bit and am concentrating more on the design / look and feel of the application, currently. Also trying to extend the functionality of the graph a bit to make it a bit more interactive.

    I'll upload some screenshots soon. Also if anyone has any feature requests or comments/suggestions please let me know!
     
  12. Matt Rogers

    Matt Rogers Kingfish

    Joined:
    Dec 31, 2000
    Messages:
    13,466
    Location:
    Berkeley, CA
    Cool. Can't wait to see your polish there... hey general question - how does the controller/software handle power outages?

    matt