RA WebApp

Related to the Portal
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 6415 times
ImageUploadedByTapatalk1374980024.157144.jpg
ImageUploadedByTapatalk1374980024.157144.jpg (35.3 KiB) Viewed 6415 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 6411 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
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: RA WebApp

Post by lnevo »

I run my script every minute through cron.
Appleseed
Posts: 86
Joined: Sat Jun 30, 2012 9:21 am

Re: RA WebApp

Post by Appleseed »

Hi,

Once again this is awesome..!

I forgot about this and am trying it again.

I extracted the tar.gz file to a linux box and can get to the page but seem to be seeing your reef even though i changed the variables in the config.php file...

any ideas are appreciated.

Andy
Image
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: RA WebApp

Post by lnevo »

I'll have to look at the php again to see what else may need to be changed. You may be seeing the webcam image defautl file...? Is the RA data the same as mine too?
Appleseed
Posts: 86
Joined: Sat Jun 30, 2012 9:21 am

Re: RA WebApp

Post by Appleseed »

Hi
it seems to be showing yours :/
Attachments
ra_image.JPG
ra_image.JPG (157.5 KiB) Viewed 6428 times
Image
Appleseed
Posts: 86
Joined: Sat Jun 30, 2012 9:21 am

Re: RA WebApp

Post by Appleseed »

there where also a whole lot of references to your username in the index.php under the Charts tab which i changed but it seems that the index.php file is still generated/referencing your setup :/

I know nothing about php etc so dont even know where to start.
Image
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: RA WebApp

Post by lnevo »

Well the good news is that its not showing *my* relay data :)

A lot of the code is going to be hard coded to my INO and specific configs. Like the relay bars...i think the labels come from the portal but its in the cache files in the data directory. You need to update the cron job shell script that dumps that out, or have it get the labels live from the portal (but that slows everything down...)

The fact that you have it up and running is great!!

I would start with the shell script that gets the cache files created. A bit in there will need to be modified.

I will definitely help you get this going, it will help converting this to a more generic form and a good learning experience for others who follow.
Appleseed
Posts: 86
Joined: Sat Jun 30, 2012 9:21 am

Re: RA WebApp

Post by Appleseed »

I didn't realise that there is a shell script. I am out and about the next few days but will look at it again later in the week.
Image
Appleseed
Posts: 86
Joined: Sat Jun 30, 2012 9:21 am

Re: RA WebApp

Post by Appleseed »

hi

can you share your shell script as the tar.gz doesnt seem to contain one?
Image
Post Reply