2023-03-25

Barebones project showing how to get an Inkplate 10 to talk to WiFi and the Internet over HTTPS using the Arduino IDE

If you're working with the Inkplate 10 (or similar model) you might commonly want to do something like: connect to WiFi, hit some API over HTTPS, and display something. If you're doing this with the Arduino IDE then here's an example project that will demonstrate WiFi, HTTPS and deep sleep. Hopefully, this will save you time getting set up as the HTTPS part can be complicated.

If you're not familiar with the Inkplate it's a lovely project the uses recycled Kindle screens and adds an ESP32, lithium battery charger, RTC backup battery, touchpads, an SD card slot, and a bunch of GPIO pins. The Inkplate 10 that I'm using has a 9.7 inch, 1,200x825 display with 3-bit grayscale. In deep sleep it consumes just 22 microamps making it very suitable to run on a battery.

My barebones project connects to the WiFi network of your choice, hits a public API that returns the IP address you are using and displays it on screen. It then goes into deep sleep for 30 seconds. 

The only complicated part is that the HTTPS/TLS functionality does not have a built in list of root CA certificates. So you either have to provide that (which takes up a lot of memory) or grab the CA certificate of the specific site you are connecting to. In this example, I used openssl s_client to get the certificate for the API I am hitting. 

You simply grab the last certificate that is output by the openssl s_client command and include it in the code. Of course, embedding the specific certificate a site uses in the binary is brittle because your project will break if the site changes CA certificate, but it does work and it uses little memory.


2023-03-19

WAVE OK! The WWVB time signal sets my clock in Portugal for the second time

Back in 2021 I wrote about how my ancient (I think it's over 20 years old now) Sharper Image clock had set itself from the WWVB signal in Colorado. Well, it happened again. I woke up this morning to WAVE OK and the time set to Pacific:


That photo was taken at 08:09:31 UTC according to the EXIF data. Pacific Time is currently -7 hours from Lisbon time with DST applied. Flipping the clock over shows that's what it's set for:


Based on when I looked at the clock the signal was received some time between 03:00 and 06:00 UTC (so that's 21:00 to 00:00 local time there). Makes sense since propagation would typically be best when transmitter and receiver are both in darkness. 

Here's the WWVB propagation chart for 04:00 UTC. 



I guess things looked a little different last night and the signal made the 7,700 km journey.


2023-03-11

Repairing a tiny ribbon cable inside a 28 year old IBM ThinkPad 701CS

I'm in the middle of turning two badly treated IBM ThinkPad 701CS machines (the ones with the lovely unfolding keyboard) into a single, working machine. Both machines are about 28 years old and haven't been loved in a while. I'll leave the story of dead CMOS batteries, masses of Ni-Cd leakage, broken connectors, missing cables and more for another day.

But the current state is that I have cobbled together a mostly working machine from the two. However the TrackPoint in the keyboard was not working and causing a boot error indicating that the pointing device wasn't working. 

The reason was pretty simple. The last few centimetres of the small ribbon cable for the TrackPoint were cracked and the actual connector pads were a total mess. I do have two keyboard but one keyboard is barely working, whereas the one with the bad TrackPoint works great.

Unfortunately, the TrackPoint is welded in place and so removing one and switching it to the other keyboard wasn't viable. However, cutting both ribbon cables and grafting the good end onto the working keyboard was. Here's how I did it.

Using a hobby knife and under a magnifier, I scraped away the coating over the copper tracks until I had shiny copper. I tried using sandpaper but only had 120 grit available and it was too easy to break tracks. With a hobby knife I was able to just scratch enough off to reveal the six tracks on each piece of cable.

The ribbon cable is only 4mm wide and there are six connections to make. I stripped out individual strands of copper wire left over from an old project. I wasn't sure what the best approach was so I used solder paste and my rework hot air gun to cover both ends in flux and tin the copper connectors.

And then I hand soldered on six wires. This was really fiddly and the result is ugly but it works! To do this I had no solder on the soldering iron tip but tinned the copper wires at each end. Using tweezers and as steady a hand as I can manage just a few seconds of heat was enough to attach the wires.

Amazingly that ugly thing has no short circuits and there's a connection on all six tracks. Clearly, that's very fragile so I mixed up some epoxy glue and covered the whole thing up.


Here's the underside of the reassembled keyboard with my International Object Sizing Tool to give you an idea how small and fiddly that cable was to work on.


The combination of solder paste to tin the connections, then hand soldering, and finally some epoxy did the trick and the machine boots cleanly into Windows 95 with a working TrackPoint and keyboard.


The machine is getting close to completion now, can't wait to try out The Internet.