Configuring a HDMI Switch over serial

If you have a HDMI switch that looks like the one below, and are having problems with configuring it over serial, skip to the bottom for my solution. Please read on though if you want the full story!

I recently picked up a HDMI Matrix switch for our TV & Projector setup, specifically the AV Access 4KMX42-H2A.

Image of AV Access 4KMX42-H2A

The are a number of key features that I like:

  • Infrared control – important later on for controlling with a Broadlink IR sender via HomeAssistant
  • Supports 4K – we don’t have any 4K display kit right now but its nice to futureproof!
  • Has 4 Inputs & 2 Outputs
    • Can put 1 Input simultaneously to the 2 Outputs
    • Can have 2 different Inputs on the 2 Outputs
  • Supports a lot of higher end AV formats
    • Dolby DTS-X, Dolby Atmos etc

Our plan was to use it to send the PlayStation, Roku, laptop or TV Receiver Box to the TV or the ceiling mounted projector as desired.

When I was setting it up however, I noticed that the remote control for the switch was activating some functions on our OSMega tv box – volume, menu items and channel changes. That makes it a bit awkward to use! Especially as you could end up changing something on the TV box without realising as you were swapping inputs/outputs on the HDMI switch. Even worse, when you adjusted the volume on the TV Box remote, it changed the input to the next one up!

However, another feature that is useful on the HDMI switch (that I thought might come in handy when purchasing!) is the ability to switch the IR codes. This means that the remote and HDMI switch can be configured to use a different set of IR codes to avoid conflicts with other IR controlled equipment – exactly the scenario we were in! And this is where the fun began…..

I knew from the manual (I assume you also read the manual before purchasing an item?…..) that the switch would need to be programmed over serial. Not a big deal – I have a good bit of experience in configuring devices over serial from Arduino to 3D Printers to networking equipment (Cisco switches and routers).

So I hooked up to the HDMI switch using the little 3 pin adapter supplied and a serial adapter I had and opened up my usual serial program, Putty. The api manual supplied the connection parameters below so I set them up in Putty, hit connect and tried the Get IR_SC command to see what IR mode the switch was in.

  • Baud rate: 115200
  • Databits: 8
  • Parity: None
  • Stop bits: 1
  • Flow Control: None

No joy……

I have also used a few other programs over the years so I gave them a shot.

  • ComTestSerial
  • RealTerm
  • Arduino Serial monitor

No joy……

Over the course of a few days I kept trying different combinations of serial adapters, cables, software, and swapping TX/RX pins. I tried all the various options and dropdowns in the programs, including different connection parameters as I had encountered incorrect details in manuals before. I even “ohm’d” the connection from serial adapter all the way to the port on the switch to prove I had no issues with the wiring.

No joy……

Looking further into the manual, it calls out a program called Serial Assist. Perhaps there is some secret sauce in there that would help? So I thought I would download that and try that out .

No joy…..

It was not to be found anywhere. I found some similarly named software called Serial Port Assistant but that was not it. The closest I found was a picture of it in this pdf for a radio receiver. Even with a version number to search for, I could not find a download anywhere.

So I contacted the vendor detailing what software I had tried and the settings I had used, and they confirmed that I was using the correct settings. But, that I would also need to enable CR/NL. These refer to Carriage Return and New Line which are very similar in function but slightly different in definition. There is a good historical explanation here with reference to their origin from manual typewriters.

So I set up two serial adapters with different software, planning to show exactly what I was using, in the hope that they could spot something that I was missing out on. First I found out that my cheap usb serial adapters were not capable of communicating in the higher baud rates! 9600 was fine, but 115200 was too high. Luckily, I had two higher quality adapters from Lindy & Startech that were compliant.

Here you can see I am sending the commands required from the Serial Port Assistant software on the left to the ComTestSerial on the right. The blue dotted arrows show the feature in the ComTestSerial to highlight spaces received in {}. Everything is being received correctly so I know my configs and cables are working! I hook up to the HDMI switch with confidence knowing that I have a working serial connection……

No joy…….

I sent that same picture to the vendor and they told me to tick the “n” box in the send settings of the Serial Port Assistant. I’m pretty sure I had done that already in one of my many, many attempts to get it working but I didn’t have it enabled in the picture I had sent them. So I gave that a shot.

There was joy!

