Internal webserver UI

Related to the development libraries, released by Curt Binder
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Internal webserver UI

Post by rimai »

Hi Guys,

I changed the internal webserver to the Uapp UI.
To test it, use the latest dev branch.
Let me know how it works for you.
Roberto.
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: Internal webserver UI

Post by lnevo »

Cool. I need to start testing the dev code. I have some updates I want to do anyway :)

Roberto are we close to another release? Maybe we get a thread together with features to test etc? I feel like it may have been a while since the last one :)
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Internal webserver UI

Post by rimai »

Yeah, I think this is the last piece I wanted to add to this release.
Roberto.
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: Internal webserver UI

Post by lnevo »

Sweet! I have to go to Hong Kong next week. I should really wait till I'm back to update...
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Internal webserver UI

Post by binder »

lnevo wrote:Sweet! I have to go to Hong Kong next week. I should really wait till I'm back to update...
definitely wait until you are back. wouldn't want you to have an issue when you are halfway around the world. ;)

Sent from my XT1585 using Tapatalk
User avatar
cosmith71
Posts: 1432
Joined: Fri Mar 29, 2013 3:51 pm
Location: Oklahoma City

Re: Internal webserver UI

Post by cosmith71 »

All I get is a white screen with "Reef Angel Controller Web Server" in big black letters at the top. Tried Chrome, Edge, Firefox, and IE.

--Colin
fishflipper
Posts: 103
Joined: Fri Jul 03, 2015 8:29 am

Re: Internal webserver UI

Post by fishflipper »

how do I update the controller to add the new UAPP Webserver?
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Internal webserver UI

Post by rimai »

cosmith71 wrote:All I get is a white screen with "Reef Angel Controller Web Server" in big black letters at the top. Tried Chrome, Edge, Firefox, and IE.

--Colin
You must go to page /wifi
Roberto.
User avatar
cosmith71
Posts: 1432
Joined: Fri Mar 29, 2013 3:51 pm
Location: Oklahoma City

Re: Internal webserver UI

Post by cosmith71 »

That works much better. :D

How do I get it to pull up my values? It's all zeroes now.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Internal webserver UI

Post by rimai »

Click refresh button on top right corner
Roberto.
User avatar
cosmith71
Posts: 1432
Joined: Fri Mar 29, 2013 3:51 pm
Location: Oklahoma City

Re: Internal webserver UI

Post by cosmith71 »

Tried that. Do I need to enter in my forum username somewhere?
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Internal webserver UI

Post by rimai »

Can you try a different browser?
Roberto.
User avatar
cosmith71
Posts: 1432
Joined: Fri Mar 29, 2013 3:51 pm
Location: Oklahoma City

Re: Internal webserver UI

Post by cosmith71 »

OK, not sure what was going on, but it's working with all four browsers now.

It always comes up with 0's until I refresh. First refresh almost always returns an "Unable to process controller data" message.

Controller labels have to be downloaded every session?

Custom variables without a label justify to the left instead of the center after downloading labels.

--Colin
User avatar
cosmith71
Posts: 1432
Joined: Fri Mar 29, 2013 3:51 pm
Location: Oklahoma City

Re: Internal webserver UI

Post by cosmith71 »

Changing DC pump modes shows the icon for the previous mode until refreshed.

Edit: Just tried it on a different computer and it works as expected?

Edit part 2: Speed and duration don't automatically refresh. If I go from a specified mode with default speeds to custom mode with hard-coded speeds, the new speed/duration doesn't change until I refresh.

I hope this kind of stuff is what you were looking for, otherwise I'm just being a jerk. :mrgreen:
fishflipper
Posts: 103
Joined: Fri Jul 03, 2015 8:29 am

Re: Internal webserver UI

Post by fishflipper »

I get unable to retrieve data every time.

Sent from my SAMSUNG-SM-G900A using Tapatalk
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Internal webserver UI

Post by rimai »

fishflipper wrote:I get unable to retrieve data every time.

Sent from my SAMSUNG-SM-G900A using Tapatalk
You must use the dev branch of our libraries.
Did you update it?
Roberto.
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: Internal webserver UI

Post by lnevo »

cosmith71 wrote:Changing DC pump modes shows the icon for the previous mode until refreshed.

Edit: Just tried it on a different computer and it works as expected?

Edit part 2: Speed and duration don't automatically refresh. If I go from a specified mode with default speeds to custom mode with hard-coded speeds, the new speed/duration doesn't change until I refresh.

I hope this kind of stuff is what you were looking for, otherwise I'm just being a jerk. :mrgreen:
The problem is when you issue a wifi command to change something you get back OK and you don't get the same results like when setting a relay which returns the entire XML. Then you'd have to do a second query.

We could do 2 things to streamline that. Instead of sending just OK or ERR. We could put a status flag in the /sa /r99 output. It might break some of the current apps, but we'd just be adding the same tag it's looking for inside the rest of the output.

The other would be making the second call to the web ui to refresh. But I have issues sometimes if I query to quickly so a slight delay wouldn't be horrible. This btw, is all the same behavior of the current UApp also.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Internal webserver UI

