User Tools

Site Tools


ircterm

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
ircterm [2015-01-11 19:55] robircterm [2015-10-05 15:55] – external edit 127.0.0.1
Line 1: Line 1:
-==== Project Background ====+===== Project Background =====
  
 Rob wanted a way to promote IRC use and make it feel more part of the lab rather than a separate 'IRC club', and also open it up to non-IRC users and provide a way to quickly reply. Similar IRC terminals exist at other hackerspaces, such as [[http://helsinki.hacklab.fi|Helsinki Hacklab]]. Rob wanted a way to promote IRC use and make it feel more part of the lab rather than a separate 'IRC club', and also open it up to non-IRC users and provide a way to quickly reply. Similar IRC terminals exist at other hackerspaces, such as [[http://helsinki.hacklab.fi|Helsinki Hacklab]].
Line 5: Line 5:
 {{:img_20150111_150838.jpg?direct&300|}} {{:img_20150111_150838.jpg?direct&300|}}
  
-==== Main Hardware Components ====+===== Main Hardware Components =====
  
-  * Raspberry Pi A++  * Raspberry Pi A+ & [[http://www.thingiverse.com/thing:566506|3D printed case]]
   * Some crappy 'PiHut' rt2800-based wifi dongle   * Some crappy 'PiHut' rt2800-based wifi dongle
-  * Optiquest Q22wb (Viewsonic/BENQ) 22" 1680x1050 (16:10) TFT mounted vertically+  * Optiquest Q22wb (Viewsonic/BENQ) 22" 1680x1050 (16:10) TFT mounted vertically, provided by shabble 
 +  * Wall mount VESA arm
   * Also a passive USB 2.0 hub and a small USB keyboard   * Also a passive USB 2.0 hub and a small USB keyboard
  
 {{:img_20150110_015443.jpg?direct&300|}} {{:img_20150110_015443.jpg?direct&300|}}
  
-==== Piecing it together ====+===== Piecing it together =====
  
 The Pi is back-powered via the hub, which is in turn back-powered via a small in-line 5v 1A PSU originally for a Zip drive. There are a few of these useful PSUs in use in the lab. The back-powering is a result of only wanting to use bits in the 'cables for butchering' box. The Pi is back-powered via the hub, which is in turn back-powered via a small in-line 5v 1A PSU originally for a Zip drive. There are a few of these useful PSUs in use in the lab. The back-powering is a result of only wanting to use bits in the 'cables for butchering' box.
Line 26: Line 27:
 {{:img_20150110_043139.jpg?direct&300|}} {{:img_20150110_043139.jpg?direct&300|}}
  
-==== Wifi ====+===== Wifi =====
  
 Terminal is connected to the main 'Hacklab' network. Wifi was showing to be very unreliable in 'n' mode. Having forced an arbitrary speed of 22Mbit/s, the wifi is now stable. Other Pis using similar dongles have experienced high latency and loss too. The problem doesn't exist when connected to different access points. Terminal is connected to the main 'Hacklab' network. Wifi was showing to be very unreliable in 'n' mode. Having forced an arbitrary speed of 22Mbit/s, the wifi is now stable. Other Pis using similar dongles have experienced high latency and loss too. The problem doesn't exist when connected to different access points.
Line 46: Line 47:
 </code> </code>
  
 +=== Automatically reconnecting wifi ===
  
-==== OS Config ====+/etc/rc.local: 
 +<code> 
 +/root/wifimonitor 2>&1 & 
 +</code> 
 + 
 +/root/wifimonitor: 
 +<code> 
 +#!/bin/bash 
 + 
 +while true ; do 
 +   if ifconfig wlan0 | grep -q "inet addr:" ; then 
 +      sleep 60 
 +   else 
 +      ifdown wlan0 
 +      sleep 10 
 +      ifup --force wlan0 
 +      sleep 10 
 +   fi 
 +done 
 +</code> 
 + 
 +===== OS Config =====
  
 Stock Raspbian with all x11-* and various other things removed. Stock Raspbian with all x11-* and various other things removed.
Line 77: Line 100:
 Terminus font in UTF8, at size 16x32. Terminus font in UTF8, at size 16x32.
  
-=== Powering on/off the screen automatically ===+===== Powering on/off the screen automatically =====
  
 The screen turns off when the lab is empty and turns back on again as soon as someone enters the lab and triggers the PIR. This happens via the message bus and is handled by idle.py which is currently run from rc.local. idle.py was written by Tim initially. The screen turns off when the lab is empty and turns back on again as soon as someone enters the lab and triggers the PIR. This happens via the message bus and is handled by idle.py which is currently run from rc.local. idle.py was written by Tim initially.
Line 104: Line 127:
 tvstate = False tvstate = False
  
-connection = pika.BlockingConnection(pika.ConnectionParameters(host=amqp_host))+connection = pika.BlockingConnection(pika.ConnectionParameters(host=amqp_host, heartbeat_interval=30))
 channel = connection.channel() channel = connection.channel()
 channel.exchange_declare(exchange=amqp_exchange, type="topic") channel.exchange_declare(exchange=amqp_exchange, type="topic")
Line 122: Line 145:
         if tvstate == False:         if tvstate == False:
             os.system("tvservice -p")             os.system("tvservice -p")
 +            os.system("echo `date` TV ON command issued >> /home/pi/idle.log")
             tvstate = True             tvstate = True
     elif state == 'EMPTY':     elif state == 'EMPTY':
         os.system("tvservice -o")         os.system("tvservice -o")
 +        os.system("echo `date` TV OFF command issued >> /home/pi/idle.log")
         tvstate = False         tvstate = False
 +
  
 channel.basic_consume(callback, channel.basic_consume(callback,
Line 136: Line 162:
  
 <code> <code>
-apt-get install python-pika+apt-get install python-pip 
 +pip install pika 
 +</code> 
 + 
 +Log file of TV status (due to people wondering if it doesn't actually ever turn off): 
 + 
 +<code> 
 +~/idle.log
 </code> </code>
  
-==== Irssi config ====+===== Irssi config =====
  
 Summary: Summary:
Line 383: Line 416:
  
  
-==== Playing the sound ====+===== Playing the sound =====
  
 Part of the 'hacksense' stuff has been copied over: Part of the 'hacksense' stuff has been copied over:
ircterm.txt · Last modified: 2021-05-21 14:00 by simon

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki