Booting Faster (with Linux).

Booting a computer does not happen extremely often in most use-cases, yet it’s a field that has not seen as much optimization and development as others had.

Find a very interesting presentation on the topic: How to make Linux boot faster here. The presentation was held at the Linux Plumbers Conference 2019.

QuickCharge 3 (QC3) enable your Arduino project

You might have asked yourself how it is that some phones charge up faster than others. Maybe the same phone charges at different speed when you’re using a different cable or power supply. It even might not charge at all.

There is some very complicated trickery in place to make those cables and power supplies do things in combination with the active devices like phones. Many of this is implemented by standards like “Quick Charge”:

Quick Charge is a technology found in QualcommSoCs, used in devices such as mobile phones, for managing power delivered over USB. It offers more power and thus charges batteries in devices faster than standard USB rates allow. Quick Charge 2 onwards technology is primarily used for wall adaptors, but it is also implemented in car chargers and powerbanks (For both input and output power delivery).

Wikipedia: Quick Charge

So in a nutshell: If you are able to speak the quick charge protocol, and with the right cable and power supply, you are able to get anything between 3.6 and 20V out of such a combination by just telling the power supply to do so.

This is great for maker projects in need of more power. There’s lots of things to consider and be cautious about.

“Speaking” the protocol just got easier though. You can take this open source library and “power up your project”:

The above mentioned usage-code will give you 12V output from the power supply. Of course you can also do…:

Be aware that your project needs to be aware of the (higher) voltage. It’s really not something you should just try. But you knew that.

More on Quick Charge also here.

smart arduino fish pond feeder: TurtleFeeder

We’ve got several quite big fish tanks in our house. Mainly used by freshwater turtles.

say Hi! to Wilma.

These turtles need to be fed every once in a while. And while this is not an issue normally it’s an issue if you leave the house for travel for an extended period of time.

Of course there are humans checking on everything in the house regularly but as much as can be automated should and will be automated in our household. So the requirement wa to have the turtle feeding automated.

To achieve this is would be necessary to have a fixed amount of turtle food be dispensed into the tanks on a plan and with some checks in the background (like water quality and such).

It’s been quite a hassle to come up with a plan how the hardware should look like and work. And ultimately i’ve settled on retrofitting an off-the-shelf fish pond feeder to become controllable through MQTT.

The pond feeder I’ve found and used is this one:

It’s not really worth linking to a specific product detail page as this sort of feeder is available under hundreds of different names. It always looks the same and is priced right around the same.

If you want to build this yourself, you want one that looks like the above. I’ve bought 3 of them and they all seem to come out of the same factory somewhere in China.

Anyway. If you got one you can easily open it up and start modifying it.

Hardware

the wheel is turned by a DC motor and the switch is triggered by the wheels fins
I’ve added a connector to the switch and the motor cables for quick connect

The functional principle of the feeder is rather simple:

  1. turn the feeder wheel
  2. take the micro-switch status in account – when it’s pressed down the wheel must be pushing against it
  3. turn it until the micro-switch is not pressed anymore
  4. turn some more until it’s pressed again

Simple. Since the switch-status is not known on power loss / reboot a calibration run is necessary (even with the factory electronics) every time it boots up.

After opening the feeder I’ve cut the two cables going to the motor as well as the micro-switch cables. I’ve added a 4-Pin JST-XH connector to both ends. So I can reconnect it to original state if desired.

These are all the parts needed:

I am using a Wemos D1 Mini and a couple of additional components apart from the prototype board:

A PN2222 NPN transistor, a rectifier diode 1N4007 and a 220 Ohm resistor.

I’ve connected everything according to this schematic I’ve drawn with Fritzing:

I’ve then prototyped away and put everything on the PCB. Of course with very limited solderig skill:

As you can see the JST-XH connector on Motor+Switch can now be connected easily to the PCB with all the parts.

Make sure you check polarity and that you did correctly hook up the motor and switch.

When done correctly the PCB (I’ve used 40mm x 60mm prototype pcb) and all cables will fit into the case. There’s plenty of room and I’ve put it to the side of it. I’ve also directly connected an USB cable to the USB port of the Wemos D1 Mini. As long as you put at least 1A into it it will all work.

Software

Since the Wemos D1 Mini sports an ESP8266 and is well supported by Arduino it was clear to me to use Arduino IDE for the software portion of this project.

Of course everything, from schematics to the sourcecode is available as open source.

To get everything running you need to modify the .ino file in the src folder like so:

Configuration

