Some Bits: Nelson's log

11 posts in December 2022

Nest is a bad product

A few years ago I bought the hype and installed a Nest thermostat. Bad choice; it’s a terrible product. I finally made it vaguely acceptable by disabling all the “smart” learning features and using it as a simple programmable thermostat. It works OK except all the times it fails, like when the Nest website is down or the time they shipped bad firmware that drained the battery necessitating you pull the thing off the wall to recharge it with a USB cable before your heater worked.

Anyway, I thought I had it fixed. Now I looked at the dumb message inbox I haven’t looked at in a year+ and see this:

Those top two messages are telling me they changed something. (The other messages are spam). Notice the lack of any notification on what changed. No idea; did they edit my schedule? What did they do? The times look the same as I’ve always had but I think I used to have it programmed to 68? I’m not sure, I stopped remembering because I had set it correctly and was comfortable.

Nest’s big claim is it saves you money and saves the environment. It does this by making you colder. I’m all for saving money and the environment. I wear a Jimmy Carter sweater. I programmed my thermostat for the right temperature for me. And now apparently Nest has decided it knows better. By making me colder. Maybe? There’s no way even know what change it made.

Update: I’m cold

A month later and I’m pretty sure Google changed my schedule on me. I’ve been cold every day. I finally reprogrammed my temperature to 68. (Which took about 30 clicks; the web UI is very awkward.)

Looking at the notifications I got I see now this is Seasonal Savings. To be fair, the docs are pretty good and claim that the feature is opt-in. I don’t recall opting in but, eh, maybe? Anyway I think this was enabled and changed the temperatures on me, both the daytime from 68 to 67 and night time from.. 62? I don’t remember .. to 59.

I think this may even be a good feature: it both saves individuals’ money and helps mitigate CO2 pollution globally. My real complaint is more about the notification. The messages only show up in some notification queue I long since disabled because it’s full of marketing spam. And the messages don’t tell me what changes it made, just that it changed something. Both problems are fixable if someone had the right product idea.

(PS: I tried asking support for help and it was a frustratingly useless experience. He kept pasting in canned replies about resetting my entire schedule and reprogramming it. The agent never once suggested it might be “seasonal savings”.)

Starlink’s bad hours

Starlink performance continues to degrade. They’ve gone from promising 100 Mbps to 50 Mbps to now 20 Mbps. And they can’t even deliver that.

I run a speed test every hour. Graphing the average for the day is misleading because the service runs very well at 3am, often 200 Mbps! What I care about is the bad hours which are pretty much every evening. To that end I have a new graph, a count of the number of hours where the download speed measured is under 20 Mbps.

Those two bad days around 11/19 are an anomaly; my router had failed over to my slower backup connection and didn’t switch back (a router bug). The rest of the data is good. For comparison, here are graphs of minimum daily bandwidth (ie: the worst hour) and average.

This is what an overloaded ISP looks like.

I have data going back almost two years. Not confident this is correct; I used to do more speedtests a day so my naive count means that numbers are overreported a year+ ago, particularly last December. Here’s a graph of 10 months which shows an increasing trend of bad hours. (I suspect 4 or 5 of the worst days here are during failover to backup.)

Starlink dishes reorienting

Starlink seems to be re-orienting dishes on the US coasts to point somewhat over the ocean.

Starlink’s dish has motors for self-orienting. Typically it’s pretty static; mine oriented once at startup and I don’t think moved for over a year. Due north or south seemed optimal.

But recently on Reddit a lot of people are reporting that their dishes are now pointing somewhat to the west or east. No reliable reports on how much. But the pattern looks like it’s US folks, and Dishy is now trying to get a view over the oceans. Presumably as a congestion avoidance mechanism; there should be more unused capacity out there. I can’t imagine it makes a huge difference but I don’t really know.

The problem is Dishy seems to be choosing a new orientation without regard to obstructions. Many reports that their install used to work fine and now is pointing at a tree and has outages. Some very annoyed folks who spent real money mounting the thing or removing trees. There’s no way to override where it points, either, short of breaking the motors. What’s weird is Dishy has a map of obstructions; it knows there’s a tree there. Maybe they’ll eventually get to optimizing with that data too.

I thought my own dish moved to point to the west. But now I’m not sure; I just measured with a compass and it may be pointing at 355 degrees instead of 0, but not much. Unfortunately I can’t access the Dishy diagnostic data at 192.168.100.100 because I can’t get my stupid Ubiquiti router to add the static route. There’s been a bug for years where static routes don’t work with WAN failover. But that static route used to at least work for a few hours, now it’s entirely broken.

zstandard as gzip replacement for files

Some notes on how to use the zstandard compression system for files as a replacement for gzip. I spent a lot of time looking for subtle but important differences but really zstadnard is quite easy. zstandard files are named “.zst” instead of “.gz” and there are command line tools that are mostly equivalents for gzip.

  • gzip -> zstd --rm
  • gunzip -> unzstd
  • zcat -> zstdcat
  • tar czf -> tar --zstd -cf
  • tar xzf -> tar xaf
  • pigz -> zstdmt

Why use zstandard? Because it is much faster and smaller. I’ve used gzip for years and years to compress files. (I am old enough to have used BSD compress and have the .Z files to prove it.) I briefly used bzip2 but it just took way too long to compress to be worth it. I also use pigz when I remember too, the parallel gzip, and that is a lot better. But, eh, what about the new hotness?

zstandard seems mostly to be an algorithm product. the zstd(1) command line tool is pretty good though and is thoughtfully documented. It mostly does the things you want with files, preserving timestamps and permissions and such. he one important difference is that zstd does not remove the original uncompressed source file, unlike gzip. There’s a --rm option to zstd if you want that behavior.

The default compression level of 3 is fine. I assume it’s the default for a reason. Higher levels get slower very rapidly for not a huge advantage. Using the 100MB Wikipedia corpus from this benchmark the highest normal level 19 makes a file that’s 25% smaller but takes 100 times as long. Some quickie data:

AlgorithmCompression ratioCompression speed
source10
zstd -32.809201 MB/s
zstd -93.7101.92 MB/s
gzip2.73925 MB/s
gzip -92.74419 MB/s
bzip23.44716 M B/s

zstdmt or pzstd for parallelism. Much like pigz, it’s possible to compress with zstandard in parallel. pigz compresses my test data in 9% of the time of single threaded gzip; 11x speedup for a 16 thread Ryzon 3700. Both pzstd and zstdmt take 20% of the time of single thread zstandard. Not sure why it’s not better than that, didn’t dive deep. zstdmt produces a file that’s identical to single threaded zstd. pzstd makes a very slightly bigger file; I’m guessing it’s doing a block approach like pigz does.

Recovery from corruption may be a weak point for zstandard. One nice thing about gzip is that it compresses in chunks. If one byte is corrupted in a gzip you don’t lose the whole file, you can use gzrecover or gzrt and maybe get most of your data back. (This chunking is also how pigz parallelizes). I’ve actually done this for real once and was grateful to get most of my tarball back. I don’t think zstd(1) has any equivalent behavior by default, and this GitHub issue suggests the zstd team thinks it’s out of scope. There is block chunking via the -B flag (and probably pzstd) but in the absence of an open source recovery program I wouldn’t count on it.

I see no reason to not use zstandard everywhere instead of gzip. Except habit, and I suspect in reality I won’t change my behavior unless it’s something where it really matters.

Fixing Samba for Sonos v1 (Ubuntu 22.04, 22.10)

To make Samba in Ubuntu 22.04 jammy and 22.10 kinetic work with Sonos v1, add these lines to the global config:

server min protocol = NT1
unix extensions = no

On Sonos the login works fine with a blank username and blank password (assuming your music volume is a guest volume). I think username guest, password blank also works.

That first line has been necessary for awhile because Sonos v1 has an ancient SMBv1 client baked into it and the company won’t update it. The second line about unix extensions is new; it wasn’t necessary in the Samba included in Ubuntu 20.04. I don’t know what changed. Ubuntu 20.04 uses 2:4.13.17~dfsg-0ubuntu1.20.04.1; Ubuntu 22.04 installs 2:4.15.9+dfsg-0ubuntu0.3.

I think the “unix extensions = no” setting is reasonably safe. The docs suggest it does something to make Unix SMB clients happier; I don’t have any of those.

I’ve been low-key chasing a problem for months. It’s been super frustrating. So much so I even considered creating an alternate server. I don’t know if the problem is a change in Samba itself or if it’s specific to the Ubuntu build. I build Samba 4.17.3 from source on Ubuntu 22.10 and had this problem, so that suggests a change of behavior in the sources.

The unix extensions config options seems to have to be in [global]; it didn’t work to put it in the share definition. Here’s the full share definition I am using:

[musicshare]
follow symlinks = yes
wide links = yes
path = /home/nelson/Music
read only = yes
printable = no
guest ok = yes

The stuff in there about symlinks and wide links might not work with unix extensions turned off.

Starlink terrible customer communications

I realized at some point my primary gripe with Starlink is how bad they are at communicating with customers. I actually like my service. It’s not delivering to the level they promise but it’s still pretty good and better than my other options. It’s a freakin’ technical marvel, too. I’d be a lot more understanding if they just communicated. But they are terrible at that; no proactive communication with customers, no information on the website, and famously no press department. It’s very hard to know what’s going on.

The latest snafu is the data caps. After announcing they’d go into effect in December, the rumor on Reddit is that they’ve changed the plan and now it’s February 2023. Several folks have reported emails saying as much. I never got one. I got an email Nov 4 saying the caps would go into effect in December. That’s it.

The cap announcement was botched. After a year+ of promising 100 Mbps service and no caps, suddenly they quietly updated the TOS on the site to indicate only 20 Mbps and a 1TB cap. No proactive communication. A week or two later they emailed The New Arrangement to us. Lower service promise, same price, take it or leave it. Then they had to email a bunch of people a second time to say “oh we made a mistake and we were wrong about your previous usage”. Oops.

Starlink’s website says literally nothing about IPv6 support. It doesn’t support it. Or at least, it hasn’t; but recently there’s evidence that a good chunk of Starlink customers now have IPv6 enabled. But absolutely not a whisper about it to the customers.

Customer support is notoriously awful. There’s no phone number or email address. You used to be able to submit a request in the mobile app reasonably easily. Now it’s apparently hidden behind you having to read a bunch of FAQ entries and then pressing a thumbs down “this doesn’t help me” before you’re allowed to make a request. Customers report very mixed results. Sometimes great instant service. Sometimes a week + before any reply and then the reply is low quality. Not for complicated questions, basic things like “why did you not ship my order?” or “my dish arrived dead on arrival”.

All this is basic “tell your customers what their service is” stuff. It’s remarkable how bad they’re failing at it. Not to mention anything forward-looking like plans for improved service in the future.

PS: I should add that I helped start a community list of firmware versions because there was zero info on software versions. Honestly all we can track is version IDs and dates released but at least it’s something.

Ubuntu 20.04 to 22.10 upgrade

I upgraded my old Intel NUC home server from Ubuntu 20.04. To 22.04 first, then to 22.10. Went smoothly, no problems.

Below are my running notes as I do the work. Good time to remind folks this is my secret work blog; you’re welcome to read, but there’s no pretense these notes are of interesting to anyone else.

Services on the system I care about. netstat -l --program | grep tcp was a help for finding these, that --program flag is neat.

  • Influx and Grafana with a lot of old data
  • Plex
  • Samba
  • autossh for a tunnel to a public machine
  • tailscale
  • unifi / ubiquiti controller, which includes mongo

I had Home Assistant and Infinitude installed via Docker but didn’t want either of them. I removed them with help from docker ps --all and docker images. Some other things to remove: munin, motion.

I always forget to start do-release-upgrade under screen. Dumb of me! I’ve had bad experiences with it being interrupted in the past (because, say, my ssh terminal failed.) Also when the system says you need to reboot go ahead and reboot, don’t try to do a few things first; the system is in a slightly odd state.

