Wednesday, 15 January 2025

Virgin TV Automation

 Intro

In September 2024 it was time to participate in the annual Virgin vs Sky renewal debate.  Virgin come up with a deal each year to make it too much hassle for me to change over to Sky.  This year the deal required a mandatory upgrade from Tivo to Virgin TV Go 360.  Our set top box remains the same but the Tivo software has been replaced by Horizon from Liberty Global, Virgins parent company.  The new software looks more up-to-date / standard and has a few more features, for example personal profiles and voice control through the remote.

In addition to watching recordings on the TV from the  Virgin set-top box we also watch downloaded films / series from our home server.  Fiddling around with multiple remote controls is becoming more of a pain, particularly when the programme maybe on the Tivo, available via catchup or downloaded onto the local network.  I felt it was time to come up with a better solution based on a browser application.

Approach

Home Assistant (HA) can be used to control a wide variety of electronic devices.  As well as integrating with most vendors IoT apps, the open source community has added many more "integrations" for a myriad of devices.

In my scenario I would like a HA running on an iPad or phone to provide all the functions I currently use on the Samsung TV, Virgin V6 set-top-box and Yamaha Soundbar with remote controls.

Samsung TV has its own HA integration and also an IoT app called Smart Things which HA can utilise.
Virgin has its TV Go app which is closely integrated with the V6 box but isn't incorporated into HA.
The Yamaha soundbar only has an infra-red remote control interface so any automation would need to be integrated using a Broadlink IR sender.

Solution

My intention was to combine Samsung, Tivo and Soundbar(Broadlink) functions into a single web browser based HA dashboard.  The project seems to be never-ending so I will outline the solution as it currently stands and, maybe, provide more technical detail and describe enhancements later.  The screen layout changes, depending on whether you are using Samsung TV or Virgin Tivo functions and the two layouts are shown below.


In the top part of the app there are buttons to turn equipment on/off, choose a source to display on the TV and control volume.  The bottom half of the screen contains all necessary buttons "copied" from the Virgin (red) or Samsung (blue) remote controls.

The power button switches TV, Tivo and Soundbar on/off at the same time.  The green sound buttons allow you to change the soundbar volume or mute it.

The TV source is usually Virgin Tivo so the set of red buttons is displayed allowing you to change channels, obtain program info, look at the TV guide etc.  Lots of the virgin channels are password protected during the day and earlier evening so I added a "code" button which inserts the password for you.  I also added some preset channels which may be of use when channel hopping.
There is a single button to access the Tivo recording screen, you can then navigate and choose the recording you want using the red arrow and OK keys in the normal way.

The downloads button takes you to the top level menu for films and programs downloaded from the internet.  Again you use keys and ENTER as usual, this time using the blue buttons, to choose and play your recording.  During playback there are also fast forward, rewind and pause buttons.

There are also buttons for Netflix and Amazon so that their programs can be selected using the app.
We dont currently make use of them but I have included Youtube and Internet browser buttons to access the built in functions which Samsung provide.

Although we dont watch it much there are lots of programs, including a wide selection of filsm on Samsung TVPlus.  The blue buttons allow you to choose channels, and I have set up a number of presents - although, irritatingly, channel numbers appear to change regularly.

Conclusion

TheVirgin TV Remote project seemed to be quite straightforward to start off with but there are many functions which need to be implemented.  Each time I look at it I think of enhancements which could be made.  We are just starting to use the version which has been outlined above and it will need some "rough edges" smoothed out before going much further.

The current system is excellent in a number of ways, so it is meeting expectations already.  In particular:
  • All devices are powered on/off by a single button instead of using three different remotes.
  • Most days, the app is all we need, the remotes aren't required.
  • All viewing sources are grouped together making it easier to find/choose the one you need.
  • A single button press is required to access Virgin recordings - instead of about 6
  • A single button press is required to access download folders - instead of about 6
  • Presets are available for favorite Tivo channels as necessary
  • Parental codes can be entered with a single button
There is a lot more that can be added but I should be content with what we have for the moment.










Samsung TV

The HA Samsung integration can select between TV+ and HDMI sources, change channels and simulate pressing buttons on the remote control.  An improved integration is available on a github repository by ollo69. It has some extra features


