Labna for mezze

I wanted to make labna, the soft cheese popular in the Middle East. Basically, it’s strained yoghourt. It would clearly be expensive to make it from good shop yoghourt, like Fage, at about £5 for a 900g tub, our favourite from Greece, so I decided to start making my own. Cue intensive internet “research”…

It turns out that Lakeland are selling the Easiyo yoghourt maker for half price, which I took to be an auspicious omen. The internet says the charity shops of the country are full of the things, because people get fed up with buying the ready-made powder the makers want you to keep buying, but I got myself a clean new one, for about £10.

The internet kindly pointed out that I wouldn’t need to go to all the bother of heating the milk to a certain temperature, and then cooling it before adding a live starter. Instead, I’m using UHT milk, which somebody else has heated, cooled, and put in a handy box.

So, I put UHT milk and a couple of spoonfuls of Yeo Valley organic natural live yoghourt in the inner jar, filled the youghourt maker with boiling water, put it all together, and left it overnight.

Putting the yoghourt I made into cheesecloth

The result was a good, set, yoghourt. Not very solid, but tasty. The next step was to put it in cheesecloth, and strain it. There’s three layers of cheesecloth in the picture, as I thought even quite thick yoghourt might run through it, but one turns out to be enough.

Labna, with the whey that came out of it.

Now, the Mezze book says one of the things I can do with labna is make little balls, and keep them in olive oil, in the fridge, ready for use. I had a go, but only made a few, before deciding that the process was too messy, and wasteful. The rest has gone back into the fridge to dry out some more.

Raspberry Pi 7 Segment display

Introduction

One of my #RaspberryPi Zeros is called PiClock, and has an 8 digit seven segment LED display. The program it runs displays the time, and sends it to two other Pis, that display it on Unicorn HD HATs. Between midnight and 8 am, it flashes the message “SLEEP” every five minutes, as well. The software library that it uses can display numbers, and most upper and lower case letters, but not all of them. I rather liked the idea of animating sequences of single segments on it, because, well you know, blinkenlights. I had a look at the software library, “7seg.py”, to see if I could get it to do that.

It turns out that the library uses a Python dictionary to look up the byte to send to the display for each of the characters it can display. Decoding the hexadecimal bytes took a few minutes, working from the code for the digits from 1 to 5.

The first bit is always a 0. The remaining seven are the seven segments, in the order abcdefg, which are laid out like this…

So, the codes for illuminating single segments are as follows…

Now to amend the library! I needed some typeable characters to put in the dictionary, ready to be used in strings in the python code. For no obvious reason, I chose a selection of brackets and the tilde character, and amended the library file. The selection of brackets didn’t work!

After trying characters until they did work, I ended up with #][£<$~ as the symbols for the segments abcdefg.

I’m only showing the amended part of the file, where the pattern to send to the display is looked up. The arrangement of the brackets and tilde for the segments is as follows…

Now I’m ready to program PiClock to do silly animations, which will be fun, and a lot easier than using the WordPress editor. Note to self: See if you can find a WYSIWYG editor for WordPress.

A marker

All the old stuff is here, and the remaining stuff on Blogger and Blogspot has been abandoned, and will not update.

It must be obvious by now that I have no idea what I’m doing with WordPress.

Rick Stein’s cookery books

Now that I think about it, these are so very much more than just recipe books. They’re works of art in themselves, with terrific photography. Not just the photographs of the food itself, but the pictures of the places Rick has visited. Mind you, some folks will feel cheated when they find just how many pages are sumptious photographs, rather than recipes, perhaps.

The fish and shellfish book, as you would expect from somebody with world-famous fish restaurants, has an excellent section on the methods used to make the various dishes. Want to know how to dismantle a crab? It’s there, with clear pictures. All of his books have thoughtful descriptions of the destinations, their cultures, and anecdotes about the people Rick met, who cooked dishes from him.

Secret France, Road to Mexico, Fish and Seafood, India… I use them all.

But, I say, Rick! Using the same picture in two books? I thought I was suffering from déjà vu… Both the Fish book and India have a picture of Amritsar fish. One is zoomed in a little, but…

