Categories
Computer science programming utilities

Controlling the Logitech Litra on MacOS

Recently I bought a USB-C connected diffused light for Zoom calls, the Logitech Litra Glow. The hardware is excellent, but the control software, Logitech GHub, is horrible. Intrusive permissions, auto start, auto updater, laggy UI, just a hard no. The light has buttons on the back to control it, but since mine is next to the camera it looks odd when I’m reaching over and let’s face it, I’m a programmer and love solving small problems with code. Let’s find a way.

Some searching found a Linux app on Github, but the USB library for MacOS required sudo access which adds hassle. There’s an issue and discussion on the topic, which led me to hidapitester, which doesn’t require root access to run.

Goals

I want menu bar control, simplified – light on and off, one or two brightness levels. Basically make it easy to use as I hop on and off calls. Here’s what I came up with, hopefully it’s helpful for you too.

Installation and configuration

  1. Install hidapitester
  2. Add shell aliases to control the light
  3. Tweak color temp and brightness values to your liking
  4. Add Shortcuts to drive the shell aliases from the GUI

Install hidapitester

Grab the source or binary from the project GitHub page. Copy it into /usr/local/bin and then, due to app signing requirements, you’ll need to approve its use from the Finder.

open /usr/local/bin

Right click on hidapitester and select Open

On the warning dialog, select Open.

The binary is now flagged as OK; you only have to do this once.

Add shell aliases

The default shell is now zsh so let’s use that. I also use and like oh-my-zsh, so my aliases are in /Users/phubbard/.oh-my-zsh/custom/aliases.zsh

Using the magic payloads from the Github issue, we define a base function _hid that invokes hidapitester with the full path and identifiers. We then build on that to add a selection of color temps and brightness levels.

function _hid() {
  /usr/local/bin/hidapitester --vidpid 046D/C900 --open --length 20 --send-output $1
}
# 2/17/22 Litra Glow aliases from https://github.com/kharyam/litra-driver/issues/13
function light() {
  _hid 0x11,0xff,0x04,0x1c,0x01
}
function dark() {
  _hid 0x11,0xff,0x04,0x1c
}
# ~10%
function glow(){
  _hid 0x11,0xff,0x04,0x4c,0x00,20
}
# ~20%
function dim(){
  _hid 0x11,0xff,0x04,0x4c,0x00,50
}
# tweaking by hand - less than 50%
function normal() {
  _hid 0x11,0xff,0x04,0x4c,0x00,70
}
# ~50%
function medium() {
  _hid 0x11,0xff,0x04,0x4c,0x00,100
}
# 90%
function bright(){
  _hid 0x11,0xff,0x04,0x4c,0x00,204
}
# 2700K
function warmest() {
  _hid 0x11,0xff,0x04,0x9c,10,140
}
# 3200K
function warm() {
  _hid 0x11,0xff,0x04,0x9c,12,128
}
# 6500K
function coldest() {
  _hid 0x11,0xff,0x04,0x9c,25,100
}

You should be able to run any of these from zsh:

exec zsh
light
dark

That might be all you need/want. If so, enjoy!

Add Shortcuts

There’s a few key things to know in order to make this work:

  • You can invoke a shell script or alias by using the Terminal app from Shortcuts
  • You don’t get a login shell, so we need to manually load the aliases for this to work.
  • We also need to use full paths, since the non-login shell has a different PATH set.
  • Once the aliases are loaded, we can chain calls using the && operator.
  • Under the Shortcuts setting, there’s a checkbox for ‘Pin in Menu Bar’ that exposes the Shortcut to your GUI.

Looks like this on the menu bar:

I use these three:

source /Users/phubbard/.oh-my-zsh/custom/aliases.zsh && light && warmest && dim
source /Users/phubbard/.oh-my-zsh/custom/aliases.zsh && dark
source /Users/phubbard/.oh-my-zsh/custom/aliases.zsh && light && warmest && normal

I hope that others find this useful. I’m happy with the result as the code runs in a second or so and has yet to fail.

Litra Beam

A reader tells me that this code also works with the newer Litra Beam if you change the USB IDs in the _hid routine to 046D/C901. Thanks, John!

Categories
Random

Cat weathervane

Saw this today. Random.

Categories
Humor Uncategorized

fopdoodle – Wiktionary

fopdoodle – Wiktionary
— Read on en.m.wiktionary.org/wiki/fopdoodle

Word of the day. Apply liberally.

Categories
Radio Random Uncategorized

Hey Verizon, you’ve got a problem in 92122

I’m a long time customer and former employee, with an MSEE and ham radio license. I play with SDR for fun – I’m no pro but I’m familiar with radio and cellular. My bonafides explained, this post explains the problem, what I tried and why you lost me today as a customer.

A few months ago we started to have problems. Calls are fine, but data is super slow and my battery was being murdered. With my iPhone 11 Pro, a bit under two years old and 83% battery health, requires two to three charges per day something is wrong.

It just discharges too fast

Second symptom: it works fine out of the home area, very approximately the 92122 zip code. As you can see from the screenshots on Nextdoor, others have the same problems. As the meme says, “I am not a crank.”

I called service and tried to explain. They sent me a new SIM, we reset networks and nothing helped. I wasn’t able to explain that the issue wasn’t me and that others were affected.

So today we’re all onto “Consumer Cellular”. Good price, stellar service so far, and instead of 12mbps I got

So Verizon, I think you’ve got a problem. Could be too many subscribers for the base station, failed antenna lobe, I can’t tell. Apple and the carriers have blocked key diagnostics like SNR so all I can do is speculate. You could sort it out with a test if your mobile coverage and I hope you do. It’s a pity to see the stellar reputation of Verizon Wireless being lost.

Update 12/1/2021 – I reached out to VerizonSupport on Twitter and they are promising to investigate. I spoke to a couple of different reps, one of whom said there was a known outage in the area.

Categories
recommendations

Gaming hardware – google Stadia on sale

I’m much more in the buy-nothing camp than the Black Friday camp, so I debated posting this. Allow me to explain – like many, I gamed in school, with my office mate and friend introducing me to the fun of network games, particularly FPS such as Quake and variants. For years, the combination of parenting and terrible Mac support has deterred me, but recently I found this Dappered gift guide post in my RSS feed.

I used to be much more of a gamer. I truly enjoy it. And before I bought this for myself, I just hadn’t found as many windows to get back to gaming since becoming a dad. It happens. But the Stadia solves every issue I had with that “time” factor. It’s cloud-based, so my games are ready to go when I turn on my controller, which instantly connects to my TV via the included Chromecast Ultra. I can also play on any computer (pictured above) or on my phone. I’ve been able to fit in dozens upon dozens of hours of gaming because of the take-it-anywhere-ness of Stadia. There are no files to download, no waiting for the console to update after leaving it dormant for a few months, no more does that precious hour window get whittled down to 20 minutes. With Stadia, I pick up the controller and I’m playing in less than a minute. Take that, impossible-to-find PS5!

https://dappered.com/2021/11/the-dappered-gift-guide-for-the-dappered-dad-2021-edition/

That sounds appealing, and $80 bucks isn’t bad. However, right now Google is selling them for $22!

Twenty two bucks! Damn, that’s cheap.

Oddly, extra controllers are $60, so I just ordered two Stadias. I hope to be able to play against a kid or friend.

It could well be that Google will discontinue Stadia, they have a long history of axing projects so there is that risk. Still, for this price I thought it worth sharing and a reasonable risk. Can’t wait to try some games again!

Categories
Covid-19

Wisdom about Covid

Categories
essays

Uhtceare is real

I started this blog with the title taken from very old English, as you can see in the header and About page. I seriously considered naming it ‘uhtceare,’ another old word meaning ‘to wake before dawn and not be able to sleep because you’re worrying about something.’ Today, a modern update from ScienceAlert:

The thoughts are often distressing and punitive. Strikingly, these concerns vaporize in the daylight, proving that the 3am thinking was completely irrational and unproductive.

https://www.sciencealert.com/why-do-we-wake-up-at-3am-and-dwell-on-our-fears-a-psychologist-explains

It’s a good read, with solid reasoning. I like this bit:

The truth is, our mind isn’t really looking for a solution at 3am. We might think we are problem solving by mentally working over issues at this hour, but this isn’t really problem solving; it’s problem solving’s evil twin – worry.

Categories
Covid-19 essays recommendations Uncategorized

The Invisible Plague. Images matter. | by James Heathers | Sep, 2021 | Medium

I gravitate towards aggregated measurements. I use words like ‘gravitate’ and ‘aggregated’ when I do it. Sometimes the complaining has been loud, and then someone writes about me in the newspapers…
— Read on jamesheathers.medium.com/the-invisible-plague-c092ab1f7771

Categories
recommendations

Ditch network solutions

Found this via Hacker News, a screen by screen takedown of all the dark patterns used by Network Solutions.

https://www.coywolf.news/webmaster/network-solutions-dark-patterns-domain-registration-transfers/

Personally, I’ve had phfactor.net since the late 1990s, started back when they were the only game in town, and they’ve frog-boiled me out of a lot of money. Today, I finished the transfer to CloudFlare and urge you to consider a move yourself if you’re still with Network Solutions. Doesn’t need to be Cloudflare, there are plenty of others, but for $8 a year I get caching, DDOS protection plus domain registration and less bullshit in my inbox.

That’s worth sharing.

Postscript – this blog post details how to use your EdgeRouter to update CloudFlare’s dynamic DNS. Nice! That saves me the second no-longer-free DNS service that I used to use from Dyn.com.

Dyn got bought by Oracle, and needless to say I’m not ready to give my credit card to them. I like the simplicity of having Cloudflare do registrar, dns and caching.

Categories
Covid-19 Politics

Three grim notes

But ultimately, some unknown percentage of those 80 million still unvaccinated will dig in and continue refusing vaccinations, even if they have to risk unemployment and other penalties. Some surveys indicate that the defiance is deep-seated, so we should expect a sizable number of marginalized, unvaccinated, unemployed, and profoundly angry Americans. These are the groups who might gravitate to leading or taking part in political violence, as we got a taste of with anti-lockdown protests last year.

https://www.thedailybeast.com/the-latest-covid-surge-is-just-the-start-of-a-new-nightmare?source=us-news&via=rss

But why would they do that? Let’s turn the microphone to LGM:

The whole key to understanding the anti-vax pro-horse dewormer mentality is that it’s not just this one thing for these people. Admitting that they’ve been wrong about this isn’t like admitting you were wrong about thinking that Willie Mays hit 700 home runs or that Detroit is the capital of Michigan. To admit you were wrong about this thing in particular would be to pull on a thread that could unravel your entire social and political identity. For those in the right wing bubble/base, admitting error on this point basically requires a literal conversion experience. It would be like a former Christian fundamentalist coming to the view that the Bible isn’t actually the inerrant word of God. In other words, that’s not just some random fact, but THE fact, that holds every other part of the person’s world view together.

https://www.lawyersgunsmoneyblog.com/2021/09/the-herman-cain-freedom-award

One last, less grim but much more difficult question: How much risk are we willing, as a people, to accept? Who bears that risk?

Will Americans accept the deaths of tens of thousands of people, as they do with the flu, if it means life returning to normal? Can the public tolerate an even higher death toll — akin to the drug overdose crisis, which killed an estimated 94,000 people in 2020 — if that’s what it takes to truly end social distancing and other precautions?

https://www.vox.com/future-perfect/22651046/covid-19-delta-vaccines-social-distancing-masking-lockdowns

I highly recommend all three essays. I’ve had them swirling around in my head for a few days now.