RA WebApp

Related to the Portal
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Custom Portal

Post by binder »

is it going to have the ability to return data from it like the portal does? i ask because i can implement the ability to add in your own "Lee's custom portal" (or whatever you want to call the general name of it) option for communication with my android app. then you could choose to receive data from it.


Sent from my iPad
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Custom Portal

Post by lnevo »

No, it has no database back-end, it's strictly a front end. It currently get's the label's from the portal, it uses cached files that I use a cron job for the initial loading and then it gets live data from either the controller directly or from the portal (I'm currently using the proxy.aspx on the portal to communicate with my controller, since port 2000 is blocked from my office)

I know I labeled the thread custom portal, but it's more of a portal front-end, so I'd consider it a client rather than a server. However, it wouldn't be that difficult to do. I believe I do have an r99.php file in the (only because Mobile Safari / Chrome do not parse the r99 directly) so in theory it could be a proxy from the Android app..

However the overall the goal is to be a standalone "go-to" version that you can use from your android, iOS, IE, Safar, Mozilla, whatever browser and have a consistent interface.
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Custom Portal

Post by binder »

ok cool. just curious. thanks for the info about it.

Sent from my Galaxy Nexus
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Custom Portal

Post by Sacohen »

Very Cool.
I like the gauges :)
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Custom Portal

Post by lnevo »

Thats my next problem...how to get the gauges to update...
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Custom Portal

Post by Sacohen »

Yeah. That's a problem.
there cool and all, but if they don't update then what's the point.
Maybe Roberto can point you in the right direction, obviously he got it working on the main portal
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Custom Portal

Post by lnevo »

No they are capable...i just need to figure out how. Theres plenty of sample code for those gaugrs...I just need to get the right details...
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Custom Portal

Post by lnevo »

Thats one thing nice about the phone specific ones..was easy to update a progress bar :)
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Custom Portal

Post by lnevo »

Woohoo. Got the cache manifest working so now the page loads just as fast as the native app on the iphone...

If I can just get those gauges to refresh, it will be feature complete :)

I promise to get a new version out there soon, but for now it takes a bit of cleanup to package, otherwise everyone's playing with my tank :)
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Custom Portal

Post by lnevo »

So seems I have a bit more work to do. Now too much is being cached since I'm getting a lot of values in php. I need to convert all the memory stuff I'm doing to use JavaScript so I can populate it with an Ajax call. Anyway, definitely getting closer. I was able to get full screen on iPhone 5, didn't even notice it was boxed in. So much more real estate ow :) anyway, my biggest complaint was load time which has been solved. Getting closer.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Custom Portal

Post by lnevo »

I got all the content issues resolved now and I've been able to put the URLs into a config file.

I still have to work out the gauges issue for refreshing and I have a bit of cleanup. I also want to add a tab for the standard memory stuff for people that don't have all my convoluted custom memory locations :) the new version is coming and hopefully useful for others...

I would say confidently that if you have a web server that you can use (or a Mac :) then you can effectively replace the iPhone app with this. And you'll be able to customize your GUI with just a bit of HTML code. Since its HTML5 it should work great on Android and desktops as well

For anyone thinking of the PI and a web interface to sit on it this would be a great drop in portal.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: RA WebApp

Post by lnevo »

Heres some teaser screenshots on the iphone.

Image
Image

Sorry for the dark webcam images...it's way past my bedtime ;)
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: RA WebApp

Post by lnevo »

Daytime shot looks much better :)

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

Re: RA WebApp

Post by rimai »

That looks awesome!!!
What if we had an optional feature to output json data instead of XML??
Would you be able to make it work too?
The advantage of json is that it is cross domain friendly and doesn't need any proxy, which would give this portal the ability to be hosted in any server, instead of a private one :)
I would be able to host on the reefangel server for everyone to use :)
Roberto.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: RA WebApp

Post by lnevo »

For r99 i'm converting to a json already. You'll have to forgive me, i just look like the web developer here :) i'm just the persistent guy trying to piece together the tidbits i make my brother show me...

I love the idea of you hosting it, but the big driver was being able to jump in and customize it. Thats why I thought more alone the lines of the PI implementation, but I'm open to whatever used we want to explore. The fun of open source of course.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: RA WebApp

Post by rimai »

I just can't see many having their own webserver to play around with :(
Roberto.
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: RA WebApp

Post by binder »

rimai wrote:I just can't see many having their own webserver to play around with :(
The only way this would happen for most people would be if we were to create a custom option / installable package to be placed onto a PI or something like that.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: RA WebApp

Post by lnevo »