The same photograph in two of Rick Stein’s books.

Python and SQL with matplotlib.

# Quick hack to graph last 500 greenhouse temperatures from weather database.
import mariadb
import matplotlib.pyplot as plt
conn = mariadb.connect(user="pi",password="password",host="localhost",database="weather")
cur = conn.cursor()
tempIN     = []
tempOUT    = []
timestamps = []
# Get the most recent 500 records.
cur.execute("SELECT greenhouse_temperature, ambient_temperature, created FROM WEATHER_MEASUREMENT 
             ORDER BY created DESC LIMIT 500")
for i in cur:
    tempIN.append(i[0])
    tempOUT.append(i[1])
    timestamps.append(i[2])  
conn.close()
plt.figure(figsize=(14, 6))
plt.title(label="Greenhouse and outside temperature up to "+str(timestamps[0]))
plt.xlabel("Date and time")
plt.ylabel("Temperature in Celsius")
plt.plot(timestamps, tempIN, label='Greenhouse temperature')
plt.plot(timestamps, tempOUT, label='Outside temperature')
plt.axhline(y=5.0, color='r', linestyle='-.')
plt.legend()
plt.savefig("/var/www/html/GHtemp.jpg")
plt.show()

The Gift Shop on the Chateau Lafayette Nile cruiser.

Looking for independent reviews of the Chateau Lafayette Nile cruiser? There are plenty of them online, for example on TripAdvisor. It appears to be quite luxurious, although perhaps a little dated, so they say.

This is NOT a review of the Chateau Lafayette Nile cruiser.


This is a warning to travellers, about the boat’s on-board gift shop. In this shop, there is a very high probability that you will be deliberately over-charged, by which I mean robbed, by the operator. I know this, because they stole a lot of money from my wife.

The owner of the Chateau Lafayette, a Mr Hany Youssef, has told me that he will not do anything about the dishonest acts of the gift shop. Of course, he’s perfectly happy taking rent from them. He accepts no responsibility for the actions of the shop. He even accused me of extortion, when I asked if he would compensate us for the loss. To clarify…

The person running the gift shop deliberately cheats unaccompanied women, and probably everyone else, overcharging them by huge amounts. He rushes his victims into making mistakes, charges in American dollars while pretending the amount is in the much smaller Egyptian currency, and it will be safer to stay out of his shop.

I strongly advise anyone travelling on the Chateau Laffayette Nile cruiser to avoid the gift shop, and to tell their fellow passengers about this shop. 

I know, foreign countries have different concepts of how to do business, and what responsibilities a boat operator has to his customers. But frankly, I see no reason to keep quiet about people who deliberately steal, or people who shrug, and say it’s not their problem, while continuing to take their share of the stolen money. The upset this has caused my wife has been very distressing to see. Morality varies from country to country. In our culture, it is regarded as decent to protect people from being robbed. Not in Egypt, though.

If this warning serves to protect you, please consider making a donation to our “Buy me a coffee” account.


I have also set up a Crowdfunder for this, but I am well aware other charities need money…

Adventures with Bread, part 94

 Rye bread, again…

You know how it is. There’s a recipe on the flour bag, and you think you’ll try it out. Well, you know, rye bread is tasty…
 
Rye bread recipe from the back of a rye flour bag.
Cotswold Flour’s Rye Bread recipe.

 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Last night, I made the poolish, and it was lovely and frothy by morning. I got the mighty Kenwood Chef out, with its dough hook, and followed the recipe carefully, all the way up to the bit telling me to prove it for 1.5 to 2 hours. After an hour, I found this situation…
 
Almost invisible bread tin, with dough rising madly, and flopping over the sides of the tin.
Underneath this over-excited dough, you can just about see the bread tin.
That’s a pretty standard sized loaf tin, but it makes a change for a rye dough to rise so well. I scooped as much of it up as I could, and put it all in a bigger tin, which I put in the oven before I remembered to take a picture.
 
The same amount of dough, in a bigger, shallower tin, in the oven.
Baking begins…

 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Then it was time to take the spaniels for their first walk of the day. Luckily, I didn’t meet anyone, and was back in time to remove the tin from the oven, and see what I had created.
 
Big, flat loaf, baked.
The result of 40 minutes in the oven, at 220°C
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
The obligatory crumb shot.
This is called the “crumb shot”. Pretty good crumb, if you ask me.

 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
And there’s the result. I buttered the slice, and ate it, in the interests of science. It has a good flavour, and I’m looking forward to the rest of it, over the next couple of days. I can’t help thinking I should have had some pastrami ready to go on it…
 
 
 

Python on Raspberry Pi, a note about structure, or something.

I’ve been struggling with a problem with a Pi camera for a couple of days. Instead of being able to start up the camera, I just had error messages about MMAL running out of resources.

Now, I knew I’d seen it before, and sure enough, Stack Overflow had quite a lot of questions about it. But I’d seen them before. And then I remembered that I never found out why the problem went away before.

As an experiment, I tried something that I thought couldn’t possibly work, and suddenly everything worked. All it took was moving the camera instantiation from the top of the program to just below all the function declarations.

At a guess, the camera startup can’t get the resources it needs, because the Python interpreter is chewing its way though all the function declarations, and using up something the camera software wanted.

It’s an age or so, since I wrote a language interpreter, and it was for a simple language, Pilot, but I know interpreters have reasons for liking programs in a particular order, so that’s my guess…

#MMALresources

A Python time-lapse program.

A free program…

This is the Python code I cobbled together to make a time-lapse movie of my rather exciting flowering cactus. I’m sure this has been done better by lots of people. It runs on a Raspberry Pi Zero, with not much memory, and no online storage, so it sends the pictures to another Pi Zero, called PiBigStore, which happens to have a 2 Terabyte USB drive. Help yourself to a copy, if you like. Change the server name, and password, obviously. If you know ways this can be improved, feel free to comment.

# Time lapse pictures
import os
import time
import ftplib
from picamera import PiCamera
import schedule

def send_to_PiBigStore():
    hour = int(time.strftime(“%H”))
    #print(hour)
    if hour < 7 or hour > 21:
        time.sleep(250)
        return
    
    file_name = “cactus” + time.strftime(“%Y%m%d-%H%M%S”) + “.jpg”
    camera.capture(“/var/tmp/” + file_name)
    
    connected = True
    ftp = ftplib.FTP()
    try:
        ftp.connect(“PiBigStore”)
    except ftplib.all_errors:
        connected = False
        print(“Couldn’t connect to PiBigStore.”)
        ftp.quit()
        
    try:
        ftp.login(“pi”,”password goes here”)
    except ftplib.all_errors:
        connected = False
        print (“Failed to login to PiBigStore server.”)
        ftp.quit()
    
    if connected:
        ftp.cwd(“/media/pidrive/data/cactus/”)
        ftp.storbinary(‘STOR ‘+file_name, open(“/var/tmp/”+file_name, “rb”))
        print (“Sent to PiBigStore “, file_name)
    ftp.quit()
    os.remove(“/var/tmp/”+file_name)

# Main loop
schedule.every(5).minutes.do(send_to_PiBigStore)
camera = PiCamera()
camera.rotation = 90

while True:
    schedule.run_pending()
    time.sleep(10)
A foot-tall cactus on a windowsill, with a Raspberry Pi Zero with camera, mounted on a Lego tower.

Curse you, munmap_chunk()!

 I still haven’t spotted a working solution to the problem where weather station programs in Python on Raspberry Pi fail, with no traceback details, after a couple of days.

I think it must be some resource in either the operating system, or the Python interpreter, running out, with very poor error reporting. I will leave it to people more familiar with the OS and interpreter to find out what it is, and fix it, in the fairly certain knowledge that everyone who could fix it has better things to do.

I found out that a Python program can actually restart itself, and changed mine to restart once a day. If that doesn’t fix it, I’ll let you know…

#RaspberryPi #Python 

My Stack Overflow comment on this.