TV: Difference between revisions

From Leeds Hackspace Wiki
Jump to navigation Jump to search
(Add IRC commands)
(→‎Hardware: Explain how Chromium auto-start works)
 
(5 intermediate revisions by 2 users not shown)
Line 7: Line 7:
After much experimentation, I (HEx) settled on 1024x768 over VGA, software scaled to 1366x768.
After much experimentation, I (HEx) settled on 1024x768 over VGA, software scaled to 1366x768.


== Sauron ==
== Hardware ==


Driving the screen is an Athlon 64 box named sauron (172.31.26.150).  It runs debian jessie.
Driving the screen is an Athlon 64 box named sauron (172.31.26.112).  It runs debian jessie.


User "kiosk" is logged in on boot, running Chromium in kiosk mode.
User "kiosk" is logged in on boot, with Chromium automatically starting in fullscreen mode on login.
 
Chromium auto-start is implemented by the <code>/home/kiosk/kiosk.sh</code> script, which is run by the kiosk user's <code>.Xsessionrc</code>. This script is responsible for starting Chromium, and ensuring it stays running (restarting if needed).


== Status page ==
== Status page ==
Line 19: Line 21:
* Twitter feed
* Twitter feed
* Mailing list feed
* Mailing list feed
* IRC
* IRC (Sauron is a member of the channel using the nickname Sauron-tv)
* Camera feed
* Camera feed


