All posts by Thomas W-P

Fret not about bubbles

500D_1848

I opened a bottle of the cheaty cider that I had decanted off and had been living in the fridge for a while.  It was rock hard.  When opened it was stupidly over-fizzy.  It took two minutes to open bit by bit and when finally open the bubbles poured out for some time.  The yeast, which had been sitting at the bottom, was also thoroughly mixed in by the furious bubbles.  Not ideal.

After drinking the cider (it was OK – if yeasty…) I filled the bottle with water and compared it’s tautness with the Christmas Ale and Cider.  There was no competition.  They are certainly more tight than just water, so off to the cellar they went.  After worrying about them being a bit soft, I am now quite relieved they are not as rock hard as the cider.

Christmas Bubbles?

500D_1775The Christmas beer has had about a week since bottling and the cider four days.  I have to say that the bottles do not seem that taught at all.  I obviously have no experience, but I was hoping that they would be rock hard by now, and ready to unleash their fizzy delights come Christmas.

It all boils down to patience of course.  If it doesn’t work then I will be wiser and have some flat beer/cider to drink.

500D_1817I checked the instructions for the cider and it is not supposed to be drunk for another 8 months!

Blue Boar Brown Beer

500D_1838

My local home brew shop, May and Brett make their own beer kits.  I bought one the other day, together with 500g dark spraymalt based on the detailed instructions above.  The till didn’t say anything, but when I got to making the beer the instructions (on the back of the label) said I needed 1kg of the spray malt.  It did say I could make it up with everyday sugar though – but it won’t be as dark as it might be.

The process was exactly the same as the Christmas Ale, but this makes three times the volume (23 litres rather than 7 litres).  I hope I (and anyone I share it with!) like it – that is 40 pints or about 46 bottles of beer.

I didn’t check the OG since this was not mentioned in the instructions – they say just wait until the bubbling stops, then check that the SG is stable.

500D_1836
Steamy stirring

500D_1837
Topping up to 23 litres

Scrumpy Bottling

500D_1834
Sieving out the ginger

I started the scrumpy a long time ago.  About a month.  Certainly before the blog.  It is a funny sort of recipe and I am not sure about the results.  I fiddled with the recipe because I was impatient and because it seemed to have no yeast involved at all.  But what is left is sort of a rich apple soup that is alcoholic, tastes of apples and ginger and smells of bread.  I really think I need to do my research in to scrumpy for next time.

Today I just bottled it off, filtering it through my bag.  I used four 2l bottles but could only find three caps so used a brewing cap.  The recipe said tighten them to the point where they are nearly tight, so I have done that.  I am not convinced that this is going to be drinkable but I will keep following the recipe (apart from the added yeast and the blitzing of the apples).

I now have to leave them for five weeks before storing for another two months in a dark place.  Maybe some magic will happen.  I just checked them and they are still fermenting for sure.  I’ve loosened the caps until I can hear the gas seeping out, then done them up a tiny bit.  Maybe that is enough to keep the oxygen out.

6 litres of scrumpy
6 litres of scrumpy

RPizeBox Display code

Here is the code for now. It needs pylms downloaded and wiringpi2 to work.  I made some changes to pylms player.py to allow for accented letters in the titles so I just load the code rather than importing it.

#####################################################################
# SqueezeLite LCD Display                                           #
# Thomas W-P - http://thomas.w-p.me.uk                              #
# Needs to be run as sudo                                           #
#                                                                   #
# Known issues:                                                     #
#      Code is a bit crap, but that's life.  It just about works.   #
#                                                                   #
#####################################################################
import wiringpi2 as wp      # to control display
import time, datetime           # for delays and date
import fcntl, socket, struct # to get mac address
import commands           # to get IP address
#import subprocess              # for printing to console
import sys
sys.path.append('/home/pi/PyLMS/')

from pylms.server import Server # to talk to LMS server
from pylms.player import Player # to talk to LMS player


# variables/constants
loggedin = False      # to wait for the server
scrollpos = 0       # for scrolling the title - needs to be remembered...
waitBeforeOffMinutes = 10   # time to wait before switching off in minutes
waitCount = 0               # counter for the suspend mode
elapsed = float(0)          # to hold elapsed time
total = float(0)            # to hold total time
scPort = 9090               # default LMS port for CLI
scUser = ""                 # CLI user
scPassword = ""             # CLI password
whatToShow = 0              # 0 = Artist, 1 = Album, 2 = Position/Length



# to get the mac address
def getHwAddr(ifname):
    s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    info = fcntl.ioctl(s.fileno(), 0x8927,  struct.pack('256s', ifname[:15]))
    return ''.join(['%02x:' % ord(char) for char in info[18:24]])[:-1]