In particular, it can use the SmartThings API to obtain better information about channels/sources and has more remote controller key-press capabilities.

Our main interest for the remote control is to set the "source", this is to choose what is displayed on the TV screen.  Most of the time we use the Virgin Set top box and the source is set to "Virgin".  However Youtube, Amazon, Netflix can also be used.
Our basic script to send one or more key presses uses the standard SamsungTV remote HA entity to send a command to the living room tv.  "{{ key_sequence}}" is an argument providing the key definitions.
For TV+ and Virgin, keys are KEY_TV and KEY_HDMI (as Virgin box is connected to HDMI1).

For YouTube and Internet we use the ollo69 Samsung media.player entity to play an application.
The Youtube app is "111299001912" and the Internet browser is "org.tizen.browser"

For Netflix and Amazon I couldn't get the apps to work, so I had to use a sequence of remote control keys.

The sequence of keys shown on the left: HOME, followed by right-arrow three times then Enter starts Amazon.

We can use the SmartThings Key ST_VD:RouterShare as a key_sequence for  the ollo69 entity media_player.samsungtv55 to select the RouterShare source.  Unfortunately, although there are other sources and Apps available in SmartThings I haven't had much luck in accessing them (yet).  In particular I have failed to access USB sticks.  As the source order changes if a USB stick is removed/inserted we cant use "arrow" keys automatically to select them.



3D Printer

 


My main Christmas present, bought jointly for me by the family (organised by Alex) was an Elegoo Neptune 4 Pro 3D printer.  This introduces me to an indispensible tool of the maker world.

There is a fair amount of careful assembly work required.  Luckily a video and instructions provide clear details for each step.  Assembling it myself also provides a basic understanding of the parts and mechanism.  There are three axes controlled by stepper motors which are accurate to 0.01mm.  An extruder heats up filament so that it is soft and comes out of a nozzle where it is built up in thin layers (maybe 0.04mm) into shapes.

The base plate needs to be carefully levelled.  The method makes the level accurate to less than the thickness of a piece of paper over the base.


My first test print, provided on an Elegoo USB stick was a buddha about 2cm high.  The level of detail and surface smoothness achieved was excellent.  The print took about 30 minutes, which seemed slow but is much faster than earlier printers.

The next couple of experiments were a tetrahedron and a "gyro" keyring both of which came out brilliantly, perhaps as good as you would expect from shop bought items. 

My first proper build is a collapsing pirate sword for Harry jnr, it is amazing.  I saw it on a great turoial from Everything STEM.  You print it in situ on the printer and when you pick it up it telescopes into a full-length sword.






Tuesday, 14 January 2025

Mathematics

Polyhedra

I have become interested in polyhedra recently.
I have some small platonic crystals, some lovely solid stone cuboctohedrons and an obsidian tetrahedron.

Solid Starred Rhombicosidodecahedron

This interest reminded me of an idea I had when I was about nine years old.  At home there was a Time-Life book of Mathematics which included many subjects I found fascinating.  In particular there was a picture of a complex polyhedron which I decided I could make.  I knew about simple nets to make tetrahedra, cubes etc and after much time/thought I worked out the net for a Rhomibicosidodecahedron.  I purchased some cartridge paper (from Crawfords paint/art shop), drew out the net and glued it together.  The final stage was to make some three, four and five-sided pyramids which were glued on to the surface.

The resulting object was about 18" in diameter and looked very impressive.  I was proud of the result and kept it for a few years, although unfortunately no pictures of it remain.

Time-Life

The Time-Life Mathematics book was very accessible, easy to read with plenty of informative illustrations.  It inspired my interest in Mathematics and of late I have become obsessed with finding a copy.  Although I recalled its title was "Mathematics" I didn't have much recollection of what it was but eventually found it was a "Time-Life" book (I had imagined it was from Readers Digest).

In December I discovered its author is David Bergamini and found a copy on the Internet Archive which I could look through.  There were numerous pages, particularly pictures that I clearly remembered I decided I must obtain a copy.

