Twitter

Featured

I’m also on Twitter and that stream gets updated a lot more often than this blog. Feel free to send me a message about anything you’d like to discuss.

LOL okay so b/c of Elno, find me at @krekr.bluesky.social and @krekr.ioc.exchange (Mastodon)

Sonos & ASUS AX issues

I’ve has issues with my Sonos setup since installing it. It would sometimes disappear from the network, sometimes the app wouldn’t see the system etc. Today (after more than a year of disappointment) I was guided through an hour-long debugging session by the very helpful Jenny, which changed the following ASUS router settings from their defaults:

Advanced settings > LAN > IPTV > Enable multicast routing
Advanced settings > LAN > IPTV > Enable efficient multicast forwarding (IGMP Snooping)
Advanced settings > Wifi > Professional > Enable IGMP Snooping

Also, check if the firmware of the router and mesh nodes are up to date, and whether the Sonos app displays any other (old/concurrent) Wifi networks (otherwise the system might keep switching back and forth).

Blackmagic Design SDI-HDMI converter micro USB problems, and a rant about connector receptacles in general

Blackmagic Design make some really awesome hardware. With some shitty flaws that means they break on lousy parts like a micro USB-connector.

I recently got a SDI-HDMI converter that only powered on intermittedly, probably because of the micro-USB connector coming loose after a mechanical shock/snag/… accident.

The current version of these is using USB-C, which is a lot more mechanically robust. But still, if you’re using these in a production environment, you’ll probably want to tape down the wires so there is no accidental force on the connector. It’s not really a field-proof power supply connector imho, especially for the types of environment BMD’s customers operate in.

To be fair, there is a plastic block holding the USB-connector down, but mechanically that doesn’t do much. A proper design of the connector’s PCB footprint might have saved this specimen though.

BMD SDI-HDMI converter on the bench. Overall, a very nicely designed board in a shitty enclosure. No water/dustproofing, no connector or cable protection. The micro-USB connector is on the top-right corner of this image

Fault finding 1

Stress cracking of the soldering connections visible at the red arrows

Under a microscope, cracks in the soldering of the connector are clearly visible. There’s a nice power LED (D2) next to the connector. Let’s get those cracks fixed up and power it up.

Re-soldered ground connections

Fault finding 2

Insert power – “pop”! But no light. Hmmm. Maybe the seller lied about it working intermittently? Was it maybe fried altogether? Check all IC’s for visual damage or magic smoke – nothing. No smell either.

Turned out that the “pop”-sound was made by something else completely unrelated. Look closely at the rightmost pin on the connector (next to the white dot – VCC or +5v). Looks good, right?

The real culprit

“Enhance!” This image pushes the limits of my microscope (and visible light microscopy in general). Remember that the pitch of these pins is 0,65mm (they’re 0,24mm wide each).

Turns out that the power for this thing runs through a *tiny* (4mil?) trace which also had been severed clean when the force was applied. Very hard to spot, even under a professional stereo microscope with proper lighting (and experience).

Fix

Tiny bit of lacquered wire connects the connector pin to a nearby via.

Mitigation

If you use BMD products (or any devices with micro USB or similarly flimsy connectors) in a rough environment, secure down the cable (e.g. with gaffer tape) near the connector. This way, pulling the cable doesn’t disconnect or break the connector.

One more step could be to put blocks of wood, LEGO or similar material around the connector to create a ‘hole’ for the connector to live in, so any snagging, pulling or falls strains the block in stead of the connector.dwdew

Proper mitigation

If you’re a device designer, PCB layouter, product architect or in any similar position to do something about this during design or scoping of the project – do so. Millions of devices end up in landfill because of simple problems like this – while the world is quite literally on fire.

I’ve fixed tens (maybe a hundred?) devices with this problem. Usually, the time-cost doesn’t match the value of the item (hello Chinese disco-light!). BMD is by no means the only company not doing this right.