Every time you do-release-upgrade it moves all your /etc/apt/sources.list.d to *.distsave versions and then edits the important .list files to disable third party repos. Doing an upgrade twice in a row means you lose the original file entirely (because *.distsave was copied to twice). It’s no big deal to hand-edit to fix it, but it’s a pain. It’s probably a good idea to refresh the sources anyway; most of the repos have a distro like “focal” hard coded in the paths. Ookla’s packagecloud repository is broken; it installs expecting “kinetic” which doesn’t have releases. “jammy” works, “stable” doesn’t.

A Sonos v1 SMB server

Summary: do you need a SMB server to serve your local library of music files to your v1 Sonos? Barry de Graaff has a solution, sonossmb. It’s a small Node implementation of SMB that works with Sonos. It works! It does take a bit of hacking to install though.

About sonossmb

I used Samba for years to serve music to the Sonos. The problem is the v1 systems are unsupported and have an ancient insecure SMBv1 client baked into them. And starting with Ubuntu 22 (which has Samba 4.17) it no longer works with Sonos, even with the special v1 config directives. No idea what’s wrong. That got me speculating that a simple stripped down anonymous-only SMBv1 server for Sonos might be a nice product. Which is what de Graaff created!

His server is based on Adobe’s Node SMB server, a project I never heard of and looks abandoned. He tells me it mostly works with Sonos just fine. He just made one tiny change to upcase the share’s name. The packaging and installation is a little trickier. He’s got some good docs and a script but it’s still something you might need to understand Linux pretty well to get running. More on that in a bit.

One problem I ran into; Ubuntu 22 ships Node 18. And that gives an error related to SSL ciphers I think because Node dropped support for old insecure SSL clients. The workaround of export NODE_OPTIONS=--openssl-legacy-provider worked for me.

Note that the share has a name like \\192.168.0.2\PUBLIC and you must log in with the username “guest”, no password. Empty username doesn’t work.

It’d be nice if Samba could be fixed. That SSL thing makes me wonder if that’s what broke on Ubuntu 22, that they too dropped some old SSL stuff that the Sonos ancient client needs. There’s some discussion on the Samba list. One happy thing is one of the Samba developers himself has a Sonos so someone in the know may work on the problem.

Packaging, Snap.

Barry’s server works but I can’t quite use it as-is on my LAN. I really need a full Samba server too. But I only have a single Linux box. And SMB doesn’t work well other than on a single port, 445. Some clients do work on other ports but I haven’t tested it with Sonos and am pessimistic. Maybe I need to just add a second IP address to my server and bind the special Sonos server there, but yuck.

All the drama of getting the thing installed makes me think a Snap container / image is the perfect way to run this server. There’s a snap for the web server Caddy so a daemon that accesses local files and serves them on the network is possible in Snap. But I’ve never built a Snap and have no idea how hard it’d be. I guess Docker would work too but Snap seems to be the choice for consumers on Ubuntu systems so I think starting there makes sense. I may give a go at building a Snap, we’ll see.

adobe/node-smb-server patch

Here’s the patch Barry sent me to upcase filenames:

diff -Naur node-smb-server-master/lib/smb/cmd/tree_connect_andx.js sonos-smb/lib/smb/cmd/tree_connect_andx.js
--- node-smb-server-master/lib/smb/cmd/tree_connect_andx.js	2021-06-22 17:20:12.000000000 +0200
+++ sonos-smb/lib/smb/cmd/tree_connect_andx.js	2022-12-09 08:21:10.674527000 +0100
@@ -10,6 +10,10 @@
  *  governing permissions and limitations under the License.
  */
 
+/* As required by original License I hereby notify you that I have made changes to this file.
+ * Copyright (C) 2022 Barry de Graaff
+ * */
+
 'use strict';
 
 var put = require('put');
@@ -76,7 +80,7 @@
 
   logger.debug('[%s] flags: %s, password: %s, service: %s, path: %s', SMB.COMMAND_TO_STRING[commandId].toUpperCase(), msg.flags.toString(2), msg.password.toString('hex'), msg.service, msg.path);
 
