Bang & Olufsen Beomaster 2400

BeoMaster 2400 Volume

This beautiful piece of design from Bang & Olufsen is now 36+ years old. Some features include touch sensitive controls (pioneered on the Beomaster 1900 a year earlier), an ultrasonic remote control and 5 preset FM stations.

BeoMaster 2400 PCB

As with most electronic equipment, electrolytic capacitors are common points of failure. A summary of why this can happen is explained here. Replacing these and the bridge rectifiers, also known to be a problem point, will significantly extend its useful life.

Assembly of BeoMaster 2400

It’s quite a complicated assembly, mainly due to its compact design.

BeoMaster 2400 Removed Electrolytics

The replacements are all smaller than their 70’s counterparts and long-life versions have been chosen where possible. The rectifiers have been swapped for uprated versions.

BeoMaster 2400 Replaced Capacitors and LDR Volume Control

The replaced components can be found in the table below and have been highlighted in the BeoMaster 2400 Service Manual.

B&O Reference Type Value Replacement Part # Mfg V Rated Hours Link
4200098 Cap 100uF EEUFR1H101 Panasonic 50V 6000 @ 105°C Link
4201065 Cap 10uF EEUEB1J100S Panasonic 63V 5000 @ 105°C Link
4200298 Cap 1uF EEUEB1J1R0S Panasonic 63V 5000 @ 105°C Link
4200296 Cap 2.2uF EEUEB1J2R2S Panasonic 63V 5000 @ 105°C Link
4200332 Cap 2200uF MAL202117222E3 Vishay 40V 8000 @ 85°C Link
4200097 Cap 220uF EEUEB1E221S Panasonic 25V 5000 @ 105°C Link
4200100 Cap 22uF EEUEB1H220S Panasonic 50V 7000 @ 105°C Link
4201061 Cap 4.7uF EEUEB1J4R7S Panasonic 63V 5000 @ 105°C Link
4200092 Cap 47uF EEUFR1J470 Panasonic 63V 5000 @ 105°C Link
4200305 Cap 5000uF ECOS1VP682CA Panasonic 35V 3000 @ 85°C Link
4200109 Cap 470uF EEUFR1C471 Panasonic 10V 6000 @ 105°C Link
8310275 B.R GSIB2520-E3/45 Vishay / I.R Link
8300277 B.R VS-KBPC602PBF Vishay / I.R Link
5370174 Pot 220R CB10LV221M Tyco Link

3M Microtouch touchscreen emulator in Python

A colleague asked about virtualising a touch screen DOS application, designed for use with a microtouch touch screen interfacing over RS232. The familiar story of the monitor / old PC hardware dying and replacing it seemed a shorter term solution to a problem that could be solved with virtualisation or emulation. Note: This software no longer has any external hardware connected.

The proposal:

  1. Virtualise or emulate the application within the windows environment.
  2. Link the application to a serial port on the host system (virtual or real)
  3. Write a touch screen emulator to simulate presses using mouse clicks within the application window.

VirtualBox and VMWare Workstation are two virtualisation solutions that support mapping host serial ports to virtual ports. After attempting to use both of these, the timing critical nature of this specific DOS application upon startup didn’t like [my suspected]  lag of the virtualised ports. Running it again in DOSBox, a x86 emulator, resolved this issue. Virtual Serial Port Emulator is a tool to create virtual ports that can act as a connector between programs. This maps the serial streams from the touchscreen emulator to the serial port DOSBox is looking for in this case (how-to configure DOSBox serial ports).


Finally, the touch screen emulation is written in Python as a quick and simple way to test it out. PyHook is used to capture mouse clicks and mouse position, while PySerial is used for all serial communication. This program  will firstly respond to a handful of serial commands that are required upon loading the system in DOSBox. Once in, it will ask you to calibrate the emulated touch screen by clicking the top left and bottom right of the application window. It will only action on clicks in the specified window, in this case, DOSBox. Each click within this area will be mapped across the standard 10 bit vertical and horizontal touch screen space and sent to the serial port specified.

# Microtouch emulator
# Copyright (C) 2014 Oliver S
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <>.

import serial
import pyHook
import pythoncom

