Reading view

There are new articles available, click to refresh the page.

Fix for Error E1 on Tuya Zigbee TRV Smart Radiator Valves

In an effort to improve comfort and reduce running costs, a couple of years back I obtained a set of Tuya Zigbee Smart Thermostatic Radiator Valves (TRVs). On the whole they weren’t really a very good buy, but they’ve been working well enough that I don’t feel the need to switch them out for something else.

After putting in a freshly charged set of batteries last autumn, they worked away regulating the temperature just fine until spring came this year. Once the heating went off, I forgot about them and the batteries ran out at some point. So they’ve been just resting for the best part of a year!

That would be fine, but being cheaply built throughout, they of course have a healthy serving of cheap grease on the inside. And sitting still is not great for cheap grease, and it’s done what it normally does, turn sticky and gum up the mechanism.

So when I came to put in fresh batteries this year for the start of the heating season, I was greeted with a wonderful big error E1 on the screen and no activity. Of course, I wasn’t going to put up with that and just buy new ones, so I set about trying to fix them. Listening to the TRVs, instead of their normal whirring for about 30 seconds to calibrate the mechanism, there were just two short clicks.

So the cause was obvious - the mechanism has got stuck, and the stiction is causing high current on the motor. The firmware on the smart thermostat looks at that, and thinks - right, I’m at the end of the travel, let’s go back the other way. And it does! But the sticky grease hasn’t gone away so it gets high current when it tries to reverse and just locks up and spits out an error.

The actual fix is simple - just free the motor up, redo the calibration and all will go back to normal. The first step is to disassemble the TRV and expose the motor:

  1. Remove the outer case.
  2. Remove the batteries.
  3. Unclip the display plastic from the top of the TRV (this might differ for some other models?). On mine, there are some sticky conductive pads between the PCB stack and the plastic, but just pulling was enough to separate these.
  4. Unscrew and pull out the PCB stack from the TRV body.

Once you’ve exposed the motor, you could try to free it up mechanically, but I think it’s easier to do it electrically, assuming you have the equipment.

So the next step is to get a bench power supply set to 3 V (current limit doesn’t matter too much, you’re not going to break the motor with a few seconds at that voltage), or I suppose two batteries in series would work just as well if you had a battery holder to hand.

Then just apply the 3V to the motor terminals, or the motor JST connector on the PCB stack (no need to unplug, you can use the terminals on the back of the PCB as contacts) for a few seconds. Reverse the polarity, and another few seconds. You should hear the motor spinning and see the actuator pin moving in and out (or vice versa).

Then assembly is the reverse of disassembly, and recalibration should proceed without the E1 error.

Let me know if this has helped you!

Living in a Building Site: The Over-Development of London’s Housing Estates

Roderick House covered with scaffolding. There is a large quantity of insulation staged on the scaffolding awaiting installation. There are satellite dishes attached to the scaffolding, which have had to be moved from the wall of the house to accommodate the scaffolding.

London is in a housing crisis. The cause is a complex mixture of different societal and policy factors, but the practical effects boil down to too much demand and not enough supply. The result is expensive and inadequate housing, if one can get it at all.

The problem is particularly apparent in the social housing sector, where tenants benefit from subsidised rents and enjoy stronger legal protections against eviction1. Owing to central government policy failures2 dating back decades as well as recent local government mismanagement, waiting lists for social housing have become extremely long and the system is unable to properly accommodate even the privileged groups previously supported.

Social housing providers don’t just have to contend with a dwindling supply and rising demand, they also have the compounding problem that much of their existing stock has been left to decay and is now in need of serious renovation. Many post-war developments were shoddily built, and in subsequent years underfunded and incompetent housing departments have let their condition deteriorate further.

In any case, despite their past inactions, local politicians now have no choice but to respond to the spiralling waiting lists and do something. Do something they have:

  • The elected mayor is building new houses on any leftover land owned by the public transport company TfL (car parks, inside and above stations, open spaces etc).
  • Councils are looking at their housing estates and either ‘regenerating’ (knocking down and starting again) or squeezing more housing in where it will fit, including in green spaces and parks.
  • Private developers are now required to provide “affordable” housing with each market rate development, which in theory reduces the demand for social housing.

Antony and Roderick Houses

Antony House and Roderick House are two adjacent small blocks of flats owned and managed by Lambeth and Southwark Housing Association. Built in the 1950s, each block is 4 storeys tall and has 16 flats, for a total of 32 between the two blocks. Located between the main railway line from London Bridge and Southwark Park, the two were in a historically quiet residential area with relatively low density.

Owing to developments over the past several decades, including the Jubilee Line extension creating a new tube station within walking distance at Bermondsey, and the Overground coming to Surrey Quays, the area has come to be seen as a target for new housing construction and regeneration. Indeed, Southwark Council declared the Abbeyfield Estate next to the two blocks a regeneration zone in 2017 and embarked on a plan to redevelop some of the council-owned tower blocks to add more flats and complete internal upgrades.3

Lambeth and Southwark Housing Association (LSHA), hopefully to nobody’s surprise, is a small housing association operating in Lambeth and Southwark. They provide social housing to 300 households and take cases referred from the Lambeth and Southwark housing waiting lists. It was in these contexts - the increasing pressure from waiting lists, and the focus on development in the area, that LSHA decided they would build more housing on the site.

Roderick House in 2018, before the beginning of the works, showing the small grassed area in front of the block.

Now, the site was quite small, containing only the two blocks, some gardens to the rear for the residents of ground floor flats and an area of grass bordered by trees to the front and sides of the blocks, through which residents could enter.

Obviously, this sliver of grass was not nearly enough space to build a whole new block. But the association owns the land, so it can do what it wants. Historically, the solution in this case is to evict all the residents, transfer them to another social flat, knock down the buildings and build a new block to modern design standards at a larger scale. Admittedly an expensive approach, but legally and practically well-tested; and at the end the housing association ends up with lots of new, high-quality, flats. And what other options are there? London needs housing, after all.

The Anti-Demolition Movement

The trouble with this plan is the residents, most of which have been living in their flat happily for many years. Imagine you’re living in one of these blocks and the association come along and decides to redevelop, and you’re going to get kicked out and have to move god knows where. The association might promise something nice, but when it comes down to it, it’s not going to, is it! Certainly not as central, anyway. What about your garden, and your old neighbours? It’s a lot of disruption, moving, and what does it help you anyway. You’ve got yours and what does it matter if there’s not enough housing to go around. Those newcomers can go and live somewhere else with more houses for all you care.

Now you have these residents legitimately kicking off, and of course the leftist types are on the case as well - angry about the idea of demolishing all this social housing (what if the replacement is shock mixed tenancy!). Other people living nearby can join in the fun too, it’s not exactly hard to emphasise with somebody getting kicked out of their own home through no fault of their own. Especially if they’re vulnerable, as social residents tend to be. And anyway, who wants a big noisy, dusty, and disruptive construction site next to their house in the first place, so this is good cover for one’s inner NIMBYism!

So it turns out, that while the theory behind demolish-and-rebuild is sound, the practice is most certainly not. Residents can tie up the project at the planning stage for years4, then once everything is approved and evictions start, it’s rather surprisingly hard to actually force somebody out if they don’t want to leave. Take Marian Court in Hackney, where one woman has simply refused to move out and stopped the demolition of a whole block since 2017.5 Now 2022, the rest of the block is sat empty, requiring full time security staff, and has not yet been demolished!

But assume it all went smoothly, the council got the planning permission, moved everyone out, demolished, and now has an empty plot of land. What’s to say something actually gets built there? Quite often nothing happens for years, waiting for budget or political approval, until eventually the scheme is rethought and a different approach has to start from the planning stage again. What benefit is there to that? Houses demolished, all the disruption, the cost, everything - for nought!

This has all bubbled up over the past few years as councils struggle to find an approach towards solving the dual problems of lacking social housing availability and poor condition of the stock that is available. Quite often their solutions involve demolitions, but the demolitions are failing to deliver the expected results. The Estate Watch website has some good information on the scale of the problem and the growing anti-demolition movement.

LSHA had another possible problem with demolishing Antony and Roderick: since they are a small housing association with only about 300 housing units under management in total, evicting and rehousing 32 households worth of people all at once might not have been possible at all.

In any case, that’s all just context. LSHA realised there was another option, one that didn’t involve demolition at all! It is quite obvious once you see it, and has a certain ideological appeal (though perhaps not a practical appeal, as will become apparent).

The Solution: Airspace

Antony House with the new block of flats on top partially complete. The bare walls of the prefabricated modules can be seen without any cladding. The new flats are supported by a series of strong steel beams, supported by silver-coloured galvanised steel columns. The facade of Antony House is stained with cement.

What if you build the new block after all, but just leave the demolition step off the schedule. Leave Antony and Roderick alone, leave the residents alone, and built the new block of flats above the existing ones? There’s enough space between the two blocks for a new lift lobby, that together with another two stories (plus another flat on the width at each end) is enough to double the number of flats on the site.

Modern engineering means you can build a steel frame over the existing building to hold the weight of the new one6, then just prefabricate the new flats, slot them in and the job’s a good ‘un. Almost no disruption to the existing residents, and you’ll have new houses in no time!

That’s the idea, anyway. Not cheap, even compared to demolition, what with all the structural work, making good, etc. But it’s not a complicated project in the grand scheme of things, and it should be a less risky, and a lot more palatable of an option to residents than demolition.

Roderick House in profile showing the building covered in scaffolding, with the new prefabricated modules placed on top.

And that happened, or rather it is what is happening now. LHSA appointed contractors Apex Airspace and Adston Construction in late 2020 to carry out the development of the new block over the top of the old ones.

While this approach seems sensible at first glance, it ignores the fact that installing the new block of flats above the existing, and the steel frame to support it, requires that the existing residents live INSIDE a building site for the duration of the works. And further, while modular prefabricated elements have been used in the construction, the project is currently in it’s second year and nowhere near final completion. Buildings are not ‘plug and play’, especially when one is not starting from a blank slate - one is not starting from a blank slate working on the top of a 70 year old existing building with residents still inside!

Is building over somebody’s house over-development?

Residents have been living inside scaffolding, their lives invaded by noise and dust from the construction, and their privacy impaired by workers outside their windows. Some residents have had their flats flooded by construction mistakes, or had holes drilled in their walls.

