summaryrefslogtreecommitdiff
path: root/content/post
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2016-05-24 19:46:37 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2016-05-24 19:46:37 +0200
commitbd8464abb8deee0d31bb84cc47cd3335c0e688d5 (patch)
treecea507ae72e1b5fda03ae6dc5c6d3cae2436a7cc /content/post
parent55439cd6455232057c9c08202c853c1f5201d79f (diff)
downloadblog-bd8464abb8deee0d31bb84cc47cd3335c0e688d5.tar.gz
blog-bd8464abb8deee0d31bb84cc47cd3335c0e688d5.zip
move posts into 'tech' section
Diffstat (limited to 'content/post')
-rw-r--r--content/post/audio-output-to-input.md15
-rw-r--r--content/post/blinkiecar.md36
-rw-r--r--content/post/esp8266.md16
-rw-r--r--content/post/internet-is-magic.md43
-rw-r--r--content/post/kindle-as-screen.md27
-rw-r--r--content/post/lilypad-bootloader.md48
-rw-r--r--content/post/music-led-visualisation.md25
-rw-r--r--content/post/raspberry-pi-router.md30
-rw-r--r--content/post/raspberrypi-bootstrapping.md109
-rw-r--r--content/post/transmission-stalling.md10
-rw-r--r--content/post/weather-snowman.md38
11 files changed, 0 insertions, 397 deletions
diff --git a/content/post/audio-output-to-input.md b/content/post/audio-output-to-input.md
deleted file mode 100644
index cc36313..0000000
--- a/content/post/audio-output-to-input.md
+++ /dev/null
@@ -1,15 +0,0 @@
----
-categories:
-- software
-date: 2015-11-28
-title: Route audio output to input
----
-
-To be able to visualize my laptop's sound output with a python script, I needed an extra audio input that made it possible to capture the system's audio output.
-
-To achieve that, I did the following on my Raspberry Pi:
-
- * install alsa-utils and pulseaudio
- * get the pulseaudio init script [here](https://www.raspberrypi.org/forums/viewtopic.php?p=619713#p619713)
- * add the users to the group "pulse-access", I got `ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect` without it even as root
- * [create an ALSA monitor source](https://wiki.archlinux.org/index.php/PulseAudio/Examples#ALSA_monitor_source)
diff --git a/content/post/blinkiecar.md b/content/post/blinkiecar.md
deleted file mode 100644
index c0a88d4..0000000
--- a/content/post/blinkiecar.md
+++ /dev/null
@@ -1,36 +0,0 @@
----
-categories:
-- embedded
-date: 2015-12-21
-title: Blinkiecar - 3D printed car with turn signals
----
-
-With some support from a friend with a 3D printer, I successfully built a magnetic car with working turning lights.
-
-![car front view](/images/blinkiecar/finished-front.jpg")
-
-_Right, it's a present._
-
-The car was printed in two pieces, the top and the bottom part. My friend downloaded the model from somewhere, I repaired it with [netfabb](http://www.netfabb.com/) (didn't like their software due to an annoying startup dialog and paid features), cut it with [slic3r](http://slic3r.org) (this program looked better) and gave him the [repetier](http://www.repetier.com/)-converted model back.
-
-![car without top part](/images/blinkiecar/wip.jpg)
-
-_This is how it looks on the inside._
-
-Inside the car is a 3.3V coin cell battery, which is connected to two switches and orange blink LEDs on the bottom of the car. You turn the switch on either the left or the right side on and thereby make the corresponding turn light blink.
-
-A strong magnet from an old hard drive is glued below the car so you can stick it onto a magnetic board.
-
-![magnet below car](/images/blinkiecar/magnet.jpg)
-
-_The magnet also covers the circuit a bit._
-
-The blink LEDs are not in sync for some reason, but that did not matter as they still function as turning lights.
-
-![both leds blinking](/images/blinkiecar/blink-both.gif)
-
-_You can still try to use them as warning lights, but that's not reliable._
-
-![front right led blinking](/images/blinkiecar/blink-right.gif)
-
-Next time, I should think of another solution for power - with this setup, you cannot swap the battery and the LEDs are quite dark.
diff --git a/content/post/esp8266.md b/content/post/esp8266.md
deleted file mode 100644
index bacb235..0000000
--- a/content/post/esp8266.md
+++ /dev/null
@@ -1,16 +0,0 @@
----
-categories:
-- embedded
-date: 2015-10-14
-title: Quick guide - Flashing an ESP8266
----
-
-Get an FTDI, the Arduino IDE, add the ESP8266 plugin to the IDE.
-
-Then connect TX↔RX, RX↔TX, GND↔GND, VCC↔3V and CHPD↔3V.
-
-To enter the flashing mode, connect GPIO0↔GND. Then briefly touch RST↔GND.
-
-After flashing, disconnect GPIO0 from GND.
-
-RX and TX can later be used as GPIOs. The blue led is on when TX is low.
diff --git a/content/post/internet-is-magic.md b/content/post/internet-is-magic.md
deleted file mode 100644
index 1d21027..0000000
--- a/content/post/internet-is-magic.md
+++ /dev/null
@@ -1,43 +0,0 @@
----
-categories:
-- embedded
-date: 2015-10-29
-title: Internet is magic - Glowing ponies show your friends' online status
-aliases:
-- /2015/10/29/internet-is-magic.html
----
-
-Friendship is magic! I like the My Little Pony series, and two of my best friends, knowing that, surprised me with self-made versions of Twilight and Fluttershy at my birthday.
-
-![Twilight and Fluttershy](/images/internet-is-magic/twilight-fluttershy.jpg)
-
-_Aren't they adorable?_
-
-As you can see in the picture, I grabbed some diffused LEDs and illuminated my ponies.
-
-That was kind of unexciting after a while. Luckily, I had an [ESP8266](https://en.wikipedia.org/wiki/ESP8266) to spare. These modules are small Arduino compatible WiFi modules, so with some programming knowledge you can control GPIOs via WiFi.
-
-Awesome! Let's connect the ponies to the world wide web.
-
-![Inside view](/images/internet-is-magic/inside.jpg)
-
-_Not much to see here_
-
-I wrote a quick-and-dirty Arduino sketch, [uploaded it]({% post_url 2015-10-14-esp8266%}) and was able to control the LEDs via netcat. You can find the sketch [here](https://git.schneefux.xyz/?p=internet-is-magic;a=blob;f=luminate.ino;hb=HEAD).
-
-![Twilight glows](/images/internet-is-magic/twilight-glow.jpg)
-
-_The cables in the background supply power._
-
-And now comes the fun part. Both of my friends chat with me via [Telegram](https://telegram.org). Unlike WhatsApp, Telegram has an open API that allows me to easily receive their online status.
-
-I installed the [telegram-cli](https://github.com/vysheng/tg) client on my [Raspberry Pi](https://raspberrypi.org), a cheap and small computer, and set up an autostart script. telegram-cli runs in bot mode, a python script updates the LEDs every minute. I uploaded the script [here](https://git.schneefux.xyz/?p=internet-is-magic;a=blob;f=client.py;hb=HEAD).
-
-So whenever my friends are online, their corresponding pony starts to glow.
-
-![Fluttershy glows](/images/internet-is-magic/fluttershy-glow.jpg)
-![Twilight and Fluttershy glowing in the dark](/images/internet-is-magic/night.jpg)
-
-_When they light up at night, you can feel the magic._
-
-If you want to build something similar to this, be sure to ask your friends whether it's okay for them that you monitor their presence all day long.
diff --git a/content/post/kindle-as-screen.md b/content/post/kindle-as-screen.md
deleted file mode 100644
index 130592c..0000000
--- a/content/post/kindle-as-screen.md
+++ /dev/null
@@ -1,27 +0,0 @@
----
-categories:
-- software
-date: 2013-10-26
-title: Use your Kindle as VNC viewer
----
-
-I could mod my Kindle so I can now use it as screen for the RaspberryPi.
-
-This is what I did with my Kindle 4 NT:
-
-1. [Jailbreak](http://wiki.mobileread.com/wiki/Kindle4NTHacking#Jailbreak)
-2. [Install USBNetwork](http://wiki.mobileread.com/wiki/Kindle4NTHacking#SSH)
-3. [Get KindleVNC viewer](http://www.mobileread.com/forums/showthread.php?t=150434)
-4. Connect your Kindle via USB to a GNU/Linux computer. ssh into it like so (the root password doesn't exist, you can type in anything):
-`sudo ifconfig usb0 192.168.15.2` `ssh root@192.168.15.244`
-5. Start the vnc viewer with `/mnt/us/kindlevncviewer/kvncviewer.sh 192.168.15.2:0 &`
-6. Here is a script to autostart the viewer:
-
-``` bash
-sudo ifconfig usb0 192.168.15.2
-sudo x11vnc -scale 800x600 -display :0 &
-sleep 8
-sshpass -p asdf ssh root@192.168.15.244 /mnt/us/kindlevncviewer/kvncviewer.sh 192.168.15.2:0 &
-```
-
-Do not forget to enable USBNetworking, otherwise it won't work. You can do so with [KUAL](http://www.mobileread.com/forums/showthread.php?t=203326).
diff --git a/content/post/lilypad-bootloader.md b/content/post/lilypad-bootloader.md
deleted file mode 100644
index 8910839..0000000
--- a/content/post/lilypad-bootloader.md
+++ /dev/null
@@ -1,48 +0,0 @@
----
-categories:
-- embedded
-date: 2016-01-02
-title: Burning an Arduino's bootloader
----
-
-Some long time ago, I bought some cheap Arduino LilyPad clones from Amazon. I spent weeks trying to get them work, but was heavily frustrated. No matter what I did, avrdude refused to upload my sketch:
-
-``` c
-avrdude: Send: 0 [30] [20]
-avrdude: Send: 0 [30] [20]
-avrdude: Send: 0 [30] [20]
-avrdude: ser_recv(): programmer is not responding
-avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
-```
-
-Somehow I found out that I was able to upload my sketch [without using the bootloader](https://www.arduino.cc/en/Hacking/Programmer) with an ISP (I used an [Arduino Uno](https://www.arduino.cc/en/Tutorial/ArduinoISP)).
-
-That was still not satisfying.
-
-Here is how I debugged:
-
- * Check that the FTDI is working. Connect the FTDI's RX to its TX (nothing else!) and send data over the serial console. You should receive what you sent.
- * Check that the Arduino is working. In my case, an LED started to blink as soon as I connected GND to GND and VCC to 3V/5V (depending on the board).
- * Check that the Arduino is receiving data. Connect GND and VCC, then connect the FTDI's TX to the pin of the Arduino that you think was RX. Now send random data to the Arduino (for example with `cat /dev/random > /dev/ttyUSB0`), the RX LED on the Arduino should blink. In my case, it didn't. It turns out that the manufacturer swapped RX and TX or that I am misreading the datasheet.
- * Now try to look at the verbose output while uploading. You can also try to push the reset button.
- * Verify that the Arduino itself is working, but the bootloader isn't. Attach an ISP and upload a sketch without the bootloader (see above), or just click "burn bootloader" in the IDE.
-
-So I knew that something was wrong with the bootloader. What next?
-
-I had a hard time figuring that out, but in the end it turned out to be quite simple:
-
-"Unlock" the bootloader's fuses. This is a protection mechanism to prevent you from changing the bootloader accidentally. On my laptop and with the LilyPad, the command was `/usr/share/arduino/hardware/tools/avr/bin/avrdude -C/usr/share/arduino/hardware/tools/avr/etc/avrdude.conf -v -patmega328p -cstk500v1 -P/dev/ttyUSB0 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0x05:m -Uhfuse:w:0xDA:m -Ulfuse:w:0xFF:m`. I simply copied it from the Arduino IDE's verbose output after I clicked "burn bootloader".
-
-Find the right bootloader. I guessed. On the LilyPad's Atmel is written "MEGA328P", so I could be sure that I needed some kind of bootloader for the atmega328. In `/usr/share/arduino/hardware/arduino/avr/bootloaders`, I looked for hex files with "328" in their names: `find -iname "*atmega328*.hex"`
-
-``` bash
-./optiboot/optiboot_atmega328.hex
-./optiboot/optiboot_atmega328-Mini.hex
-./bt/ATmegaBOOT_168_atmega328_bt.hex
-./atmega/ATmegaBOOT_168_atmega328.hex
-./atmega/ATmegaBOOT_168_atmega328_pro_8MHz.hex
-```
-
-I found five different bootloaders. It couldn't be the third, because usually "bt" is an abbreviation of "bluetooth" and my LilyPad did not have built-in bluetooth. It wasn't some kind of "Mini" variant, either. The Arduino IDE itself burns the "_pro_8MHz" hex file, as can be seen in its output. So I tried the optiboot bootloader. I copied the IDE's command and replaced the path with optiboot's: `/usr/share/arduino/hardware/tools/avr/bin/avrdude -C/usr/share/arduino/hardware/tools/avr/etc/avrdude.conf -v -patmega328p -cstk500v1 -P/dev/ttyUSB0 -b19200 -Uflash:w:/usr/share/arduino/hardware/arduino/avr/bootloaders/optiboot/optiboot_atmega328.hex:i -Ulock:w:0x0F:`
-
-Again, I tried uploading the sketch. Bummer, "programmer is not responding" again. So optiboot obviously does not work. I tried the last bootloader - unlock the fuses, burn the bootloader, upload a sketch - aaaaaaand it worked! I was freaking out. It seems that the clone does not ship the "pro_8MHz" variant.
diff --git a/content/post/music-led-visualisation.md b/content/post/music-led-visualisation.md
deleted file mode 100644
index f7d5c12..0000000
--- a/content/post/music-led-visualisation.md
+++ /dev/null
@@ -1,25 +0,0 @@
----
-categories:
-- software
-date: 2016-02-13
-title: Visualize music with MPD and an LED strip
----
-
-With Arduinos, 5050 RGB LED strips, Hyperion and MPD on a Raspberry Pi I created a low cost party lightning environment.
-
-![First test results](/images/music-led/led-floor.jpg)
-
-_First tests show that the setup seems to work._
-
-The setup consists of cheap RGB LED strips, 2 \* 5 meters, powered by two 12V 3.5A adapters and an Arduino with three TO-120 transistors each.
-For strips with 30 LEDs per meter, you need 0.5A per meter. To be safe, add additional 10% to the total. So for my 10 meters, I could also have used a single adapter with at least 5.5A.
-The Arduino's GPIOs are not nearly able to supply 5.5A \* 12V = 66W, so we need transistors - either darlington transistors or MOSFETs. [Adafruit](https://learn.adafruit.com/rgb-led-strips/usage) has more information and detailed explanations. After wiring, the Arduino needs to be flashed with a software that communicates with the Raspberry Pi. I adapted a sketch that implements the Adalight protocol, you can find it [here](https://git.schneefux.xyz/?p=mpd-rgb-vis;a=blob;f=adastrip.ino;hb=HEAD).
-
-The Raspberry Pi as server runs [Hyperion](https://github.com/tvdzwan/hyperion) which is AmbiLight-like. On the same host, MPD outputs music to speakers and a FIFO. I wrote a Hyperion plugin that processes the output of the FIFO and thus visualizes the music that is currently be played. The plugin and more installation instructions are [here](https://git.schneefux.xyz/?p=mpd-rgb-vis;a=blob;f=README.md;hb=HEAD). In my case, I started two Hyperion daemons, because I had two Arduinos connected and it is currently not possible to output the same data to two Hyperion compatible devices.
-
-Initially, I planned using an ESP8266 instead of the Arduino. I had not the right parts to step down 12V to 3.3V and tried to hack something together with LEDs and a 7V-3.3V-stepdown converter.
-Well… that didn't work out quite well. I used Arduino Unos instead.
-
-![Failed attempt of connecting an ESP8266](/images/music-led/controller-failed.jpg)
-
-_Do not reproduce, this fries the ESP…_
diff --git a/content/post/raspberry-pi-router.md b/content/post/raspberry-pi-router.md
deleted file mode 100644
index 8e51d6f..0000000
--- a/content/post/raspberry-pi-router.md
+++ /dev/null
@@ -1,30 +0,0 @@
----
-categories:
-- software
-date: 2014-08-05
-title: Use your Raspberry Pi as WiFi router
----
-
-Using [this guide](http://www.daveconroy.com/turn-your-raspberry-pi-into-a-wifi-hotspot-with-edimax-nano-usb-ew-7811un-rtl8188cus-chipset/) I successfully turned my Raspberry Pi with an Edimax WiFi dongle into a WiFi hotspot.
-Here's how:
-
-- setup customized hostapd
-- setup dhcp server
-- configure NAT
-
-My network layout looked like this:
-
-``` c
-internet - router - Pi - tablet
- |
- |---- PC
-```
-
-Now the tablet is able to connect to the PC, but not the other way round.
-To fix this, add a route to the PC's IP configuration:
-
-``` bash
-ip route add -net $PI_NETWORK netmask 255.255.255.0 gw $PI_IP
-```
-
-Replace `$PI_NETWORK` and `$PI_IP` with your own values.
diff --git a/content/post/raspberrypi-bootstrapping.md b/content/post/raspberrypi-bootstrapping.md
deleted file mode 100644
index 20ca0d8..0000000
--- a/content/post/raspberrypi-bootstrapping.md
+++ /dev/null
@@ -1,109 +0,0 @@
----
-categories:
-- embedded
-date: 2016-01-30
-title: Installing Arch Linux ARM on a Raspberry Pi
----
-
-My cheat sheet for deploying multiple Arch Linux machines, Raspberry Pis here.
-Installs `pacserve`, `rngd` and `yaourt` in a btrfs subvolume `root`. To allow local users to poweroff, `polkit` is also installed.
-
-# Filesystem setup
-See also the [Archlinux ARM guide](http://archlinuxarm.org/platforms/armv6/raspberry-pi).
-
-Change `sdx` to `sdb`/`sdc`/…
-``` bash
-sudo fdisk /dev/sdx
-sudo mkfs.btrfs /dev/sdx2
-sudo mkfs.vfat /dev/sdx1
-mkdir -p tmp/{r,b}oot
-cd tmp
-sudo mount /dev/sdx2 root
-sudo btrfs subvolume create root/root
-sudo umount root
-```
-
-# Copying the files
-Use `ArchLinuxARM-rpi-2-latest.tar.gz` for the Raspberry Pi 2 or 3.
-``` bash
-wget http://archlinuxarm.org/os/ArchLinuxARM-rpi-latest.tar.gz
-sudo mount /dev/sdx1 boot
-sudo mount -o subvol=root,autodefrag,compress=lzo /dev/sdx2 root
-sudo su -c "bsdtar -xpf ArchLinuxARM-rpi-latest.tar.gz -C root" && sync
-sudo mv root/boot/* boot
-sudo umount boot
-sudo mount /dev/sdx1 root/boot
-```
-
-# QEMU chroot
-[Optional](https://wiki.archlinux.org/index.php/Raspberry_Pi#QEMU_chroot). You can skip this and power the Pi up instead.
-
-``` bash
-sudo cp /usr/bin/qemu-arm-static root/usr/bin
-sudo arch-chroot root /bin/bash
-```
-
-# Configuration
-``` bash
-echo "root=/dev/mmcblk0p2 rootflags=subvol=root,autodefrag,compress=lzo rw rootwait console=tty1 elevator=deadline" > /boot/cmdline.txt
-sed -i "s/gpu_mem=64/gpu_mem=16/" /boot/config.txt
-
-cat << EOF >> /boot/config.txt
-start_file=start_x.elf
-fixup_file=fixup_x.dat
-start_x=1
-EOF
-
-sed -i '/\[options\]/a CacheDir = /var/cache/pacman/pkg/' /etc/pacman.conf
-sed -i '/\[options\]/a CleanMethod = KeepCurrent' /etc/pacman.conf
-cat << EOF >> /etc/pacman.conf
-[archlinuxfr]
-SigLevel = Never
-Server = http://repo.archlinux.fr/arm
-
-[xyne-any]
-Server = http://xyne.archlinux.ca/repos/xyne
-EOF
-```
-
-# Package installation
-``` bash
-pacman -Syu --needed pacserve git yajl rng-tools polkit archlinuxarm-keyring archlinux-keyring base-devel
-systemctl enable pacserve rngd
-echo 'RNGD_OPTS="-o /dev/random -r /dev/hwrng"' > /etc/conf.d/rngd
-echo "alarm ALL=(ALL) ALL" >> /etc/sudoers
-pacman.conf-insert_pacserve > /tmp/pacman.conf
-mv /tmp/pacman.conf /etc/pacman.conf
-su alarm
-cd
-git clone https://aur.archlinux.org/package-query.git
-cd package-query
-makepkg -s
-mv package-query*.tar.xz /tmp
-cd ..
-rm -rf package-query
-exit
-pacman -U /tmp/package-query*.tar.xz
-pacman -S yaourt
-exit
-```
-
-`sudo umount root/boot root` or `reboot`
-
-# Post installation (on the Pi)
-SSH into alarm with password alarm. root password is root, but SSH login for root is by default disabled.
-``` bash
-sudo hostnamectl set-hostname xxx
-sudo timedatectl set-timezone Yourtime/zone
-sudo vi /etc/systemd/timesyncd.conf
-sudo timedatectl set-ntp true
-sudo pacman-key --init
-passwd
-sudo passwd
-```
-
-# Troubleshooting
-Can't unmount for some reason? Use the hammer (not recommended): `sudo fuser -km mntpoint || sudo umount -l mntpoint`
-
-# Further information
-For more, see [the Arch wiki](https://wiki.archlinux.org/index.php/Raspberry_Pi).
diff --git a/content/post/transmission-stalling.md b/content/post/transmission-stalling.md
deleted file mode 100644
index 4f4df93..0000000
--- a/content/post/transmission-stalling.md
+++ /dev/null
@@ -1,10 +0,0 @@
----
-categories:
-- software
-date: 2016-01-02
-title: Fix transmission not downloading anything
----
-
-I experienced a weird issue on my NAS where transmission suddenly stopped downloading my torrents. It showed "Downloading from 0 of 0 connected peer(s)" for hours!
-
-After some experimenting, I found out that in the individual torrent's properties there was the option "Maximum peers", which was apparently set to 1. Increasing it changed everything: Now that torrent had peers and even web seeds.
diff --git a/content/post/weather-snowman.md b/content/post/weather-snowman.md
deleted file mode 100644
index c55edcb..0000000
--- a/content/post/weather-snowman.md
+++ /dev/null
@@ -1,38 +0,0 @@
----
-categories:
-- embedded
-date: 2015-12-12
-title: Weather snowman - Embedded LED forecast
----
-
-It's christmas time! As a kind of pre-christmas gift, I built an Internet of Things enabled snowman for one of my best friends.
-
-Like in [my last project]({{< ref "internet-is-magic.md" >}}), I used an ESP8266 again, some LEDs and an old acrylic snowman that I cut open.
-
-![blue glowing snowman](/images/weather-snowman/snowman-glowblue.jpg)
-
-_The electronics were cheaper than the snowman._
-
-Inside the snowman was a fading RGB led, a switch and batteries. Boring!
-
-I replaced it with the ESP8266, which had 3 LEDs attached to it (red, green, blue). Via a USB cable and a voltage converter, I powered it:
-
-![inside setup](/images/weather-snowman/leds.jpg)
-
-_Luckily, you don't see how messy it really becomes once you put all this in that tiny snowman…_
-
-![inside setup, top view](/images/weather-snowman/leds-esp.jpg)
-
-Coding took a while.
-
-The ESP creates a wireless access point with a web server after powerup and asks you to enter your WiFi credentials. After first setup and whenever the module is started again, it connects to your wireless network and queries [OpenWeatherMap](http://openweathermap.org/) every hour for a 3 hour forecast.
-
-Depending on the forecast, the blue and red LEDs glow in different patterns. If a rainy day is to be expected, the top red LED lights up and the bottom blue LED fades in and out. A storm at night is displayed via a deep blue head and a blinking snowman's body.
-
-If you inspect [the source code](https://git.schneefux.xyz/?p=weather-snowman;a=tree), you'll see that there also is an Android app. The app simplifies the setup and runs a background service that makes your snowman's green LED flash on new notifications.
-
-![new notification snowman](/images/weather-snowman/snowman-blink.jpg)
-
-_Gotta check my mails._
-
-![blue and red glowing snowman](/images/weather-snowman/snowman-glowbluered.jpg)