Pages

18/12/2021

Measuring central heating return temperature with ESPHome, Home Assistant, and a Inkbird IBS-TH1

I'm currently renting and the boiler in my flat is old and lacking smarts. Last year I had a Drayton Wiser Thermostat installed which I'd highly recommend to people doing smart home stuff. The native app is tolerable, but it's takes minimum effort to get it working with Home Assistant, a popular home automation platform. Home Assistant allows me to do things like automatically set away mode when the house is empty, and also gather some metrics like when the boiler is actually on ( Or at least, the thermostat is calling for heat ), and if someone has fiddled with the thermostat...

One of the Wisers strengths is an intelligent, PID controller like operation that switches the heating on and off fairly frequently to prevent overshoot, and it does a good job at keeping the temperature relatively stable. But I'm curious how the seemingly short cycles affect the temperature of the water in the system, so I'd like to collect some more metrics on the return temperature and eventually the flow and hot water pipes if it works out.

 

Inkbird IBS-TH1 Sensor

 

 

17/12/2021

M5Stack Atom Lite + esphomeflasher = "Error: Reading chip details failed: Timed out waiting for packet header"

I recently purchased a M5Stack Atom Lite ESP32 module to use with ESPHome. It wouldn't flash with the browser, so I downloaded the binary and attempted to upload it with esphomeflasher, but it failed with the error "Error: Reading chip details failed: Timed out waiting for packet header" on every attempt.
 

Fortunatly I found a work-around.


15/12/2021

Mikrotik RouterOS - "received unsupported protocol 0x2145"

I've recently been playing with L2TP tunnels between Cisco and Mikrotik gear in an LAC/LNS type configuration. The L2TP tunnel was coming up but any traffic across the tunnel would fail. Enabling l2tp logging on the Mikrotik router revealed the error "received unsupported protocol 0x2145"

Google didn't give any direct solutions but did give a few clues suggesting it might be related to "Protocol Field Compression" (PFC),  and reading RFC 1661 yielded a bit more information on how it should work.

Fortunatly I was able to find a fix.

 
https://humornama.com/wp-content/uploads/2020/08/Leonardo-DiCaprio-laughing-meme-template-of-Django-Unchained-1024x1024.jpg
A Mikrotik bug? Never!

10/12/2021

Restoring a GPO 332 Bakelite Telephone

I've previously restored several old Bakelite GPO 300 series telephones and had a couple of people ask me to document how I go about it. I'm pretty bad at taking before / after photos as I tend to just dive in and dismantle the things before even considering taking a photo, so this time around I tried to get some photos before, during and after the restoration. I still got ahead of myself at times so the photos aren't quite in chronological order but I've tried to go back and fill in the gaps.

I aquired this phone from a seller on Facebook Market place along with a 232 Telephone and CB 935 Switchboard ( More info on those another day ). It was in reasonable condition but could do with some love to bring it back to its former glory.


The telephone, pre-restoration

 

 

Adjusting a GPO No. 12 Dial with a Digital Oscilloscope

In order for an exchange to detect the "pulses" a rotary dial generates, the timing needs to be within an acceptable range. There's two main parameters, the pulse speed, which should be 10 ± 0.5 pulses per second, and the break ratio, which should be between 63 - 67%. These will drift over time and will likely change after the dial has been cleaned, so adjusting the dial is best practise during restoration.

There are specialist pieces of equipment for testing dials, but you can get away with using a cheap digital oscilloscope that calculates the duty cycle and cycle time. In theory you could calculate both of these using an analog scope, but I won't go into that here.

I use a "DS213" oscilloscope which is a tiny handheld thing, but you should be able to use almost anything - we're only trying to measure 10Hz. If you don't have an oscilloscope, consider buying a cheap one or asking your local electronics / radio enthusiast, a Hackspace or an Amateur Radio Club. It might also be worth checking if your multimeter has basic oscilloscope functionality.

Before adjusting the dial you should give it a through clean, I've documented the process in another blog post.

DS213 oscilloscope

Cleaning a GPO No. 12 Dial

Rotary telephone dials are a thing of beauty. They're entirely mechanical but manage to accurately and consistently "pulse" a telephone line in order to signal the number the user wishes to call. The first time I restored one it happened by accident - I had no intention of fully dismantling it but I removed one too many screws and the spring lost it's tension, so I ended up stripping and re-building it. It's not actually that difficult, so don't be put off. I recently aquired a GPO 332 that needed some love, so I thought I'd document the restoration process. Restoring the dial is a significant section of the process, so I thought I'd split it into a seperate post.