# to scroll the title
def scrollTitle():
    tracktitle = ""       # string to hold track title
    global scrollpos
    try:
        tracktitle = sl.get_track_title()
        if (len(tracktitle) > 16):
            tracktitle += " --- " + tracktitle[:16]
            for x in range(0,7):
                # exit if not in "Play" mode
                if (sl.get_mode() != 'play'):
                    return
                # we're at the start - pause 
                if (scrollpos == 0):
                    # scroll 
                    wp.lcdPosition(lcd, 0, 0)
                    wp.lcdPuts(lcd,tracktitle[0:16])
                    time.sleep(3)
                if (len(tracktitle) > 16+scrollpos):
                    scrollpos += 1
                    wp.lcdPosition(lcd, 0, 0)
                    wp.lcdPuts(lcd,tracktitle[scrollpos:16+scrollpos])
                    time.sleep(0.4)
                elif (len(tracktitle) == 16+scrollpos): #we've got back to the start
                    scrollpos = 0
        else:   #standard title
            for x in range(0,4):
                if (sl.get_mode() != 'play'):
                    return
                wp.lcdPosition(lcd, 0, 0)
                wp.lcdPuts(lcd,(tracktitle + " "*16)[:16])
                time.sleep(1)

    except:
        wp.lcdPosition(lcd, 0, 0)
        #cmd = [ 'echo', tracktitle ]
        #output = subprocess.Popen( cmd, stdout=subprocess.PIPE ).communicate()[0]
        #print output
        wp.lcdPuts(lcd,"(Title unknown)")
        time.sleep(5)  


# get the IP address
import commands
intf = 'eth0'
intf_ip = commands.getoutput("ip address show dev " + intf).split()
intf_ip = intf_ip[intf_ip.index('inet') + 1].split('/')[0]

# set up the display - 4 bit to save pins - apparently slower but marginal
# https://projects.drogon.net/raspberry-pi/wiringpi/lcd-library/
wp.wiringPiSetup();
lcd = wp.lcdInit (2, 16, 4,  11,10 , 0,1,2,3,0,0,0,0)

# connect to the squeezebox
sc = Server(hostname=intf_ip, port=scPort, username=scUser, password=scPassword)

# initialising
wp.lcdClear(lcd)      # clear the lcd
wp.lcdPosition(lcd, 0, 0) # cursor to start of row


# keep trying to connect until there is a response
while loggedin != True:
    try:
        sc.connect()
        loggedin = sc.logged_in
        #wp.lcdPuts(lcd,str(loggedin))
    except:
        wp.lcdClear(lcd)
        wp.lcdPosition(lcd, 0, 0)
        wp.lcdPuts(lcd,"Music server"[:16])
        wp.lcdPosition(lcd, 0, 1)
        wp.lcdPuts(lcd,"   not ready :("[:16])
        time.sleep(3)

# set up the player
sl = sc.get_player(getHwAddr("eth0")) # http://stackoverflow.com/questions/159137/getting-mac-address

# change the display
while True:

    # show something
    if (sl.get_mode() == 'play'):
        waitCount = 0 
        try:
            wp.lcdPosition(lcd, 0, 1)
            # no switch in python!
            if(whatToShow == 0):
                wp.lcdPuts(lcd,(sl.get_track_artist() + " "*16)[:16])
            elif(whatToShow == 1):
                wp.lcdPuts(lcd,(sl.get_track_album() + " "*16)[:16])
            elif(whatToShow == 2):
                wp.lcdPosition(lcd, 0, 1)  
                elapsed = sl.get_time_elapsed()
                total = sl.get_track_duration()
                progress = int(9 * elapsed / total)#
                wp.lcdPuts(lcd,">" + ">"*(progress+1)+"-"*(8-progress) + " " + str(datetime.timedelta(seconds=int(total)))[-5:])            
            whatToShow += 1
            if (whatToShow == 3):
                whatToShow = 0
        except:
            wp.lcdPuts(lcd,"      ~~~~      "[:16])          
        # title scrolling
        scrollTitle()  


    # deal with pause/stop
    if (sl.get_mode() == 'pause'):
        wp.lcdPosition(lcd, 0, 0)
        wp.lcdPuts(lcd,(sl.get_track_artist() + " "*16)[:16])
        wp.lcdPosition(lcd, 0, 1)  
        wp.lcdPuts(lcd,("     PAUSED" + " "*16)[:16])
        time.sleep(1)
        waitCount += 1
        if (waitCount >= (waitBeforeOffMinutes * 60)): 
            # send "OFF" message to player
            sl.set_power_state(False)

    if (sl.get_mode() == 'stop'):
        waitCount = 0
        wp.lcdPosition(lcd, 0, 1)  
        wp.lcdPuts(lcd,"           " + time.strftime("%H:%M", time.gmtime())[:16])
        wp.lcdPosition(lcd, 0, 0)
        wp.lcdPuts(lcd,(datetime.datetime.now().strftime("%A") + " " + datetime.datetime.now().strftime("%d")+ " " + datetime.datetime.now().strftime("%B")[:3] + " "*16)[:16])
        time.sleep(1)