What you need to configure:

  • the output pins you have chosen – D1+D2 are pre-configured
  • WiFi SSID + PASS
  • MQTT Server (IP(+Username+PW))
  • MQTT Topic prefix

Commands that can be sent through mqtt to the /feed topic.

MQTT topics and control

There are overall two MQTT topics:

  • $prefix/feeder-$chipid/state
    This topic will hold the current state of the feeder. It will show a number starting from 0 up. When the feeder is ready it will be 0. When it’s currently feeding it will be 1 and up – counting down for every successfull turn done. There is an safety cut-off for the motor. If the motor is longer active than configured in the MaximumMotorRuntime variable it will shut-off by itself and set the state to -1.
  • $prefix/feeder-$chipid/feed
    This topic acts as the command topic to start / control the feeding process. If you want to start the process you would send the number of turns you want to happen. So 1 to 5 seems reasonable. The feeder will show the progress in the /state topic. You can update the amount any time to shorten / lengthen the process. On the very first feed request after initial power-up / reboot the feeder will do a calibration run. This is to make sure that all the wheels are in the right position to work flawlessly.

So if you want to make it start feeding 3 times:

mosquitto_pub -t house/stappenbach/feeder/feeder-00F3B839/feed -m 3

And if you want to see the state of the feeder:

mosquitto_sub -v -t house/stappenbach/feeder/feeder-00F3B839/state

All in all there are 3 of these going to be running in our household and the feeding is going to be controlled either by Alexa voice commands or through Node-Red automation.

fear the flex of my tensor tympani muscle!

TIL that I could do something which I assumed everybody could do. I could make me hear a roaring thunder sound by flexing a muscle I did not know until now.

It’s quite interesting. The muscle is named “Tensor tympani” and it’s here:


Henry Vandyke Carter
 and one more author – Henry Gray (1918) Anatomy of the Human Body (See “Book” section below) Bartleby.comGray’s AnatomyPlate 907

The tensor tympani acts to dampen the noise produced by chewing. When tensed, the muscle pulls the malleus medially, tensing the tympanic membrane and damping vibration in the ear ossicles and thereby reducing the perceived amplitude of sounds.

https://en.wikipedia.org/wiki/Tensor_tympani_muscle#Voluntary_control

So the eye has an Iris to control how much light makes it in. The ear has this muscle to dampen too loud sounds. And apparently not everyone is able to willingly control it. Bummer!

Contracting muscles produce vibration and sound. Slow twitch fibers produce 10 to 30 contractions per second (equivalent to 10 to 30 Hz sound frequency). Fast twitch fibers produce 30 to 70 contractions per second (equivalent to 30 to 70 Hz sound frequency). The vibration can be witnessed and felt by highly tensing one’s muscles, as when making a firm fist. The sound can be heard by pressing a highly tensed muscle against the ear, again a firm fist is a good example. The sound is usually described as a rumbling sound.

Some individuals can voluntarily produce this rumbling sound by contracting the tensor tympani muscle of the middle ear. The rumbling sound can also be heard when the neck or jaw muscles are highly tensed as when yawning deeply. This phenomenon has been known since (at least) 1884.

https://en.wikipedia.org/wiki/Tensor_tympani_muscle

Interesting theories not started in my head. As I am very sensitive to chewing noises of all sorts – either produced by myself or by others. This could give an explanation to why.

Now excuse me, I need to flex this muscle and make the thunder roar!

Homebrew AR: HoloKit

Augmented Reality – AR – is getting some buzz here and there throughout the last 20 years almost. With hardware becoming more powerful and optics+light hardware becoming cheaper and more efficient it’s still all but close to become widely used and available.

Many refer to some one-trick pony feature in location-based games like “Pokemon Go” to being “AR”. But actual useful cases of AR are there but not feasible with current hardware generations.

Nevertheless a team in california has taken our the scissors and keyboards and made HoloKit:

HoloKit features super sharp optics quality and a 76-degree diagonal field of view. Pairing with a smartphone, HoloKit can perform an inside out tracking function, which uses the changing perspective on the outside world to note changes in its own position. HoloKit merges the real and the virtual in a smart way. While you see through the real world, virtual objects are blended into it. Powered by the accurate gyro and camera on smart phones, HoloKit solidly places virtual objects onto your table or floor, as if they were physically there without physical makers. These virtual objects will stay in the same place even if you walk away, just like real physical objects.

HoloKit is different from screen-based AR experience like Tango. You can directly see through the headset and view the real world as is, and in the meantime the virtual objects are projected on top of the real world, as opposed to viewing both the real and the virtual through a smartphone camera.

