Building a really realtime website

Show or discuss your existing Home automation project here, so a detailed explanation!.....
Digit
Global Moderator
Global Moderator
Posts: 3388
Joined: Sat Mar 25, 2006 10:23 am
Location: Netherlands
Contact:

Building a really realtime website

Post by Digit »

Hi,
Today I finally made some time to have a look at a way to make my website REALLY realtime.
Not the x second interval Ajax polling anymore, but the real deal - instantly seeing new information being displayed in your web pages!
Once you've figured it out, it's soo easy... much easier than I imagined that it would be, actually.
I wrote a post about it on my weblog so if you wanna know more about how to do it, read it.
It's still in a 'Proof of Concept' status with working examples right now, but it looks very promising 8)
http://blog.hekkers.net/2012/10/13/real ... socket-io/
User avatar
RDNZL
Forum Moderator
Forum Moderator
Posts: 1008
Joined: Sun Sep 24, 2006 1:45 pm
Location: Dordrecht, The Netherlands
Contact:

Re: Building a really realtime website

Post by RDNZL »

Nice stuff, I noticed the code sample on the site are not error free, or my Node.js installation is not correct yet, need some more time to tinker with it.
Regards, Ron.
User avatar
Willem4ever
Global Moderator
Global Moderator
Posts: 805
Joined: Mon Oct 30, 2006 3:48 pm
Location: Uithoorn / Netherlands

Re: Building a really realtime website

Post by Willem4ever »

I'm working on an apache plugin which allows you to subscribe to a mosquito broker thru mosquitto-1.0.js using websockets. First tests are looking good !
Digit
Global Moderator
Global Moderator
Posts: 3388
Joined: Sat Mar 25, 2006 10:23 am
Location: Netherlands
Contact:

Re: Building a really realtime website

Post by Digit »

RDNZL wrote:I noticed the code sample on the site are not error free
Ron, if you mail me the errors maybe I can help. Had some myself too :wink:
User avatar
RDNZL
Forum Moderator
Forum Moderator
Posts: 1008
Joined: Sun Sep 24, 2006 1:45 pm
Location: Dordrecht, The Netherlands
Contact:

Re: Building a really realtime website

Post by RDNZL »

I have it working now.
It was because i'm on Linux, and was struggling to get node.js and MQTTjs to work together.
Regards, Ron.
Digit
Global Moderator
Global Moderator
Posts: 3388
Joined: Sat Mar 25, 2006 10:23 am
Location: Netherlands
Contact:

Re: Building a really realtime website

Post by Digit »

Willem4ever wrote:I'm working on an apache plugin which allows you to subscribe to a mosquito broker thru mosquitto-1.0.js using websockets.
That would be even better, very nice! 8)
Digit
Global Moderator
Global Moderator
Posts: 3388
Joined: Sat Mar 25, 2006 10:23 am
Location: Netherlands
Contact:

Re: Building a really realtime website

Post by Digit »

I've got my smart meter online now; online as in the smart meter data being displayed in real-time 8)
It doesn't get any better than this :)
With the help of Willems Apache module,which works great!
View the real-time web page here:
http://www.hekkers.net/domotica/Smartmeter.aspx
PS: IE doesn't support it; Chrome, Firefox, iPad should all be OK.
User avatar
RDNZL
Forum Moderator
Forum Moderator
Posts: 1008
Joined: Sun Sep 24, 2006 1:45 pm
Location: Dordrecht, The Netherlands
Contact:

Re: Building a really realtime website

Post by RDNZL »

Nice.
Willem is your apache module code online somewhere?
Would links to test with it too.
Regards, Ron.
User avatar
Willem4ever
Global Moderator
Global Moderator
Posts: 805
Joined: Mon Oct 30, 2006 3:48 pm
Location: Uithoorn / Netherlands

Re: Building a really realtime website

Post by Willem4ever »

Not yet Ron, I have to prepare some instructions to make it suitable for the general public and it comes with no guarantees :-) Last night I added an additional option to prevent publishing thru the websocket interface - I can email you what I currently have which seems to work on OSX (Mountain Lion), Centos 6.3 and Fedora 17. Send me your email address by PM and I will forward the source with very basic instructions to you. For every one else, stay tuned on Github
User avatar
Willem4ever
Global Moderator
Global Moderator
Posts: 805
Joined: Mon Oct 30, 2006 3:48 pm
Location: Uithoorn / Netherlands

Re: Building a really realtime website

Post by Willem4ever »

Check here for my realtime online smart meter
Akatar
Senior Member
Senior Member
Posts: 1135
Joined: Thu Nov 22, 2007 12:25 am
Location: the netherlands

Re: Building a really realtime website

Post by Akatar »

alleen maar vraagtekens...
User avatar
Willem4ever
Global Moderator
Global Moderator
Posts: 805
Joined: Mon Oct 30, 2006 3:48 pm
Location: Uithoorn / Netherlands

Re: Building a really realtime website

Post by Willem4ever »

Forgot to mention, it is based on webs sockets which is currently not supported nu IE, Safari / Chrome / Firefox / iPhone with IOS 6 should work fine.
Digit
Global Moderator
Global Moderator
Posts: 3388
Joined: Sat Mar 25, 2006 10:23 am
Location: Netherlands
Contact:

Re: Building a really realtime website

Post by Digit »

Willems page still works fine for me.. except for the certificate...?

Since yesterday (late in the evening) my Opentherm Gateway information is 'real time' available the same way my smart meter info is.
The only thing left to do is making a web page.
User avatar
Willem4ever
Global Moderator
Global Moderator
Posts: 805
Joined: Mon Oct 30, 2006 3:48 pm
Location: Uithoorn / Netherlands

Re: Building a really realtime website

Post by Willem4ever »

Yeah, it is signed by my personal CA ... for the geeks, the page is available on IPv4 and IPv6 and connects to the broker using IPv6 ....
User avatar
Willem4ever
Global Moderator
Global Moderator
Posts: 805
Joined: Mon Oct 30, 2006 3:48 pm
Location: Uithoorn / Netherlands

Re: Building a really realtime website

Post by Willem4ever »

The apache handler is uploaded to Github. It includes a simple webpage which allows you to play with MQTT using the mosquitto web socket interface. Sofar it is confirmed to work on Ubuntu 11.04 (Thanks Ron !) , Centos/Redhat 6 and OSX 10.8, Test are undergoing to get it working with a Raspberry PI.
screen-capture.jpg
screen-capture.jpg (149.48 KiB) Viewed 10871 times
Post Reply

Return to “Home Automation Projects”