The code is stored on [https://github.com/hexwab/lhs-status GitHub] and is checked out locally to <code>/srv/lhs-status</code> on Sauron, which is then served by Apache.  
The code is stored on [https://github.com/leedshackspace/lhs-status GitHub] and is checked out locally to <code>/srv/lhs-status</code> on Sauron, which is then served by Apache.
 
=== Updating the code ===
 
When the code in the lhs-status GitHub repo has been updated, <code>cd</code> into <code>/srv/lhs-status/lhs-status</code> and <code>git pull</code> to pull the most recent changes. Then either refresh Chromium on the PC, or via SSH run <code>sudo pkill chromium</code> to kill Chromium (<code>kiosk.sh</code> will automatically restart it).


=== Mailing list feed ===
=== Mailing list feed ===
Line 28: Line 34:
The list of topics on the mailing list is served as an RSS feed by Google Groups, but due to [https://en.wikipedia.org/wiki/Cross-origin_resource_sharing CORS] restrictions it cannot be accessed using an AJAX request directly from the status page. As a workaround, Apache is configured to reverse-proxy requests to <code>topics.xml</code> in the main lhs-status directory to the actual Google Groups [https://groups.google.com/forum/feed/leeds-hack-space/msgs/rss.xml?num=15 RSS URL].
The list of topics on the mailing list is served as an RSS feed by Google Groups, but due to [https://en.wikipedia.org/wiki/Cross-origin_resource_sharing CORS] restrictions it cannot be accessed using an AJAX request directly from the status page. As a workaround, Apache is configured to reverse-proxy requests to <code>topics.xml</code> in the main lhs-status directory to the actual Google Groups [https://groups.google.com/forum/feed/leeds-hack-space/msgs/rss.xml?num=15 RSS URL].


=== IRC client ===
== Control through IRC ==
 
Sauron has some functions that can be triggered through the IRC channel. They can be run in two ways:
* by mentioning the name of the bot in the Leeds Hackspace channel
* by sending a private message to the bot
 
You can get the bot's attention by either mentioning its name, or prefixing your message with the "^" symbol. Commands are run by giving the command name and then the command arguments, e.g:
* <code>Sauron-tv: bigtext This message will appear big on-screen</code>
* <code>^bigtext This message will appear big on-screen</code>
 
=== Commands ===


==== Commands ====
==== General ====
* <code>bigtext ''your message here''</code> - show a short message in big flashing text on screen for 10 seconds.


The IRC client has some commands that can be run from the IRC channel. They can be triggered by mentioning the name of the bot in the Leeds Hackspace channel, followed by the command name, then the command arguments. Example: "Sauron-tv: bigtext This message will appear big onscreen". They don't work by private messaging Sauron-tv.
==== Camera view control ====
Controls what camera is currently displayed on the screen. Current camera choices are ''carpark'', ''main1'' (camera by the soldering station), ''main2'' (camera on the arcade cab), ''door'' (the internal door), ''outside'' (the external door), and ''3dprinter''.
* <code>cam fix ''camname''</code> - View the specified camera indefinitely.
* <code>cam resume</code> - Resume rotating through cameras (Sauron starts up in this mode)
* <code>cam view ''camname''</code> - View the specified camera for 30 seconds, then resume rotating


Currently available commands are:
=== Implementation ===
* bigtext - show a short message in big flashing text on screen for 10 seconds. Args: the string to show


==== Implementation ====
The IRC client embedded within the status page is a [https://github.com/leedshackspace/shout fork] of the [https://github.com/erming/shout Shout] Node JS-based web IRC client. The fork includes Hackspace-specific additions such as a theme that hides all UI elements apart from the main chat messages window, in addition to having several pull requests on the main Shout repository merged ([https://github.com/erming/shout/pull/414 automatically joining the channel on load], and [https://github.com/erming/shout/pull/320 adding a framework for client plugins]).


The IRC client embedded within the status page is a [https://github.com/ultrafez/shout fork] of the [https://github.com/erming/shout Shout] Node JS-based web IRC client. The fork includes Hackspace-specific additions such as a theme that hides all UI elements apart from the main chat messages window, in addition to having several pull requests on the main Shout repository merged ([https://github.com/erming/shout/pull/414 automatically joining the channel on load], and [https://github.com/erming/shout/pull/320 adding a framework for client plugins]).
Commands from the IRC client iframe are passed up to the main display's frame using a plugin located in <code>/home/kiosk/.shout/plugins/bridge.js</code>. These commands are received by the [https://github.com/leedshackspace/lhs-status/blob/master/irc-command.js <code>irc-command</code> module in the lhs-status repo].


The client runs as a node process (managed by <code>supervisord</code>), which listens for HTTP connections on port 3000. The status page then embeds the client in an <code>iframe</code> pointing at <code>http://localhost:3000</code>.
The client runs as a node process (managed by <code>supervisord</code>), which listens for HTTP connections on port 3000. The status page then embeds the client in an <code>iframe</code> pointing at <code>http://localhost:3000</code>.

Latest revision as of 20:57, 2 June 2016

A plasma screen is affixed to the wall. It displays status information about the space.

The Screen

It's a Hitachi 42PD5000. Native resolution is 1024x1024, but it does not accept digital input at this resolution, or any sane resolution. The screen itself is 16:9, but all the advertised EDID modes are 4:3. The manual suggests that it should be capable of more, but these are specific to which inputs are used (DVI accepts different resolutions to VGA).

After much experimentation, I (HEx) settled on 1024x768 over VGA, software scaled to 1366x768.

Hardware

Driving the screen is an Athlon 64 box named sauron (172.31.26.112). It runs debian jessie.

User "kiosk" is logged in on boot, with Chromium automatically starting in fullscreen mode on login.

Chromium auto-start is implemented by the /home/kiosk/kiosk.sh script, which is run by the kiosk user's .Xsessionrc. This script is responsible for starting Chromium, and ensuring it stays running (restarting if needed).

Status page

The status page displays:

  • General status from the API (open or closed, who's here, current temperature).
  • Twitter feed
  • Mailing list feed
  • IRC (Sauron is a member of the channel using the nickname Sauron-tv)
  • Camera feed

The code is stored on GitHub and is checked out locally to /srv/lhs-status on Sauron, which is then served by Apache.

Updating the code

When the code in the lhs-status GitHub repo has been updated, cd into /srv/lhs-status/lhs-status and git pull to pull the most recent changes. Then either refresh Chromium on the PC, or via SSH run sudo pkill chromium to kill Chromium (kiosk.sh will automatically restart it).

Mailing list feed

The list of topics on the mailing list is served as an RSS feed by Google Groups, but due to CORS restrictions it cannot be accessed using an AJAX request directly from the status page. As a workaround, Apache is configured to reverse-proxy requests to topics.xml in the main lhs-status directory to the actual Google Groups RSS URL.

Control through IRC

Sauron has some functions that can be triggered through the IRC channel. They can be run in two ways:

  • by mentioning the name of the bot in the Leeds Hackspace channel
  • by sending a private message to the bot

You can get the bot's attention by either mentioning its name, or prefixing your message with the "^" symbol. Commands are run by giving the command name and then the command arguments, e.g:

  • Sauron-tv: bigtext This message will appear big on-screen
  • ^bigtext This message will appear big on-screen

Commands

General

  • bigtext your message here - show a short message in big flashing text on screen for 10 seconds.

Camera view control

Controls what camera is currently displayed on the screen. Current camera choices are carpark, main1 (camera by the soldering station), main2 (camera on the arcade cab), door (the internal door), outside (the external door), and 3dprinter.

  • cam fix camname - View the specified camera indefinitely.
  • cam resume - Resume rotating through cameras (Sauron starts up in this mode)
  • cam view camname - View the specified camera for 30 seconds, then resume rotating

Implementation

The IRC client embedded within the status page is a fork of the Shout Node JS-based web IRC client. The fork includes Hackspace-specific additions such as a theme that hides all UI elements apart from the main chat messages window, in addition to having several pull requests on the main Shout repository merged (automatically joining the channel on load, and adding a framework for client plugins).

Commands from the IRC client iframe are passed up to the main display's frame using a plugin located in /home/kiosk/.shout/plugins/bridge.js. These commands are received by the irc-command module in the lhs-status repo.

The client runs as a node process (managed by supervisord), which listens for HTTP connections on port 3000. The status page then embeds the client in an iframe pointing at http://localhost:3000.