The grass at the front and their gardens at the back are now a permanent staging area, surrounded by ugly Heras fences, covered in diggers and construction material. All except one of the mature trees have been chopped down (it’s not possible to replace a mature tree) which will be a permanent loss of amenity.

A sign attached to a Heras fence admonishing passers by to "PLEASE KEEP NOISE TO A MINIMUM". Behind the fence is a Hitachi mini digger on top of a pile of sand.

The residents are rightly furious with the housing association, for choosing this approach, for exposing them to such disruption for years on a project with seemingly no end after it gets delayed again and again. And for doing all of this during a pandemic when they were locked down at home so wasn’t even an option to get a break from the work somewhere else.

But (and this is a big one), the work is getting done. In another year’s time, unless all goes horribly wrong, there will be 31 new affordable houses on the site, ready for new residents to move in. The existing residents will still be in place, able to continue largely as they were before. The project isn’t stuck in demolition purgatory or the legal quicksand, it’s actually happening.

That’s the trouble here. If you just ignore the bit in the middle where things actually get done, the project is perfect. New housing built, old housing retained. I’m sure that other social housing providers will be looking at this project as a case study and trying to replicate it in their own portfolios.

There are no good solutions to the problem of building new social housing. Perhaps the disruption is worth it, especially if demolition and rebuild is impossible. But somebody has to pay the cost, and that’s the residents of Antony and Roderick. And that will be the case with any future projects - it’s impossible to build a new building around an old one without a lot of pain to the residents, and pretending otherwise is stupid.

Footnotes:

  1. Social housing is provided either by the local authority according to it’s legal obligations, or by a private housing association which acts in a similar way to the local authority. 

  2. The big problem is Right to Buy, which allows residents to buy their council house at a discount. This compounded with policies explicitly preventing the construction of new council housing, funding cuts, and misguided renewal schemes that led councils to dispose of even more housing. 

  3. This, including the Maydew House situation, has turned into a complete disaster, certainly of greater proportions than the Antony and Roderick issue, but that’s for another time. 

  4. One example - the residents at the Cressingham Gardens estate in neighbouring Lambeth have managed to hold off demolition for more than 8 years in the planning process. And that’s a council failing to get proper permission from itself to demolish it’s own estate! 

  5. As detailed in this article from the Hackney Gazette. 

  6. Sadly structural plans aren’t publicly available for the building, if they were it would certainly be interesting to see how it all works out in an engineering sense. 

To Escape the Heat, Just Apply Suncream?

Recently there have been several spells of unusually hot weather in the UK (including one day in July with a temperature of 41 degrees Celsius, substantially above the previous record of 37 degrees). As you would expect, the media has been full of advice about how to deal with the unusual heat.

Invariably the advice includes many sensible ways to cope, like staying in cool places, drinking water, wearing less clothing, etc. But there’s usually another bit of advice provided. To wear suncream.

Here’s what the BBC says1:

If you do have to go outside, wear a sunhat and sunscreen and try and stay in the shade where possible

And the Guardian2:

Not everyone will be able to hunker down indoors. But precautions are necessary if venturing outside. Wear light, loose-fitting clothes, sunglasses, sunscreen and a hat, take water with you, and try to stick to the shade.

And even the Met Office3:

Walk in the shade, apply sunscreen and wear a wide-brimmed hat, if you have to go out in the heat.

There is just one problem with this last piece of advice. It’s wrong. Hot weather doesn’t cause sunburn. There are only three controllable factors4 that affect sunburn incidence: the UV strength of sunlight at the time of exposure (UV index), time spent outside, and the skin’s preponderance to burn (natural, as modified by protective clothing or suncream). The outside temperature does not feature among these three factors.

Of course, correlation does not equate to causation, and undoubtedly the statistics will show that serious sunburns correlate well with periods of hot weather. More people will go outside more often and for longer when the weather is hot; and this will result in some small percentage of sunburnt people, vaguely proportional to the increased time spent outside.

But the hot weather did not cause the sunburns! The people that got burned all did so for mundane reasons - perhaps they forgot their hat or to apply suncream; misjudged how long they could stay outside, went outside at midday when the sun is strongest rather than in the morning or evening, or any one of many other similar reasons. The sun would have been just as dangerous if the day had been cooler.

That said, the correlation is valid, and a cause for concern: sunburns damage the skin and are believed to cause serious cancers. If sunburns are more common during hot weather then finding ways to reduce sunburns during hot weather is a valid public health objective. It is just that the correlation is only relevant at the population level - for an individual the heat outside is irrelevant to how they should approach sun exposure.

Indeed I suppose if you asked the question directly - “does hot weather cause your skin to burn or not?”; few people would say that it does. As is common sense: one does not get sunburn from sitting in a sauna, or working in a hot kitchen, or any other time one is hot. There is nothing different between those occasions and the same heat, but outside. Nevertheless the advice’s memetic value persists, and one is often reminded by well-meaning peers and authority figures: “It’s hot, don’t forget to wear your suncream!”.

My concern is that by over-emphasizing sun protection advice during exceptional circumstances like a heatwave, the importance of sunburn awareness at other times is diminished in the collective consciousness. In the UK, you can pick any day in the four months between May and August and the it’s likely that the midday sun will be strong enough to burn a large proportion of the population. Sun awareness is an everyday action, not something to be reserved for exceptional circumstances like the one major heatwave a year.

Perhaps we can adjust the wording of our collective advice - from “It’s hot, don’t forget to wear your suncream!” to something more like “don’t stay out in the sun too long - apply sun protection as usual, proportional to your exposure!”

Footnotes:

  1. original article on the BBC 

  2. original article on the Guardian 

  3. original article on the Met Office website 

  4. I say three, but there’s really just one factor that affects sunburn - the amount of UV-mediated damage caused to your skin. But one can’t control that directly, only by controlling other factors can one control the real cause of sunburn. 

Running With The Foxes

I like to run with the foxes, when the city is dark and quiet, when the warmth of the day ebbs away and the coolth of the night approaches, when the path is empty and when the other people recede into bubbles of their own conscience.

I like to run in the old towns, where the route twists and turns; in the new places under construction, where the landscape changes by the month; and in the waste lands, where the places are soon not to be.

I like to run in the city, because I can run all of these.

The city is real, not a place - but a feeling. The freedom of one amongst many, the freedom to watch, to listen, to learn, to do, and where one participates solely by being.

The city is a mirror of the societies it contains, supporting, protecting, revealing and yet also inherently destroying. That is the beauty of the city, when one can look around the bricks and mortar to see the substance of the thing.

But there is more to the city, not only the reality lived and built. The city is complexity, disorder, change, and tradition; history known yet futures unknown.

I like to run in the country too, when the birds sing and when the seasons pass by, when the stars can be seen and when I leave footprints in the earth as I pass.

But the country is stability and order: where crops grow in neat monoculture lines, awaiting their own destruction, so too its human inhabitants in their neat cottages; where the old go to die. And after my footprints wash away in the rain, the grass will soon grow again.

YouTube Comment Spam and the Linking Non-Link

As somebody who quite often scrolls down to the comments section on YouTube (for my sins), I’m often faced with the innovative tactics that spammers use to get their comments through Google’s automated filtering and detection systems.

One method that’s somehow persisted for a few years is the linking non-link. YouTube doesn’t like comments with links in them and will often silently hide or sometimes outright refuse them. But the link-detection algorithm used in spam filtering isn’t the same one that’s used in the frontend to convert textual links into clickable hyperlinks!

So spammers craft their comments with unusual TLDs and mixed into normal-looking text. They aren’t detected as links by the filter, but their marks can still click on them as normal! This has been going on for quite a while with different iterations of TLDs and filters, but somehow Google hasn’t managed to stamp it out quite yet.

Here’s an example (Spanish language) spam comment, where the .uno domain is the bait:

spanish spam comment by a cyrillic account

I often wonder if there’s any real development effort put into spam filtering from the comment side; my guess is that as a centralised platform YouTube puts a lot more emphasis on filtering out spammy accounts. Some of my creator friends often complain about the lack of moderation tools to keep their comment sections clean - beyond deleting comments individually and the “naughty words list” that automatically hides comments there’s not really that much a creator can do.

A Thought - Maybe More Money is not More Better

Nobody understands the economy. But more money is more better, right?

That’s how you measure the economy after all. If more money is moving, then more goods and services are being purchased, and society benefits.

So it follows that it’s good for society to increase money. Consumer credit. Corporate financial engineering. Making the money printer go brrrr. Stocks, and derivatives. All these and more function to increase the amount of money in the economy, and as such are incentivised by the government, which prioritises the economic figures above almost all else.

Trouble is, it actually takes real effort to make money. It takes work to make that number on the screen go up. You have to employ accountants, lawyers, marketers, build offices, lobby the government, get debt collectors and many things more. And all these need complicated infrastructure, expensive education and a big city in which to do all the hard work.

And this is very different from the old economic model, where you make money by making things that people want, or doing things people want. It requires different infrastructure, different raw materials, different education and different management. And an economy cannot be based on the creation of money alone. The financial economy of money creation must coexist with this real economy.

So there is a choice, if one has money, to spend it on making oneself happy; to invest it in the real economy; or to invest it in the creating of money itself 1.

Spending it is right out; after all what is there to buy? Manufactured goods are cheap (they come from abroad), and there’s only so many services one can use (if one’s moral code even allows unbounded service consumption 2). So it’s investments, the only choice is which ones.

And that’s the trouble with information technology. If there’s one thing computers are good for, it’s calculating that number on the screen. But a computer can’t interact with the real world in any meaningful way. Computers increase the efficiency of making money far beyond the amount they increase the efficiency of the real economy.

So the information age has accelerated the existing transition, further tipping the balance of investment from the real economy to the financial economy. And with further technological development, the balance shifts further and further; compounded by the extrapolative tendency of the market expecting the rapidity of recent technological advances to continue far into the future.

So the real economy stagnates from underinvestment while the financial economy grows. It’s worse than that, of course, because participation in the money-making economy is predicated on the non-universal trait of already having lots of money, while the real economy often requires little money to participate. Therefore it’s possible to make more money by hurting the real economy (as in the case of loss-making ‘disruptive’ startups which ruin functioning economic sectors but have high valuations).

And that’s the stage we’re at. The real economy is stagnating, and our standards of living with it, because people have too much money, which they’re just using to make more money.

