Should anyone ask, Bitcoin is Galt’s Gulch.

From the department of falling asleep thoughts: Many Bitcoiners dream of finding their Galt’s Gulch: a fictional place in Rand’s Atlas Shrugged where society’s most productive and innovative individuals retreat to escape an outside world that seems to make less and less sense and feel more and more constricting.

Myself too: I’m selling up in Berlin and actively looking for my idealised utopia. I’ve been evaluating future places based on tax codes, education level, government style, weather, food… But just maybe the suffocating system we are escaping from and to isn’t a place: Maybe the panacea of Galt’s Gulch is less a place and more the individual opting out of the current system and into the Bitcoin standard.

Bitcoin is the escape from a centralised financial system driven by government intervention. Bitcoin’s rejection of centralised control parallels the characters opting out to live sovereign lives beyond the reach of central authority. It’s a Galt’s Gulch without needing to move somewhere else.

Indeed Bitcoin mirrors a lot of Rand’s objectivist system and advocates for reason as the primary means of understanding reality. Bitcoiners seem to reject faith, mysticism, and arbitrary beliefs. And when adopting “faith” do so more for the structure rather than mysticism. Bitcoiners also seem to strive for free markets, limited government and individual rights: all beliefs one would expect to find in Galt’s Gulch.

All this said, my quest to find a physical Galt’s Gulch continues: outdoorsy nature, beauty (Berlin skips this part), smart people & privacy.

Should anyone ask, The FT’s Bitcoin articles

The FT still struggles to separate signal from noise when writing about “crypto”. It’s like a throwback to articles on AOL and Compuserve being “the internet” and entirely missing the promise of the future open internet and the new industries it would spawn. 

Just like the open internet protocols free of political or corporate meddling, there’s value in a money protocol that operates without a central authority like a government or a bank. This gives users greater financial authority and security, as transactions are recorded on a public blockchain which is transparent and immutable and not at the whim of politics.

Yes, fiat currencies have an intrinsic value that cryptocurrencies do not: specifically, governments demand tax payments in fiat rather than any other form of property. 

But Bitcoin is *the* alternative currency (not “crypto”) for people who do not believe in government created money (not dissimilar to gold bugs) or need to escape their rather oppressive governments in less free states. Bitcoin is for the same people who saw that AOL and Compuserve were just a passing fad on the way to the open internet.

Should Anyone Ask, Measuring Water Use

I wanted to measure how much water is being used. So when the plumber was setting up the water connection I asked him to install a small turbine that emits pulses (about 400 per liter) . The idea being that I could count the pulses and then calculate overall consumption for both hot and cold water independently. Here’s a picture of one of the turbines.

I connected the turbine up to an ESP8266 board and flashed with the latest version of Tasmota.

Wemos D1R2 Pinout

Here it is mounted in the closet and receiving pulses for both hot and cold water.

And showing the final water consumption and pricing on a Home Assistant dashboard.

Should anyone ask, configuring wall tablets for home automation

A quick write up on mounting Amazon Fire tablets on walls and configuring them to work nicely with Home Assistant and as a digital photo frame when idle.

Hardware

I was recently building a new apartment and looked at various ways to control it. Naturally there were a bunch of propitiatory systems but I really wanted to build on open source. Originally I started the control system on OpenHAB but then switched to Home Assistant and have been very happy with it.

Part of this was coming up with a nice way to control everything from the walls. Ideally you don’t have to control anything since blinds and heating valves just open and close automatically based on the sun’s position or room temperature. But every now and again it’s nice to be able to to see how much power is being used or trigger a vacuum cleaning in a particular room.

I was interested in the price point of the Amazon Fire tablets but only if they could be rooted and all the Amazon cruft replaced by an open build like Lineage. I picked up 10 refurbished Amazon Fire HD 2017 model tablets on the Amazon Warehouse deals page for about €50 each. Worst case I could run it with the Amazon software but I also knew that the hardware was almost identical to another rooted model and reached out to the person that had achieved that. He offered to take a look at it if I sent him a tablet. A day later, there was a working exploit and we were in business with a cyanogenmod (before it became Lineage) firmware.