https://holokit.io/

tickling the dragons tail – the party game?

The demon core was a spherical 6.2-kilogram (14 lb) subcritical mass of plutonium 89 millimetres (3.5 in) in diameter, that was involved in two criticality accidents, on August 21, 1945 and May 21, 1946. 

Wikipedia: Demon core

Now you can have fun without the death-risk in the comfort of your home.

Meet the party-core:

If you’re interested in this topic I can recommend a book:

Atomic Accidents: A History of Nuclear Meltdowns and Disasters: From the Ozark Mountains to Fukushima

A “delightfully astute” and “entertaining” history of the mishaps and meltdowns that have marked the path of scientific progress (Kirkus Reviews, starred review).

create 3D environments with your phone – early access

Augmented Reality needs proper 3D geometry and the ability to sense the environment to interact with it. At some point I would expect tools to show up that allow us to do some of this ourselves.

Seems like we’re one step closer. Ubiquity6 is reaching out to get early access to interested users:

We’re giving early access to our 3D mapping tools for creators and artists! If you’re interested in trying it out sign up for early access here: https://ubiquity6.typeform.com/to/bmpbkB

Ubiquity6 on Twitter

Of course. I applied. And I’ve just started testing.

BlaspBerry v2

Have you ever wanted a full control over your communication tool ? #SnapOnAir #BlaspBerry v2. A true Qwerty computer KB. @Raspberry_Pi
zero W. @Quectel
3G cellular chip. #Lora RFM95 chip. All opensource.

pwav robot on Twitter

There’s a full twitter thread here. More pictures, more information.

And there’s a GitHub repository with some schematics, configurations and so on…

text replacements for Tokyo ward and kens on iOS and macOS

I am having a hard time learning japanese and reading/writing the kanji especially.

Having to write japanese city names frequently (for example when doing searches) I still do remember the spoken out version of the name but I do not quite yet remember the kanji version. Also I do not want to switch back and forth in keyboard languages.

For this, especially in macOS and iOS there is a nice way around this. With the built-in “Text Replacement” feature of your Mac or iPhone/iPad you can easily mass-import a mapping between the romanized version of a word and the japanese written out kanji version of that word.

While you are typing then you will be presented with recommendation text replacements, effectively the kanjis of what you’ve just tried to write.

see the text recommendations above the keyboard

Unfortunately I do not know a way how to mass-import these text-replacements on iOS.

But if you own a macOS computer and you have it synced over iCloud with your mobile phone or tablet you will likely be able to open the text replacement pane in your system settings and import this plist file into it. Simply drag the file (after unzipping the ZIP file) into the text replacement window.

Download the Tokyo-Text-Replacement.zip file. Extract it (double clicking). And drag the .plist file into the Text Replacement Window.

For you to derive your own files you can find the raw data, a list of all designated Ken and Ward names in Tokyo here:

nodes – a new way to create with code

In Nodes you write programs by connecting “blocks” of code. Each node – as we refer to them – is a self contained piece of functionality like loading a file, rendering a 3D geometry or tracking the position of the mouse. The source code can be as big or as tiny as you like. We’ve seen some of ours ranging from 5 lines of code to the thousands. Conceptual/functional separation is usually more important.

Nodes.io

Nodes* is a JavaScript-based 2D canvas for computational thinking. It’s powered by the npm ecosystem and lives on the web. We take inspiration from popular node-based tools but strive to bring the visual interface and textual code closer together while also encouraging patterns that aid the programmer in the prototype and exploratory stage of their process.
*(not to be confused with node.js)

Hack-The-Planet Podcast: Episode 003

Wir haben wieder etwas aufgenommen. Der Release heute ab 15 Uhr wie gewohnt hier und hier sogar mit Live-Chat.

Diesmal geht es um:

  1. Scanner Pro auf iOS – https://apps.apple.com/us/app/scanner-pro/id333710667 
  2. Scanbot auf iOS – https://scanbot.io/en/index.html 
  3. Abo-Modelle bei Software und Diensten
  4. RING Kamera und Überwachungssystem – https://de-de.ring.com/
  5. Canary Indoor Camera – https://canary.is/
  6. Surveillance Station – https://www.synology.com/en-global/surveillance
  7. Ring has more than 400 police “partnerships” – https://arstechnica.com/tech-policy/2019/08/ring-has-more-than-400-police-partnerships-company-finally-says/
  8. Jumbo Privacy – https://blog.jumboprivacy.com/ – App Store: https://apps.apple.com/us/app/jumbo-privacy/id1454039975?ls=1
  9. Tim Berners-Lee Projekt “Solid”: https://solid.mit.edu/https://en.wikipedia.org/wiki/Solid_(web_decentralization_project)https://solid.inrupt.com/how-it-works 
  10. Ubuntu – https://ubuntu.com/
  11. Throw-Away Remote VNC Linux Desktop in a Docker container – https://www.schrankmonster.de/2019/08/27/a-throw-away-linux-desktop-in-a-container/ 
  12. Virtual Network Computing – https://en.wikipedia.org/wiki/Virtual_Network_Computing
  13. Stephen Wolfram – https://blog.stephenwolfram.com/
  14. Speed of Light in Medium – https://en.wikipedia.org/wiki/Speed_of_light