Well, that’s just today’s thought. I’m not an economist; I haven’t done any research, I don’t have any figures and I can’t think of any way to measure whether this is right or not anyway… But some time out in the public air will do it some good.

Footnotes:

  1. publicly traded stocks are not the real economy, and to invest in property is simply investing in the success of others’ money creation 

  2. consuming cheap services is unethical owing to the unstable and exploitative conditions of workers; for some reason the modern economy refuses stable jobs with good conditions to the low-paid 

Bottle Deposits are Bad Policy

Bottle Deposits, i.e. a government-mandated deposit placed on disposable drinks containers refundable upon return to the place of purchase, are a popular environmentalist policy worldwide. The aim of such a policy is generally to reduce the polluting impact of littered drinks containers while simultaneously increasing the recycling rate of the same.

Bottle Deposits are universally bad policy, imposing outweight costs on society while barely helping the problems they are intended to. This occurs notwithstanding the purported success of a deposit policy in terms of return rate.

Simulation

A simple economic analysis of a bottle deposit system gives the cost to society per bottle that is no longer littered as approximately £10.

Let’s construct a simple system where our hypothetical country of 1 million people proposes a bottle deposit system:

  • There will be a 20p deposit levied on all sealed, disposable drinks containers.
  • This will be collected by local beverage distributors, and passed on by retailers.
  • Containers can be returned to the point of purchase (or other participating location) for a full refund of the deposit.
  • Retailers are responsible for disposing of the collected container and can claim funds back from the government for refunds issued, as well as 5p per bottle for disposal and administration.
  • Any shortfall (or surplus) is covered by (returned to) the general fund of the government.

Making the following realistic assumptions:

  • Each citizen uses 300 bottles per year, for a total of 300 million bottles.
  • 7.5% of all drinks containers were littered before the deposit.
  • 90% of issued containers are returned for a refund once the system is operational.
  • There is an average wage of £30.
  • Property rental costs are £200 per square meter per year for homes, and £1000 for shops.
  • 80% of bottles are returned using reverse vending machines and 20% manually by an attendant.
  • RVMs cost £4000 per year to rent, service and empty, can process 150000 bottles each. and take up 2 square meters of floor space.
  • It takes an cashier 10 seconds to process the return of a bottle.
  • People store their bottles at home prior to return. This takes up 0.1 square meters.
  • It takes 30 seconds per bottle in overhead to sort, collect and transport for consumers.

Costs

Now we can calculate the costs. The direct cost to the government is simple, calculated as the costs of administration less the unreturned surplus:

  • 300000000 * 0.9 * 5p - 300000000 * (1 - 0.9) * 20p = £7,500,000

Costs to consumers are more challenging: as well as direct losses from unreturned bottles, one must also account for sorting, storage, transportation and return overheads. Transportation costs can be ignored as return is always combined with a trip to buy more bottles.

  • Unreturned bottle cost: 300000000 * (1 - 0.9) * 20p = £6,000,000
  • Storage cost: 1000000 * 0.1 * £200 = £20,000,000
  • Administration time: 300000000 * 0.9 * 0.5/60 * £30 = £67,500,000
  • Total cost to consumers: £6,000,000 + £20,000,000 + £67,500,000 = £93,500,000
  • Total cost to an individual consumer = £93.50

It is tempting to ignore costs to retailers as costs are subsidised by the administration fee. However, as retailers legally must collect bottles, and the fee has not necessarily been set correctly, their costs must be considered anyway.

  • Human time for bottle redemption: 300000000 * 0.9 * 0.2 * 10/60^2 * £30 = £4,500,000
  • RVM Costs: 0.9 * 0.8 * 300000000 / 200000 * (£4000 + 2 * £1000) = £8,640,000
  • Administration remittance: 300000000 * 0.9 * 5p = £13,500,000
  • Ignoring accounting costs, there is a small residual benefit of £360,000 to retailers.

The total net costs of the proposed system would therefore be: £93,500,000 + £7,500,000 - £360,000 = £100,640,000, or £100.64 per citizen. It is notable that at 33.5p per bottle, this is much higher than the bottle deposit itself!

Benefits

Marginal benefits from recycling can be assumed to be zero, as the market for recyclate in developed countries is saturated, with negligible residual value. Excess sorted waste is dumped, stockpiled or exported for disposal by countries with lower standards. In fact, since consumers of recycled material are subsidised both by the market (consumer demand for recycling) and governments, encouraging additional recyclate collection may in fact be a net negative for society - even if it appears to be economically neutral.

Higher value recycling may be possible with additional regulation - for instance standardisation of bottle shape and adoption of refillable bottles. However, this is not economically viable, and therefore countries like Germany that formerly reused the majority of its bottles now prefer to crush and recycle: the economic and environmental costs of collection, transport and cleaning exceed the benefits.

Nevertheless, bottle deposits may still have benefits in reducing litter. Although drinks containers are only one component of litter, they are a significant component.

It does not follow, though, that a 90% return rate reduces litter by 90%. Littering is a crime of convenience and does not occur when beverages are consumed at home - it will always be easier to put the container in a bin than to throw it on the ground outside. If 60% of drinks are consumed at home where their containers will always be returned, the remaining 40% of drinks consumed away from home can still be littered at a 25% rate and 90% return will be maintained overall.

If we assume the bottle deposit reduces container litter by 50%: 7.5% of bottles were littered before the policy, and 3.75% would be after. That’s 11,250,000 less pieces of litter on the street than before the policy. That sounds like a win until you realise that the bottle deposit policy costs more than £100,000,000.

That means our hypothetical society will be paying £9 per bottle to clean up litter! Even if you assume the complete elimination of littering, the cost per bottle only reduces to £4.50, which is plainly ridiculous. For £4.50 of a litter picker’s time, far more can be achieved than collecting a single bottle.

If you want to have a go with your own simulation, download my spreadsheet and have a go.

What are you really doing when you fill in an hCaptcha

hCaptcha is a reCAPTCHA clone that has been growing in popularity over 2020 and 2021, in particular due to Cloudflare’s conversion of their nag screens from Google’s reCAPTCHA to hCaptcha. Although hCaptcha advertises itself as being a privacy-conscious alternative to reCAPTCHA, there’s also an incentive for websites to switch over: hCaptcha will pay websites each time one of their users completes a hCaptcha challenge.

Now the question is: how does you completing a captcha earn anyone money? Of course, hCaptcha is a VC-funded business, so it can afford to burn money in the pursuit of market share; nonetheless there needs to be a plausible business model there, and it’s not obvious at first sight.

If you read the hCaptcha website, they suggest that AI startups will pay them to label their images for them. 1 Labelling images is a labour-intensive task and required for some current-generation machine learning approaches. AI startups are well-funded and have money to spend on labelling, so this sounds like a reasonable case of selling shovels during a gold rush. But the output from solving CAPTCHAs isn’t obviously isomorphic to the type of labelling required for machine learning, which is often quite specific and requires a very low error rate.

Complex CAPTCHA challenges are not possible, as web users turn out to be drunk, blind, 3 years old, or just randomly clicking buttons to get this infernal thing to go away. Accordingly, hCaptcha challenges are simple: select the images that match a simple 1-3 word prompt from a 3x3 grid. This is fortunately easy for most real people. 2 3

The most common prompts seem to be selecting buses, trucks, boats or trains out of the grid.4 The market demand for this sort of simple labelling must be rather limited, even if challenges have to be repeated many times and cross-checked to get an acceptable error rate.

So far, a little inscrutable but all seems sensible enough. But then it all gets interesting when you actually take a look at the images in a little more detail:

hCaptcha example

Starting from the top left and going right, we have:

  • A boat that appears to have been painted by Dalí, with a mast drooping like a wet noodle.
  • A plane with tricycle landing gear, except it’s got two sets of wheels at the front and one at the back. That’s not normal!
  • A normal looking plane with some odd-looking clouds above.
  • A bus with an axle in front of the door, and another behind it, and another at the back. Hmm
  • A boat in a marina made of splodges.
  • A normal-looking boat on a normal-looking sea, except - look at that horizon! How did that happen.
  • A single-decker london bus with a ghost of it’s double-decker cousin above. And a giant moth perched on it at the back.
  • Another ghostly upper deck on a regional bus.
  • A sailing boat with some oddly stylised “alien” writing on the sail.

These images are obviously AI-generated. They have all the hallmarks of GAN output, with typical artifacts and oddities. Have some more and see if you can spot the same things in these other challenges - it’s not hard at all, is it!

The question then is why? Why would hCaptcha be generating these challenges - aren’t they supposed to be labelling real life, not some AI mirages? You know the labels before you generate them, what’s the point in using humans to re-label them again… And why are the results so bad - these are definitely not state of the art!

The only explanation that makes sense is that hCaptcha is not really doing this whole AI-labelling business at all, or if they are it’s only in very limited fashion. Most of the time they’re just using a GAN to generate images that defeat the bots’ image recognition AI. And the GAN isn’t trained to optimise human recognition, rather to confound the bots in an arms race, leading to the bad image quality.

If you have any better ideas I’d be glad to hear them because this whole thing doesn’t really make much sense.

Footnotes:

  1. If you look closer, they have an article that purports to explain the “technical architecture of hCaptcha” which is a supreme example of buzzword-stuffing blockchain-washed nothing. There is less than zero need for a blockchain to track customer requests, much less the public Ethereum blockchain, but it’s the buzzword of the month so it must go in. 

  2. Most real users, that is. There are some users for whom the challenge is actually too hard, or who’ve been blackholed and are interpreting bad IP reputation as poor skill. But the ones who fall down most often are those who try too hard and analyse the prompt and challenge in too much detail. The real way to solve these image challenges is to answer what you think other people will answer, rather than the correct answer. And don’t take too long either, just a quick glance is all your competition are giving! Anecdotally, this isn’t too common with hCaptcha, but reCAPTCHA challenges are extremely prone to this failure if you think too hard. 

  3. Unfortunately this is also quite easy for bots, somewhat subverting the point of a CAPTCHA, so that’s how browser fingerprinting and IP reputation creep in to get reasonable enough results. 

  4. These prompts are so common that a front-page post on Hacker News consisted of this observation (and prompted me to write up my thoughts on the topic from the past few months). 

New Things of 2021

It’s getting to be the end of 2021 - so it’s a good time to look through some of the things I bought over the year, and reflect on how they’ve turned out. Some of them have been rubbish of course, but there are a number of things that have turned out to be very useful, or to have brought me joy in some other way, and made them into a list in the hope somebody else will find it helpful.

Choosing what to buy is a hard problem - and nobody has the exact same criteria for their purchases as anybody else, but it’s still useful to hear how other people got on, and to see reviews in context. So just take this list as social proof - “it worked for me”.

I’ve tried to provide a Amazon US and UK link for the items that are sold there - these are affiliate links, so I will get a small cut if you buy something on Amazon after clicking one. However, due to Amazon’s monopoly pricing power, you’ll probably find the best price somewhere else local to you - the links are just there for your convenience.

Tools

Knipex Cobra 250mm Water Pump Pliers

amazon UK amazon US

These are a really excellent set of water pump pliers. They can substitute for (or improve on) at least three tools: pliers, an adjustable spanner and a pipe wrench. I’ve used these many more times than I had imagined I would when I got them, they really are a do-anything tool. The fit and finish is immaculate as you’d expect for something made by Knipex plus they have a great feel in the hand with an ergonomic textured handle, and the ultra-hard jaws grip on to anything. And they’re Project Farm approved too!

I do wish that these came in a left-handed variant, as the adjustment button is slightly uncomfortable to push when in your left hand. And I now need to get another in a smaller size that I can put on my electronics desk permanently - these big ones are spending more time out of the toolbox than in!

UT-210E AC/DC Clamp Multimeter

amazon UK amazon US

I needed a clamp multimeter for electronics work: the UT-210E does DC, and it has a great 1 mA resolution (other meters typically have 100mA, which is useless for electronics). It’s not terribly accurate, but it’s more than good enough once you zero it out, and it’s super cheap compared to others on the market. It’s so useful to be able to clamp on to a wire and quickly measure out the current without having to shut down the device, splice wires and restart like you do with a normal multimeter. This is a simple tool, but it does it’s job perfectly and I have had absolutely no problems with it.

The VoltCraft equivalent of this meter should be identical aside from the colour of the case, but it was more expensive at the time I bought mine so I ended up with the Uni-T brand.

Makita M4301 Jigsaw

amazon UK

Yes, it’s a red Makita! It’s heavy, brushed and corded. But it’s cheap, sturdy, and it works perfectly: it has variable speed control, a high quality plastic construction and proper rubber cord. It works about 100x as fast as a hand saw, so you’ll be saving time. And for the £35 I paid it’s a no-brainer if you don’t have a jigsaw already. It even came with one good quality blade so you’re ready to go from the start.

Mechanix FastFit Gloves

amazon UK amazon US

Versatile gloves that provide reasonable protection and excellent grip without taking away too much feel. They work touchscreens too. I bought a new pair this year - they last about a year for my light-duty use. They’re really easy to put on and take off but they stay fitted perfectly and allow good freedom of movement.

ZebraLight SC64c LE

nkon.nl for Europe ZebraLight.com for US

For a torch (flashlight), this is perfection. It’s amazingly bright, wonderfully compact (barely larger than the 18650 battery it contains), runs seemingly forever on a charge, and it has an excellent belt-clip too.

Every detail of this is right: it’s got a high-CRI 4000K emitter for nice colours and versatile usage day or night, an intermediate-distance orange-peel reflector design for smooth spill and graduated light distribution, with some throw for when it’s needed. It’s got a electronic side-switch with simple UI: no turning on in your pocket, and always the right mode first try. I have owned a lot of torches, and this is the best.

It is expensive, and ZebraLight unfortunately has persistently poor stock levels and only sells within the US. That said, I now have two, just in case I lose this one and can’t get another immediately. And I say lose - there’s no chance of this breaking, it’s so well put together. Even the anodising is practically like new after a year of use.

Technology

Quntis 52cm Monitor Light Bar

amazon UK amazon US

My desk at home was always quite badly lit - with most of the light in the room coming from a pendant behind me, the desktop was in shadow without a desk lamp. As a result I’ve always had space on my desk taken up by a heavy desktop lamp base, and put up with uneven lighting.

Since I got the monitor light bar, it’s been completely transformed. I’ve got more space on the desk as the light bar just rests on top of the monitor, and the lighting is so much more even. Although adjustability is a little bit limited and you have to bring your own power supply, it’s still a good deal for usable desk lighting. I don’t use the sensor function, so can’t comment on how that works, and I also don’t know how this compares to the Benq version at twice the price, but I’m happy with this one so not inclined to find out.

DJI Osmo Pocket 2

amazon UK amazon US

This is a perfectly conceived product - basically the modern incarnation of the camcorder form factor. It’s so handy and easy to use - just point and shoot. And the results are impressive: the video is entirely competent 4K with reasonable bitrate, but the real joy is the stabilisation; it’s perfect - thanks to the gimbal there’s zero shake or roll. The focal length of the standard lens is just about right - I feel the FOV is too narrow just about as often as I feel it’s too wide. Of course there is an extra-wide angle attachment, but it’s certainly not essential.

Not to say this is perfect: it’s expensive, the menu system is painful until you get your muscle memory, and you have to install an app on your smartphone to ‘activate’ the device before you use it for the first time: you need to phone home to DJI’s mothership at least once. And the case is an infuriating missed opportunity - it’s essential for protection of the fragile gimbal head, but rather than doubling as a useful handle or tripod mount (it doesn’t come with one by default!), while you’re shooting you have to shove it in your pocket where it just takes up space.

kwmobile Matte Screen Protector for 13” MBP

amazon UK amazon US

Unfortunately I’m forced to use a MBP for my job. Although Apple’s design choices are in general awful, the glossy screen on MacBooks is particularly so: you get terrible glare, and when the laptop is closed, the screen touches the keyboard transferring a grease-print of your keys onto the coating, leaving discoloured patches. This matte film fixes both issues, reducing glare considerably and also increasing the cleaning interval for the screen - I used to clean it twice a week, and now I only have to clean twice a month!

You do lose a little bit of brightness, but it’s not very noticeable, and a tiny bit of sharpness (although this actually improves the image IMO). These tradeoffs are perfectly fine, however, because the film makes the laptop usable when it wouldn’t be otherwise. Why this is not the default from the factory I don’t know!

BASE12 Laptop Stand

amazon UK amazon US

I’ve had several laptop stands before, but this was recommended to me in the summer and I can confirm that it’s the best one so far. It holds the laptop up nice and high (or lower, if you want) and it’s sturdy. And when you’re done it folds up very neatly to a small package for transport. On the downsides: it’s not beautiful (although the branding is tasteful - no giant ugly logos), and the feet are slightly slippery so it is unsuitable for sloped desks.

Durgod Taurus K320 Mechanical Keyboard

amazon UK amazon US

I’ve been a mechanical keyboard user for quite a few years - I’ve had several of the cheap chinese keyboards with blue switches. I decided to upgrade this year due to WFHing more often, and it was a choice between the Durgod K320 and the Keychron K8: I needed a nice full-size TKL keyboard with UK layout and brown switches.

I ended up with the Durgod because it was in stock at the time, but it’s an excellent keyboard - sturdy construction, high quality PBT keycaps (with no misprints!), and well lubricated original MX brown switches. The cable is Type-C and detachable so can be replaced, or switched for a Type-A if desired. I was so pleased with mine that I bought another one for the office.

Kitchen

Stainless Steel Garlic Press

amazon UK amazon US

A garlic press is an essential tool in the kitchen. In go cloves of garlic, skin on, and out comes perfect crushed garlic straight into the pan - no tedious peeling or chopping. I’m probably using 5x as much garlic now I have the press, and my food is better for it.

Sadly most garlic presses on the market are terrible. They are either made of cheap thin steel that doesn’t stand up to the simple task of crushing a clove of garlic, or they are made of cast zinc. Cast zinc has no place in the kitchen - it is weak, brittle and corrodes easily and as a result harbours dirt and grime. Plus, it can’t be washed in the dishwasher so cleanup is an extra step at the end of every meal.

Luckily this press is made of solid, polished stainless steel. There’s lots of leverage for stubborn cloves, and you can be confident it won’t fall apart. When you scrape the crushed garlic off the grate with a spoon, the skins simply pop loose, ready to reload. And when you’re done it can just be dumped in the dishwasher (turned inside out) ready to wash up perfectly for next time. I expect mine will last for many years to come, and I have given several of these presses out as gifts.

Metal Dustpan and Brush

amazon UK

Why were plastic brushpans invented in the first place? This metal one is perfect: no plastic to warp in the sun and no annoying rubber seal to wear out after a year. Simple.

Fun

Powerball Wrist Gyroscope

amazon UK amazon US

This allows you to work out your forearm while you have fun at your desk, with the simultaneous benefit of annoying all the people around you with a loud whining noise. Once you get the hang of it, this is surprisingly fun and easy to use, and it really gets the blood pumping into your hands if they’re a bit cold. Yes, it’s cheap and plasticy, but it’s also cheap!

Nikon Aculon 8x42 Binoculars

amazon UK amazon US

My old binoculars broke, so I had to buy a new set. These may be from the budget range and of an unfashionable porro prism design, but the optical performance is leaps and bounds ahead of my old vintage set (made in Japan). The image is bright, sharp and colourful, plus you can use them with glasses on and the field of view is wider than the more popular roof prism design. If you’re still using vintage binoculars, think about an upgrade to a modern equivalent, you may be surprised!

Midwest Tungsten 1kg Cube

amazon UK amazon US

Yes, it’s a meme. And yes, I now have several more dents in my desk than I did last year. But The Cube is also a really fun object to hold, to pick up and play with. And there’s no way the wind is going to blow papers off my desk now I have it to weigh them down! And when you sell an NFT for a million dollars, you too can be the owner of The Cube ;) You’ll need that million too, as the price now seems to be about 3x what I paid for mine!

Dishonourable Mentions

These are the things I bought that turned out to be a bad idea in retrospect.

Duronic Spice Grinder

amazon UK

This is bulky, impractical and loud. And it smells like it’s going to catch on fire every time I use it. I switched to a mortar and pestle instead - much nicer!

Compatible Earcups for Sony WH1000-XM3

amazon UK amazon US