Here's the dial in the condition I aquired it. Visually it's not the worst I've seen, but it wasn't running very well as the speed would vary dramatically and it would stick in places - making it a good candidate for a deep clean. 

 
Dial No. 12 in its uncleaned state.

 
 

23/11/2021

EVEN MORE Retrobright Experiements - Restoring an Ivory GPO 746 Telephone

I've been doing some experiments with Retrobright recently, a process which uses Hydrogen Peroxide to bleach plastic back to it's original colour. Firstly I experimented with how temperature and concentration affected the bleaching process (link), and once that was complete I experimented with how time affects the process (link). I didn't make any groundbreaking discoveries but I've settled on using 3% H2O2 at 40°C without any laundry oxidizer going forward.

As I still had the equipment out and surplus H2O2 I thought I'd bleach an entire phone. I've bleached phones before but I'm terrible at taking before / after photos but this time I remembered, just - you'll notice the before picture is missing the handset cord because I forgot to take a photo before starting to strip it. Doh!

I picked this phone up along with another for a grand total of £5. I intended to strip it for spares but as it turned out to be an "8746" (It already has the required mods to work on a modern line) I thought I'd keep it intact. Here it is pre-bleaching. It's very, very yellow.

Telephone

17/11/2021

More Retrobright experiments

I recently did some experiments with Retrobrighting plastics, using Hydrogen Peroxide to bleach them back to their original colour. I wanted to see how temperature and concentration affected the process. Once I'd gathered the results I wanted to run another experiment to see the affect of time.

16/11/2021

Retrobright Experiments

Retrobright, also known as Retr0bright is a process of bleaching sun damaged ABS plastic back to the original colour using a solution of Hydrogen Peroxide and laundry oxidixer containing TAED. It was originally developed for restoring retro computers which left the factory an off-white / light beige colour and often went yellow or even brown with age.

As you may know I've started collecting / restoring old telephones and the ABS plastic the GPO used to make phones in the 60s onwards also suffered from the same yellowing issue. It's most obvious on the Ivory models (Frequently sold incorrectly as "Yellow") but also affects the appearance of the coloured models, most notably the green and grey versions.

I've retrobrighted a couple using UV light, but in the UK the sun is variable and almost non-existant in winter, so I thought I'd try using heat instead of UV, and do some testing with different concentrations, temperatures, and amounts of oxidizer.

 

 

 

H2O2

 

27/10/2021

Restored GPO 300 Series Bakelite Telephones

Some time ago I had a small collection of 70s era GPO 740 series rotary dial telephones which I sold for a pittance when I moved house, something I since regret. I recently started playing with analogue telephony again, and my suppressed passion for old telephones returned.

I picked up a couple cheap of 746s from EBay and Facebook Marketplace but it didn't quite scratch the itch. I needed a "proper" bakelite phone, so I picked up a 312 from Facebook Marketplace for £30 which is relatively cheap, but it turned out to have some damage to the bakelite shell. I then found a 332 at a car boot with a sticky dial for £25 and quickly ended up with another 332 in very poor condition for £17. Finally I picked up another 312 with a damanged handset at RetroTechUK for £20. 

So that left me with 4 phones in varying states of disrepair for £92 - not too far off the price you'd pay for a fully restored 300 series phone. But now I had to restore them.

I won't fully document the process here, but with some part swapping and some spares aquired both online and at a Telecommunications Heritage Group "Swap Meet" I was able to restore 3 of the 4 phones to their former glory for less than £60 each, which includes the cost of purchasing all 4 phones and the required spares - not bad!

I intend on getting hold of another phone in poor condition to document the actual restoration process, which I'll post once finished. In the meantime, enjoy the photos:

GPO 332, GPO 312, and GPO 332 with a Dummy Dial  

23/10/2021

Assistance required - Building a Dial-up Network Access Server. Cisco NM-30DM?

Hello! I currently have a project bubbling along in the background to provide multiple (100+) of copper telephone lines to a bunch of people in a field, for "fun". For added "fun", I'd quite like to be able to provide dial up internet, even if it's just for a handful of active users.  But this is a little out of my comfort zone, so I could do with some help!


Cisco NM-30DM Module
Cisco NM-30DM

Update: I've managed to get a working setup with the help of some clever folks from ShadyTel. It's currently in the testing phase - I'll do a full blog post soon.

30/09/2021

Sous PIDe v0.1

I've wanted to build a PID temperature controller for a while. It's essentially an intelligent thermostat that carefully maintains the temperature, with a low hysteresis and minimal overshoot. They're used for all sorts of things, like sous vide cooking, brewing, reflow solder ovens, basically anything where accurate temperature control is required.