The book was first published in 1963 with a later edition in 1969.  In 1963 I was six so it must have been that edition that my family owned which I remember.  There was a copy on sale on ebay in America and luckily as Harry and Leah were in California at the time they were able to buy it for me and bring it back with them.

Memories

Here is a selection of pages I remember very clearly from all those years ago.






PS

Now I have a 3D printer I can actually print out the smaller rhombicosidodecahedron.  The version I made was covered with 3,4,5 sided pyramid making it a solid starred rhombicosidodecahedron.

This is the net




Sunday, 27 October 2024

Awesome AI Art

Musing

AI in art is a contentious subject.

Does art require human inspiration or can AI reasonably be expected to produce quality pieces to rival human artists?
Certainly AI can produce some art which is indistinguishable from human efforts.  AI art isn't inspired.

Do we need to understand the artists motivation, thoughts or inspiration to appreciate art?
Often the answer is yes, artworks are considered good because of the message they are designed to communicate: highlighting injustice, portraying emotions, recording history, showcasing beauty etc.
AI can only do this incidently.

What about art which doesn't have a higher purpose, a flower, a landscape, a portrait?
AI can do this very well.

If you cannot tell if an artist is human or AI, is there any difference?
Probably not.  You don't need a back story to like art.

AI animates art

I think AI bringing art works to life is wonderful.
Various tools which create videos from a users specification providing amazing results are already available.  Sora and invideo allow you to create videos based on ideas you specify, there are some stunning videos produced by them.

Invideo in particular seems to be able to "bring artworks to life".
However, as I look there don't actually seem to be many examples out there.  I expect it is actually very difficult to get them to produce something good with a "wow" factor to be worth sharing widely.

Examples

Examples are generally shared on TikTok, Insta, Facebook or Youtube.  There are often many different copies floating around in different media.   I have included some from Youtube, as it is easiest for me to provide links.
























Tuesday, 22 October 2024

My (Computer) History 4

1979

During university summer "long vacation" I worked at BAC in Stevenage.  One summer I spent working on a computer ground system for Rapier ground-to-air missiles.



I found that the first system control programs were stored in patterns of little magnets stored in grids - perhaps the most primitive storage imaginable.

We were writing an Operating System for a more advanced version of a ground station which the company had built.  I believe I wrote some parts of the disk operating system, for instance a command to copy files.  I dont remember if it was written in assembler but I expect so as a compiler or cross-compiler was probably not available.

1980

IBM System/370 : APL : PERT

When I returned to work full-time at BAe in Stevenage after Univeristy, the project I spent most time on was a project scheduling package.
At the time project scheduling was traditionally a manual procedure.  An approach called PERT (Project Evaluation and Review Technique) allowed you to specify projects as a connected network of tasks and allowed you to identify the "critical path" and work out scheduled dates for project tasks.


A talented Electronics Engineer called Geoff Hoyle, had developed (or acquired) a program to do this analysis for his team and the company wanted to expand it for other departments and link the projects together into a company program.  It was a very forward-thinking but hopelessly over-ambitious scheme as most departments didn't have anyone who could use a computer, but I was unlucky enough to be allocated to it.

A big technical drawback was the program was written in an esoteric language called APL (A Programming Language!).  APL is a wonderful but completely incomprehensible very high level language which works on vectors and matrices. Here is an example program which works out the determinant of a matrix.

It uses a lot of pwerful single character opoerators and a special typewriter keyboard is required to write programs. It was available to use from terminals on an IBM mainframe.


I was able to make the system functionality work technically.  As network analysis was already working I had to add a user interface, suitable for non-computer people to use, allowing them to enter tasks, carry out critical path analysis and provide a report suite.
We had "donors" and "receivers" to link tasks to other projects and these needed careful maintenance.
The system actually needed a Program Office to manage the overall picture but the expectation was that the computer could manage the big picture and the users would just see what effect other projects had on them.
The system was rolled out to one engineering group but failed to make a major improvement to overall scheduling.

IBM 5100 : APL : Laplace Transform

The benefit of working for the defense industry was the amount of leading edge technology available.  One such device was the original IBM 5100 PC.