Some Tips:

  1. Select the most robust connector (type) that’s available and appropriate for the job (I can understand going for micro-USB here because of the versatility, cost, and ubiquitous-ness back when it was designed (2015).
  2. Design the enclosure such that the connector receptacle is as recessed as possible. This way, the bulky, ‘hard’ part of the connector plug sticks out as little as possible, lowering the chance of impacts and shortening the ‘arm’ of a moment that is applied to the receptacle in case of a snagging momentum on the cable.
  3. Mount the receptacle as sturdy as possible within the constraints of your assembly (soldering) workflow. No tiny traces. No relying (solely) on copper-substrate bonding. Use the board’s thickness and the mechanical resilience of vias to your advantage.
    USB-C receptacles are much better in this respect because of their pins that actually pierce the board in stead of just sitting on top (and relying on the copper bonding).
  4. Add extra mechanical anchoring: Add clear copper pads next to a connector to (manually) add bulk solder blobs if necessary. Anchor the receptacle to the enclosure if possible. Add mechanical brackets over a connector (that actually do something – see next point). Hell, break out the hotmelt gun if you’re skimping.
  5. Test! TEST! Test the living bejesus out of your prototypes and products. Put yourself in the boots of your users. If it’s meant to be used on a film set, visit those. Products will fall. Cables will be pulled by a stray piece of equipment.
    Put a weight on a typical cable and let it swing while plugged into your device. Let if fall. If the connection breaks, the cable (plug) should break – (and this is important) the receptacle should be fine. Cables are almost free – the device is expensive.

Keep in mind: Circuit board, thin copper traces and solder are all very brittle – meaning there is little displacement required for the mechanical and electrical connections to get separated. Even a tiny tolerance or play (e.g. on a bracket) of say 0,2mm might be enough to reach ‘yield’ conditions in any of those. Make sure they can’t be reached (with a safety margin). That’s why the plastic block holding down the USB-connector inside this product is a non-working afterthought.

Let me tell you; mounting it like this will fuck up (even the new USB-C) connector real quick if you’re not just interviewing someone in a vacuum.

But!…

Yes this adds costs. But these are tiny in comparison to the cost of products failing, (film) productions halted or delayed, and the damage to your brand’s reputation. The environment (and your users, co-workers in warranty, stock holders etc. etc.) will thank you.

Arduino Software PWM without library

Sometimes you want your code to be as independent as possible. Arduinos have a hardware PWM-function, but not on every pin. For instance, on the (awesome!) Seeedstudio Grove Beginner Kit, both onboard LEDs (pin 13 and 4) are on pins that don’t have hardware PWM. There is a library to do software PWM, but sometimes you don’t want to use a library (e.g. extra overhead).

Here is an example that simulates PWM using only Arduino native functions:

/*
Analog Input

Demonstrates analog input by reading an analog sensor on analog pin 0 and
turning on and off a light emitting diode(LED) connected to digital pin 13.
The amount of time the LED will be on and off depends on the value obtained
by analogRead().

The circuit:

  • potentiometer
    center pin of the potentiometer to the analog input 0
    one side pin (either one) to ground
    the other side pin to +5V
  • LED
    anode (long leg) attached to digital output 13
    cathode (short leg) attached to ground
  • Note: because most Arduinos have a built-in LED attached to pin 13 on the
    board, the LED is optional. created by David Cuartielles
    modified 30 Aug 2011
    By Tom Igoe This example code is in the public domain. http://www.arduino.cc/en/Tutorial/AnalogInput
    */

int sensorPin = A0; // select the input pin for the potentiometer
int ledPin = 4; // select the pin for the LED
float sensorValue = 0; // variable to store the value coming from the sensor

void setup() {
// declare the ledPin as an OUTPUT:
pinMode(ledPin, OUTPUT);

}

void loop() {
// read the value from the sensor:
sensorValue = analogRead(sensorPin);
// turn the ledPin on
digitalWrite(ledPin, HIGH);
// stop the program for microseconds:
delayMicroseconds(sensorValue);
// turn the ledPin off:
digitalWrite(ledPin, LOW);
// stop the program for for microseconds:
delayMicroseconds(1024-sensorValue);
}

3D-printable door handles

Materialise is an awesome 3D-printing service. In light of the COVID-crisis, they designed a suite of door handles that you could print and attach to doorhandles around your home or office, so people can open doors without touching them with their hands.

However, I found that none of their designs quite fit the most common door handles in use in The Netherlands. Also, one model tended to break easily because of the thin walls. So I adjusted their designs.

Best printed in PETG w/ 100% infill for sturdiest end results.

Clean HDMI output on Nikon D7000

Quick write-up of steps and info to get the D7000 to output clean 720p HDMI (no menus etc.) for recording or streaming.

You’ll have to download firmware version 1.03 which is available here (same site has a Windows download):

http://www.opendrivers.com/download/driver-166837.html

And put it through an online “patcher” here:

http://simeonpilgrim.com/nikon-patch/nikon-patch.html

Further instructions are available here:

https://nikonhacker.com/wiki/Nikon_Patch

2011 15″ MacBook Pro & Crucial M500 SSD issues

When a tool works, I like to keep it as long as possible. About 8 years ago, I bought a 15″ MacBook Pro, and it has served me well all this time. Apple replaced the logic board a few years ago (under warranty!) because of graphics issues. Since purchasing, it’s had it’s memory upgraded, the hard drive replaced for an SSD and the optical drive swapped out with a hard drive. I replaced the SSD again for a larger 512GB model (Crucial CT512MX100SSD1) when they became cheaper. So far so good.

Recently, a friend gave me a defective MBP, which turned out to be the exact same model (A1286). Great for spares, I thought. Lo and behold, there was a whopping 960GB SSD (A Crucial ct960m500ssd1) inside. “Why not swap that into mine?”

I wish I hadn’t. While the swap was relatively easy, and the computer worked okay, it got a little sluggish over time. I upgraded macOS and it got even slower. Until I got to a point where I couldn’t even send an e-mail without getting the hated macOS “Spinning Pinwheel Of Death” (SPOD). Once every 30 seconds. Sometimes Spotify would even stop playing music, even when I didn’t even touch the machine.

I’ve had this OS install since I bought it. All the development kits, homebrew, libusb-type hacks etc; maybe something is acting up. Let’s try a clean install. Nope, still getting beachballs right after booting a VM. Different SATA cable – nope. Other memory. Oh well.

Must be all the OS upgrades, I thought. Also, I’ve been asking quite a lot from such an old machine, running a lot of programs simultaneously – even some VM’s too. “But it always worked flawlessly!”. I was seriously considering buying a new laptop, even looking at Windows machines because of the price difference. A MacBook Pro with similar storage and memory would’ve cost ±€4000, though.

Then it hit me. The problems started – gradually – about a year ago. About the same time I upgraded to the M500 SSD. Swapped back the MX100, clean install; bingo! VMWare Fusion, running Windows 10 and Windows XP simultaneously, different browsers with 4K video, some file transfers running in the background; no problem.

Since I couldn’t find anything online about this apparent incompatibility, I thought I’d share it here. What makes it even more problematic is that the drive seems to work fine; the OS installs, it boots, etc. You’ll only notice the hangs and freezes after a while. That’s what makes this so insidious.

I don’t know the root cause of the problem, and at this point I don’t care. 512GB ought to be enough for anybody 😉

BeagleBone Black Technical Drawing

I know. You’re hacking and whipping a proof-of-concept up. You’d like to laser cut a baseplate for your favorite dev tool: the BeagleBone Black. Unfortunately, BeagleBone doesn’t provide nice technical drawings like Raspberry Pi does.

I noticed a shift in visitors to my blog; most of them used to come for the cheap chinese laser cutter pages, or the Solidworks Macros. But lately, most of them are coming for the Arduino Uno technical drawing! Since there are no good mechanical drawings for the BBB out there, I decided to whip one up.

Thanks for Logic Supply for the (very detailed!) CAD-model.