The original Sony earcups are made of memory foam and do a very impressive job blocking out sound leakage. These are not made of memory foam, and as a result they do a terrible job blocking out sound, making them completely pointless unless there’s no other option. Unfortunately there is no other option, as Sony seemingly doesn’t make spare earcups available to replace mine that have fallen apart. Bad Sony!

Noris Digital EMR Marker

amazon UK amazon US

I wanted a new marker for my Remarkable Tablet - I thought I would try the Staedlter Noris one, because it looks cool and it has a rubber as well. Well I returned it pretty much immediately: it’s a plasticy piece of junk and it rattles as you write, and it misses half the strokes you put down when the remarkable one gets them all. Plus the tip is way too soft and slippery: it feels like you’re writing on plastic, not paper. I’m happy with the ReMarkable one even though it will set you back twice the price.

My IDE Broke

Last week I opened up VS Code, ready to get to work on a project. Instead, I was greeted with a wodge of error messages piling up in the bottom right corner. The C++ language server had crashed. This was important. My project is written in C++, and I need the language server. So I closed the window and opened it again. No difference. I restarted the langauge server manually using a palette comand. No difference. I updated the IDE to the latest version (a new one comes out seemingly every week) - no difference. What if I uninstall the C++ plugin and install it again? No difference! It was dead, kicked the bucket, shuffled off its mortal coil!

Of course the error message in the UI is singularly unhelpful. It tells me it crashed, OK fine, but then how do I fix that? Of course there’s no error code, no stacktrace, nothing. This is a tool for modern developers - you see; in today’s world nobody can be expected to understand the workings of their own tools. Least of all the toolmakers themselves, when they treat their own components as black boxes! In vain, I tried opening the IDE in verbose mode, to see if there was anything to be gleaned from the logs. Nothing obvious. That’s the point you realise something is going to take time to fix. So that’s that, I could fix it later, then… the feature was simple enough to write without the language server, I thought! My broken tool has only sent half an hour down the drain, no matter.

And then I realised that I can’t write code anymore. I can’t write C++ without the language server enabling the IDE to guide me, to complete my word when I press tab; to go to definition when I need it, and to give me the types when I hover. My muscle memory is so attuned to the IDE that I don’t know how to do anything outside of it’s safety. I have never thought of myself as an IDE softie - I wrote lots of the code for this project before VS Code even existed; and the magic incantations that control CMake are at the top of my mind. But compiling the code yourself is not the same thing as the oldfashioned mental map of the source code, the innate knowledge of the types and parameters of the functions you use everyday, and the ability to write a line of code that actually compiles!

Well I got the feature done, but it took a lot longer than usual, and only after a few false finishes when it failed to compile - no red squiggles to fix my mistakes as I go without the language server after all.

Now I have an IDE again, after I deployed the nuclear option of a whole fresh installation.1 Everything is back to normal and productivity is great. Just another lesson of the force multiplier that is modern tooling.

So what am I to take away from this all? Of course using an IDE makes the craft easier, but am I really a better, more efficient, programmer when I use an IDE, or am I in reality letting my skills rot away for some pretty colours and a few less keystrokes? Maybe… but I’ll try the next project with the training wheels turned off from the start, and see what difference it makes.

Footnotes:

  1. Although it must be said I was planning to do this anyway, due to Microsoft’s increasingly monopolistic behaviour in the space. Switching to VSCodium and avoiding the proprietary extensions is sort of the minimum you can do. 

You block ads in your browser, why not in your city?

Ads are annoying, right? Getting right in your face and shouting for your attention when all you want to do is something else - when you get an unskippable ad before a video to watch; when you’re reading an article and an ad pops up over the writing; when somebody you had trusted endorses something that you and they both know is bunk. This badvertising is a scourge on modern society and a manifestation of all that’s wrong about suveillance capitalism.

That’s not to say that adverts are evil, or that they have no place. But they must be in their place. When you’re reading in the hypothetical yellow pages, that’s advertising. Or when you’re walking down the high street, looking in shop windows; advertising again. Or a specialist magazine; instagram channel or even so called content marketing. They’re all adverts, but they are in their place. Both the advertiser and the viewer get value out of the interaction - enough that you seek them out yourself.

Now, in some ways technology is the great equaliser of our time: the same tech that allows ever more complicated and pervasive badvertising also allows ever more complete and simple de-badvertising. The good citizen of the net makes technology work for them: they install uBlock Origin and SponsorBlock to protect their web browser, and then set up a Pi-hole to reduce badvertising outside of the confines of the open web. The better citizen sets these same protections up for their family, and supports and contributes to the development of better tools. And they pay for services when to do so is not just to feed the beast.

Now, while this equilibrium persists on the net, in real life the badvertisers have been taking advantage of just as many technological improvemements: internet control and management; high intensity LED illumination; pervasive video, animation, and sound; smartphone and facial tracking and many more advantages alike. Our cities are being turned into a dystopian nightmare - as shopping moves online: MORE ADVERTS to sell you on existing shops; when there’s a funding crunch in local government: MORE ADVERTS to bring in the revenue; when that isn’t enough: MORE ADVERTS just for the sake of it. And with all this new technology, these ads aren’t just some posters or billboards, but rather aggressive and intrustive screens that sap the real life from the city; replacing it with an artifical reminder of the corporate landscape you live in.

Blocking ads may work online, but unless you spend your life in VR goggles, one cannot apply technical solutions alone. But don’t tell yourself that you can’t block adverts in real life - just think about how the ads got there. The good citizen in real life fights the planning applications for new adverts; they tell their local politicians about the damage badverts cause; they fund campaign groups to tell others the same. Make a conscious decision to avoid adverts, and enjoy your life more. Do the science that explains to advertisers exactly why these badverts don’t help them sell. Technologists too: use the benefits of modern technology to multiply your effort, shut down the adverts sooner.

Above all else, don’t take advertising as a given. It’s your choice, and you can help choose no for your city.

Searching for Nothing, Finding a Surprise

Following on from my post yesterday about an edge case in YouTube, I thought I’d write about a class of edge cases perhaps even more strange that I’ve been exploring recently:

Search engines are a fact of daily life for most of the population nowadays. Google (sub your preferred provider) is an extension of the brain, imagined as giving you access to the sum of the world’s information at the click of a button. But a search engine isn’t just a Ctrl-F for the internet with a nice interface and ads; rather it’s a tremendously complicated system with lots of features and interactions between those features. And all you need to explore the system yourself is some well-tuned search queries.

I recently had an epiphany: search engines are designed to find you results for something and that’s a job they perform well. But there’s nothing stopping you from searching for nothing! And the search engines will still give you results!

And what results they are - have a go on the links below:

An empty query on DDG: https://duckduckgo.com/?q=+””
A different empty query on DDG: https://duckduckgo.com/?q=(“”)
An empty query on Google: https://www.google.com/search?q=(“”)
An empty query on Google News: https://www.google.com/search?q=”“&tbm=nws

And have you ever thought about doing an anything but search? Normally you can add negations to the end of your search term to remove unwanted results, but there’s nothing stopping you from having a search term consisting entirely of negations!

Here’s one on DDG: https://duckduckgo.com/?q=-“an entirely negated query”
On Bing: https://www.bing.com/search?q=-“an entirely negated query”
And on Google Books: https://www.google.com/search?q=-“nothing to see here”&tbm=bks

Commentary

Google appears to have some half-effective filtering for these empty search queries so you’ll mostly get the same two YouTube videos as a result - is this an Easter egg? Although Google News and Books don’t have any filter, and you do get some odd results there!

DuckDuckGo doesn’t appear to have any filtering at all, although it’s obvious just how much DDG relies on Bing’s whitelabel product for its results by looking at how similar the two are.

If you can think of a deeper reason for these results, please do leave a comment and lets try and explain some of the mystery away.

Drinking From the (Musical) Firehose on YouTube

Nowadays YouTube is a great place to listen to music, because everything is there. There’s such a wide selection of to listen to - seriously - the permissive ask-for-forgiveness1 bazaar means that if you search for it, it’ll be there. Make your own playlist, and when it’s time to add something new to you, it’ll be there. Alternatively, just be guided by the flow and don’t worry about where it’s all coming from.

And to that point, discovery is where YouTube really excels - The Algorithm knows what genres you like, and what you’ve listened to before, and there’ll always be an old favourite ready to listen again or something new, but familiar, to experience for the first time. Training time is minimal, because The Algorithm is a simple beast really (do you really think AlphaGooYou is going to waste resources on a complex model).

That said, sometimes you just want a change, and it’s hard to switch off completely. If you log out and clear your cookies, you’ll get music, sure; but it’ll be the worst dregs of contemporary nongenre, optimised for the dying radio sector. Not worth it! What you need is a quick way to jump out of your filter bubble: a random mode, a shuffle play, to say. And floating there in the aether, an odd edge case at the margins of the beast, it actually exists:

Here it is, the snappily named: “Uploads from Various Artists - Topic” Playlist. 20000 entries, all songs just recently uploaded to YouTube in the past week or so. Go ahead: break into a brand new song with 0 lifetime views!, Enjoy a random cyrillic-lettered song you can’t understand!, Use it as an infinite radio - whole new songs being added faster than you can listen to them!

Although I don’t completely understand why this exists, it seems to be a quirk in the YouTube partner music upload programme: music rightsholders (or those who purport to be) can upload music to YouTube2 in bulk and these are arranged into “Topic Channels” for each artist. These “Channels” inhabit the half-space between a real channel and a playlist - you can subscribe but there’s no real person on the other side of the curtain; certainly there’s no community there. And it seems, on one end or the other, that in the absence of any better information everything just gets unceremoniously dumped into the “Uploads from Various Artists - Topic” topic channel playlist.

Either way, it may be quirk, and an odd one at that; but it’s fun and it should be saved. Please don’t take it away, oh wondrous BigTech…

Footnotes

  1. For all the perils of YouTube’s arbitrary Copyright system, the variety of music it allows is certainly a benefit. When videos are allowed by default, and the normal punishment after detection of your copyright infringement is a few cents from ads going to the labels, you get channels like ultradiskopanorama uploading rare classics that were never going to go on a service like Spotify. 

  2. These videos always have “Auto-generated by YouTube” in the description, and all have their comments turned off (sadly a recent change). 

No, California Is Not Going to Take Your Generator Away