I've recently done some experiements with Retrobrighting (bleaching) old discoloured ABS telephones. The original method involved using a source of UV, such as the Sun, but more recently people have had good results using heat, which finally gives me an excuse to build a PID temperature controller.

This post isn't a detailed tutorial. Just some food for thought if you're constructing your own.

Sous PIDe - A PID based temperature controller
 

15/08/2021

Telkom Telos ATP-1

As you may have guessed from previous posts I have a thing for phones. Recently someone on IRC going by the name of gannymac

Telos ATP-1 Phone

 

06/08/2021

Fixing Gai-Tronics Commander Telephone Speed Dial Memories

Some people might say I own too many phones. Those people are wrong. I've got a small collection of  Gai-Tronics phones and recently got one of the speed dial memory ones for £20. It's missing the handset cradle, so it's not quite fully operational.

Before I got around to testing it I saw a post on a forum stating that the memory speed dial versions of these phones tend to die prematurely. Someone else suggested it might be due to a dead battery.

I hooked it up and whilst inbound calls worked fine, sure enough the speed dial button didn't work. Hmm. Time to take it apart.


30/07/2021

Connecting a Telephone handset to a USB Sound Card

I have a bit of a thing for ruggedised telephones like the ones you see on railways and industrial settings. In the UK the main manufacture is Hubbel, formerly Gai Tronics, formely DAC...

Their phones cost a fortune new but occasionally pop up on EBay for reasonable prices, however they're usually in some state of disrepair and spare parts cost a fortune. £200 for a replacement handset for a £600 phone. Yikes! (Incidentally I suspect this is why the end up on EBay, it makes more sense to buy a new one than try to get spares)

For a long time I've wanted to create my own custom internal controller to replace any that are broken, with the added bonus of converting them to SIP. I had some concerns about interfacing the handset / reciever with a soundcard as telephones generally operate at a different impedance to your average speaker and microphone, so I connected one up as a proof of concept. 

I chucked a photo up on Twitter and it was suprisingly popular so I thought I'd document the process

29/07/2021

BG7TBL 88-108MHz FM BPF Band Pass Filter

I've recently been listening to Pirate and "DX" FM Broadcast radio so I purchased a BG7TBL 88-108M FM BPF Band Pass Filter Ebay and stuck it on the NanoVNA to check it out.

It tested out well, with less than 2dB loss in the passband and 30dB rejection below 50MHz and above 145 MHz. Not much else to say about it, I'm just sharing here for posterity.





 

28/06/2021

APC 940-0103 Pinout for AP9211 AP9212 AP9217 & AP9218

APC can get in the sea. Every one of their devices uses a random connector with an obscure pinout for the console port. RJ50, RJ11, 2.5mm Stereo Jack, male DB9, to name a few.

I recently aquired an AP9212 in a job lot and wanted put it to use but didn't know the network config so had to console in. Except the DB9 on the front was male, and my el cheapo USB to RS232 adapter was also male. Hmm. Anyway, some googling later I managed to find the correct pinout, which turns out is just a "normal" null modem cable


15/06/2021

Bodging an RJ11/RJ12 Console Cable for use with an APC 7922 (And possibly others)

I recently aquired an APC 7922 Switched PDU - you can read more about it here

Unfortunatly when I aquired it the network interface wasn't working ( I suspect auto negotiation had been disabled) so I needed to console into it to get it factory reset and working.

Well, APC are a bunch of plonkers and tend to use odd connectors and pinouts on their console cables so you spend more money to aquire them. Well, I'm too smart  tight for that, so I looked into making my own with bits I had around the house. After a trip to the parts boxes I returned with an old Cisco Console Cable and some RJ12 connectors and just needed to figure out the required pinout.

After a bit of tweaking I mangaged to get something functional made up 

 

Upgrading the Firmware on an APC 7922 Switched PDU with FTP

I recently aquired an APC 7922 Switched PDU as part of a bulk purchase. Its a chonky box that sits in the rack at a data centre and distributes power to servers, switches and routers etc much like a 16 gang extension lead but it allows you to remotely switch devices on and off, monitor their power usage, and do things like add delays to devices powering up when the power is restored - useful for managinging in-rush current.

Whilst it's a nice bit of kit its not particuarily useful to me, especially give that the sockets are IEC13, so I thought I'd stick it on eBay where it could still get £100+ despite it being relatively long in the tooth. 

Before I listed it I thought I'd do some house keeping - Factory reseting it, testing it worked, getting the firmware up-to-date and finally it was just an excuse to play with it as it has been several years since I worked with this kind of gear.

The following blog post should help you get an APC 7922 upgraded to the latest firmware using FTP. Why FTP? I hear you ask. Well, I can't SCP it because it uses some ancient SSH implementation that wont play ball, and I couldn't find anywhere to download the "Firmware Upgrade Utility" - so FTP it is.


 

