Listen to Podcasts

Apartment life involves a lot of chores: cooking, cleaning, folding laundry, etc. Many American housewives watch TV while doing chores, but I do not have a TV. The next closest thing is the radio, but I find it boring to listen to the same news over and over. In Dec 2016, as I scroll through my iPad Mini, I discovered the best activity to accompany chores: podcasts!

A podcast is a series of periodically published digital audio files that a user can download and listen to. iPad Mini comes with a Podcasts app that allows me to search for, subscribe to, download, and listen to podcasts.

My initial subscriptions include:

  • Radiolab, in-depth news stories. It's similar to a magazine, but in an audio format.

    My favorite episode is The Ceremony, a report about how Zcash generated their cryptocurrency parameters.

  • Stranglers, true crime stories about the Boston stranglers. They kept my eyes wide open at nights.

Listening to podcasts improves the quality of my housekeeping, because I do not rush through the chore so that I can switch to more "enjoyable" activities sooner. Instead, I can take my time cleaning the bedroom, while enjoying great audio content. I do have to keep it quiet, so that I can hear what's coming out of the small speaker on the iPad Mini.

Four-key Piano on Fipsy FPGA

The newest addition to yoursunny.com's toy vault is Fipsy FPGA Breakout Board, a tiny circuit board offering a piece of Lattice MachXO2-256 field-programmable gate array (FPGA). After porting an SPI programmer to ESP32, it's time to write some Verilog! Blinky is boring, but I did it anyway. Then, I'm moving on to better stuff: a piano.

The piano is an acoustic music instrument played using a keyboard. When a key is pressed, a hammer strikes a string, causing it to resonate and produce sound at a certain frequency. A normal piano has 88 keys, and each key has a well-defined sound frequency. My "piano", built on Fipsy, has four keys, and uses a passive buzzer to produce sound.

Fipsy FPGA connected to a buzzer and a keypad

Play Tone on Passive Buzzer with FPGA

A passive buzzer plays a tone controlled by an oscillating electronic signal at the desired frequency. In Arduino, the tone() function generates a square wave of a specified frequency, which can be used to control a passive buzzer.

Program Fipsy FPGA Breakout Board from ESP32

MocoMakers is creating Fipsy FPGA Breakout Board, a tiny circuit board offering a piece of Field-programmable gate array (FPGA). I worked with FPGA years ago in class projects, but didn't have access to a device after that. I backed the project, and received two Fipsy boards on Jul 20.

Fipsy is a very simple board: there is no power regulator or USB port. The official method to program the Fipsy is through the SPI port on a Raspberry Pi. It is easy to setup, and is a good use case for my Raspberry Pi Zero W, but there is one problem: It is good practice to power off the circuit when modifying hardware wiring. However, powering off a Raspberry Pi cleanly requires sending a shutdown command and waiting for a few seconds. If I just pull the power cord, I would risk corrupting the filesystem.

ESP32 microcontroller has SPI ports, and can be powered off and restarted very quickly. Can I program Fipsy from an ESP32?

Fipsy connected to Heltec WiFi\_Kit\_32

Hardware side is easy. ESP32 has two available SPI ports, HSPI and VSPI, and I connected Fipsy to the Heltec WiFi_Kit_32's HSPI port. All that remains is deciphering the spaghetti code of the official programmer. After a day of hard work, I got it working:

How to Compile Just One Kernel Module

I received two C.H.I.P computers in 2016. They come with Linux kernel 4.4.13, but the kernel had limited features. When I needed to use the fuse kernel module, I had to re-compile the entire kernel, which took a whole day. Two years later, I upgraded to a newer 4.4.138 kernel, built by community member kaplan2539. The kernel comes with more modules including fuse, which is a better situation than the original kernel.

DM9601 USB Ethernet adapter plugged into a C.H.I.P computer

Recently I acquired a cheap USB Ethernet adapter. When I plugged it in, the kernel recognizes a USB device:

Watch @EmojiTetra Live on ESP32 OLED Display

@EmojiTetra is an online game resembling Tetris, hosted on Twitter platform. Every 20 minutes, the @EmojiTetra account posts a tweet that displays the current game board, along with a four-option poll that allows visitors to vote for the game's next move: left, right, down, rotate, or plummet.