-  var shareName = msg.path.substring(msg.path.lastIndexOf('\\') + 1);
+  var shareName = msg.path.substring(msg.path.lastIndexOf('\\') + 1).toUpperCase();
   var shareLevelPassword = utils.bufferEquals(msg.password, Buffer.from([ 0x00 ])) ? null : msg.password;
   if (_.indexOf(server.getShareNames(), shareName) === -1) {
     result = {

Ubuntu vs NodeJS versions

Node seems to have some serious stability problems; various apps are sensitive to which version of Node you run. Here’s some recent versions:

  • Ubuntu 22.10 / kinetic: 18.7.0
  • 22.04 / jammy: 12.22.9
  • 20.04 / focal: 10.19.0

Nodesource packages different versions of NodeJS for Ubuntu. It’s basically a PPA but they want you to use their shell script to install them.

I ran into a problem with Nodesource where “apt install” really wanted to keep installing Ubuntu’s 18.7 despite having a PPA. I fixed that with apt install nodejs=14.21.1-deb-1nodesource1 to select a specific version.

Starlink performance last week: 5mbps

Just making a note of a recent performance graph.

Nothing new here, this congestion pattern has been happening for months. But it gets worse and worse. There’s some tiny hope that the new throttling system will help free up some bandwidth for me, at least until I myself am throttled. That was supposed to launch early December but now apparently is pushed back to February.

ActivityPub servers

I want an ActivityPub server so I can do Fediverse experiments and see them in Mastodon. What I really want is something like CGI; I don’t care about the protocol server, I just want to write little scripts that easily federate. I don’t want a consumer product with a web UI, I want a little platform for which I can create experimental scripted accounts for people to subscribe to. I’m not sure that exists.

I asked on Mastodon about servers and got some suggestions. Here they are. Lines of code are rough estimated calculated with scc.

takahe. 9,000 lines of Python. Active, seems very new (2 months old), not yet at a 1.0 release. Seems web UI centric.

gotosocial. 58,000 lines of Go. Active, six months old, labelled “alpha”. Also focussed on a web UI and consumer product.

epicyon. 103,000 lines of Python. Active, 3.5 years old. Also web based but an emphasis on being simple. OTOH runs as a proxy server and needs nginx in front.

honk. 10,000 lines of Go, 3.5 years old. Not entirely active, but has had some recent updates. Seems.. idiosyncratic. But also nicely minimalist. Someone mentioned it has lots of forks.

minipub. 7200 lines of Typescript+Javascript. A year old, but no edits in 6 months, maybe one developer. “for posting federated podcast comments”.

minimal-activitypub, 650 lines of Python, 4 months old, one author. Found this one myself and as the name says, it’s minimal. May be a suitable start for the platform I want? I note from the docs that it’s all client to server stuff, not server to server, and I don’t even understand enough about ActivityPub to know exactly what that might mean. There’s a couple of the author’s projects built on top of it.

express-activitypub. 440 lines of Javascript, 4 years old, one author and seems largely moribund. OTOH it’s by the great Darius Kazemi, ActivityPubber extraordinaire, so it’s worth a look. Darius says his projects are live, just stable.

rss-to-activitypub. 700 lines of Javascript, 4 years old, also Darius and mostly moribund? But this specific RSS product is very close to what I want to tinker with, also worth revisiting.

snac2, 6000 lines of C. Two months old, active but maybe just one developer. Has a simple web interface. Mostly runs like an old school Unix daemon, this post talks about setup. The earlier snac was a prototype in 3800 lines of Python written in six weeks.

microblog.pub. 13,000 lines of Python. 5 months old (v2), active. Simple web UI. Single user, minimalist, blog-oriented. This looks promising as a starting point for me.

notes. Ruby, new, experimental.

6 static files. 0 lines of code, just some static JSON. Not a real server but a nice demonstration of a very very simple ActivityPub participant. The writeup notes that you have to accept POST requests to handle people following you, so that takes a little code.

Playing with ActivityPub, tmcw’s article about writing his own very simple ActivityPub instance. Describes the complexity required.

How to implement a basic ActivityPub server: notes from 2018.

Adding ActivityPub to your static site.

None of these are an obvious thing for me to Just Use.