left_click = 0
# check that value passed is within specified range
def set_limits(n, minn, maxn):
    if n < minn:
        return minn
    elif n > maxn:
        return maxn
        return n

# on each mouse click
def OnMouseEvent(event):

    # record current mouse position
    x,y = event.Position

    global left_click,tlp_x,tlp_y,brp_x,brp_y # tlp = top left position, brp = bottom right position

    # check to see if we're clicking in the dosbox window
    if event.WindowName and "DOSBox" in event.WindowName:
        left_click += 1

        if (left_click == 1):
            print "Please click top left of desired window"
        elif (left_click == 2): # if second click store top left position
            print "Please click bottom right of desired window"
            tlp_x = x
            tlp_y = y
        elif (left_click == 3): # if third click then store bottom right position
            brp_x = x
            brp_y = y
            print "Finished - Window size:", (brp_x-tlp_x), (brp_y-tlp_y)

        # if calibration is complete        
        if left_click > 3:

            # now calculate the position
            # the full range of the 3M microtouch range in hexadecimal mode is 000 - 3FF
            # use the full range (0 - 1023)
            screen_x = int ((1023.0 / (brp_x - tlp_x)) * (x - tlp_x))
            screen_y = int (((1023.0 / (brp_y - tlp_y)) * ((brp_y - tlp_y)-(y - tlp_y))))

            # set upper and lower limits on values if outside of defined area
            screen_x = set_limits(screen_x,0,1023)
            screen_y = set_limits(screen_y,0,1023)

            print "Sending (",screen_x,",",screen_y, ") Hex: (\x01"+format(screen_x, '03X')+","+format(screen_y, '03X')+"\x0d) "
            ser.write("\x01"+format(screen_x, '03X')+","+format(screen_y, '03X')+"\x0d")      # write a string

        print "Clicked outside DOSBox;"

    # return True to pass the event to other handlers
    # return False to stop the event from propagating
    return True

