User avatar
with ice cream
Posts: 175
Joined: Mon Jul 30, 2012 7:25 am

Event/Notification Display?

Sat Mar 09, 2013 9:06 am

Currently I am using a LCD photo keychain with lcd4linux as a miniature display. It displays weather and temperature information, current title from MPD and a few more things. The lcd4linux setup watches a few files and changes the info displayed when the files change (eg. one file gets updated with the caller's name and number when a phone call comes in, another one contains the most recent email's sender). All this works fine but the display is too small.

Come to think of it, what I am doing is what people usually have as information in their smart phones' lock screens. Now I want to accomplish the same on an analog 3.5" screen.

The problem I am facing is the instant update the moment an event occurs. I am struggling to set up a web page to be displayed in midori that refreshes on a server side event. I am not even sure that using a (PHP) web page is a good approach. I read up on comet and similar things but that is beyond my scope and capabilities (I know a but of perl and PHP). I am currently considering having a javascript chunk to request the modification time of a file and if there was a change to the last check it would force a reload of the whole page. I am not sure if this makes sense when I expect a response time of 200 to 300 milliseconds (e.g. a call comes in (a file gets changed) and the display should change during the first ring).

TL;DR: How can I accomplish a near instant display of event notifications (last email, current (last) caller, temp) without a big framework?

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Event/Notification Display?

Sat Mar 09, 2013 5:13 pm

Not using HTML :D
I think you can't do this without AJAX.
jQuery might be a start ...


ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

User avatar
with ice cream
Posts: 175
Joined: Mon Jul 30, 2012 7:25 am

Re: Event/Notification Display?

Sun Mar 10, 2013 10:01 am

Thanks for the response. Frankly, I am so at a loss that I would need more than a pointer to the technology. A snippet of code might help.

I am inclined to admit defeat, recognizing that approaching it with a web-based solution is beyond what have the skills for. I am currently thinking about having several terminal windows with tail -F or pushing notifications via jabber.

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Event/Notification Display?

Sun Mar 10, 2013 6:46 pm

Here is a german tutorial :
http://blog.axxg.de/2012/08/einfuehrung ... uickstart/

You would run the requests in a loop , and the PHP script either
gives back a empty response or the changed file(s) contents.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

User avatar
with ice cream
Posts: 175
Joined: Mon Jul 30, 2012 7:25 am

Re: Event/Notification Display?

Sun Mar 10, 2013 7:20 pm

Danke!

By now I have successfully implemented a long polling jquery-based page. This put me on the proper track.

I may study the source quoted to see what I can improve. Currently I am struggling to populate an array with the data returned but I am confident that I will get this sorted out as well.

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Event/Notification Display?

Sun Mar 10, 2013 7:47 pm

Cool , you can always learn something new.
So the umbrella buzzword for this approach is "comet" or what ?

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

Return to “Other projects”