Recently, I was involved in a discussion about AB-1346, a routine decision of the California Legislative Assembly. The bill was passed in October 2021, and requires the California Air Resources Board (CARB) to put in place regulations restricting emissions from new Small Off-Road Engines (SOREs). Not being a Californian - indeed as I am living in the UK and not a USAian at all, this may seem somewhat an odd topic to write about. Nonetheless the bill is generating quite a lot of fuss online and I thought it would be interesting to explore the topic in a little more depth.

While the new law itself is quite light on detail, it links in to an interesting technological transition that’s currently ongoing and rapidly speeding up: the technological obsolescence of small engine-driven machinery, in favour of electrically operated machinery, powered by batteries.

The law has widely been reported as a ban on electrical generators for home use in California, and resultantly the bill has attracted a somewhat disproportionate level of attention from the press and public in this regard. Many people in California and throughout the USA are, or perceive themselves to be, dependent on generators to supply their electricity (at least for some of the time).

While this level of attention would be reasonable if the bill did in fact ban generators; the bill does not, in fact, ban generators. In fact, the other market segments affected will have much more impact on the day-to-day life of Californians.

What the bill does do, is to give legal force to new rules currently being made by CARB. If these rules are adopted as proposed, emissions standards for SOREs will be raised to technically infeasible levels from 2024 onwards, effectively prohibiting production of SOREs for the California market. Generators are included in this, although they will not be completely restricted until 2028. Existing equipment will not be affected by these rules, however - Californians’ generators will not stop suddenly stop working when the clock strikes midnight on the 1st of January 2028, nor will the police go about rounding up outdated generators.

Even in 2028 and afterwards, if somebody wants a new portable generator, they will be able to get one. Both used generators, and new generators bought directly from other states, will still be available; additionally some manufacturers will be able to use accumulated emissions credits to legally sell noncompliant generators.

Why are small engines so good, historically?

Removing SOREs from the market will be a historic and tremendously significant occasion, as they have been a fixture of domestic life for going on 70 years, powering all manner of essential tools: from chainsaws, lawnmowers and leafblowers to pressure washers, arc welders, plate compactors - and indeed, portable generators. All these categories would not exist as they do today without the SORE to give them rotational energy, mechanically converted by their mechanisms into useful work for the home and the job.

Would you bother mowing the lawn once a week if you had to push the mower yourself, instead of riding along in comfort while the SORE does all the work for you? What would you do without a chainsaw as a tree surgeon? Or without an arc welder as you’re building the new oil pipeline that inches its way across the landscape?

SOREs are convenient, portable and powerful. Pour in some fuel, pull the cord and away you go. Maintenance is easy, if you can be bothered, just top off the oil every so often, and switch out the carburator gaskets and spark plug when they wear out. If you can’t be bothered, for not many dollars somebody else will do it for you; if even that’s too complicated for you then you can just throw it away and buy another - small engines are cheap enough that you can afford it.

SOREs are the safe bet. They can operate in harsh conditions without a blink - hot, cold, wet, dry? No bother. What about infrastructure - all you need is a can of fuel, and as an American, you can trust in the supply of petrol for your SORE. The government fights wars for your right to burn oil. No matter who you are or what you do, or where you are in the country; there’s nothing better than a SORE by your side.

Or maybe not, there are downsides too!

When you snap out of your American dream, you realise that your suburban paradise is more like a suburban prison. The car in the garage is not a ticket to freedom, but a shackle to the petrol pump and a life doomed to sit in traffic; the 30-year mortgage not independence but dependence on the market and maintaining your income; and that pristine green lawn is not the status symbol it once was. It must be fertilised, pesticised, mown, leafblown, edged and watered, taking up hours of your time and many of your dollars.

And all that mowing belies one of the problems with the SORE. When every identical house in every identical cul-de-sac with its identical green, manicured lawn has its own mower running for hours a week, that’s a lot of fuel being burned by SOREs in a relatively small area. And that’s not good. The SORE is a noisy, smelly and inconvenient machine. When incessant droning of the neighbours’ leafblowers just won’t shut up when you want to relax, and when the smog hangs in the air like a foul blanket over the city for days on end, you realise that you have a problem. And it’s a big problem too; reading the scientists’ reports about just how many people are dying of this gives you a shock. And then you realise that the carbon dioxide being pumped out of these engines isn’t that benign either.

The truth is that SOREs have a lot of tradeoffs in their design. They may be cheap, lightweight and powerful, but because of this they are designed to be crude and simple machines. There’s no budget (economic, weight, or engineering complexity) for anything more than the bare minimum. They pass out exhaust gases unfiltered, and burn through fuel at an astronomical rate.

In the case of two-stroke engines, even the minimum of pollution control isn’t possible, because of the total-loss lubrication strategy. Engine oil is mixed directly with the fuel and passed through the combustion chamber. The partially burned results are apparent as smoke, full of the worst kinds of pollutants. But when you need an engine small enough to fit in your chainsaw, even the complexity of valves and a sealed crankcase is too much - two stroke it is, consequences be damned.

In the old days, cars and lorries emitted these kinds of pollutants too (and in aggregate, far more than SOREs): unburned hydrocarbons (HC), carbon monoxide (CO) and plain soot; but nowadays the law mandates that this is not the case. Modern cars (as designed) emit almost undetectable quantities of these pollutants, thanks to the catalytic converter, ECU and fuel injection (among countless other technologies). But this is possible because the tradeoffs are different for large and expensive car engines. If adding fuel injection is necessary to pass smog, of course that will get done, but it would probably have happened anyway once consumers realise it is more reliable and leads to lower fuel costs.

It’s only now that cars have got to be so good that SOREs are the next biggest issue to fix.

And it turns out that SOREs are a bit of a pain sometimes too. When the carburator needs to be rebuilt every year (or more often!) because of the new type of petrol with ethanol in it, that gets old fast. And when your nice new car always smells of fumes from the infuriatingly leaky (supposedly anti-leak!) mechanism in the fuel can, you’d really rather not have to carry petrol about quite so often. And when the power goes out and society is falling apart, when are you going to get the petrol for your generator from anyway - it’s not like you can store it for more than a few months without it going off after all. Maybe there really is something better than a SORE?

What are the alternatives to small engines?

Luckily there are now better alternatives to SOREs in many instances. Efficient and powerful permanent magnet AC motors now exist which are far lighter than SOREs, and when combined with Lithium batteries can be just as, if not more, compact and portable. Electric chainsaws are now more popular than engine-driven models for the home market, and many areas mandate the use of electric leafblowers already out of concern for noise pollution. Electric lawnmowers are competitive with petrol-powered ones, and even large lawns are suitable for self-charging robotic mowers, which not only cut out the SORE, but much of the labour too.

Larger and mobile machinery is just as suitable for battery-driven operation, with few exceptions, owing to the breakneck pace of development in the battery and electric car industries.

Even portable generators have been replaced by Lithium power packs for many uses - where only moderate power is needed and recharging facilities are easily to hand hand they are invaluable. And since they have no hazardous fuel nor any exhaust they are safe to use indoors. And for backup power after the Big One, or the next storm, Lithium provides an answer too. Solar panels on the roof and a Powerwall in the garage mean you can be totally self-sufficient, no generator needed.

And more high-tech innovation does look to be on the way: fuel cells powered by methane or hydrogen gas are already available and this segment is currently undergoing a frenzy of investment. Generators and power packs using the technology are sure to come on the market before too long.

All that said, there are still many market segments that are best served by SOREs at the moment, and it certainly is taking a gamble to say everything will be good by 2024-8. The alternatives are typically significantly more expensive than SOREs, and while price-conscious consumers can be served by the pre-2024 used market, prices will no doubt increase for all market participants.

Back to the rules

Looking back to CARB’s proposed rules, we need to read them in more detail to understand the reasoning for the change. Looking at the Initial Statement of Reasons, CARB explains its remit and how current healthy pollution limits are being exceeded in California, and what it plans to do about that:

The California Air Resources Board (CARB or Board) is responsible for protecting the public from the harmful effects of air pollution through the development of programs that reduce the emissions of specific pollutants and their precursors. Several areas within California exceed national ambient air quality standards (NAAQS) set by United States Environmental Protection Agency (U.S. EPA) for both fine particulate matter (PM) with diameter of 2.5 micrometers or smaller (PM2.5) and ozone.

Meeting these public health goals requires phasing out the use of internal combustion engines in both on-road and off-road applications and adopting zero-emission technology.

Governor Newsom’s Executive Order (EO) N-79-20, issued September 23, 2020, (EO N-79-20) orders CARB to develop and propose, “Strategies, in coordination with other State agencies, the U.S. EPA, and local air districts, to achieve 100 percent zero-emission from off-road vehicles and equipment operation in the State by 2035.”

Even so, in California, SORE emit more NOx and ROG [Reactive Organic Gases] than light-duty passenger cars, both in summer and annually. Without additional regulation, SORE will emit 1.8 times the amount of summertime NOx and ROG that California light-duty passenger vehicles emit in 2031 (CARB, 2020 and 2021b).

The pollution figures may seem high, but these are justified by the extremely poor performance of SOREs, high relative usage and extremely good performance of modern cars.

The Proposed Amendments would accelerate the transition to ZEE by setting evaporative and exhaust emission standards to zero for new SORE (engines or equipment produced for sale or lease for use or operation in California), except engines used exclusively in generators, for model year (MY) 2024 and subsequent model years. Implementing emission standards of zero [0.00 grams of hydrocarbons (HC) + NOx per kilowatt-hour, or g·kWh-1, for exhaust emissions and 0.00 grams per test for evaporative emissions] does not necessarily mean that all new sales of small off-road equipment would be ZEE. Banked emission reduction credits could be used to offset emissions from SORE for up to five model years after the credits were generated. Also, engines or equipment emitting below 0.005 g·kWh-1 or g·test-1 could be certified to meet emission standards of zero. However, staff believes that it is unlikely that engines or equipment meeting emission standards of zero will be manufactured. It is more likely that manufacturers will use emission reduction credits in the near-term to offset emissions from SORE while the credits are available.

The way that CARB is going about this is admittedly odd, but also quite appropriate in a way: nobody would have thought that the appropriate level of pollutants would ever be set to zero when pollution first became an issue. But they gave CARB the right to regulate the emissions, and zero is a perfectly appropriate number to regulate it to, given today’s environmental and market conditions.

Have a read of the proposal yourself, the introduction is quite comprehensible and there’s lots of evidence of the real work done by CARB later on. Although at >400 pages you might not want to read the whole thing!

