Android Reef Angel Status

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

Re: Android Reef Angel Status

Post by binder »

pandimus wrote:This error I'm having with the ai sol control is definitely on your end.. You have the dimmer control backwards on royal blue and blue.. I thought it might just be an indication problem, but they are indicating the same on my portal.
Are you noticing this error/problem after using the popup box to override the values?

I did some further checking into the code and all I could come up with was me not updating the override values for the AI channels. This should not swap the values between Blue & Royal Blue. This would just cause the incorrect value to be displayed if the channel was being overridden.

I cannot find anything else in the code that would cause the 2 channels to be flipped. I parse the XML data and store the values based on the XML tag. I then pull the data out of my own local database using the exact tag that it was stored under. I have everything set as define statements to link to the proper values and use the define statements in my code.
I made my change and hopefully that will fix the problem you are seeing. If you could provide me with some feedback to my question I asked above, that would be helpful.
pandimus
Posts: 213
Joined: Mon Apr 01, 2013 7:58 pm

Re: Android Reef Angel Status

Post by pandimus »

Long press on blue
Image
Image

Adjust value
Image

Royal blue is the one updated

And vice versa
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Android Reef Angel Status

Post by rimai »

Could it be a bug in the libraries?
Roberto.
pandimus
Posts: 213
Joined: Mon Apr 01, 2013 7:58 pm

Re: Android Reef Angel Status

Post by pandimus »

rimai wrote:Could it be a bug in the libraries?
The update is reflected in portal also.. I cant get my cable to work so i cant tell if its just a display issue or if its affecting the actual light also
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Android Reef Angel Status

Post by binder »

rimai wrote:Could it be a bug in the libraries?
I'm wondering that myself. I setup my Plus to enable the AI control. I can reproduce the exact error he is experiencing and am trying to track it down.

pandimus - thanks for the screenshots and further information. it has helped me confirm what you were experiencing is the same as what I just found out on my end.
pandimus
Posts: 213
Joined: Mon Apr 01, 2013 7:58 pm

Re: Android Reef Angel Status

Post by pandimus »

No problem.. Do you also see 255 percent?
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Android Reef Angel Status

Post by binder »

rimai wrote:Could it be a bug in the libraries?
Yep, I think it is a bug in the libraries.

Here's the PWM override values from Globals.h:

Code: Select all

#define OVERRIDE_AI_WHITE		8
#define OVERRIDE_AI_ROYALBLUE	9
#define OVERRIDE_AI_BLUE		10
Based on this, if I were to issue the override command for blue to change it to 48, it would be this:

Code: Select all

GET /po10,48
I did that from the serial monitor and the resulting status (GET /r99) had this in it:

Code: Select all

<AIBO>255</AIBO><AIRBO>48</AIRBO>
So when the controller receives the override command, it does not store it in the proper location. I have not tracked it down in the libraries but this is what is happening.
I also noticed that we use these defines in the Globals.h

Code: Select all

/*
AI Channels

Used by the AI Functions
 */
#define White			0
#define Blue			1
#define RoyalBlue		2
Which are exactly what is used in my app.

Now, looking at the code in RA_Wifi.cpp, here's where we set the values that are sent to us:

Code: Select all

ReefAngel.AI.SetChannelOverride(weboption2-8,weboption);
weboption2 is the channel. weboption is the value for the channel.
if we subtract 8 from 10, we get 2, which equals the RoyalBlue channel.

So, it looks like the fix for this bug is to change the PWM channel override values to this:

Code: Select all

#define OVERRIDE_AI_WHITE		8
#define OVERRIDE_AI_BLUE		9
#define OVERRIDE_AI_ROYALBLUE		10
I will be testing it on my controller shortly, but everything seems to lead to making that change to fix the problem. Of course, I will have to fix it in my app as well because my app will be sending the wrong value out.
All the apps that use these values will need to be updated to reflect the values properly as well. My app will be updated and the libraries will need to be updated.
What small little bug to track down. :)
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Android Reef Angel Status

Post by binder »

pandimus wrote:No problem.. Do you also see 255 percent?
yeah, this 255% is a display bug on my end. it has to do with me not storing the override value properly. i've got that fixed already on my end in my current test code.
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Android Reef Angel Status

Post by binder »

perfect.

my fixes have resolved the issue. once i publish the next testing app, you will need to refresh your status for the percentage to show properly. after that initial refresh, everything will be displaying properly in the app.

also, the controller should be just fine in regards to those values. if they are left alone (and not updated in the libraries), there will be no issues with the libraries. the ONLY issue it looks like is a display issue for any of the touch interfaces and that's just in regards to setting and clearing an override.

so this is not a critical bug fix, but a minor fix none the less. it's mostly a touch interface display issue.
pandimus
Posts: 213
Joined: Mon Apr 01, 2013 7:58 pm

Re: Android Reef Angel Status

Post by pandimus »

Excellent... Thanks for the hard work sir
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Android Reef Angel Status

Post by binder »

pandimus wrote:Excellent... Thanks for the hard work sir
you're welcome. i'm just happy it was a simple fix. :)
pandimus
Posts: 213
Joined: Mon Apr 01, 2013 7:58 pm

Re: Android Reef Angel Status

Post by pandimus »

I guess its safe to say not many ai users controlling with ra and the app..
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Android Reef Angel Status

Post by binder »