07/06/2021

Return of the Cisco 887VA - Testing and updated config

 Around 3 years ago I blogged about using a Cisco 887VA Router as a VDSL Modem.  As far as I recall I actually documented the configuration whilst getting ready to sell it, as I was downsizing my network.

Well, my network has since creeped back up in both size and complexity so I wanted to swap out the venerable Huawei HG612 VDSL modem for something else that could be rack mounted (cos bling). A quick google suggested the Cisco 887VA was still a good way to go, so I purchased another.



16/05/2021

Resetting the password on a Cisco Catalyst 2940 Switch - (Hint: It doesn't involve sending a break)

I recently got frustrated with the crappy "smart" switches in my network so I replaced them with second-hand Cisco hardware. Because no one got fired for buying Cisco, right? 

It turns out I don't need 1Gb/s to things like VoIP phones and my Blu Ray player, so I could get away with older models with 100Mb/s ports and a single 1Gb/s uplink, like the WS-C2940-8TT-S which are available for £25 and fan-less, with something beefier as the "core".

Whilst I was getting it configured I figured I should probably have a go at performing the password reset. For some reason I had it stuck in my head this entailed sending a break signal whilst it was booting to get into ROMMON, and then changing the configuration-register to ignore the config stored in the NVRAM when it booted. After desperately sending break signals, swapping console cables and generally swearing at the thing I got around to RTFM and realised I was doing it wrong... it seems the whole break into ROMMON thing is the procedure for another router I own, but not the Cisco 2940. Doh!

There's 1000s of guides on resetting Cisco switches. I'm mostly just writing this to commit it to memory and so I can look back on it next time I waste an hour send break signals to a switch.

28/04/2021

WTF AWS CLI? "No credentials found in credential_source referenced in profile"

I was recently debugging a bash script that was failing on an EC2 instance. The script was fairly straight forward and was using the AWS CLI to make some changes to the AWS config, however it was failing with the error "Error when retrieving credentials from Ec2InstanceMetadata: No credentials found in credential_source referenced in profile"

The error implies that the correct credentials cannot be found via the Metadata API, right? Apparently not.



21/04/2021

A Yealink T46S locked to Zoom! - How to unlock...ish

I recently purchased a Yealink T46S SIP phone from EBay as I wanted something with more line keys that supported Opus.

When it arrived it had an active account on it, which would potentially allow me to make outbound calls billed to the original owner. Unfortunately this is quite common for phones acquired on EBay and is incredibly poor practise.

The phone was quite well locked down with an admin password and the SIP signalling being sent via TLS, but a packet capture revealed the phone communicating with IPs belonging to Zoom.

Being an upstanding citizen I wanted to factory reset the phone so I could use it on my own service. The admin password prevented me from reseting the phone via the menu, but Google revealed that pressing the OK button for 5 seconds will factory reset the phone, or so I thought!



31/03/2021

Opportunistic SRTP Support in VoIP Devices

The widely used VoIP signalling protocol SIP has a bad reputation. In my opinion it's mostly unwarranted. If you don't stray too far off piste and have a decent NAT traversal behaviour things will generally work fine.

In the ideal world everything would be encrypted, but there's a plethora of end of life and unsupported devices out there, and devices which may support encryption are often configured by end users that may not enable it.

Enter Opportunistic SRTP - a method of encrypting the audio stream if it's supported by the other end, and it's not supported just fall back to plain old RTP

Photo by Markus Spiske on Unsplash

01/03/2021

Factory Reseting a Polycom VVX 450

I recently acquired a Polycom VVX 450 off Ebay for £30, which is an absolute bargain for a modern 12 Line SIP phone with OPUS / SILK support. 

There was some risk however, it had previously been used by a VoIP provider that shares its name with a character in the Greek Alphabet and some providers lockdown the configuration to make it challenging to make them work with another provider.

Getting around these locks can occasionally involve intercepting traffic and redirecting it to your own TFTP or HTTP server, however with this phone it didn't seem to be the case.


19/02/2021

Yealink T42G attended transfer fix

I recently started using a Yealink T42G - An older (but still very functional) SIP Desk Phone. Weeks passed without any issues, until I attempted an attended transfer. I'd receive a call, chat to them, hit transfer, dial the next number, hit send, and my desk phone would start ringing again displaying "ReCall" on the screen. If you answer the call, the leg to the phone you wish to transfer to will drop.

Fortunately I was eventually able to find a fix. I presume the same fix will work on the other T4X series phones, including the T40, T41 T46 and T48