The TLDR:

The two boxes I needed to enable were the “r” and the “n” in Serial Port Assistant. I have highlighted in green the commands I was sending. You can see the return data from the HDMI switch was not processed correctly as it kept putting in new lines where there should be none, but it worked! I had now enabled mode 2 on the HDMI switch!

I wasn’t quite finished though. I still needed to configure the remote to use the Mode 2 codes. Thats the easy part though, there is a small push button on the remote to switch to using Mode 2 codes.

If you have already pressed that button on the remote and you wish to return to Mode 1, then simply pull the battery for a few mins and it will default back to Mode 1. Also something to remember when changing the battery!

Got there in the end, but I’m still not sure why the manufacturer doesn’t have a an easier method to change between Mode 1 and Mode 2 on the HDMI switch itself. A physical toggle switch would be nice but even some key combo from the remote would be a good alternative. Or even a download link to a specific serial term program and a set of instructions for that software.

Father Ted inspired phone cover

As you can see from some of the other posts, a lot of my builds are for presents. This one is no different. If you have read the series on the Father Ted inspired tape dispenser, you can guess that this build was for my brother who is a massive Father Ted fan.

He was looking at tedtees.com to choose a birthday present for himself from me, and he came across some phone covers. Unfortunately, they were only for the iPhone and he has a Samsung Galaxy S5 🙁 I looked elsewhere but nowhere else was doing anything like them for non-iPhone users. So I thought to myself, this would be a nice surprise for him if I can rig something up.

The first thing I looked for was a case that had a slot to allow you to insert your own graphics. No joy. So I looked for a clear cover with the idea that he could wedge in a printed piece of paper between it and the phone. As it was clear, the paper would be visible through the case. I found one on ebay, and even better, it had a neon green trim which is his favourite colour since he owned a Ninja.

SCAN1_Page_1

When the cover arrived, I set about making the paper inserts. Luckily there was a blank insert already with the cover which gave me a good starting point. I scanned this in using some post-it notes to add contrast. I then imported this into Silhouette Studio and used the “Trace” tool to get a set of cutting paths. I then tidied up the automatically created paths as they were a little messy in parts due to the contrast not being sharp enough between the white insert and the yellow post-its. I guess I should have used a darker contrast medium. Once cleaned up I did a test cut which came out ok but the hole left for the camera wasn’t completely on centre. It didn’t help either that i didn’t have access to the phone itself. I was relying completely on the case to be accurate.

I did a couple of copies of the cutting paths on one page, and moved the camera hole around slightly on each one. This way, I had three more test pieces along with the original. After testing with these, one more tweak was made and now I had a reliable set of cutting paths. Next step was to add the imagery.

screenshot

Screenshot of one of the sets of inserts as laid out in the Silhouette Studio software. I’ve shown just the base colours with the cutting paths in red (the red does not get printed). The registration marks can be seen in both of the top corners and in the and bottom left hand corner.

 

I used the images from the TedTees site for one or two and for inspiration for my own Ted themed inserts. As I had the cutting paths all laid out, it was pretty simple to run off a large batch of around 20 different inserts. Enough choice to keep my brother happy for a long time! Plus, with the studio files saved, any insert can be recreated easily so if they get lost or damaged, they can be replaced quickly and with little effort.

 

Lego Oogoo moulds

My friends daughter has an upcoming birthday and is having a Lego friends themed birthday party. I had seen an instructable several years ago for some Lego shaped jellies and had always wanted to make some – here was the perfect excuse!

Looking for some food safe silicone to make the mould was proving tricky however. Plenty of places in the UK but either they would not ship outside of the mainland or were exorbitantly priced for a small amount. I was primarily looking at Smooth-On casting products but then went for food safe silicone caulking with the idea to make some oogoo – another thing on my “must try it someday” list.

First was to try out some basic non food safe silicone to see how the mould making would go. Unfortunately I didn’t take any pictures of the process but I ended up with a mould as follows after leaving it set overnight.

Lego_Oogoo14 Lego_Oogoo13

