Difference between revisions of "Pogo"

From Bloominglabs
Jump to: navigation, search
Line 7: Line 7:
 
* RFID access management (RFID operates independently)
 
* RFID access management (RFID operates independently)
 
* Gateway between RFID system and IRC via doorbot
 
* Gateway between RFID system and IRC via doorbot
* Audio and Text annunciation to people within the space
+
* Audio annunciation to people within the space
 +
* Controls scrolling LED sign, access from IRC via SignBot
 +
* X10 Firecracker (serial X10 device control)
 
* LDAP (still experimental)
 
* LDAP (still experimental)
  
  
 +
== FTDI - /dev/ttyUSBx ordering ==
 +
We have a number of FTDI serial adapters connected to pogo. These allow access to X10 control, the scrolling LED sign, access to the RFID board, etc. To keep the tty devices ordered the same after each reboot some udev rules had to be created.
  
== Notes on pulseaudio setup ==
+
* /etc/udev/rules.d/10-local.rules
Previously only a user logged in through X could get audio output on pogo. This is necessary for fun audio stuff like letting the RFID system greet members when they badge into the space.
+
  
This is how to get pulseaudio working on pogo so anyone logged in can launch sound from the command line. Note that this is not normally how pulseaudio is supposed to run, in fact the pulseaudio folks explicitly state this is bad and not supported, it's only allowed for strange setups like what we actually need for our use of it on pogo.
+
<pre>
 +
# Run this to find an FTDI adapters serial number:
 +
# udevadm info --name=/dev/ttyUSB1 --attribute-walk | grep -i serial
 +
# More info here: https://forum.sparkfun.com/viewtopic.php?f=14&t=34590
  
Found part of the fix from this link:
+
# Definition for the X10 Firecracker on FTDI /dev/ttyUSB0
* http://wiki.laptop.org/go/PulseAudio
+
SUBSYSTEMS=="usb", KERNEL=="ttyUSB*", ATTRS{serial}=="FTCUSA8R"
  
<pre>*** PULSEAUDIO: Unable to connect: Access denied</pre>                                                       
+
# Definition for the RFID system (Arduino)
aplay: main:545: audio open error: Connection refused                                                       
+
SUBSYSTEMS=="usb", KERNEL=="ttyUSB*", ATTRS{serial}=="A7006QeX"
This happens because pulseaudio requires authentication before accepting connections to prevent random people from playing audio on your computer. Pulseaudio places a cookie in the home directories of the user running the server. Copy the cookie of the machine you want to send the audio data to, to the home directory of the sender machine. (Alternatively, you may add auth-anonymous=1 to the end of the load-module module-native-protocol-tcp line to disable authentication). You are ready to play networked audio using pulseaudio.
+
  
First verify console kit is installed, there are other ways to use pulseaudio but this is what was working with pulseaudio as of today:
+
# Definition for the serial USB interface to the scrolling LCD sign /dev/ttyUSB2
<pre>rpm -qa | grep -i consolekit
+
SUBSYSTEMS=="usb", KERNEL=="ttyUSB*", ATTRS{serial}=="FTCBW2W2"
ConsoleKit-libs-0.4.5-1.fc15.i686
+
ConsoleKit-0.4.5-1.fc15.i686
+
ConsoleKit-x11-0.4.5-1.fc15.i686
+
 
</pre>
 
</pre>
  
First fix from the default install: change this line in /etc/pulse/system.pa to this:
 
<pre>
 
#load-module module-native-protocol-unix
 
load-module module-native-protocol-unix auth-anonymous=1
 
</pre>
 
  
Also uncomment this line and change to "yes" in /etc/pulse/daemon.pa:
+
== Notes on pulseaudio setup ==
<pre>daemonize = yes</pre>
+
There were some pulse audio notes here, but the final fix to get audio working again on pogo was to uninstall pulse-audio. That's it.
 
+
At this point pulseaudio can be started and won't die - should accept audio from any user, and probably over the network as well...
+
<pre>/usr/bin/pulseaudio -D --system --disallow-module-loading --disallow-exit</pre>
+
 
+
I threw together an init file here: /etc/init.d/pulseaudio
+
Then set it up to start at boot with this:
+
<pre>chkconfig --add pulseaudio; chkconfig --level 345 pulseaudio on</pre>
+
 
+
Now festival and other apps can generate audio output regardless if a user is logged into X.
+

Revision as of 22:27, 18 February 2013

Pogo is the name of the system we keep running for services in the space. Generally we try to keep it in a running state as much as possible.

Services Pogo provides

  • Internal webserver/fileserver
  • External webserver via dynamic dns
  • Shell accounts
  • RFID access management (RFID operates independently)
  • Gateway between RFID system and IRC via doorbot
  • Audio annunciation to people within the space
  • Controls scrolling LED sign, access from IRC via SignBot
  • X10 Firecracker (serial X10 device control)
  • LDAP (still experimental)


FTDI - /dev/ttyUSBx ordering

We have a number of FTDI serial adapters connected to pogo. These allow access to X10 control, the scrolling LED sign, access to the RFID board, etc. To keep the tty devices ordered the same after each reboot some udev rules had to be created.

  • /etc/udev/rules.d/10-local.rules
# Run this to find an FTDI adapters serial number:
# udevadm info --name=/dev/ttyUSB1 --attribute-walk | grep -i serial
# More info here: https://forum.sparkfun.com/viewtopic.php?f=14&t=34590

# Definition for the X10 Firecracker on FTDI /dev/ttyUSB0
SUBSYSTEMS=="usb", KERNEL=="ttyUSB*", ATTRS{serial}=="FTCUSA8R"

# Definition for the RFID system (Arduino)
SUBSYSTEMS=="usb", KERNEL=="ttyUSB*", ATTRS{serial}=="A7006QeX"

# Definition for the serial USB interface to the scrolling LCD sign /dev/ttyUSB2
SUBSYSTEMS=="usb", KERNEL=="ttyUSB*", ATTRS{serial}=="FTCBW2W2"


Notes on pulseaudio setup

There were some pulse audio notes here, but the final fix to get audio working again on pogo was to uninstall pulse-audio. That's it.

Personal tools