if __name__ == '__main__':

    # attempt to open serial port with parameters as specified
        ser = serial.Serial(
        if ser.isOpen():

            # mouse stuff            
            hm = pyHook.HookManager()               # create the hook mananger           
            hm.MouseAllButtonsDown = OnMouseEvent   # register two callbacks            
            hm.HookMouse()                          # hook into the mouse and keyboard events

            # serial stuff
            ser.flushInput()                        # flush input buffer
            ser.flushOutput()                       # flush output buffer
            while True:

                # read any new lines
                response = ser.readline() # this is non-blocking, provided that timeout is set to 0
                # if there is a new line
                if response:

                    print (response)
                    if "R" in response:
                        print "Reset Command"
                    elif "MS" in response:
                        print "Mode Stream"
                    elif "FH" in response:
                        print "Format Hex"
                    elif "MP" in response:
                        print "Mode Point"
                    elif "CI" in response:
                        print "Calibrate Interactive"

    except serial.SerialException as e:
            print("Failed to open Serial Port: {}".format(e))

Please note that this has been tailored to the application that I’m running – but can be easily tweaked / amended as necessary using the microtouch reference guide. The shell output:


The DOS application running  – with some numbers entered through the emulator using a mouse.


Scraping data from the BBC with Python

There is an annoying tendency of the BBC News site to have numerous ancient stories in their ‘Popular’ sidebar. It was a good excuse to try out Python and collect a bit more information on when this occurs.

This Python script follows the following process:

  • Visit the BBC News homepage and scrape the ‘Most Popular’ sidebar.
  • Visit the URL of each story.
  • Collect the published date (from the meta data and front end)
  • Calculate the difference between present date / time and the published date.
  • Store the data as a CSV file.
  • Repeat the whole process every n minutes or seconds.

Beautiful Soup makes relatively light work of parsing what we want, along with PrettyTable, CSV, Regular Expressions and Requests.

# BBC News scraper
# Copyright (C) 2014 Oliver S
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <>.

import time
import requests
import re
import csv
from prettytable import PrettyTable
from datetime import datetime
from bs4 import BeautifulSoup

def scrape_bbc_popular_stories():
    """ Scrape all of the shared and popular stories from BBC homepage and record published date """

        # request BBC news homepage    
        response = requests.get("")

        # parse HTML using Beautiful Soup
        # returns a `soup` object
        soup = BeautifulSoup(response.content)

        # find all the posts in the page.

        # find each list element belonging to class ol[number]

        most_popular=soup.find_all('li',{'class': re.compile('ol[0-9]')})

        #article group is 0 = shared 1 = most read 2 = audio / video
        #story number is the number assigned to the article (the number next to the title)

        article_group = 0
        last_story_number = 0

        # set up prettytable for nice printout
        x = PrettyTable(["Days Old", "Group Name", "Story Number", "Story Title", "URL", "Present D/T", "Original Pub Date", "Orig Pub Date (front)"])
        x.align["URL"] = "l"            # Left align URL
        x.align["Story Title"] = "l"    # Left align story title
        for each_story in most_popular:

            # store the URL of each story
            link = each_story.find('a').attrs['href']   
            print link

            # get the story title
            story_title = each_story.find('a').text 
            story_title = re.sub(r'^\W*\w+\W*', '', story_title)

            # get the story number (thats listed next to the article)
            story_number = each_story.span.text   
            story_number = re.sub(':\s*',"",story_number)

            # work out which group it belongs to
            if (abs(last_story_number-int(story_number)) >= 4)   :
                article_group += 1
            last_story_number = int(story_number)
            if (article_group == 0) :
                article_group_name = "Most Shared"
            elif (article_group == 1) :
                article_group_name = "Most Read"
            else :
                article_group_name = "Audio / Video"

            # if its an audio / video story that uses javascript to generate the time relations, ignore
            if article_group != 2:
                # retrieve the missed connection with requests
                response = requests.get(link)

                # Parse the html of the missed connection post
                soup = BeautifulSoup(response.content)

                # get the original publication date from the meta tags
                orig_pub_date_meta =  soup.find(attrs={"name":"OriginalPublicationDate"})['content']

                # get the original publication date from the front end (new BBC site)
                    orig_pub_date_front = soup.find('span',{'class':'story-date'}).text
                    orig_pub_date_front = datetime.strptime(orig_pub_date_front, "\n%d %B %Y\nLast updated at %H:%M\n")
                except AttributeError:
                    print "Old site - set front date to meta date"
                    orig_pub_date_front = orig_pub_date_meta
                # calculate the difference between original publishing date and time of checking
                orig_pub_date_meta = datetime.strptime(orig_pub_date_meta, "%Y/%m/%d %H:%M:%S")
                days_difference = abs((

                #"Days Old", "Group Name", "Story Number", "Story Title", "URL", "Present D/T", "Original Pub Date", "Orig Pub Date (front)"
                x.add_row([days_difference,article_group_name,story_number,story_title,link,'%Y/%m/%d %H:%M:%S'),orig_pub_date_meta.strftime('%Y/%m/%d %H:%M:%S'),orig_pub_date_front])
                #"Check TS", "Panel", "Title", "URL", "Pub Date Meta", "Pub Date Front"
                f.writerow([days_difference,article_group_name.encode('ascii','ignore'),story_number.encode('ascii','ignore'),story_title.encode('ascii','ignore'),link,'%Y/%m/%d %H:%M:%S'),orig_pub_date_meta.strftime('%Y/%m/%d %H:%M:%S'),orig_pub_date_front])

        # print the nicely formatted table that PrettyTable generated, once all stories collected
        print x
    except requests.exceptions.RequestException as e:    # This is the correct syntax
        print e

if __name__ == '__main__':

    f = csv.writer(open("bbc_popular_stories.csv", "wb"))
    f.writerow(["Days Old", "Group Name", "Story Number", "Story Title", "URL", "Present D/T", "Original Pub Date", "Orig Pub Date (front)"]) # Write column headers as the first line

    while True:
        print "Waiting for 5 minutes...."

Running this in IDLE shell looks like this:

and some of the ‘old’ results collected over a 3 hour period can be seen in this spreadsheet . Out of 46 news stories listed under popular stories during this period, 21 were over 67 days old!

Creating a Timelapse from a CCTV DVR

If you have a Dahua, QVIS or similar DVR that works with PSS software, processing the video into a timelapse isn’t easy – it has an odd file format, it is segmented by the hour (my DVR only encoded one key frame per hour too), the tools are awkward with 100+GB of video and generally timelapses are created from stills, not video. I’ve put together a brief guide on one way of doing this – in my case combining three weeks of footage from 3 cameras at 6fps and combining them into a <2 minute timelapse. You will need the following tools:

This assumes you’ve used PSS before and can download .dav files in hourly segments. Firstly, download all of the hourly segments using PSS for each camera.  Using the batch file converter, select the folder with the .dav files in and let it do its thing.


Now that you have a folder full of converted files, combine the files into more manageable groups. Using three cameras,  I organised by /camera name/dd_mm.avi and concatenated the eight hours from each day into a single file – the trick is to do this without with needing to re-encode anything (and losing quality). Avidemux does this with its Append feature (Ctrl+A shortcut).

Open the first file and repeat the Append function for each subsequent file. When finished use the save function to save the file as a .avi.  You may be able to skip this Append step and concatenate all files using a single step in Avisynth, see below, depending on the number / size of your files.

Tiling the three camera views and combining days

To tile and combine these daily streams, Avisynth is the right tool. Create a new text file putting

dir /s /b >filelist.txt

as its contents. Rename to .bat. Run a copy of this in each folder and you’ll have a file listing in a new text file. Create a new file in Notepad++ and use the search and replace to make the list match this formatting for each camera (A, B, C, D etc).

A=UnalignedSplice(AVISource("D:\timelapse\front\front_1_02.avi"),AVISource("D:\timelapse\front\front_2_04.avi"),AVISource("D:\timelapse\front\front_3_05.avi"),AVISource("D:\timelapse\front\front_4_06.avi"),AVISource("D:\timelapse\front\front_5_07.avi"),AVISource("D:\timelapse\front\front_6_08.avi"),AVISource("D:\timelapse\front\front_7_11.avi"),AVISource("D:\timelapse\front\front_8_12.avi"),AVISource("D:\timelapse\front\front_9_13.avi"),AVISource("D:\timelapse\front\front_10_14.avi"),AVISource("D:\timelapse\front\front_11_15.avi"),AVISource("D:\timelapse\front\front_12_18.avi"),AVISource("D:\timelapse\front\front_13_19.avi"),AVISource("D:\timelapse\front\front_14_20.avi"),AVISource("D:\timelapse\front\front_15_21.avi"),AVISource("D:\timelapse\front\front_16_22.avi"),AVISource("D:\timelapse\front\front_17_25.avi"),AVISource("D:\timelapse\front\front_18_26.avi")).AddBorders(4, 0, 0, 4))