I was pretty happy with it. Some loss around the side walls and some loss of definition on some of the studs but overall a decent first attempt. I used a wooden coffee stirrer stick to place the oogoo in place and as it is about 75% of the width of a single Lego block, it worked a charm. It also had the flexibility to act in a spatula type fashion to spread out the oogoo. I did however put in a little too much cornstarch for the first batch and made too much so that by the time I was putting the last of the batch in place, it was already going off quite substantially and I had to dump the last quarter of the batch.  This negatively affected its ability to conform to the studs on the top of the block and was the reason I believe that the casting was not so well defined around the studs.

Having made the practise casting, I went ahead with the real thing using food safe silicone and a few lessons learned from the first go.

  1. Use a bit less cornflour to lengthen the working time
  2. Make smaller batches to ensure it remains workable for the duration of the moulding
  3. Take care around the studs and where possible use the first couple of applications from the batch on a stud section to take advantage of the pliability before the curing begins
  4. Use multiple smaller bricks instead of long bricks for the outside walls. It makes it much easier to remove them when releasing the mould.

My mould was made from my old Lego bricks that I had when I was a kid. It was really cool to reconnect with all the memories, especially with some of the more unique bricks that I individually remembered: Space “computer” bricks, turbines from an aircraft, Robin Hood etc.

Check out this really cool interpretation of the computer bricks

My friends daughter was going to be 6 years old and her name begins with an E so I made those in Lego aswell. I also thought it would be cool to make some of the other shapes for some variety. (now thinking about it, I wish I made some of the circular bricks aswell….maybe next time!)

Lego_Oogoo1

The mould is shown upside down so E appears backwards

Lego_Oogoo2

 

I mixed up the oogoo and began moulding. I started in one corner and worked outwards, building up the layers slowly, taking care to pay attention to the area around the studs. As before, I used the wooden coffee stirrer stick which worked very well. I used almost the full tube of silicone to make the first mould and as you can see from the pics, it was a clear silicone so I got a bit of a surprise when the second tube was a black silicone. Not an issue really but the clear is better to judge the mixing of the cornflour. As I could no longer judge from the colour, when I thought it was mixed, I just gave it a couple of more stirs to make sure.

Lego_Oogoo3 Lego_Oogoo4 Lego_Oogoo5 Lego_Oogoo6

The second mould was a bit smaller so was a bit faster to make and I was getting better at judging the batch size. There is no issue in making multiple batches as the oogoo sticks to itself very well. Once done, I put them aside and left to set overnight.

Lego_Oogoo8 Lego_Oogoo7

Next morning, I began the process of removing the retaining walls to speed up the curing process. The curing in most silicones is achieved via moisture being absorbed by the silicone. By removing the retaining walls and base plate, I would be exposing a greater surface area to pull moisture from the air.

Lego_Oogoo9 Lego_Oogoo10

It was then I spotted the difference in colour around the “E”. I’m not sure was this because it was the last of the silicone in the tube or if it was the amount of cornflour I used for that batch but it didn’t seem to be affecting the curing as it had the same level of squidgy-ness as other areas. I’m inclined to think it was the level of cornflour I was using as I had been using progressivly less with each batch. This turned out to have a negative effect when removing the Lego blocks as they were much more difficult to remove from those areas where I had used less cornflour. I had to use the coffee stirrer to persuade the silicone to pull away from the Lego when removing from these areas although there was still no tearing. The areas where I had used more cornflour came away very easily.

Lego_Oogoo12 Lego_Oogoo11

Overall I’m pretty happy with how they turned out although if repeating I would make the following changes:

  1. Make sure to get all clear silicone
  2. Measure more accurately than two pulls of the caulking gun and a pinch of cornflour!
  3. Add more cornflour
  4. Based on further research, add some gelatine to assist with the curing
  5. Use the more flexible base plate like I did for the larger mould. The stiffer one was harder to remove from the smaller mould.

Still it was all worthwhile! There will be further posts on the making of the jellies themselves 🙂

 

SHS Piston and ACM Piston head incompatibility

Just a quick post that may be of use to someone who is going to repair an airsoft L85.

I recently needed to replace the piston and piston head on  an airsoft SA80 (an Army Armaments L85 to be exact) due to damage to the existing set. The teeth were stripped on the piston and there was a chunk taken out of the piston head.

L85Piston001

The parts I chose to replace them with were an SHS 19 metal tooth piston and an ACM bearing piston head. The Piston was chosen as it was the cheapest one I could get that was suitable for the L85. A standard 15tooth piston will not work without a spacer as the gearbox design requires a longer piston. The piston head was chosen, as the cheapest decent part available.

