Barputer

From Voidwarranties - Hackerspace Antwerp, Belgium
(Difference between revisions)
Jump to: navigation, search
(Software)
 
(9 intermediate revisions by 3 users not shown)
Line 3: Line 3:
 
|Category=Electronics
 
|Category=Electronics
 
|Logo=Beer computer-300x290.jpg
 
|Logo=Beer computer-300x290.jpg
|Participants=Koen, Koert,
+
|Participants=Koen, Koert, berz, Warddr
 
|Locations=Den Bunker
 
|Locations=Den Bunker
 
|Short description=In a hackerspace a computer is needed everywhere, included behind the bar. So this project was born.
 
|Short description=In a hackerspace a computer is needed everywhere, included behind the bar. So this project was born.
Line 13: Line 13:
  
 
== Hardware ==
 
== Hardware ==
===Internal===
+
The computer is situated next to the refrigerator. Its audio jack is connected to the amplifier to play music.
The computer is situated in the corner at the end of the bar. Its audio jack is connected to the amplifier next to it to play music.
+
*HP case
+
*Intel 82865G Motherboard with internal audio controler and an unused graphics chip
+
*Intel Pentium 4 CPU 2.60GHz
+
*AMD ATI Rage 128 Pro Ultra TF Video card
+
*Broadcom Gigabit Ethernet
+
*80GiB harddrive (root filesystem)
+
*20GiB harddrive (backup)
+
  
=== Touchscreen ===
+
The touchscreen is a 17" LCD which connects using VGA. The touchscreen also has a serial port, which is connected to a serial-to-usb adapter.
The touchscreen is located at the other end of the bar and is connected to the case through a USB cable for the input devices and a VGA cable for the output (screen).
+
 
*Touchscreen
+
===Case===
**17" LCD (VGA)
+
It is fancy.
**the touchscreen has a serial port, which is connected to a serial-to-usb adapter plugged in a usb hub
+
*Mouse and keyboard
+
**Since we have a USB hub we connected extra USB input device so we can use the computer as an all-purpose device
+
**We might drop these extra input devices if we find a decent on screen keyboard
+
*The touchscreen is powered by a PSU, a button on the back of the screen's case switches this PSU on
+
  
 
===Misc===
 
===Misc===
 
* We have a serial barcode scanner, but we don't use it at the moment
 
* We have a serial barcode scanner, but we don't use it at the moment
** Is this still available?
+
** Is this still available? Yes!!!
  
 
==Software==
 
==Software==
 
