Android Reef Angel Status

Community contributed apps
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Android Reef Angel Status

Post by binder »

projectx wrote:there a way to change what is set to on and off during feeding mode or water change mode?
Yes. You do this inside your PDE file. If you used RAGen to generate your PDE file, on the PDE tab at the bottom of the screen you will be able to "check" what ports get turned off in the different modes.

If you did not use RAGen, you can manually add that functionality to your PDE file in the setup(). The code you will want is as follows:

Code: Select all

void setup()
{
    ReefAngel.Init();  //Initialize controller

    // Set the ports that get toggled on & off during the following modes
    // To enable a port to be toggled, place a 1 in the appropriate position
    // Uncomment and update as needed
    //                     Port   87654321
    //ReefAngel.FeedingModePorts = B10011100;
    //ReefAngel.WaterChangePorts = B10011100;
    //ReefAngel.OverheatShutoffPorts = B00001100;
    //ReefAngel.LightsOnPorts = B00000110;

    // Other initialization code goes here...
}
From the example above, you just need to place a 1 in the correct spot of the port you want turned on/off in the respective mode. If you look at the Feeding and water change modes above, ports 8, 5, 4 & 3 will be turned OFF when those modes are entered and turned ON when those modes are exited.
projectx
Posts: 118
Joined: Sat Apr 23, 2011 6:53 pm

Re: Android Reef Angel Status

Post by projectx »

Ok, sorry I ment inside the android app, i did do it inside the ragen app.
Image
serhiyi
Posts: 49
Joined: Thu Jul 21, 2011 8:59 pm

Re: Android Reef Angel Status

Post by serhiyi »

Does this work with WiFi Authentication?

I was testing app inside the house with local IP and it works. But I want to be able to access controller from anywhere using phone. Before setting up router to handle redirect I added security to controler

I'm able to use access by 192.168.1.100:2000/wifi and it asks for user and password. Works great.
But now app is not working.

My code:

Code: Select all

void setup()
{
    ReefAngel.Init(); //Initialize controller
    WifiAuthentication("ra:test");
    ReefAngel.SetTemperatureUnit(0);
    ReefAngel.PWM.SetActinic(0);
    ReefAngel.PWM.SetDaylight(0);
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Android Reef Angel Status

Post by binder »

No, authentication currently is not implemented. It is added to the todo list and will be worked on. If I recall correctly, some people were having issues with authentication in general but I do not know what the status of that is as it has been a little while since it was discussed on the forums.
agentgreen
Posts: 97
Joined: Wed Jul 06, 2011 6:45 am

Re: Android Reef Angel Status

Post by agentgreen »

Great work on this app! Quick question.

I have port forwarding setup and I can use the app to read memory settings, so I know the connection is working. However, when I hit Refresh, the 'Last Updated" field runs through, Connecting -> Reading (can't really tell its too fast) -> Parsing and stays at parsing, but doesn't seem to update any of the items below.

Once I switch back to the web banner everything updates. Am I missing something?
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Android Reef Angel Status

Post by rimai »