L85Piston002 L85Piston004

The piston head had a bearing set that allows it rotate as needed. This reduces the possibility of the piston going off center and therefore reduces risk of piston/gearset damage/failure. The bearing set goes on the inside of the piston and connects to the piston head on the outside via a screw.

L85Piston006 L85Piston007

There was an issue on assembly though. The screw that is designed to go through the piston to hold the piston head in place, was too short. It would work on other pistons, but the SHS 19 tooth piston is thicker at the top and so the screw is just a little short. I was able to replace it with an M3 x 10MM which worked perfectly. The original screw had a countersink head but the thickness of the piston head was such that it accommodated the standard head on the replacement.

L85Piston008 L85Piston009 L85Piston012 L85Piston013

Success! The assembly went back into the gearbox with no issue and has been reliable during testing and game time. Silicone grease was added to the oring before putting in – helps with airseal by ensuring the oring doesn’t dry out. Abbey Lt2 (silicone grease with added molybdenum for heat resistance) to the piston teeth.

It is important to use silicone based grease as petroleum based oils/grease will “eat” the rubber seals. Keep an eye on the components of the lubricant as sometimes they will mix in some oil based lubricant. I personally avoid the aerosol sprays as you can get better placement with the raw oil/grease and makes certain that you are not getting any extra ingredient you didn’t want.

 

DIY Lipo battery

Another hobby of mine is Airsoft – imagine paintball but with small plastic pellets. Great craic and a good way of getting in some sneaky exercise.

Most of the guns used are classed as “AEG’s” – Auto Electric Guns. A battery is used to power a motor which pulls back on a spring loaded piston through a set of gears. When the piston is released, it moves forwards and compresses air – this air is used to “fire” the plastic pellet down the barrel.

As is the same with most devices, the most common battery type used in Airsoft nowadays is the lipo battery. Great power in a small package but it has is downsides. One of those is that they can fail fairly easily in comparison to nimh batteries and when they do, the typical mode of failure is that they will go puffy and swell up. This is a good indication that the battery is on the way out or has already failed.

You can see the puffiness in the battery at the right hand side. Due to the gassing, it has swollen up.

You can see the puffiness in the battery at the right hand side. Due to the gassing, it has swollen up.

DIYLipo001

 

My brother also plays and two of his batteries had suffered this fate, each one looking like one of the cells in the battery had failed. The batteries in question were 1200mAh 7.4V G+P 20C lipos. Given that they were the same type of battery, I offered to combine the remaining good cell from each battery to make a “new” battery. It is important to note that this was an option due to the same cells being used in both batteries. If the cells were mismatched (different mAh rating) this would not be a good idea as it would lead to an unbalanced battery pack.

Each battery is composed of two 3.7V cells: 3.7V + 3.7V = 7.4V. These values are only the nominal values for the cells and actually can vary quite a bit from that nominal value. By testing the voltage of each cell, it should be possible to work which are the bad cells and if there are two good ones.

DIYLipo007

Voltage across both cells shows 3.97 when expected to be between 6.2 and 8.4

 

DIYLipo008

Bad cell showing 0V

DIYLipo009

Good cell showing 3.97V – same voltage as shown above to be across both cells

 

Good cell from second battery

Good cell from second battery showing 4.04V

 

The testing of the voltages can be done via the balance lead which has connections across each of the cells as shown in the image below.

Testing the cells in the first battery showed that one cell was at 0V and one at 3.97. The second battery gave a similar 0V and 4.04V so we had two good cells! 🙂 if you look closely at the pictures above, you can see that the voltage on the good cell in each battery is measured across two different pairs on the balance lead. This implies that it should be easier to recombine the two good cells into one battery as they are naturally the two opposite halves of the battery.

Next step was to start stripping the batteries down to the separate cells. The battery is covered in a shrink wrap coating. I used a blade to carefully nick the plastic coating at one end and then tearing off the shrink wrap.

DIYLipo013 DIYLipo017

You can see the silver foil that forms the outer covering of the cell. It is very important to avoid puncturing this to prevent a fire starting. Covering both ends is a piece of thick paper and some kapton tape. The kapton tape acts as insulation to ensure there are no short circuits.

DIYLipo018 DIYLipo021