*Berz tried using debian (concerned with the system's reliability) but couldn't get the touchscreen (which isn't supported by the kernel) configured
 
*Berz tried using debian (concerned with the system's reliability) but couldn't get the touchscreen (which isn't supported by the kernel) configured
*The server runs Ubuntu 10.10, which comes with Utouch, under which Ward got the touchscreen working quickly
+
*The barputer runs Xubuntu, which comes with Utouch, under we got the touchscreen working quickly
  
 
===Touch===
 
===Touch===
Line 54: Line 41:
  
 
=== Music ===
 
=== Music ===
We use MPD (Music Player Daemon) as a server. This allows us to use various clients at the same time, including over the network and on portable devices. For information on playing music, see [[How to play music]].
+
The technical aspect of the setup is documented here, if you just want to play some music, check out [[How to play music]]
 +
 
 +
We use MPD (Music Player Daemon) as a music server. This allows us to use various clients at the same time, including over the network and on portable devices.  
 +
 
 +
MPD can play audio streams. The list of streams is populated by scanning /home/barputer/Music/streams
 +
Aditionally MPD scans for music in /home/barputer/Music/shares. However no music is kept on barputer, and we intend to keep it this way. Instead, this directory is dynamically populated by mounting available music directories over the network.
 +
==== RAF ====
 +
[[ Image:RAF.png | right | 100px ]]
 +
Raf is the name of the script that mounts the shared music dirs, and is an abbreviation of Remote Audio Folders. It scans the network for available samba shares, keeps only those whose name contains the string 'music' to prevent mounting the wrong shares, mounts and updates the MPD library if necessary. It also scans if all the mounted shares are still accessible and unmounts them if they are not. Raf is invoked automatically by cron, keeping the MPD library up to date.
 +
 
 +
If you're impatient, you can force a sync by executing the following command on barputer:
 +
# RAF sync
  
 
To add music to the MPD library we originally used djmount, a program which automatically mounts UPNP shares. This setup was copied from [http://0x20.be Whitespace] and is documented [http://0x20.be/Audio_System here].
 
To add music to the MPD library we originally used djmount, a program which automatically mounts UPNP shares. This setup was copied from [http://0x20.be Whitespace] and is documented [http://0x20.be/Audio_System here].
Although this setup kind of worked, it didn't for some people. One of these people was berz_, who wrote a script which automounts sambashares which we currently use. We might complement this with djmount, allowing everyone to pick the one they prefer. This isn't implemented at the moment because no one bothered to use UPNP yet.
+
 
For information on adding your own music to the database, please see [[How to play music]].
+
==== Forwarding sound through pulseaudio ====
 +
Pulseaudio has replaced ALSA and OSS quite some time ago as the default sound server on linux. Since pulseaudio has networking built in by default, you can forward sound to barputer instead of your laptop speakers if you are running pulseaudio too (ie: run linux).  
 +
 
 +
===== The CLI way =====
 +
PULSE_SERVER=192.168.42.103 rhythmbox
 +
This should start rhythmbox while sending the resulting audio to barputer. Warning: barputer's ip might change.
 +
 
 +
===== The GUI way (GNOME) =====
 +
You will need to have paprefs, pavucontrol and avahi installed. Avahi needs to be running to discover network devices. Launch paprefs and tell pulseaudio to make remote audio servers available locally. Reboot to or restart Pulseaudio. Launch pavucontrol. Under the 'playback' tab you will see all programs playing audio listed. If Avahi detects barputer's pulseaudio server you should be able to select it to play one of these streams
  
 
=== Point of sales & Stock management ===
 
=== Point of sales & Stock management ===
Line 64: Line 70:
  
 
===Backups===
 
===Backups===
 +
====Images====
 
Every once in a while we make a full snapshot. These are full images that can be restored to the drive. The last image was made on '''17/05/'12'''. The images are made using FSarchiver. We can't use Norton Ghost or Clonezilla since they don't have support for EXT4, which we use for barputer's root filesystem. Backup procedure:
 
Every once in a while we make a full snapshot. These are full images that can be restored to the drive. The last image was made on '''17/05/'12'''. The images are made using FSarchiver. We can't use Norton Ghost or Clonezilla since they don't have support for EXT4, which we use for barputer's root filesystem. Backup procedure:
 
* Boot a live cd which has FSarchver (you can use System Resque CD).
 
* Boot a live cd which has FSarchver (you can use System Resque CD).
Line 70: Line 77:
 
* make an archive: fsarchiver savefs --compress=4 /mnt/images$(date +%F) /dev/sdb1
 
* make an archive: fsarchiver savefs --compress=4 /mnt/images$(date +%F) /dev/sdb1
 
**The first time we used --compress=5, which took a long time. So we should probably use level 4 or even 3.
 
**The first time we used --compress=5, which took a long time. So we should probably use level 4 or even 3.
 +
====Incremental====
 +
A backup of all the files on the root drive is taken every hour. These backups are rotated. Every fifth hourly backup is kept for 25 hours and is called a 'recent' backup. Every fifth recent backup is kept for 125 hours and called a 'medium' backup. Every fifth medium backup is called an 'old' backup and is kept indefinably. One hour in this context refers to an hour the computer is turned on. The snapshots are made and rotated automatically.
  
To this we should add regular incremental backups, so we can roll back to specific files. A solution might be to use rsync and cron.
+
This scheme uses rsync for snapshotting, rsnapshot for rotating, and space usage is kept down using hardlinks (every version of a file is only saved once).
 +
<pre>
 +
$ sudo du -hs /media/backup/incremental/*
 +
4.0K /media/backup/incremental/counter
 +
3.8G /media/backup/incremental/hourly.0
 +
138M /media/backup/incremental/hourly.1
 +
71M /media/backup/incremental/hourly.2
 +
123M /media/backup/incremental/hourly.3
 +
72M /media/backup/incremental/hourly.4
 +
82M /media/backup/incremental/young.0
 +
</pre>
  
 
==TODO==
 
==TODO==
*MOAR DOCUMENTING (on this page and [[How to play music]])
+
<del>*MOAR DOCUMENTING (on this page and [[How to play music]])</del>
*clean up the server for clarity and minimizing diskspace
+
*<del>clean up the server for clarity and minimizing diskspace</del>
 
**<del>Uninstall unneeded packages (Ubuntu comes with many packages preinstalled we don't need)</del>
 
**<del>Uninstall unneeded packages (Ubuntu comes with many packages preinstalled we don't need)</del>
**Organize our directories and files
+
**<del>Organize our directories and files</del>
 
*<del>make a backup image we can roll back to in case of emergency</del>
 
*<del>make a backup image we can roll back to in case of emergency</del>
*set up a cron job to backup important dirs at fixed intervals so we have incremental backups and can roll back a part of the system if we need to
+
*<del>incremental backups so we can roll back a part of the system if we need to</del>
*have barputer power itself on and off automatically when the space opens / closes
+
*have barputer power itself on automatically when the space opens
 +
*have barputer power itself off automatically when the space closes
 
*barputer hangs sometimes when booting, we don't know why
 
*barputer hangs sometimes when booting, we don't know why
 
*<del>we could use a relay so we don't have to turn the touchscreen's PSU on by hand when booting barputer</del>
 
*<del>we could use a relay so we don't have to turn the touchscreen's PSU on by hand when booting barputer</del>
 
*<del>creating icon for barputer</del>
 
*<del>creating icon for barputer</del>

Latest revision as of 12:17, 23 August 2013


Barputer
What:
In a hackerspace a computer is needed everywhere, included behind the bar. So this project was born.
Beer computer-300x290.jpg
Participants:
Koen, Koert, berz, Warddr
Category:
Electronics
Locations:
Den Bunker

Contents

Function

Hardware

The computer is situated next to the refrigerator. Its audio jack is connected to the amplifier to play music.

The touchscreen is a 17" LCD which connects using VGA. The touchscreen also has a serial port, which is connected to a serial-to-usb adapter.

Case

It is fancy.

Misc

Software

Touch

Install the needed packages:

sudo apt-get install xserver-xorg-input-elographics xserver-xorg-input-evdev-dev utouch sudo apt-get install xinput-calibrator

Recognize the device at boot

echo 'inputattach -elo /dev/ttyS2' >> /etc/rc.local

Calibrate the touchscreen, and put the output here: /usr/share/X11/xorg.conf.d/99-calibration.conf

xinput_calibrator

This is the config I last used, but if you've got smaller finger feel free to optimize it:

Section "InputClass"
Identifier	"calibration" MatchProduct	"Elo Serial TouchScreen" Option	"Calibration"	"4015 -4 6 4026"
EndSection

Music

The technical aspect of the setup is documented here, if you just want to play some music, check out How to play music

We use MPD (Music Player Daemon) as a music server. This allows us to use various clients at the same time, including over the network and on portable devices.

MPD can play audio streams. The list of streams is populated by scanning /home/barputer/Music/streams Aditionally MPD scans for music in /home/barputer/Music/shares. However no music is kept on barputer, and we intend to keep it this way. Instead, this directory is dynamically populated by mounting available music directories over the network.

RAF

RAF.png

Raf is the name of the script that mounts the shared music dirs, and is an abbreviation of Remote Audio Folders. It scans the network for available samba shares, keeps only those whose name contains the string 'music' to prevent mounting the wrong shares, mounts and updates the MPD library if necessary. It also scans if all the mounted shares are still accessible and unmounts them if they are not. Raf is invoked automatically by cron, keeping the MPD library up to date.

If you're impatient, you can force a sync by executing the following command on barputer:

# RAF sync

To add music to the MPD library we originally used djmount, a program which automatically mounts UPNP shares. This setup was copied from Whitespace and is documented here.

Forwarding sound through pulseaudio

Pulseaudio has replaced ALSA and OSS quite some time ago as the default sound server on linux. Since pulseaudio has networking built in by default, you can forward sound to barputer instead of your laptop speakers if you are running pulseaudio too (ie: run linux).

The CLI way
PULSE_SERVER=192.168.42.103 rhythmbox

This should start rhythmbox while sending the resulting audio to barputer. Warning: barputer's ip might change.

The GUI way (GNOME)

You will need to have paprefs, pavucontrol and avahi installed. Avahi needs to be running to discover network devices. Launch paprefs and tell pulseaudio to make remote audio servers available locally. Reboot to or restart Pulseaudio. Launch pavucontrol. Under the 'playback' tab you will see all programs playing audio listed. If Avahi detects barputer's pulseaudio server you should be able to select it to play one of these streams

Point of sales & Stock management

Using the vwcr application made by Koert. It's not completely finished yet, but it can be used (and is being used).

Backups

Images

Every once in a while we make a full snapshot. These are full images that can be restored to the drive. The last image was made on 17/05/'12. The images are made using FSarchiver. We can't use Norton Ghost or Clonezilla since they don't have support for EXT4, which we use for barputer's root filesystem. Backup procedure:

Incremental

A backup of all the files on the root drive is taken every hour. These backups are rotated. Every fifth hourly backup is kept for 25 hours and is called a 'recent' backup. Every fifth recent backup is kept for 125 hours and called a 'medium' backup. Every fifth medium backup is called an 'old' backup and is kept indefinably. One hour in this context refers to an hour the computer is turned on. The snapshots are made and rotated automatically.

This scheme uses rsync for snapshotting, rsnapshot for rotating, and space usage is kept down using hardlinks (every version of a file is only saved once).

$ sudo du -hs /media/backup/incremental/*
4.0K	/media/backup/incremental/counter
3.8G	/media/backup/incremental/hourly.0
138M	/media/backup/incremental/hourly.1
71M	/media/backup/incremental/hourly.2
123M	/media/backup/incremental/hourly.3
72M	/media/backup/incremental/hourly.4
82M	/media/backup/incremental/young.0

TODO

*MOAR DOCUMENTING (on this page and How to play music)

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox
Content Creation
Belgian Spaces