Bug :(
You are in the same boat that I am.
Curt is working on it though.
Roberto.
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Android Reef Angel Status

Post by binder »

Roberto is right. He found a bug with the app. I had partially implemented relay boxes and doing so triggered the bug. I've got it fixed and should be releasing an update soon.
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Android Reef Angel Status

Post by binder »

Just released the fix for it. Be on the lookout for the update to come through the market.
agentgreen
Posts: 97
Joined: Wed Jul 06, 2011 6:45 am

Re: Android Reef Angel Status

Post by agentgreen »

binder wrote:Just released the fix for it. Be on the lookout for the update to come through the market.
Love it! Thanks!
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Android Reef Angel Status

Post by binder »

Let me know if you have any other problems or questions about it. Also, feedback (both positive and negative) is always welcomed.
agentgreen
Posts: 97
Joined: Wed Jul 06, 2011 6:45 am

Re: Android Reef Angel Status

Post by agentgreen »

Hrmm, I saw the update, installed it, rebooted my phone to verify I am running the new version, and I'm still seeing the same behavior. Is there anything on my side that I might be missing?

I guess the better question, have you released multiple updates today? Maybe I didn't get the most recent one...
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Android Reef Angel Status

Post by binder »

Most recent update is 0.4.1.

If you are still seeing the same behavior, could you elaborate more on what your setup is? How many relay boxes do you have installed?
agentgreen
Posts: 97
Joined: Wed Jul 06, 2011 6:45 am

Re: Android Reef Angel Status

Post by agentgreen »

binder wrote:Most recent update is 0.4.1.

If you are still seeing the same behavior, could you elaborate more on what your setup is? How many relay boxes do you have installed?
Sure. I just verified I'm running 0.4.1. I am running 2 relay boxes at the moment and both are connected. I have port 2000 forwarded on my router to port 80 on the internal IP address of the wifi module. I can read memory settings as well.

I can PM you my connection information if it will help with debugging.
dedvalson
Posts: 140
Joined: Tue Oct 04, 2011 5:49 am

Re: Android Reef Angel Status

Post by dedvalson »

Hi,

I am having the same issue. As of the update a few days ago, the Android app got stuck on Parsing forever. I just downloaded the newest update today and it is doing the same thing.

I have 1 additional Relay box (besides the main one). This was working great for me till a few days ago.

I know I am able to reach the box because I can Read and Write Memory and also the Feeding Mode button works. I have Library version 0.8.5.19 and Reef Angel Status version 0.4.1

Don
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Android Reef Angel Status

Post by binder »

Yeah, I figured out what the problem actually is now. Thanks to agentgreen for letting me test out on his controller to confirm a couple things. It was a continued error on my part with the only partially implemented expansion relay support. Problem is fixed and will be released shortly.
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Android Reef Angel Status

Post by binder »

Just released the fix for the problem. Let me know if it still persists.
agentgreen
Posts: 97
Joined: Wed Jul 06, 2011 6:45 am

Re: Android Reef Angel Status

Post by agentgreen »

binder wrote:Just released the fix for the problem. Let me know if it still persists.
Success! Thanks so much!
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Android Reef Angel Status

Post by binder »

Ok. I figured out a problem. In fixing the relay box issue, it breaks with the 0.9.0 libraries. It has to do with how the data is sent. There's gonna be one more minor update. So bear with me on this update. This will fix both versions of the libraries now until expansion relays are officially supported.
dedvalson
Posts: 140
Joined: Tue Oct 04, 2011 5:49 am

Re: Android Reef Angel Status

Post by dedvalson »

Works for me too.

Thanks.

Looking forward to having the Expansion Relay Support. ;)
Mike S
Posts: 82
Joined: Tue Dec 27, 2011 7:26 pm

Re: Android Reef Angel Status

Post by Mike S »

I'm finally diving in to the memory settings in this app and they are awesome. Is there a guide or info available that explains how each setting works? I'm trying understand how the actinic/daylight pwm % settings relate to the pwm slope actinic/daylight end % settings. Does the pwm % setting adjust the maximum intensity that the light will reach once the slope function ramps up fully? Does the slope % end setting set the threshold at which the lights turn off? This setting appears to range from 0 to 255 rather than a 0 to 100 scale?
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Android Reef Angel Status

Post by binder »

Mike S
Posts: 82
Joined: Tue Dec 27, 2011 7:26 pm

Re: Android Reef Angel Status

Post by Mike S »

Thanks Curt that answered my question. It sounds like I need to set the pwm values to 0 when using the slope function and use the pwm slope ____ end % to set the peak values.
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Android Reef Angel Status

Post by binder »

Mike S wrote:Thanks Curt that answered my question. It sounds like I need to set the pwm values to 0 when using the slope function and use the pwm slope ____ end % to set the peak values.
That would work just fine. To ensure that, you would most likely need to modify your PWMSlope function call inside your PDE file to have it read the memory values. What we have done in an upcoming release is link the PWMSlope call to the on/off times for your StdLights call. Here's the code you should use to have it mimic that:

Code: Select all

ReefAngel.PWM.SetActinic(PWMSlope(
			InternalMemory.StdLightsOnHour_read(),
			InternalMemory.StdLightsOnMinute_read(),
			InternalMemory.StdLightsOffHour_read(),
			InternalMemory.StdLightsOffMinute_read(),
			InternalMemory.PWMSlopeStartA_read(),
			InternalMemory.PWMSlopeEndA_read(),
			InternalMemory.PWMSlopeDurationA_read(),
			ReefAngel.PWM.GetActinicValue()
			));
ReefAngel.PWM.SetDaylight(PWMSlope(
			InternalMemory.StdLightsOnHour_read(),
			InternalMemory.StdLightsOnMinute_read(),
			InternalMemory.StdLightsOffHour_read(),
			InternalMemory.StdLightsOffMinute_read(),
			InternalMemory.PWMSlopeStartD_read(),
			InternalMemory.PWMSlopeEndD_read(),
			InternalMemory.PWMSlopeDurationD_read(),
			ReefAngel.PWM.GetDaylightValue()
			));
Using that should allow for you to operate fully off of the internal memory values.
dedvalson
Posts: 140
Joined: Tue Oct 04, 2011 5:49 am

Re: Android Reef Angel Status