Conclusion

Anyway, to sum up, it’s certainly an interesting time in the small off-road equipment market, and probably a good place for a startup manufacturer of electric equipment, and quite possibly for the consumer as well. As an existing manufacturer of SOREs, maybe not so much. That’s no death sentence though, although there’s no time to spare, the incumbents have strong R&D departments and the state is setting them off in the right direction.

A lot of the lobbying against this change is surely coming from these manufacturers, with the scaremongering media and religious generator users coming along for the ride. But there are legitimate complaints, due to the very short timescale for the phaseout of non-generator SOREs and the increased cost of generator alternatives currently on the market.

It’s clear that this will be good for the health and welfare of Californians, and that existing generator users have nothing to fear from the change, but rather they can expect benefits from the new and innovative products that California will be producing in the near future.

Related Note:

With all this new battery-operated equipment coming on the market soon, there needs to be a big push for a consistent and repairable battery standard. Vendor lockin, battery cost and safety all need to be improved. Existing proprietary batteries - where the options are an overpriced and unrepairable original battery or a dangerous cheap clone are not the solution. A well-designed open standard is needed so that consumers can choose batteries that are compatible between all their equipment and can buy high-quality third party batteries.

Defective by Design: Reflected Attacks on Email Privacy using DMARC

Email privacy is dead, confirmed for the umpteenth time. In this post I present the SOILED-PRIVACY attacks (Systemic Online Information Leakage using Email+DMARC against Privacy). These are two reflected attacks against email infrastructure allowing an attacker to access private knowledge about a target user, transparent to mail forwarding, mailing lists, and web services.

Many email users choose to use an address under a generic domain under the control of a commercial email-service provider, their ISP, or a cooperative operator; however there is also a large proportion of email users that choose an address under a domain they or their organisation owns. There are many advantages to using a domain under your own control, including (but by no means limited to): portability between email service providers; increased personal or corporate branding potential; and improved user choice or privacy as a result of self-hosted infrastructure.

However, a custom domain also necessarily entails some privacy downsides: as there is a trivial mapping between personality and domain name, it is possible for any person or service sending mails to an address under the domain to identify its owner. Depending on the use case of the emails being sent, this may not be a particular problem or may even be an advantage. However, in many cases this is a serious downside - very often users do not want to be identified personally by all the services they use or content-providers they subscribe to. These downsides have led to the development of various workarounds to protect user privacy. Such workarounds include:

  • Anonymous or single-use forwarding addresses.
  • Mailing lists not publishing lists of recipient addresses.
  • Web services proxying user-user mail (e.g. with a web form or forwarding address).

Users of custom domains have come to trust that these are effective at protecting their private activities, and limiting their trust boundary to the forwarding address operator, mailing list service or trusted web service rather than having to trust the whole of the internet or all other users of the services they use. The attacks presented mean that the above workarounds are not effective solutions and do not provide privacy of recipient, and therefore should not be used without either user knowledge of the attacks or relevant mitigations being applied.

DMARC: Defective by Design

DMARC is a internet technology that aims to combat email forgery and reduce the incidence of spam being sent with forged From addresses. It achieves this by standardising a DNS TXT record that can be attached to a domain by its owner. A server that receives an email can fetch the record for the domain in the From header of the email. DMARC gives the receiving server guidance on what to do when DKIM and SPF checks fail - to delete, quarantine (typically place in the spam folder), or to do nothing. Although DMARC has been subject to valid criticisms (particularly because it breaks many existing mailing lists and forwarding systems), it is a valuable tool in the fight against forged transactional email and spam.

As well as giving guidance to receiving servers, DMARC also establishes a feedback loop: receiving servers are encouraged to send reports detailing successful and failed forgery checks back to a location nominated by the owner of the From domain. In theory, this allows email senders to track down and fix errors in the infrastructure causing unwarranted SPF or DKIM failures.

However, in practice this opens up significant privacy issues which have not been communicated properly to the internet at large. I quote from the DMARC specification, RFC 7489:

When message-forwarding arrangements exist, Domain Owners requesting reports will also receive information about mail forwarded to domains that were not originally part of their messages’ recipient lists. This means that destination domains previously unknown to the Domain Owner may now become visible.

The attacks presented in the next section exploit this specified behaviour, which is inherent to DMARC aggregate reports sent by a very large proportion of email service providers. The providers sending these reports vary in size from individuals’ personal mail servers to behemoths like GMail and yahoo. Forensic reports are even worse, again quoting from the specification:

Failed-message reporting provides message-specific details pertaining to authentication failures. Individual reports can contain message content as well as trace header fields. […]

although the [format] used for failed-message reporting supports redaction, failed-message reporting is capable of exposing the entire message to the report recipient.

Luckily very few email providers send DMARC forensic reports, for obvious reasons: not only the breach of privacy inherent in sending detailed reports but also the potential for amplified (or even self-reinforcing) backscatter DDoS attacks and the cost associated with significantly increased processing effort on their own machines.

Attack 1: Reflected Self-Exfiltration using Aggregate DMARC

This is the simplest case, when an attacker arranges that an email is sent with their domain as the From, and elects to receive DMARC aggregate reports. The attack email (which can have any content or none, and could even be rejected by the server per DMARC rules) is sent to an address that does not personally identify the victim, but forwards to a domain that does. This could be a mailing list, anonymous forwarding address, or web service.

When the victim’s domain’s mailserver receives the email, and dutifully returns the DMARC aggregate report, their personality will be revealed.

Example 1:

malicious@attacker.example -> xxx@mailinglists.example -> itsme@alice.example

The attacker sends an email to a mailing list submission address, xxx@mailinglists.example. The attacker does not know what the recipients of their mail will be, because the mailing list does not publish subscriber information. The attacker’s email is forwarded to itsme@alice.example, an address that identifies the victim, Alice.

The receiving server for alice.example then send a DMARC report to the attacker, identifying alice.example as the sender of the report. The attacker now knows that Alice subscribes to the target mailing list.

Example 2:

malicious@attacker.example -> totallynotbob@gmail.com -> hi@bobworld.example

The attacker sends an email to an unknown address that does not identify the victim, here totallynotbob@gmail.com. This mail is then forwarded to hi@bobworld.example, an address that identifies the victim, Bob.

The receiving server for bobworld.example then sends a DMARC report to the attacker, identifying bobworld.example as the sender of the report. The attacker now knows that totallynotbob@gmail.com is actually Bob.

Example 3:

malicious@attacker.example -> potato on InnocentWebCommunity.example, via web form -> contact@charliesplace.example

The attacker sends an email to potato, a user on InnocentWebCommunity, via the web form on InnocentWebCommunity.example. The email is sent by the web service to contact@charliesplace.example with its From header as malicious@attacker.example. potato is not an identifiable username and the malicious attacker wants to find out their real information.

The receiving server for charliesplace.example then sends a DMARC report to the attacker, identifying charliesplace.example as the sender of the report. The attacker now knows that potato is actually Charlie.

Attack 2: Forwarded Reflected Exfiltration using Aggregate DMARC

In this case, similar to Attack 1, the attacker arranges that an email is sent to the victim with the attacker’s domain as the From, and elects to receive DMARC reports for that domain.

The attack email must be sent to an address that does not personally identify the victim, but that forwards to an address with domain that does. The difference in Attack 2 as compared to Attack 1 is that this identifiable-domain address then forwards the email on again, to another provider that sends DMARC aggregate reports.

Since the personally-identifiable domain forwards the email, the IP and domain of its mailserver will become visible in DMARC reports sent by the ultimate receiving server back to the attacker.

This is the more complicated case, which is not relevant to as many email users as Attack 1, but has been mitigated by very few third-party email-service providers, if any.

Examples

All the examples for Attack 1 apply for Attack 2, when a final forward to example@gmail.com is performed by the personally-identified domain.

Are you vulnerable?

  • If your email addresses are only under generic domains, you are not vulnerable.
  • If all the servers processing email for you do not send DMARC reports or participate in feedback loops, you are not vulnerable. (but you can’t assume things will stay this way)
  • If you do not forward emails from a custom domain, and the servers processing mail for you anonymize DMARC reports, you are not vulnerable. (This applies to most, but not all, custom domain users on commercial mail hosts, and means Attack 1 is less potent than it might otherwise be.)

Otherwise, if none of the above apply, you may be vulnerable. You should review your email pipelines and ensure that the appropriate mitigations, some of which are detailed below, have been applied.

What can you do about this?

The only foolproof method to avoid these attacks is to use a generic domain (e.g. hotmail, aol, etc.) to receive your email, and not to forward any mail to a custom domain once it is received.

If you use your own domain, do not automatically forward mail from this domain. If you do need to forward mail in this situation, make sure you forward to a server you control and trust not to send DMARC reports.

If you control your own mail servers, disable all DMARC reporting or delivery feedback loop mechanisms.

If you don’t control the servers that receive your mail, switch to ones you do control or ask the server owner to disable all DMARC reporting and to not participate in delivery feedback loop mechanisms.

Commentary

The fact that this perfectly simple and obvious privacy leak has been standardised and adopted by the vast majority of email service providers (even many of those that cry about ‘protecting your privacy’) is rather mind-boggling.

This speaks to the general state of affairs around email privacy - it’s basically an impossible task to fully protect yourself; without significant behaviour changes, and deep knowledge of the operation of all components in the email pipeline there are just so many holes that patching one makes little difference.

My opinion is that there is a fundamental problem in the ecosystem: email standards are too complicated, and have not been designed with privacy in mind. When problems with existing standards have arisen, the solution seems to have been adding additional complexity layers on top of the existing ones.

Unfortunately this is a problem of interoperability as email is a federated system which has developed over time; standards developers have attempted to keep backwards-compatibility when writing new standards but the negative effects of some of these decisions look rather more evident in hindsight than they might have appeared at the time.

I don’t have any solution for this problem, nor do I believe switching to some alternative ecosystem is a good idea: if email didn’t work ok, then it wouldn’t be so successful as it is. Nevertheless, it’s sad that things are as bad as they are.

Wayland is Almost There

Wayland is a thing. It’s the future. If you listen to the hype then you’ll hear about all the different ways it’s better than X and how X is so outdated and old and… nasty.

And that’s true. X is old, and X is nasty, especially when you stray outside the happy path and get stuck in the customisation quicksand or the configuration quagmire.