Thoughts then turned to how to mount these on the wall. When I’d built I’d installed empty sockets with mains power and POE enabled ethernet. Power was easy using a little Meanwell 230-5v transformer. But what I did want to avoid was an ugly USB cable sticking out the side of the device. On Aliexpress I found some wireless charging adapters and it was possible to extract just the cable and solder it to the 5v power supply.

To mount the tables I first tried wood and magnets which turned out to be a disaster, Part of the issue was that hot gluing the magnets to the tablet and wood in four places mean that there was slight rocking from the differing heights / amount of glue under each magnet.

Eventually I ripped the magnets off and went for Velcro. That said, after the magnets meant that tablets’ would sometimes fall from the mounts, this time around went for some industrial grade Velcro which turned out to be overkill and made the tablet’s quite hard to remove from the wall. Regular Velcro should b just fine!

To make everything blend in I spray painted the silver buttons on the tablet and silver charging port with a nice matt black. The cat was not spray painted.

finally it was time to mount all nine tablet’s on the walls. I like the unframed look and they seem to float against the wall.

Software

The requirements for the was was something along the lines of :

  • show a webview of Home Assistant’s dashboard
  • after a set amount of time show a random photo as a screensaver
  • based on motion in the room, flip back to the dashboard (later removed)
  • on the backend resize photos before sending them to the underpowerd tablet (the tablet’s and wifi was choking on anything more than a few megapixels.

One of the biggest problems I’ve had with all solutions is Android’s aggressive power management (even though it’s plugged into a wall power supply). Android will drop wifi connections to save battery. There could also be an issue with the wifi controller on these tablets giving up too easily and going into some kind of shutdown. I’m still investigating as are others.

I first tried, and tried to get Wallpanel working. It even includes code to hold a wifi wakelock (as in, don’t turn off the wifi while this app is running). But the tablet would still drop off the network which meant that when you wanted to use it, it would need to fully reconnect. Also remote control over the tablet (for example turning the screen on based on the room’s motion detectors) wasn’t possible.

After banging my head against Wallpanel, including all sorts of android wifi tuning options, I tried out Fully Kiosk Broswer.

To configure each tablet, I used a fresh install of Lineage, and then scripted up the rest of the install to run on the tablets. I’m now running them with the following fully-kiosk settings.

Next was a screensaver. I looked around at different photo gallery software and found that PiGallery2 was the only one that let me configure a nice randomised picture based on queries (for example give me a random photo in landscape format, and exclude photos of ex girlfriends). I set this up to run as a Kubernetes deployment.

I then came up with a webpage to show the image and rotate it every n seconds. The problem then remained how to deal with underpowered tablet’s having a 40 megapixel photo thrown at them. For this I configured a reverse proxy on Nginx that would resize images on the fly to be the maximum width of the tablet screens (the HTML page passes this in as a parameter from a media query). I’m happy to have that work. It was no fun to debug. This also runs as a Kubernetes deployment.


location /random_resized_image/ {
    rewrite ^ $request_uri;
    rewrite ^/random_resized_image/(?<width>\d+)/(?<image>.*)$ $image break;
    return 400;
    proxy_pass http://pigallery2.imagilan/pgapi/gallery/random/$image;
    image_filter resize $width -;
    image_filter_jpeg_quality 90; # Desired JPG quality
    image_filter_buffer 100M; # Will return 415 if image is bigger than this
    proxy_http_version  1.1;
    resolver 10.7.11.1;
    add_header Cache-Control "max-age=0, no-cache, no-store, must-revalidate";
    add_header Pragma "no-cache";
}

I have the following automation scripts setup in Home Assistant to turn off the tablets in the evening since I run them at full brightness and they keep a bedroom too bright.

alias: turn off tablet screens
description: ""
trigger:
  - platform: time
    at: "22:00:00"
condition: []
action:
  - service: switch.turn_off
    data: {}
    target:
      entity_id:
        - switch.tablet_hallway_screen
        - switch.tablet_bedroom1_screen
        - switch.tablet_bedroom2_screen
        - switch.tablet_bedroom3_screen
        - switch.tablet_lounge_screen
        - switch.tablet_hallway_screen
        - switch.tablet_kitchen_screen
        - switch.tablet_bathroommain_screen
        - switch.tablet_bathroomguest_screen
        - switch.tablet_lounge_screen
        - switch.tablet_study_screen
mode: single

And to turn them on again when motion is detected. This one is currently problematic since, the screen being off tends to kick Android into some kind of power saving state, even though wifi and CPU are wakelock’d.

alias: Turn on Tablet Screens (fully-kiosk)
description: turn on wallpanel screen when motion detected
trigger:
  - platform: state
    entity_id:
      - binary_sensor.bathroomguest
      - binary_sensor.bathroommain
      - binary_sensor.bedroom1
      - binary_sensor.bedroom2
      - binary_sensor.bedroom3
      - binary_sensor.hallwaylarge
      - binary_sensor.hallwaysmall
      - binary_sensor.kitchen
      - binary_sensor.lounge
      - binary_sensor.study
    to: "on"
condition:
  - condition: time
    after: "06:00:00"
    before: "22:00:00"
action:
  - service: switch.turn_on
    data: {}
    target:
      entity_id: switch.tablet_{{ trigger.to_state.object_id }}_screen
mode: single

All in all I’m pretty happy with how things work. It would be nice to nail down the wifi reliability, but for the moment I have Fully-Kiosk doing a reboot every evening which seems to tame some of the errant wifi laziness. What I like most is coming around a corner or into a room and seeing the tablets showing photos from years ago and the memories associated with that.

Should anyone ask, setting up OpenWRT on a D-Link DGS-1210-28 Switch

Who wouldn’t want more ports? So when I saw support for this switch entering mainstream OpenWRT, I had to have one.

These switches are pretty cheap on ebay and have the following spec:

CPUMemoryFlash
Ubiquiti EdgeRouter X4 core (MIPS 1004Kc V2.15)256MB256MB
D-Link DGS-1210-281 core (MIPS 4KEc V7.0)128MB32MB
so basically not the most beefy of devices but enough to run some switching software

Installing was pretty easy. Hardest part was finding a serial adapter.

  • Added a header and serial console using screen /dev/ttyUSB0 115200 8n1
  • Setup a TFTP server on another machine that you can pull from
  • press escape during boot
  • network with rtk network on command
  • setenv ipaddr 192.168.1.1 (since this is the future openwrt default address too)
  • boot with tftpboot 0x8f000000 openwrt-rtl838x-generic-d-link_dgs-1210-28-initramfs-kernel.bin
  • boot the image with bootm and you are now running from memory.
  • the default vlan setup is kinda dumb – aparently plugging into port 2 works.
  • copy on a -sysupgrade.bin image onto the switch and run a sysupgrade command.

My custom config is at https://github.com/imaginator/home-network/blob/master/switch02.settings

Should anyone ask, my 2022 predictions.

Where will the world be going?

Economy

  • US bond sale slowdown 
  • European economic slowdown
  • China slowdown and crashing of zombie companies
  • General insecurity
  • China no slowdown / strengthening Yuan
  • High inflation
  • Bitcoin distinguishes more from “crypto” space
  • Spot Bitcoin ETFs in US market
  • Turkey defaults
  • El Salvador bond launches
  • at leat two more countries adopt Bitcoin as a national currency
  • More lightning transactions and bigger transactions
  • Lightning moves bitcoin from store of value to means of payment

Politics

  • More populist leaders being elected.
  • More “tax the rich” backlash from the likes of Elisabeth Warren
  • Less Corona + returning to normal
  • World learned nothing from the massive pandemic – instead polarisation of views. No ability to balance risks / returns based on evidence. 
  • UK government limps on
  • Biden continues lame-duck presidency
  • Trump was not elected as a Republican candidate. 
  • Saurez, DeSantis,  Abbott are likely to be republican candidates.  (Republicans win election after Democrats fail to shake off their woke wing of the party)
  • More countries will look at the El Salvador bonds.