Post by dedvalson »

Curt,

I was looking into adding support for Relay Expansion boxes to the Android app (mostly because I need it).

I got the code from git and have successfully compiled and run it. I see that you have code to parse the expansion data and store it in the database. I even hacked in code to display the status of expansion relay box 1 on the screen instead of the main one.

I wanted to get your thoughts on how you planned to deal with this. Were you thinking to have some sort of selector that would switch the relay controls from box to box, or were you thinking to add more controls to the scrollable page?

I would like to help out here if I can, some pointers as to your intent would be helpful. Of course if this is somthing you have nearly completed anyway then I will just stay out of your way.

Don
Mike S
Posts: 82
Joined: Tue Dec 27, 2011 7:26 pm

Re: Android Reef Angel Status

Post by Mike S »

Curt

Anyone else other than me an Roberto getting the error 23 xlm parser error? I can get it to work on ocassion by unplugging my wifi adapter but within a few minutes I get the error again until I reboot it. I can adjust the memory and the relay toggles work. Am I beating my head against a wall for no reason trying to get this to work? Should I just be sitting patiently waiting for an update? :D
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Android Reef Angel Status

Post by binder »

Don -
Glad that the code compiled and ran fine for you. Good to know I uploaded all the proper files. :)

I have envisioned a swipe left/right to switch screens: Probes | Main Relay | Exp 1 | Exp 2 | etc
I don't really want to make the page longer from top to bottom if I don't have to. I planned on using fragments or something along those lines.
When storing the data from the expansion relay, you gotta be careful because the web banner code uses different relay box references. That's the problem I ran into with the 0.4.1 & .2 releases. I need to revisit the web banner / portal data referencing. The code to handle the retrieval and toggling of ports should exist. It's just "storing" it properly and displaying it.

I'm not close to completing it. I was working a lot with getting the swipe left/right working with a scrollable view (which is tricky to accomplish). I'm also trying to work on an easier way to handle the views without having to repeat a lot of code. I like to make things "elegant" and reuse code if I can instead of just duplicating things. Feel free to work up some suggestions and stuff and share with me. It could definitely help and then I can merge/add it if needed or help with it too.

Mike -
Hmmm....I'm not aware of it happening often. I've not had it happen much on my controllers and one gets accessed VERY often since it's my public one (and the default address when you install the app before it gets configured). I'll take a look at the code more and see if there's anything else that I can come up with for the error. It would be beneficial if I knew your general controller setup. What library version? Quantity of expansion relays? Wifi configuration settings? Is the Portal() enabled in your sketch?
Mike S
Posts: 82
Joined: Tue Dec 27, 2011 7:26 pm

Re: Android Reef Angel Status

Post by Mike S »

Thanks Curt

It started after I installed the new libraries and updated my code using the latest version of ragen with the portal code and added a second relay box. Im 99% sure that i set up the adapter the same way as before with the wifi utility program. I'm using the same IP as before and can see the wifi adapter when i put the IP address in my browser. Do you need to know any other settings for my adpater? The portal isn't working for me yet and my banner isnt updating but I think that is a seperate issue with port forwarding and the ooma voip adapter that i have installed between my router and modem. Trying to tackle on issue at a time. :D. Oh and I'm seeing the same issue on my phone running ics and my tablet.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Android Reef Angel Status

Post by rimai »

I got my android app to work by unintalling the app and downloading it again.
It's working really good now :)
Roberto.
Mike S
Posts: 82
Joined: Tue Dec 27, 2011 7:26 pm

Re: Android Reef Angel Status

Post by Mike S »

Yep tried that 2x. :-) I have the app set tl pull the data from my controller. If i set it to get the info from reefangel.com do I just enter my user id ie Mike S? For some reason I think I had a different username entered there.
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Android Reef Angel Status

Post by binder »

Mike S wrote:Thanks Curt

It started after I installed the new libraries and updated my code using the latest version of ragen with the portal code and added a second relay box. Im 99% sure that i set up the adapter the same way as before with the wifi utility program. I'm using the same IP as before and can see the wifi adapter when i put the IP address in my browser. Do you need to know any other settings for my adpater? The portal isn't working for me yet and my banner isnt updating but I think that is a seperate issue with port forwarding and the ooma voip adapter that i have installed between my router and modem. Trying to tackle on issue at a time. :D. Oh and I'm seeing the same issue on my phone running ics and my tablet.
I don't need any more specific wifi adapter settings than what you mentioned. I'm thinking there is some sort of error or delay being caused by your ooma voip adapter based on you having problems with the portal. There could be some dropped packets somewhere in your network causing the problem. Routing issues can cause problems. It's not a definite answer, just a thought.
Post Reply