paint it (very) black

You might, or might not be aware of my passion for black clothing. I like the simplicity and absence of noise.

Anyway. You might not be aware of the wonderful world of black as-in paint.

Apparently the current record holder in blackness (measured in percent absorption of visible light) is a product called “Vanta Black”.

Wikipedia: Wrinkled aluminium foil with a portion—equally wrinkled—coated in Vantablack

Vantablack is a material developed by Surrey NanoSystems in the United Kingdom and is one of the darkest substances known, absorbing up to 99.96% of visible light (at 663 nm if the light is perpendicular to the material).
The name is a compound of the acronym VANTA (vertically aligned carbon nanotube arrays) and the color black.

Wikipedia: Vantablack

Unfortunately this blackest-of-black coating is not readily available for purchase. Export rules apply and so it’s usually not sold to civilians at all.

“What is the next best thing?”, you ask. Well it’s BLACK 2.0.

Functional Threshold Power

I am cycling for fun and for the effect it has on my body and well-being. I do about 30km of cycling every day on average.

After my first stationary trainer broke I bought a new one with the capability to measure wattage and also to apply resistance measured by the watt.

After looking at my average speeds, heart-rates and times on the device I was able to build a quite detailed understanding of the broader picture. What effects my power output and what does not. The effects of nutrition and health to what the body will deliver while being asked the exact same power output curve than the last time.

In a nutshell the numbers tell me that I am usually at a mediocre wattage of 150W constant load doing about 40 km/h average. My reserves usually allow me to go for 1-2 hours without a break doing this.

So far so good. Now I’ve found out from more serious cyclers that there’s something like “Functional Threshold Power“. I do regular have tests at the doctors to check for any heart-rate issues.

Reading about this Functional Threshold Power my curiousity is sparked.

How much could I do? Should I even go for measuring it?

a throw-away remote VNC linux desktop in a docker container

I am running most of my in-house infrastructure based on Docker these days…

Docker is a set of platform-as-a-service (PaaS) products that use operating-system-level virtualization to deliver software in packages called containers. Containers are isolated from one another and bundle their own software, libraries and configuration files; they can communicate with each other through well-defined channels.

All containers are run by a single operating-system kernel and are thus more lightweight than virtual machines.

Wikipedia: Docker

And given the above definition it’s fairly easy to create and run containers of things like command-line tools and background servers/services. But due to the nature of Docker being “terminal only” by default it’s quite hard to do anything UI related.

But there is a way. By using the VNC protocol to get access to the graphical user interface we can set-up a container running a fully-fledge Linux Desktop and we can connect directly to this container.

I am using something I call “throw-away linux desktop containers” all day every day for various needs and uses. Everytime I start such a container this container is brand-new and ready to be used.

Actually when I start it the process looks like this:

As you can see when the container starts-up it asks for a password to be set. This is the password needed to be entered when the VNC client connects to the container.

And when you are connected, this is what you get:

this is what you see after connecting to the desktop container by VNC

I am sharing my scripts and Dockerfile with you so you can use it yourself. If you put a bit more time into it you can even customize it to your specific needs. At this point it’s based on Ubuntu 18.04 and starts-up a ubuntu-mate desktop environment in it’s default configuration.

When you log into the container it will log you in as root – but effectively you won’t be able to really screw around with the host machine as the container is still isolating you from the host. Nevertheless be aware that the container has some quirks and is run in extended privileges mode.

Chromium will be pre-installed as a browser but you will find that it won’t start up. That’s because Chromium won’t start up if you attempt a start as root user.

The workaround:

“–no-sandbox” parameter for Chromium

Now get the scripts and container here and build it yourself!

Password Managers…

I am using 1Password for years now. It’s a great tool. So far.

As I am using it locally synced across my own infrastructure I feel like I am getting slowly but surely pushed out of their target-customer group. What does that mean?