The 5100 could be programmed in Basic or APL.  I believe I actually used a 5110 which was released a couple of years later and could have floppy disk drives attached.  In fact it was a portable computer, with a self-contained screen, keyboard and tape drive.  It weighed about 25Kg so one strong person could carry it around.  Our model had a dual floppy disk unit which was the size of a cupboard and took two people to carry.  It could store a massive total of 4.8MB.  I had this all to myself for a number of months, as no-one else knew how to work it or what to do with it.
My task was to write a program to calculate Laplace transforms, which are a version of Fourier transforms.  APL was ideally suited to this work and my programs were very useful.  I could tell the PC how accurate I wanted the results to be and set it off to calculate the answers.  If I wanted very accurate results, I could let it run for hours, doing more detailed calculations.

Tektronix 4014 Graphics

One of the expensive toys our department had available was a Tektronix 4010 series graphics terminal.  I believe the one we used was a 4014 model which had a beautiful 19" screen.




Steve Cussens, who was a friend / colleague, had a friend in the movie business (perhaps an intern).  Steve wrote a program which simulated a space craft (well a simple cuboid shape) coming in to land, approaching the viewer.  I think I helped write the program, which required matrix manipulation for 3D graphics calculations.  This was soon after Star Wars came out and we were using a computer rather than models to draw the space ship.

1982

Computer Networking

The last project I worked on was to design and build a local area network, linking heterogeneous British Aerospace engineering systems.  There were a large number of different computers from a variety of manufacturers in use on site and obvious benefits in linking them together.  I believe DECnet would have been available for PDP-11 and Vax machines, but we wanted others to be linked in.  We were working with Logica VTS on the project and I remember a trip to their office by Oxford Street to look at at a "grey" market IBM PC.  The IBM PC was on sale in America from August 1981 but not introduced in the UK until January 1983.
My recollection of my objective was a little vague.  I think I came up with a potential set of user commands for operating over the network, largely based  on my knowledge of DEC Digital command language but I am not sure that networking  hardware had been agreed so I could only do some superficial programming.

Footnote

I moved on from BAe in August 1982 having worked for them for a total of about four years between 1976 and 1982, whilst studying for my degree.  In retrospect I was fortunate to work in a wide variety of environments on some innovative and forward looking systems, which I can look back on fondly.  The Undergraduate Apprenticeship was a great programme, it was a shame that recogition and remuneration did not keep pace with our value to the company and marketability.


Tuesday, 15 October 2024

My (Computer) History 3

1977

PDP11/34 : Coral66 : Edge Tracker

One of my favorite projects.
A new anti-tank missile was planned, which would use image processing to home in on its target.  The hardware circuit design included am2900 bit slice microprocessor chips and some expensive specialist chips.  Our teams job was to provide a software emulator for the missile guidance system so that another team could test their guidance algorithms and code by running it on our emulator.

I wrote the code for the ALU and some other system components.  It was vital that the emulator behaved exactly like the proposed hardware and I provided an exhaustive test suite to make sure results match the circuit specification.  We wrote our programs on a DEC PDP-11/34.  The PDP had an Operating System RSX and display terminals.  This provided an incredibly productive environment, allowing us to write our programs quickly directly in the computer, compile them in a few seconds and then test them immediately.
Coral66 was a good "sceintific" language to use, like Algol60 but slanted towards the defence industry somehow.






The project was a great success and allowed the guidance team to test their software on real digital video data, provided by the army, of tanks moving in various scenarios.  By analysing the edges of objects in a the image they were usually able to pinpoint the tank from the heat signature of its exhaust fumes.
I recall that one dataset proved troublesome; it contained a tank in a field of cows, and the missile guidance usually aimed at a cow's "exhaust" instead of the tank!

As a follow-up we started to build an emulator for guidance system based on 6502 processors for an air-to-surface missile.  I wrote most of the code before the project was cancelled.  It may have been because the actual hardware board became available to use for testing and an emulator was no longer required.

1978

Siemens 330 : Assembler : ATE