But there’s something else true: X works. And unless you want to get stuck in that quagmire, unless you delve deep into the architecture and work up an emotion, unless you have a ideological opposition to what’s old, you don’t need to worry about any of that. Install your favourite distribution, pick your preferred desktop environment (please not GNOME3 though); things will just work.

Installing Wayland

But the mind is as the mind does, and the hype does wear you down after a while. You can have too much of a good thing. Comfort is normalised, things can’t just be OK, there must be something better out there… So it goes that way, I’ll switch to wayland then. At least to try it out, for a week. That’ll be fine. Everybody says it’s easy. What could go wrong.

Back to reality for a second, and for a bit of context: just before the government mandated period of home-working my main development computer was running more smoothly than it ever had before. I had a big 4K monitor, and one of those ubiquitous little old Dell monitors (to keep up on those slack distractions); I had a two-generations-old AMD graphics card with the open source AMD driver, and I had TearFree enabled so unneccessitating the wrangling of X and vsync. I had the big monitor with fractional scaling and the little one just running at native resolution. I had i3 set up and I had the keybinds ingrained into my muscle memory (just about). I had a compose key!1 I had found a set of applications that worked well and suited my desktop lifestyle! Life was a dream!

But the world being the way it is, Crown Disease broke out and now I’m stuck with a 1080p monitor, and a rather old nVidia graphics card, and the video tearing is making my eyes water. So, wayland it is then. That extra frame of latency is a fair tradeoff for fixing the tearing. And sway exists2, and it’s supposedly a drop-in replacement for i3.

So, I did what was suggested:

sudo apt-get install sway
mkdir ~/.config/sway
cp ~/.config/i3/config ~/.config/sway/config

First impressions, this downloaded quickly! That’s a good sign at least, maybe it isn’t bloated like all modern software development seems to encourage.

And so I foolishly followed the debian migration guide and copied this into my config file

input * xkb_layout "us,de,ru"
input * xkb_variant "colemak,,typewriter"
input * xkb_options "grp:win_space_toggle"
input "MANUFACTURER1 Keyboard" xkb_model "pc101"
input "MANUFACTURER2 Keyboard" xkb_model "jp106"

And then I tried logging out and back in again, this time with sway rather than i3. I was presented with a wonderful black screen, and half a second later unceremoniously dumped back on lightdm again. Something had failed. I wasn’t ready to give up at the first hurdle, so jumped on over to a text terminal, Ctrl-Alt-F1, logged in and tried a second time. A helpful error message, telling me that I can’t use the nVidia proprietary driver. That’s not unexpected, so time to nuke it from orbit:

sudo apt-get purge '^nvidia-.*'
sudo apt-get autoremove

Nice bonus: away goes DKMS, and slow kernel upgrades. And the basic text terminal looks sharp and full-res, not the fuzzy mess it was before. Makes me wonder why I even installed this piece of junk in the first place. But I’m definitely buying AMD next time… Anyway, back to the coal face:

One sway and it’s away. I was in! That happiness only lasted about a single second though, because I realised that I was completely unable to do anything in this new desktop environment. None of my keybinds worked, I couldn’t even find the way to get me out!

So I took my pick of recovery options. Back at the terminal, I realised a likely suspect for this problem. The keyboard layout must be wrong. The debian migration guide has suggested that the most common keyboard layout was colemak. I didn’t even recognise it as the name of a keyboard layout initially, unusual as it is. Why whatever debian developer writing that guide chose it as an example, I don’t know. Colemak… really? Anyway, I RTFMd (man 5 sway-input)3, and worked out a more sensible input command:

input type:keyboard {
    xkb_model pc105
    xkb_layout gb
    xkb_variant extd
    xkb_options compose:ralt
}

So it’s sway and away for the second time. I’m in for real this time. And I had my compose key back, without any hassle at all. It’s starting to feel good!

I had my two screens, and the left was on the left and the right on the right, and I could move the mouse between them! And I could open up kitty, and it worked as it should have done. Score 2 for wayland! Next thing, down come my fingers on the keyboard, the keys are pressed… and dmenu does not appear. Oh. Next up is firefox. Nothing there either. claws? No. Oh dear.

Maybe wayland adoption isn’t as far along as I had heard. It turns out Firefox does have support for Wayland, but it’s not a stable feature yet. dmenu I could replace with wofi. Similarly i3lock can be replaced by swaylock. There’s no substitution (nor any apparent development effort in terms of wayland adoption) for claws-mail though.

So you really can’t just use wayland on its own. It’s not realistic, there are too many applications that rely on X in one way or another. And I don’t think it will be realistic for quite some time yet, no matter what the wayland boosters say. Luckily there is a solution, and it’s just as simple to install as the rest of wayland/sway:

sudo apt-get install xwayland

That, plus a restart is all it takes. Suddenly all my applications work again. I haven’t been able to detect any issues using applications routed through it, so as far as I can tell xwayland has no downsides beyond being just another bit of software to install.

Can Sway replace Xrandr?

Even though I won’t be needing to change display settings regularly with this old desktop, I still decided to try out hotplugging the displays and moving things around. Through the limited set of challenges I tested it with, sway seems to behave fairly logically, albeit you have to control everything yourself with swaymsg input ....

When I tried toggling a display off then on again, my workspaces all shuffled over to the active display, but to my great surprise as soon as the disabled display blinked into life again they were off, back to whence they came! This is very nice QOL improvement compared to what I had before with i3 and Xrandr - having to move the workspaces back to where they should be manually is a pain.

Unfortunately sway doesn’t support display mirroring, or any way to decouple outputs from the logical workspaces, to split one window across multiple montitors. This isn’t a feature I need on my desktop, but it’s nice to have this stuff (or the capability at least) if I were to install wayland on my laptop. There’s an issue open on GitHub although it has the usual affliction: lots of activity but nobody who can be bothered to do the work and submit a patch.

And if I ever get tired of doing the manual work setting up new displays, it looks like kanshi will be there to help.

I didn’t try messing around with HighDPI or backlight control, because this computer just doesn’t have the hardware to support that kind of experiment. Maybe it’ll turn out those are impossible to do if I install sway on compatible hardware, but that remains to be seen!

Impressions

After using my new DE for a few days, I feel I’m competent to give my initial judgement: It’s OK. That’s it! wayland+sway is a combination that works; it’s nothing groundbreaking, it hasn’t told me the winning lottery numbers or finished off all those projects at the top of my to-do list but it works and that’s all that matters really. It’s a bit nicer around the edges than X+i3, and with a little bit more maturation and new features I would have no qualms recommending sway over i3 as the best choice of desktop environment.

My eyes are no longer watering at the thought of display tearing, so the original objective has been satisifed at least, but in terms of the performance impact of compositing I can’t say I really noticed any difference. Probably everything else is so slow that it doesn’t make much difference. Either that or I got used to the difference immediately. Even the mouse cursor latency seems just as good as before.

The performance impact I did notice though was starting up a new kitty instance. Somehow it seems just ever so slightly slower to start up, so the first character or two of the command I was about to type in got cut off. Maybe I’m was just imaginging it, since I got used to the new latency after the first day anyhow.

So I’m going to keep using wayland and sway, unless some big show-stopping issue comes up; and when the pandemic-panic has reduced I will try it on my other computers as well. It’s nothing earth-shattering, but it wasn’t a pain to set up, and it the meat and potatoes of it seem just as good as X.

Niggling Issues

That said, there were still a few outstanding problems I discovered in the first few days, some of which I managed to fix or work around, and others I just couldn’t be bothered to do anything about, since they’re so minor.

One was that my monitors wouldn’t go to sleep when I locked my computer. The documentation was helpful once again and a solution was soon at hand, I had a new lock-script:

#!/bin/sh
revert() {
    killall swayidle
}
trap revert HUP INT TERM
swayidle -w \
    timeout 5 'swaymsg "output * dpms off"' \
    resume 'swaymsg "output * dpms on"' &
swaylock
revert

Admittedly it’s a bit ugly to spawn a new idle daemon and kill each time the screen is locked, but I had to do a similar thing with X as well, so at least it’s not gotten any worse with sway!

My scroll-wheeling speed also seemed to have gone down a little bit, so I tried increasing it. Now I can scroll 1.2 times faster!

input type:pointer scroll_factor 1.2 

scrolling inside kitty was still rather too slow, but I realised quite quickly that all I needed was a small tweak to kitty.conf:

touch_scroll_multiplier 6.0

Apparently wayland is handled as a ‘touch’ device inside kitty and does high-precision scrolling so it needs to be configured seperately.

Another issue resolved not to resolve itself: although my left screen was correctly placed on the left, and the right similarly on the right, and moving the mouse between the two worked as expected; the left screen was workspace number 2 and the right number 1. I like my workspaces to increase from left->right and as far as I can tell I can’t make this happen without lots of manual work on each boot.

lightdm still doesn’t work either, and I can’t be bothered to do anything about that, so I have just switched it off; it’s actually a bit nicer starting my DE manually. It would be nice to know why though, since lightdm and sway are at least notionally compatible with each other.

TL;DR

  • wayland works
  • it’s not perfect, xwayland is necessary, but does it matter?
  • sway is everything good about i3, just better
  • nVidia sucks
  • compositing delay isn’t that bad when everything else is slow anyway

Postnote

One thing I haven’t mentioned is network transparency, and that’s because it’s not a display server feature I have ever used, or ever intend to use. I don’t understand why anybody makes a fuss about it. I can only put it down to display server fanboyism - it’s just completely irrelevant to the actual issues!

Footnotes

  1. If you don’t have a compose key, you should get one. Is that right-alt doing anything useful on your keyboard? Make it a compose key instead and type special characters intuitively. It’s such an obvious feature that I can’t understand why it isn’t supported on any of the major Operating Systems (at least by default, thankfully it’s easy to enable on Linux). 

  2. Incidentally, the author of sway, SirCmpwn is a 100x programmer if there ever was one, the amount of software I use everyday he has written is rather impressive. And while some of his work is unconventional, it’s so much better for it. If you’re not a sourcehut subscriber, you should be. 

  3. The documentation manual-pages for sway are excellent. I was able to find exactly the information I needed without wading through endless junk like I’m used to in manpages. If you want to install sway yourself and get stuck on any of the configuration, look at the manual first and you might be pleasantly surprised. 

❌