To tough bargainers:

This meme is spot on about my expertise in HP/Agilent/Keysight Infiniium Oscilloscopes. It might take me 30 minutes to put on the automation I’ve created to fix a specific issue, but nobody with just one non-functioning unit in front of them can figure out the right steps even if they worked on it for months. Writing the automation itself turns out to be the least of the bulk, and it’s still more time than one is willing to spend writing the scripts or performing the undocumented procedures manually.

Many of my know-hows were acquired to be used once or twice. I solve problems that are not seen before. I always start with doing due diligence researching what has been done, rather than jumping to reinvent the wheel. If I confirmed that it’s an unsolved problem, I’ll start inventing.

Once I figure out the details I often automate the workflow, document it, and move on to something else.

That’s why for consulting, I often quote high hourly rate for the first few hours and taper it down for more complex projects (keeping the project short). It’s to make sure we don’t have incentives to waste each other’s time and focus on solving your problem as fast as I can figure it out.

Loading

Off the Matrix Notes

Namecheap Shared Hosting

  • Free Dynamic DNS with domain (Namecheap has a free Windows client. Use zoneclient for Linux)
  • Email (IMAP): usese Maildir (for those who need migration)
  • Contacts: CardDav (use DavX5 adapter on Android)
  • Calendar: CalDav (use DavX5 adapter on Android)
  • Notes/Tasks: NextCloud (can sync with NextCloud’s built-in CalDav server)
  • Blog: WordPress
  • And of course, your own website!

VPS Hosting

  • NextCloud has File-On-Demand (like OneDrive) called Virtual File System (VFS)
  • YunoHost: easy to use modular self-hosting
  • UBOS Linux: distro for self-hosting. Even works for Raspberry Pi
  • Awesome-Selfhosted: has many free web services packages

Phone (Android only)

  • De-google your phone with microG Project
  • Play store: F-droid (Bonus: many open source apps that are paid apps on Google store offer the full version for free on F-droid to encourage you to move away from Google Play), Yalp Store

Research

  • restoreprivacy.com
  • Rob Braxman Tech (He knows about the nasty dictators like the Chinese Communist Party. Don’t think you are safe in America. The reach of the Chinese Communist Party Mafia, formerly known as the Chinese SOVIET Republic) is beyond our imagination.

Alternatives to Big Tech respecting privacy (for now)

  • Search (Google): DuckDuckGo
  • Browser (Chrome): Brave
  • Email (Gmail): see above (self-host) or ProtonMail (zero knowledge encryption)
  • Cloud (Google Drive, OneDrive, Dropbox, etc): see above (self-host) or use zero-knowledge encryption
  • Text/Chat (Whatsapp, Line): Signal App
  • Calling: Telegram has better voice quality than signal, but sometimes it has weird behavior on certain phones. Telegram does not have zero-knowledge proof, so it’s up to Pavel Durov (he’s usually good at not bending to totalitarians).

Alternatives to Big Tech that refuses to censor and manipulate users (for now)

  • Video (Youtube): Odysee (LBRY), Rumble
  • Facebook: MeWe
  • Twitter: Gab, Safechat, CloutHub has a crappy search feature, Parler now has PC bots patrolling and misfiring

Zero-knowledge encryption means the server have no access to the info you put in there as they are all encrypted and protected by a password which only you have (preferably use zero-knowledge proof so the owner of the server do not have any master keys to see your data: you lost the key and the data is practically gone forever)

Loading

ATX Motherboard 433Mhz Wireless Remote Soft Power Button

I tucked away my PC a little away from my workstation desk and the power switch is located at an inconvenient location. I tried to keep the wiring minimal so I’d rather not wire a dedicated ATX power switch onto my desk.

Unfortunately my motherboard does not support turn on by USB keyboard, and I’m not ready to upgrade because I am using it to test PCI data acquisition cards and it’s the fastest one that has 4 PCI slots and they are hard to find nowadays.

I found a $2.5 wireless module on eBay that claims to switch LED lamps which works on the standard 433Mhz channel and it replicates momentary switch pattern and can operate on 5V (My motherboard is new enough to have 5Vsb from onboard USB header).

Initially I was tempted to get the built-in relay version, but I was worried about the current draw from 5Vsb and those are 12V relays., not to mention the footprint is much bigger (the one above is 22.5mmx 11mm x 8mm).

I thought I can figure out with some sort of BJT switch instead of using a relay that has a much bigger current draw requirement, but I realized it’s a pain in the ass because the output is ‘floating’ differential. The OUT- does not tie to the power ground (it’ll short out the unit when I tried to. That’s why I added quotes to ‘floating’ because it’s only relative to OUT+). I also measured OUT+ which is +5V with respect to power ground.

I tried to power a LED and it only works if current flows from OUT+ to OUT- so it’s really sinking current from source power to do that, and it’s unidirectional.

I’d just take a gamble and hook up with a 5V NO relay that I have around. Turned out it actuates with the 5Vsb from the USB header. I glued the relay to the back of the PCB and hook up a flyback/snubber diode (reverse biased) across the relay coil so the back EMF won’t fry my motherboard.

Seems like the transmitter-receiver pair is on momentary switch mode by default, so no addition configuration is needed other than pressing the learn button and immediately press the transmitter button to pair.

I wired a jumper extension cable (male – female) to the relay output from the middle as a by-pass since I’d like to keep the original power switch’s functionality (so it’s basically OR-ing between hardwired switch and the wireless remote 433Mhz switch)

Here’s an example of taking 5Vsb from USB header and tapping into the power switch jumper in Front-Panel jumper block:

Note that the PWR SW- pin is connected to the ground. Since I’m using a relay, the relay output is floating so the polarity does not matter.

Loading

NextCloud setup notes

Free Horde Webmail client was ugly so I was looking for alternatives to view my email, calendar, contacts and notes. After a bit of research, I decided to try NextCloud.

NextCloud hosts calendar/tasks (CalDav) and contacts (CardDav) as a server, but do not store emails. Use any email provider (from your ISP or free email services as long as they do IMAP/POP and SMTP).

  • Default welcome/demo files are under /core/skeleton (you can change this by editing /config/config.php)
  • If you move the folder, you have to edit the database and root location paths in /config/config.php
  • Need to setup MySQL first. Avoid PostgreSQL option as it does not work out of the box.
  • Disable sqlite3 PHP extension
  • If installed on shared hosting, install without featured app because it will install CODE which is a can or worms.
  • Collabora Online is a can of worms. See below

Collabora Online (LibreOffice engine to edit documents live on web browsers) require special handling:

  • There’s a free community edition called CODE (Collabora Online Development Edition)
  • Do NOT install the BUILT-IN CODE server Nextcloud App if you NextCloud is on a shared hosting because this will appear as a rogue app that slows Nextcloud to a crawl, exhausting entry processes (aka concurrent Apache requests), and still it’ll timeout opening a document. Probably malfunctioning due to some permission issues on shared hosting.

Ports that need to be opened (more accurately port-forwarded to the CODE server) for Collabora:

  • 443 (HTTPS)

Turns out port 80 (HTTP that starts with Univention administration interface) is not necessary. It just redirects to port 443 (HTTPS) if you forgot to type the URL starting with https:// (it’s http:// by default when you type in the address bar of your browser).

Since the URL of Collabora Online-server in NextCloud settings uses only HTTPS and a HTTP URL is going to be redirected to HTTPS anyway, don’t bother with forwarding Port 80 (HTTP) and enter https:// in the Collabora Online-server URL instead.

You don’t need to forward 9980 (WOPI) either. Somebody mentioned it in Nextcloud forum but that’s not the cause.


Well, the next part is the hairiest. Turns out even the Collabora server checks out with NextCloud, the documents won’t open (some weird error messages):

The webpage at https://<Collabora Server>/loleaflet/23e6a73/loleaflet.html?WOPISrc=https%3A%2F%2F<Collabora Server>%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F2180_octqxsu7tnwz&title=<Filename of document to edit>&lang=en&closebutton=1&revisionhistory=1 might be temporarily down or it may have moved permanently to a new web address.

Of course, substitute <Collabora Server> and <Filename of document to edit> with your scenario.

I tried going to https://<Collabora Server> and noticed this NET::ERR_CERT_AUTHORITY_INVALID error:

Turns out given my server do not have the SSL certificate installed yet (and I got around it by “Disable certificate verification” in Collabora Online setup), my users/clients has to manually visit the Collabora (NOT NextCloud) server and click through the security warning to accept the Collabora site that do not have a valid SSL certificate. After that the Collabora Online works properly!

In other words, if you run into certificate issues with Collabora server, NextCloud won’t tell you when it calls Collabora server (with REST API) to open the document, instead it’ll just appear as a fail HTTPS call without warning or giving you a chance to correct the certificate issue.

Loading

Lepy LP-2051 Class D/T Amplifier Turn-off Pop Fix Mod

A few years ago I switched my stereo system (I’m using them as computer loudspeakers) to Class D because I was annoyed by the heat the professional (Class AB) amplifiers generate heating up the room (electricity bill aside).

I personally prefer the sound from Tripath amplifiers (started with LP-2020A and LP-2024A), which they called Class-T, but it’s really just Class-D with better PWM feedback mechanism. To drive bigger speakers with stronger bass, I bought a LP-2051 (50W x 2 RMS), which uses TP2150 (200W driver) + TC2001 (Audio Signal Processor) Tripath chips.

However, this amplifier has a very fatal flaw: it has a ridiculous loud turn-off pop! The system has speaker protection relays, so there’s no turn-on pop as expected as speakers are connected 3 seconds after switching on the power.

The turn-off pop bad enough that I was about to toss that in the trash as the amplifier fearing that it might damage by expensive and hard to get ADS vintage speakers. However Class-T chips are no longer produced and the TI Class-D chips for some reason just doesn’t have the clarity in the mid-range and high-frequency range I was looking for in Class-T amps, so I’ve decided to figure it out.

DO NOT TOSS YOUR Lepy LP-2051 Amp because of the loud turn-off pop!
There’s a simple way to fix it if you have a soldering gun, some wires AND a relay (normally open, 5V coil)!

Before I get to the solution, here’s a a few things I figured from observing the board which helped:

  • The power line is 19V (the unit won’t turn on until it reaches 18V, so the acceptable range is 18V~19V)
  • The unit draws around 1/3 of the turn-on power when the power switch is off. The switch is AFTER the power rail smoothing inductor and tank capacitor so they are charged.
  • Turns out the speaker protection relays are hooked straight to the 19V plug input BEFORE the switch (two channel’s relay coils are chained in series, then to the collector of a NPN transistor acting as a switch)
  • The 5V regulated (rightmost pin of 78M05 when viewed from top) is always powered even when the power switch is off.

[Failed] Attempt 1): was to disconnect the left/right speaker wires with 24V external relays switched by the front panel power switch (it’s passing 19V and 19V is enough to activate the relay). The reason is that the power droop faster than the relay disconnect when losing power.

[Mixed success] Attempt 2): I have a big power capacitor 0.12F as external power smoother (initially used to fix huge transient power draw for huge bass transients like drums), which slows down the power droop when the power is switched off enough there’s no power-off pop. However, this solution is very clumsy as reasonably sized 0.022F capacitors won’t slow the power line droop enough to avoid the turn-off pop. This observation gave me the idea that it’s the power-loss detection circuit not reacting fast enough for the system to do the proper ‘shutdown’ procedures (muting the output or disconnecting the speaker wires).

I initially looked into expediting disconnecting speaker protection relay when the power switch goes to off position, but realized it’s already done in the transistor switch logic (cascaded NPN stages) that controls the speaker protection relay as I trace the circuits.

I started looking up the datasheet looking for built-in mechanism in the IC that mutes the amplifier as I switch the unit off (the unit is partially powered once the DC plug is in). Turns out there is: the mute pin is on TC2001’s pin 24 (MUTE):