Post by rimai »

I thought I changed that. When the controller responds with OK, I update the UI.
I'll double check.
I may have only done that for the cloud server connection, now that you mentioned.
Roberto.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Internal webserver UI

Post by rimai »

Ok, so I just tested and it updates fine on my side.
I had DCPump in Constant mode.
Click the image, selected a new mode, the browser showed the spinning wheel for a brief second and it updated the UI with the mode I had selected.
Roberto.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Internal webserver UI

Post by rimai »

I also did the same thing for the speed and duration, which updated the UI after the spinning wheel.
Roberto.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Internal webserver UI

Post by rimai »

I did see the labels not being kept though.
I'll work on this shortly.
Roberto.
User avatar
cosmith71
Posts: 1432
Joined: Fri Mar 29, 2013 3:51 pm
Location: Oklahoma City

Re: Internal webserver UI

Post by cosmith71 »

It happens to me when going from custom, with it's own hard-coded speed and duration, to any other mode. It shows the custom speed and duration until a refresh.

Also, there seems to not be an icon for gyre?

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

Re: Internal webserver UI

Post by binder »

lnevo wrote:
cosmith71 wrote:Changing DC pump modes shows the icon for the previous mode until refreshed.

Edit: Just tried it on a different computer and it works as expected?

Edit part 2: Speed and duration don't automatically refresh. If I go from a specified mode with default speeds to custom mode with hard-coded speeds, the new speed/duration doesn't change until I refresh.

I hope this kind of stuff is what you were looking for, otherwise I'm just being a jerk. :mrgreen:
The problem is when you issue a wifi command to change something you get back OK and you don't get the same results like when setting a relay which returns the entire XML. Then you'd have to do a second query.

We could do 2 things to streamline that. Instead of sending just OK or ERR. We could put a status flag in the /sa /r99 output. It might break some of the current apps, but we'd just be adding the same tag it's looking for inside the rest of the output.

The other would be making the second call to the web ui to refresh. But I have issues sometimes if I query to quickly so a slight delay wouldn't be horrible. This btw, is all the same behavior of the current UApp also.
I implemented a delay when refreshing from that command in my app for the same reason. too fast of request will error out.

Sent from my XT1585 using Tapatalk
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Internal webserver UI

Post by rimai »

cosmith71 wrote:It happens to me when going from custom, with it's own hard-coded speed and duration, to any other mode. It shows the custom speed and duration until a refresh.

Also, there seems to not be an icon for gyre?

--Colin
Can you post the relevant code for me to replicate the problem?
Roberto.
User avatar
cosmith71
Posts: 1432
Joined: Fri Mar 29, 2013 3:51 pm
Location: Oklahoma City

Re: Internal webserver UI

Post by cosmith71 »

Here you go.

Code: Select all

void PumpControl()
{
  // *******************  Pump Control *******************

  if (InternalMemory.DCPumpMode_read()==11)   // If custom mode on Portal
  {
    ReefAngel.DCPump.UseMemory = false;    // Turn off memory control
    ReefAngel.DCPump.SetMode(Else,60,30);  // If nothing changes it in the next few lines, this is what runs.
    ReefAngel.DCPump.Threshold=20;  
    if (hour()>=22 || hour()<9) ReefAngel.DCPump.SetMode(Gyre,80,30,50);  // Gyre max, duration, minimum
    if (hour()>=9 && hour()<10) ReefAngel.DCPump.SetMode(Gyre,90,30,60);  // Gyre max, duration, minimum
    if (hour()>=10 && hour()<11)
    {
      ReefAngel.DCPump.Threshold=20;
      ReefAngel.DCPump.SetMode(Else,40,20);    // Else mode from 1000 to 1100.  Wake up!
    }
  }
  else ReefAngel.DCPump.UseMemory = true;    //  If it's not custom mode on the portal, then do what mode the portal says.
}
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Internal webserver UI

Post by rimai »

But if you are using usememory=false, you shouldn't be able to change speed and duration, right?
Roberto.
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: Internal webserver UI

Post by lnevo »

Yeah you're logic is a bit off..once in custom how do you get out?
User avatar
cosmith71
Posts: 1432
Joined: Fri Mar 29, 2013 3:51 pm
Location: Oklahoma City

Re: Internal webserver UI

Post by cosmith71 »

Correct. Custom uses the hard coded values. Right now, they are gyre 80/30. The memory values for a non-custom mode are, say, 60/20. If I switch from custom with coded values of 80/30 to, say short pulse, the speed and duration still show the coded values of 80/30 instead of the memory values of 60/20 until I do a refresh. Same if I go back to custom from a memory mode. The mode display updates immediately, but the speed and duration values don't update on the screen until a refresh.

Lee, you can choose any mode you like from the DC Pump page. The code can tell when custom is selected.


--Colin
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: Internal webserver UI

Post by lnevo »

Right nevermind. I misread the if statement. If memory is set to non custom the RF.UseMemory is true.
fishflipper
Posts: 103
Joined: Fri Jul 03, 2015 8:29 am

Re: Internal webserver UI

Post by fishflipper »

how do I update to the newest libraries?
Post Reply