I spent some time in the Automated Test Equipment lab.  The idea was to use computer programs to test whether equipment / weapons were working properly; at the time it was quite an advanced concept.  For some reason, probably political, we were using Siemens 3003 computers which we had to program in German assembly language.


  Not being able to understand German this slowed me, and others. down considerably.  I dont remember what equipment we were supposed to test.  I do recall that the programs and data shared the same address space so we could try out dynamic programming.  For example, if you wanted a loop to execute 50 times you would write the integer value 50 into the appropriate place in the program.  It was all a bit of a come down from sexy PDP-11s.

Pixette SlideShow + Webdav

 Aim

My Art Gallery picture slideshow web application works very well, allowing me to look at pictures together with their descriptions and my comments.  Occasionally, I would prefer to see an iPad slideshow of the pictures full screen, with the minimum of borders / distractions.

The pictures are held on an RPI Samba shared folder and it would be easy enough to copy them across to my iPad and view them in Apple Photo or LiveFrame which I currently use.  However it doesn't seem right to do this when I already have the photos available, both on a shared folder and available as web URLs.

For some reason I found it difficult to find an iPad app that would access pictures on a shared folder and allow me to look at them in a slideshow.

Lighttpd web server

After searching Pixette appeared to be popular app, which might allow me to view shared folders collections on "NAS".  I thought that my RPI with shared folders qualified as NAS but apparently proper NAS devices have their own system software (e.g. Synology) - to allow proper file-sharing, multiple users etc.
However Pixette does support Webdav devices and I found that my web server lighttpd can be configured for webdav. I followed a guide fom Haven200 which explains how to setup lighttpd for webdav.
Unsurprisingly you need to install a couple of lighttpd modules and configure lighttpd.conf details.
You also need to make sure you have a password file available (I used htpasswd for simplicity)


After completing these steps it is possible to see my art directory structure

Configure Pixette

It took me a little time to get webdav working but once I had a URL I simply entered the details into Pixette, indexed files and sat back to watch my slideshow



Verdict



Pixette is an excellent tool which gives a proper full-screen slide show experience.  Of course the iPad has a high quality screen so the pictures themselves look great.  Pixette is intended as a digital picture frame and it shows pictures in a random order but that isn't much of an issue.

webdav is actually intended to allow you to make updateable pages, so I could probably experiment with that idea separately.  I recall that when Tim Berners-Lee initially setup his web server he intended web pages to be writeable so webdav is truer to the original idea than most.








Saturday, 12 October 2024

My (computer) history 2

1977

Intro

Having being accepted to study Mathematics at St Catharine's College, Cambridge I started an Undergraduate Apprenticeship with British Aircraft Corporation at their Guided Weapons Division in Stevenage.  The first three months was a mandatory workshop training course, mainly learning metalwork, with the traditional apprentices.  It disabused me of any notion that I had any practical abilities and I admired the skills of the younger, traditional apprentices.

After this difficult period I was sent to work in various departments around the site.  The other undergraduate apprentices were due to study Electronics and were easy to find placements.  They didn't really know what to do with a Maths student and it was natural to send me to work in departments with computers.  As a research and development site, there was a significant investment in computers but very little existing expertise in controlling and programming them.

IBM : Fortran : Statistical Analysis

My first placement was with the Precision Products group working alongside experienced traditional mechanical engineers who were computer illiterate.  BAC made extremely accurate gyroscopic compasses for the military.  Repeated readings gave slight variations and the designers hoped to improve accuracy by looking at a statistical analysis of compass readings.

I taught myself the Fortran IV language and wrote programs to analyse readings, using a 80 character coding sheet to write down the program. 


 I then went to a punched card machine where I typed each line of code onto a Hollerith punched card.  Column 1 was blank unless it was a comment.  Columns 2-7 were used for a line number for goto statements. Fortran commands were entered into columns 8-72.  Columns 73-80 were blank.  At the top of each card in each column, the character was printed, and beneath a sequence of holes indicated what the character was in binary. 

 Compass readings were also typed on cards which were appended to the end of the program.

After checking the cards, they were handed to an Operator who used a Remote Job Entry (RJE) terminal to read in the cards and run them in a batch partition on the mainframe.


I believe the computer was an IBM 360 running OS/VS Operating System.  The operator would add a couple of Job control language (JCL) card at the front of my program deck to tell the mainframe which partition to run and which printer should be used for results.