There are only three feeds in my case, so I added a fourth blank image in the unused area. These four entities can now be stacked.

D=ImageSource("d:\timelapse\spare.bmp", end=2000, use_DevIL=true).AddBorders(4, 6, 0, 0).ConverttoYv12()


Add the above code at the bottom of the new file and save as a file with the extension .avs. This is an Avisynth file, that will play like any normal video in Media Player Classic using Avisynth as a frameserver.

This will result in a tiled, combined, unedited stream of all of the footage with regular keyframes for editing.


The 1 hour between keyframes means it takes too long to skip to frames using Avisynth as a frameserver. This delay makes it impractical to edit the video. To eliminate this open the .avs in VirtualDub and use the frame rate control option to increase the source frame rate as appropriate (I changed it from 6 to 60fps) and speed up playback.  Using Lagariths lossless codec, export to a new file. This file was ~450GB in my case.

To quickly scan through that footage, play the resulting file in Media Player Classic using Ctrl+Up to fast forward, Space to pause and Left / Right arrow keys to step frames. Each time you find a Start or Stop point, press Ctrl+G and copy the frame number to a spreadsheet. Export as a CSV and use search / replace in Notepad++ to create a new file with the start/stop frame numbers in the following format.


Open this new .avs file in VirtualDub. Using the frame rate control option again,  change both the Source rate adjustment and Frame rate conversion. Keeping ‘Convert to fps’ at 60, adjust the Source rate adjustment to a higher figure to increase the speed at which the final output will be played.

VirtualDub frame rate adjustment

Finally, change the video encoder to x264vfw in VirtualDub (Ctrl+P) and go to ‘Save as AVI’ (F7).

disclaimer: there are probably ways of doing this with fewer tools / steps.