TC2001, pin 24 is the mute pin (it’s active, aka mute, on high)
TC2001 Mute (Pin 24) has internal pull-up resistor

I tried flying pin 24 to the 5V regulated output (on 78M05) and it muted as expected. I didn’t really bother to check, but when I take out the jumper wire, it’s unmuted as expected (which contradicts with the datasheet description that floating is considered high/mute, so I assumed there’s other logic driving it low by default)

[Failed] Attempt 3): Use a NPN transistor like 2N9304 (and a potential divider to tap the 19V logic to 4.5V) to drive the mute pin (TC2001 pin 24) high (which means muted) when I power the unit off. The turn-off pop is still there because it turns out that there’s a 200ms delay for the mute pin:

So now the goal is to have mute activated (set to high) FIRST a little before the 19V power line gets disconnected. The timing order for turning on does not matter because the speakers aren’t going to be connected until after 2.5 seconds once it’s hooked up to the 19V source, it doesn’t matter what’s the logic transient logic level of the mute pin (it’s going to be NOT connected to the 5V when the SPDT power switch is ON steady).

Realizing that there the power switch acts the fastest, then the mute pin, with relay actuation being the slowest, and the power switch that came with the unit is a SPDT, I don’t even have to implement a timer to delay disconnecting the 19V line before it finishes muting. Here’s the winning solution:

I accidentally wrote 18V rail voltage instead of 19V. The unit works anywhere from 18V to 19V, so you get the idea that I meant the same thing.

I happen to have a Fujitsu/Takashimaya JY5H-K5VDC reed relay which happens to be a NO (Normally Open switch) which happens to fit the design like a glove. Here’s a picture for the experimental (working) hook up that the turn-off pop is completely gone:

On the board, there’s actually a reserved spot for a on-board jumper in place of the supplied/installed SPDT switch. Those are the two red wires rerouted to the relay switch.
(FYI, the bottom node goes to 19V of the DC jack, the top node goes to the rest of the 19V circuit)
The 5V line is the green wire. Goes to the common/middle pin to be switched by the SPDT switch.
The mute pin (pin 24) is the brown wire. Goes to the furthers/longest pin of the switch
Ground is the black wire. Goes to any one side of the relay coil
The shortest pin of the switch goes to the other side of relay coil. I soldered it directly to the relay pin

Completed mod after cleanup:

Overview

There’s a few cleanup that I did:

  • I hot glued the relay on the two hard switches as they are not near any heat sources and mechanically stable
  • I stole the ground (going to the coil) from the nearby C5’s ground pad (C5 is the moderately big 470uF SMD cap nearby).
  • The old right-angled hard switch’s pins were lifted from the board by bending the pins straight.
  • The utmost pin/pad (leftmost, closest to the power plug) for the switch is not connected anywhere else on the board. It was a dummy as the SPDT switch was only used as a SPST switch. Good for me so I can solder one of the 3 pins there for mechanical support (otherwise we’ll twist the front two dummy solder joints for mechanical stability when we toggle the lever repeatedly). I chose to bend the middle pin to solder it to the board because the other two are either too far out or too short.
  • In summary, furthest SPDT switch pin goes to mute pin, the middle is the 5V regulated rail to be switched between the mute pin or the relay coil. The shortest SPDT switch pin goes to the coil. The rest are obvious

Here’s the finished mod with different angle shots for you to see the wiring:

Given the amp itself is cheap (but it’s really an excellent bang for the buck: clear sound, solid bass, class-D efficiency, small size and light weight), those who are not that electrically savvy might not be inclined to do that mod. If you are going to throw it away anyway, please send it to me (I’ll pay for postage).

It’s a very very simple mod that any beginner electronic hobbyists or an electronics student might be willing to do it for you with the instructions here for a small fee. Basically it’s just some wires and a relay and some good solder wick (or if you have a nice desoldering pump, it works fine too).

I typically don’t take petty service orders (under <$500), because of all the hassles shipping back and forth, opening it up, putting it back, and keeping records for the IRS, plus the liability risks. So please find a kiddo, hobbyist or tech to do it.

Loading