The current pricing scheme, if you buy new, for 1Password looks like this:

So it’s always going to be a subscription if you want to start with it and if you want it in a straight line.

It used to be a one-time purchase per platform and you could set-up syncing across other cloud services as you saw fit. If you really start from scratch the 1Password apps still give you the option to create and sync locally but the direction is set and clear: they want you to sign up to a subscription.

I am not going to purchase a subscription. With some searching I found a software which is extremely similar to 1Password and fully featured. And is available as 1-time purchase per platform for all platforms I am using.

Also. This one is the first that could import my 1Password export files straight away without any issues. Even One-Time-Passwords (OTP) worked immediately.

The name is Enpass and it’s available for Mac, Windows, Linux, iOS, Android and basically acts as a step in replacement for 1Password. It directly imports what 1Password is exporting. And its pricing is:

much more reasonable and without subscriptions.

Subscriptions for services as this are a no-go for me. It’s a commodity service which I am willing to pay for trailing updates and maintenance every year or so in a major update.

I am not willing to pay a substantial amount of money per user per month to just keep having access to my Passwords. And having them synced onto some companies infrastructure does not make this deal sweeter.

Enpass on the other hand comes with peace-of-mind that no data leaves your infrastructure and that you can get the data in and out any time.

It can import from these:

As mentioned I’ve migrated from 1Password in the mere of minutes and was able to plug-in-replace it immediately.

host GIT repositories painlessly

As people around me discuss what to go for in regards to manage their growing number of private GIT repositories I joined their discussion.

A couple of years ago I assessed how I would want to store my collection of almost 100 GIT private repositories and all those cloned mirrors I want to keep for archival and sentimental reasons.

An option was to pay for GitHub. Another option, which most seemed to prefer, was going for a local Gitlab set-up.

All seemed not desirable. Like chaining my workflows to GitHub as a provider or adopting a new hobby to operate and maintain a private GitLab server. And as it might have become easier to operate a GitLab server with the introduction of container management systems. But I’ve always seemed to have to update to a new version when I actually wanted to use it.

So this was when I had to make the call for my own set-up about 4 years ago. We were using a rather well working GitLab set-up for work back then. But it all seemed overkill to me also back then.

So I found: gogs.io

It runs with one command, the only dependency is two file system directories with (a) the settings of gogs and (b) your repositories.

It’ll deploy as literally a SINGLE BINARY without any other things to consider. With the provided dockerfile you are up and running in seconds.

It has never let me down. It’s running and providing it’s service. And that’s the end of it.

I am using it, as said, for 95 private repositories and a lot of additionally mirrored GIT repositories. Gogs will support you by keeping those mirrors in sync for you in the background. It’s even multi-user multi-organization.

Train Melody / 武蔵小杉駅

In hearing distance of the place I am usually staying when in Tokyo is a train station. So if the wind is right and the window is open I hear all these train station chimes and sounds.

If you don’t know what it is, let Wikipedia educate you:

train melody is a succession of musically expressive tones played when a train is arriving at or about to depart from a train station. As part of train passenger operations, a train melody includes a parade of single notes organized to follow each other rhythmically to form a lilting, singular musical thought.

In Japan, departing train melodies are arranged to invoke a relief feeling in a train passenger after sitting down and moving with the departing train. In contrast, arriving train melodies are configured to cause alertness, such as to help travelers shake off sleepiness experienced by morning commuters.

発車メロディ

With this post I also want to have you hear what I mean. These sounds are having interesting pavlovian effects anyways.

before the train exits the station
played beforehand any announcement
doors are closing

Find more here and here and here.

Hack-The-Planet Podcast: Episode 0

A friend of mine started something and I have the honor to be part of it. The world now has one additional podcast to listen to. It’s in german though. For now at least.

We are still working on the website, the feed and the audio mixing and recording quality. So bear with us.

And now: Episode 0 is upon us!

Discover Zaraday!

Prickle-Prickle 5 Bureaucracy: The Apostle Zarathud’s Holyday. A hard nosed Hermit of Medieval Europe and Chaosphe Bible Banger (after his enlightenment, that is). Dubbed “Offender of The Faith”. Discovered the Five Commandments (The Pentabarf).

Zaraday

˙sǝᴉʇᴉʌᴉʇɔɐ ǝʇɐᴉɹdoɹddɐuᴉ ǝpnlɔuᴉ sǝᴉʇᴉʌᴉʇɔɐ ǝʇɐᴉɹdoɹdd∀