a tweet by @EmojiTetra

I find this game interesting. To watch or participate in @EmojiTetra, I need to unlock my tablet, open Twitter app, search for "EmojiTetra", and scroll past the pinned tweet in order to see the current game move. In total, this process needs 17 taps. Looking at the 0.96 inch OLED display on my Heltec WiFi_Kit_32 board, I'm thinking: can I play @EmojiTetra on an ESP32?

Twitter API

Twitter offers an API that allows applications to retrieve and post tweets. GET statuses/user_timeline resource, for example, retrieves a collection of the most recent tweets posted by a specific user. To watch the game, "user timeline" is exactly what I need to retrieve the current game state.

Moving Dot: How Many Displays Can You Fit on an ESP8266?

In yoursunny.com's toy vault, there is an assortment of LED displays. I'm wondering, how many LED displays can I fit on an ESP8266? So I built this "moving dot" demonstration, with two LED displays and a buzzer.

moving dot demo

The LED matrix serves as the game board. A dot appears on the matrix. In each time step, the dot randomly moves by one pixel or stays in the same position. The 4-digit displays current time step number. Whenever the dot reach any of the four corners, the buzzer plays a piano note selected between C3 and B5.

Hardware

Bill of materials

Yuma Mega

Since my spontaneous visit of Pima Air & Space Museum on my 2015 birthday, I started a tradition of having a little road trip for every birthday. I rode a bike to Sweetwater Wetlands Park to see some birds with Tucson Audubon Society on my 2016 birthday. When my 2017 birthday came close, I planned something big: I wanted to attend the Yuma Mega, the biggest geocaching event in the Southwest region.

Finding the Event

I started geocaching as a hobby in 2013. Geocaching for me is mostly an individual sport: I rode bikes all over Tucson metro area, lift up lamp post covers and poke my hand into guardrails to find mint containers hidden within. Event Caches, on the other hand, are special geocaches that allow geocachers to gather and socialize. I browse Geocaching.com's event listing from time to time, and attend those events regularly. Normally, 15~30 people would show up in a local restaurant or city park. People would tell their stories, and plan out-of-state trips to search for large number of geocaches.

Yuma Mega is not just any event, but a "Mega-Event Cache". Geocaching HQ awards Mega status to events attracting more than 500 geocachers. I heard about Yuma Mega in 2015, but the date was adjacent to a conference trip so I wasn't able to arrange it. 2017's Yuma Mega event falls on Sunday Feb 12, which happens to be my birthday. 2017 is also my last year living in Arizona. It was "now or never", so I have to attend Yuma Mega!

I made up my mind on Nov 24, 2016, and booked a rental car and a motel room for the trip. Both reservations were cancelable in case there's a paper deadline on that weekend, but thankfully there wasn't one, so I'm greenlighted for the trip.

Install OpenCV 3.2.0 on Raspberry Pi Zero W in 15 Minutes

OpenCV, or Open Source Computer Vision Library, is an open source computer vision and machine learning software. It works on Raspberry Pi computers, and can process photos captured by the Raspberry Pi Camera Module.

OpenCV has two supported versions: 2.4.x and 3.x. New features are being added to 3.x branch, while 2.4.x only receives bug fixes and efficiency fixes. It is recommended that new developments should use OpenCV 3.x, to take advantage of new features. However, the official operating system for the Raspberry Pi, Raspbian Stretch, comes with OpenCV 2.4.9. While I am not yet familiar with OpenCV algorithms, one thing notably missing from OpenCV 2.4.9 is a Python 3 binding.

I wanted to have OpenCV 3 running in Raspbian Stretch on a Raspberry Pi Zero W. Unable to find existing packages for Pi Zero and Stretch, I had no choice but to compile my own OpenCV 3. I decided to do it the proper way: build a backported Debian package. This method is superior to installing from the source code, because the packages can easily be deployed to other Raspberry Pi Zero W computers. I followed the Simple Backport Creation instruction, and spent a week building the packages. Now I'm sharing my compiled packages, so that you can use them if you dare.

What You Need