The engineers and myself could look at the printed results.  I also had access to a Calcomp plotter which was attached to the remote mainframe.  This was a very exotic and expensive device which enabled me to show results on a printed graph.



Analog Computing : Missile Guidance

In the 1950s 1960s and early 1970s analog computers were a useful tool.  Signal sources (Input voltages) would pass  through various components to give results in the form of output voltages. They were particularly useful in modelling systems whose behaviour was based on differential equations.

As shown below there were a variety of operations which could be carried out.  BAC used them to test missile guidance systems.  A missile nose cone would be mounted on gimbals in a test rig allowing it to turn and rotate.  A moving Radio Frequency target would be placed at the other end of a long room.   The nose cone then needed to track the target.  Instead of signals send to control rocket motors, the analog computer interpreted them and adjusted nose cone direction appropriately.

Electronic Associates (EAI) were the principal manufacturers of analog computers.  I learnt on one similar to EAI-180 at TNMOC which is shown below. It is programmed by plugging patch cables from inputs, through a sequence of components leading eventually to outputs. Although plugging the cables was easy it was difficult to design/test a working system.  I recall that the production system had a spaghetti-like mass of cables.  Patch boards could be interchanged on the front of the computer to run different "programs".



Saturday, 5 October 2024

My (computer) history

1971

My first recollection of an interest in computers was probably 1971 when I was 14.  The CEGB (Central Electricity Generating Board, now National Grid) had an open day at Roseneath, their local office in Bramhall Park which was about a mile from my home.  A little site called bygone days has gathered together some information and recollections on CEGB.  A recollection from Len Simpson mentions that there were a couple of open days after the new control room was opened.


As an aside my sister was at school with Isobel Plevin, whose father Don was a manager at Roseneath, and Annettes father, Roy, who also worked at the CEGB in the National Control Centre used to go up to visit Don Plevin.  In addition the bygone-days website has articles by Roy Lewis and his colleague Tony Malins.


I remember that we walked around the Control room, which was very impressive.  I don't know whether we saw a computer but there was a board describing  a computer (memory) as having a lot of pigeon holes for information, which sounded strange.

I came away from the visit with a freebie, which was a totally incomprehensible book of flowcharts relating to the computers application.  I used to look at them to try to understand how it might work.

Following the visit I must have expressed an interest in computers.  My fathers company used to receive Computing and Computer Weekly newspapers but I think no-one read them.  My father used to bring them home for me and I regularly read through them and saved old copies even though they didn't mean much.  I read a lot about the mainframe manufacturers of the day, IBM. ICL, Sperry Univac, Burroughs.  I recall lots of discussions on ICL 1906 computers being installed by councils and government bodies.

1974


My first interaction with computers came at school, in 1974 I think.  I attended Kings School, Macclesfield and studied Maths and Physics  in the sixth form.  The local Technical College had a teletype terminal with a remote telephone link to a mainframe at Manchester University.  One afternoon a week, for a term, we went to the college to learn Basic programming and to use the teletype.
I enjoyed the sessions immensely and wrote a few programs.  I recall a program which generated simple poems was great fun and impressed the teachers.



We "wrote" programs at an "offline" teletype terminal and saved them on the attached paper tape machine.  We then  went to the "online" teletype and inserted the tape so that it could be read in.  This loaded the program to the computer in Manchester.  Running the program caused the results, or an error message, to be printed on the teletype.  You would then tear of the paper and handover the terminal to the next person.  If there was an error, you amended your paper tape and waited in the queue to re-run your program.  It seemed wonderful.
 

1975

The school was offered a place on a residential computer course in the 1974/5 Christmas holidays.  As I was interested in computers I was lucky enough to be selected to attend.  The course was held at Eton College which was lucky enough to have its own computer, an Elliot 903
I am not sure what programming language we used, it may have been Algol or Fortran.  It was a small computer with no long-term storage.  Again we wrote programs using a teletype and saved them on paper type.  As the computer didn't have permanent storage or much memory it was necessary to load the compiler into the computer on a tape, then load your program tape and compile.  The output was another paper tape which you loaded into the computer (overwriting the compiler) and ran the program.  Program output was printed on a teletype.
Unfortunately I dont recall details of programs I produced.