If you have a Mac its as easy as turning on web sharing. Drop the files in your Sites directory. For Windows I'm sure you could find an easily installed apache or lamp installation. Opening port 80 isn't any harder than opening 2000. But yes this is the challenge of it being an html based option. I think for the mass of users the PI option would be ideal or if we can adapt it and have roberto host it...let's just see how it evolves :)
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: RA WebApp

Post by lnevo »

OK, the new version is posted. There is a file config.php where you can set your URL paths. It will use mine as a starting point if you install it which is fine. However if you use the live demo inside your network it will control your RA.... since the default URL is pointed at http://reefangelwifi:2000 so try it out :)

I added the css / js to add the popup button to add to your iOS home screen. That's where this shines. The caching should work so after you relaunch it *should* be fast. If you install this on your own web server make sure to look at the appcache file as it's very finicky.

I'm curious if anyone who installs it is able to use it :) Please keep me posted.

Live Demo:
http://www.easte.net/RA/demo

Source:
http://www.easte.net/RA/demo/ra_portal_demo.tar.gz
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: RA WebApp

Post by Sacohen »

It looks great.
I may try hosting it on my MAC, but I don't usually keep that on all the time.
I only use it when I have some freelance video editing work to do.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: RA WebApp

Post by lnevo »

Looks like the demo is currently controlling my tank... thought the json was on the client end... gotta figure this one out real quick.. :(

It's either have a broken demo or be exposed... :(
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: RA WebApp

Post by lnevo »

Ok. It had nothing to do with json, but the ajax call queries a php script on the server. Meaning that the actual communication with the controller happens between the webserver and the controller and then it returns the json object to the client which then does the javascript to parse it.

I've now cleaned up the data-cmd values so that all the calls just run r99 so it looks like everything from a r/w perspective now is assured. Unfortunately not as good a demo, but at least you see a live tank and can interact with the front end. Just pretend it's doing stuff. You should see the webcam update when you click stuff at least.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: RA WebApp

Post by rimai »

Is the live demo link the same as your screenshots?
I get different stuff :(
Roberto.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: RA WebApp

Post by lnevo »

It should be somewhat close.. It's different on the phone, the desktop/tablet version has gauges and LEDs for the relays. The phone version has progress bars and buttons for the relays...also there is a charts tab on the desktop/tablet version. I can post some pics as well of that version.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: RA WebApp

Post by lnevo »

ImageUploadedByTapatalk1374979980.797125.jpg
ImageUploadedByTapatalk1374979980.797125.jpg (37.17 KiB) Viewed 6416 times
ImageUploadedByTapatalk1374980024.157144.jpg
ImageUploadedByTapatalk1374980024.157144.jpg (35.3 KiB) Viewed 6416 times
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: RA WebApp

Post by rimai »

Yeah, that's what I see on my desktop.
How does handle the override on the LED buttons?
Roberto.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: RA WebApp

Post by lnevo »

So there are 4 led colors. green-on, green-off, red-on, red-off.

The color represents the auto / programmed status. If you click the led it will force the override to the opposite of the current, when it's in that state another click clears the override.

It works very well in practice. The only negatives are that you can't override it to the state that it's in, and you also cannot tell if the relay is overridden and in it's auto state (I.e. programmed to on and overriden on both look the same)

It can be changed, but I was trying to do it all in one button when I did it. On the iPhone, you get discreet on/off/auto.

Here's a screen shot with one relay (extension) overridden on and my refugium light overridden off.
ImageUploadedByTapatalk1374981376.871629.jpg
ImageUploadedByTapatalk1374981376.871629.jpg (39.45 KiB) Viewed 6412 times
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: RA WebApp

Post by lnevo »

Sacohen wrote:It looks great.
I may try hosting it on my MAC, but I don't usually keep that on all the time.
I only use it when I have some freelance video editing work to do.
Just an FYI.

The cache may not work properly...I'm a version behind on OSX so i dont know about the latest...but the extension for the cache manifest changed from .manifest to .appcache. So you can either rename the manifest file and update the <HTML> tag to match the new name or update the mime types for apache.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: RA WebApp

Post by lnevo »

This has been my primary method for controlling my RA for a while now. I've made a number of improvements so that everything is refreshed from ajax and also used html5 local storage to remember what tab you are on. It's made the webapp seem very seamless and simulates multitasking very nicely. I added that this past weekend and it's made checking on my tank sooo nice.

I'll be posting the updated code in next week or two. The one issue is that i do a lot of caching by preloading the pages with a shell script running on my mac. It speeds up page load a lot.

Other than that I'm very happy with this. If anyone is using this or would like more info please lmk.

Thanks
Lee
ReEfnWrX
Posts: 234
Joined: Tue Nov 05, 2013 8:40 am
Location: Houston TX

Re: RA WebApp

Post by ReEfnWrX »

This looks really cool, does it update more frequently than the portal?
Image
Post Reply