pandimus wrote:I guess its safe to say not many ai users controlling with ra and the app..
that's probably a safe assumption. or they may just have left it alone and do not update or change anything with it.
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Android Reef Angel Status

Post by binder »

AlanM wrote: - Can there be a way to set custom variables when those are enabled by holding on the value just like you do with dimming and dc pump? You'd just need to call the url "http://dns:2000/cvar1,150" or whatever it is set to and watch for the OK to come back similar to the other overrides, I think.
Did you want a slider bar to choose a value between 0-255 or would you rather an edit box to type in the value?
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Android Reef Angel Status

Post by lnevo »

I think for what Alan is doing he'd want the edit box. I like the slider bars in the Universal App, but it's hard to set a specific number with them.... just my $.02.
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Android Reef Angel Status

Post by binder »

lnevo wrote:I think for what Alan is doing he'd want the edit box. I like the slider bars in the Universal App, but it's hard to set a specific number with them.... just my $.02.
yeah, I was thinking about that too. Sliders look nice but can be hard to set the exact number you want.
So, I went with this instead:
custom var popup.png
custom var popup.png (36.83 KiB) Viewed 7225 times
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Android Reef Angel Status

Post by binder »

I finished up a few things and am getting closer to an official release.

For now, I have to drop support for devices below Android 4.0 (sdk 15). It has to do with the preferences and the new material toolbar. I might be able to bring back support to older versions in the future but we will just have to see.

Here's a highlight of the changes from Beta 2:
  • Added Custom variable value setting (this is for you Alan)
  • Fixed AI blue / royal blue display bug
  • Fixed the setup wizard bug of not storing the full away host when using RA's dynamic dns
  • Added in Custom mode for the DC Pump page
  • Switched over to using the Material Toolbar
Anyways, here's the link to download the third beta:
http://curtbinder.info/apps/ra-2.0.0.beta3-debug.apk

If all goes well with it and no major bugs are discovered, I plan on cleaning up some code and then officially releasing it.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Android Reef Angel Status

Post by Sacohen »

The DC Pump custom mode works as it should.
I poked around some other places and didn't run in to issues. Thanks Binder.
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Android Reef Angel Status

Post by binder »

Sacohen wrote:The DC Pump custom mode works as it should.
I poked around some other places and didn't run in to issues. Thanks Binder.
awesome.
AlanM
Posts: 263
Joined: Wed Jan 01, 2014 7:26 am

Re: Android Reef Angel Status

Post by AlanM »

That way of doing cvar numbers is perfect. Just like the other memory locations. It also would have been fine to just increase the list of memory locations in that dialog to include the locations that hold the cvar values. Thanks, Curt. It saves me from trying to push in numbers via url by typing it out in the url location and hoping I get the right internal ip address.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Android Reef Angel Status

Post by lnevo »

The worst part of doing it in the browser is sometimes the entry gets cached (in my mobile browser) and then loading the page later triggers it to make the api call which sometimes is not what I want. :(
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Android Reef Angel Status

Post by binder »

one thing I personally noticed after installing the beta update from the play store is that the existing home screen shortcut stopped working. this happened because I changed the name of the main class and forgot to put an alias in the apps manifest file to tell it what happened and where to look.
so for those of you beta channel testers, this is just a heads up that you will have to create a new shortcut if you had it on your homescreen.


Sent from my iPad mini
pandimus
Posts: 213
Joined: Mon Apr 01, 2013 7:58 pm

Re: Android Reef Angel Status

Post by pandimus »

Hey curt, i noticed something.. Not sure if its the app or my phone.. I deleted the non beta app so not sure if it was affected there also..

Lets say im on the relay page.. Like when im testing my dosers. I set my phone down to play with the hose on my doser and the phone goes into landscape mode.. It changes back to the first page with the temp..

Ive noticed it does that on all pages.

Kinda inconvenient because i gotta scroll back to turn off doser
pandimus
Posts: 213
Joined: Mon Apr 01, 2013 7:58 pm

Re: Android Reef Angel Status

Post by pandimus »

Just reinstalled the non beta app and it responds as expected
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Android Reef Angel Status

Post by binder »

pandimus wrote:Just reinstalled the non beta app and it responds as expected
just to make sure I'm following you, it works properly now?
or is it not fixed?

Sent from my Moto X
pandimus
Posts: 213
Joined: Mon Apr 01, 2013 7:58 pm

Re: Android Reef Angel Status

Post by pandimus »

The beta is not fixed. I just reinstalled the current play store reef angel status. It works like its supposed to..
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Android Reef Angel Status

Post by binder »

pandimus wrote:The beta is not fixed. I just reinstalled the current play store reef angel status. It works like its supposed to..
ok. I will look into this. Thanks for the feedback.
AlanM
Posts: 263
Joined: Wed Jan 01, 2014 7:26 am

Re: Android Reef Angel Status

Post by AlanM »

Curt,

I tried out v 2.0.0 today and it looks and works great! It got the settings from the old Reef Angel Status app and let me set a custom variable just like I always wanted. 8) Thanks for the work on it!
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Android Reef Angel Status

Post by lnevo »

Missing your apex at all Alan :)
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Android Reef Angel Status

Post by binder »

AlanM wrote:Curt,

I tried out v 2.0.0 today and it looks and works great! It got the settings from the old Reef Angel Status app and let me set a custom variable just like I always wanted. 8) Thanks for the work on it!
awesome! glad it is working the way you want it.


Sent from my iPad mini
Post Reply