The two cells were attached together with double sided tape so I carefully prized the cells apart using a round plastic rod to rub in between the cells to break the adhesive seal of the tape. You can see that the cells were marked at one end with a “+” to denote the positive end.

DIYLipo023

One of the cells on the second battery was already ruptured before I had removed the shrink wrap. You can see some of the lithium polymer that has oozed out and crystallized in the picture above. At this point I was thinking about stopping but as the battery hadn’t exploded in the last few months, I didn’t think it would go any further. I did however carry out the rest of the dis-assembly of that battery whilst outside and holding it over an ammo can. If there was any heat build up, indicating an imminent issue, I could simply drop the battery in the can and close the lid to reduce the air supply to the fire. I also had a fire extinguisher on standby just in case.

DIYLipo022 DIYLipo025

You can also see how the cells are joined via foil tabs at the end. Using a soldering iron, I heated up the solder on the joints, adding a little of my own to assist with the heat transfer. With solder melted, I simply pulled the cells apart. The end result was 4 cells, two good and two bad. The ones marked with a red X are the bad cells. You can see the extra puffiness in both of them in comparison to the good cells. In the bottom cell, you can see the board connecting the balance plug and main battery connector (a mini deans in this case) is left in place. This was deliberate as it reduced the number of extra solder joints to be done on the new battery and it would only have been a replication of the existing connections anyways.

DIYLipo031 DIYLipo034

One thing to note when soldering batteries is the need to avoid heating the cells up. When working with lipo batteries, this is especially important. The technique used in industry is to use a spot welder on the battery tabs. That allows them to place a large amount of heat for a short amount of time thereby minimizing the chance of heat transfer into the cell itself. We can use a similar technique by using a soldering with a large head and by using a high temp ~ 500C. This is in contrast to the usual electronics soldering technique of smaller heads and a lower temp. You can see the difference in head size above, between the normal electronics soldering iron on the left and the larger iron on the right.

The technique is to allow the iron to come up to temperature, then place it on the solder joint. Feed in some new solder as this will help the spread of the heat throughout the joint. Once the solder has melted, remove the cell whilst simultaneously removing the soldering iron. This process should only take 2 seconds at most so do not leave the soldering iron in contact for long. You will also need to keep an eye on the temperature of the cell as the heat will damage it or possibly cause a fire.

DIYLipo030 DIYLipo039

The battery I was creating was in the nunchuck style as it was to go into a tight space on the gun. Normally in a two cell lipo you would connect the cells directly end to end, but with the nunchuck style, a separate wire is required to run between the two. In the first picture above, you can see the thick blue wire which will join the negative of the right hand cell to the positive of the left hand cell. The wire use is 14 AWG  to ensure it has the current carrying capacity – if you use a thin wire, it will heat up with the high current. If you are lucky it will just wear out……if unlucky it will cause a fire…..Can you see a running theme here regarding fire! 🙂

The thin blue wire on the left is coming from the balance plug. This will be extended down to end of the battery and it is important to keep this as a balance plug is necessary to maintain a healthy battery pack. In the right hand picture, you can see where the two wires have been soldered on to the tabs of the cells. I chose to flatten out the tabs to make it easier to solder onto, but this would latter come back to bite me when fitting the battery.

DIYLipo035 DIYLipo036

I also extended the connection from one cell to the other to allow for extra flexibility when inserting the battery in the gun. I also added some heatshrink to cover the main connections, and I later added some hot glue for further moisture protection.

DIYLipo041 DIYLipo042  DIYLipo044

 

I used some foam padding which was removed during the teardown of the battery to give a little protection to the exposed tabs before wrapping the ends in new kapton tape. If you don’t have kapton tape, you could use insulation tape. I then replaced the thick paper on the ends and added some hot glue for further protection.

DIYLipo045 DIYLipo046

All done! I wrapped some more kapton around the cells and wire to keep it neat

However, on putting the battery in the gun, I realised that I had made each half of the nunchuk too long and it would not fit in! I had miscalculated and had been working off the assumption that the handguard when the battery went was all hollow, and also that a battery I was using for size had the correct length. I was wrong on both counts! I had planned to put some more heatshrink over the cells, but I am glad now that I didn’t as it gives me a chance to alter the soldering to shorten the connections and therefore the entire cell length.

When I will get around to do that is a different story!