Building a photobooth with Raspberry Pi and a toy microwave

A few weeks ago I found an old first-generation Raspberry Pi hiding in a closet. At the same time I started investigating WordPress REST API at work. I also wanted an excuse to buy a Dremel. Everything seemed to align when I was strolling by the local Goodwill where my wife found an old toy microwave. Perfect excuses assembled, I had to buy a Dremel to fit a Raspberry Pi, its camera and a screen in a toy microwave to build a photobooth machine.

Several nights after, the hardware is ready. I found a used Dremel on Craigslist: great machine to cut the plastic quickly. I carved an opening in the microwave’s front door and mounted the Landzo display on it. For holding the Pi in place, I used a very low tech hack of wood sticks and glue, plus a rubber band. Unfortunately the first-gen Pi doesn’t have mounting holes on its base and I didn’t want to spend more money on a case. Good enough.

The microwave came with buttons and a LED that I connected to the board’s GPIO: the Start button starts the photobooth app, and the LED blinks while taking pictures. There are 4 more buttons that I will probably connect too for something fun, like show a video of actual food being cooked in the microwave… something for version 2 though.

In the next post I’ll talk a little more about the Python code I modified to use WordPress REST API.

Advertisements

Configure Landzo 7″ Display for Raspberry Pi

I’ve started building a photobooth using one of the first generation Raspberry Pi I found in a drawer. More details are to come. Meanwhile, here are some notes to configure the Landzo 7″ touchscreen display.

The display is sold as compatible with Raspberry Pi and probably it is but it didn’t work out of the box. The box comes with a CD-ROM but I don’t have any way to read that old stuff anymore. The landzo.com website doesn’t seem to host the content of that CD-ROM either.

The Pi doesn’t use the correct video modes for the display out of the box so I had to read the documentation. The gist of it is that you need to add a new custom mode to /boot/config.txt as below:

# uncomment to force a specific HDMI mode (this will force VGA)
hdmi_group=2
hdmi_mode=1
hdmi_mode=87
hdmi_cvt=800 480 60 3 0 0 0

If you’re interested, here is how I got to those numbers. I rebooted the Pi in VGA mode (hdmi_group=1 & hdmi_mode=1) and then ran the tools to interrogate the display:

pi@raspberrypi:~ $ /opt/vc/bin/tvservice -d edid.dat
Written 128 bytes to edid.dat

Parsed the file with the edidparser:

pi@raspberrypi:~ $ /opt/vc/bin/edidparser edid.dat 
Enabling fuzzy format match...
Parsing edid.dat...
HDMI:EDID version 1.3, 0 extensions, screen size 15x10 cm
HDMI:EDID features - videodef 0x80 !standby !suspend !active off; colour encoding:RGB444|YCbCr422; sRGB is not default colourspace; preferred format is native; does not support GTF
HDMI:EDID ignored unknown descriptor tag 0x10
HDMI:EDID ignored unknown descriptor tag 0x10
HDMI:EDID ignored unknown descriptor tag 0x10
HDMI:EDID does not yet know monitor vertical range, setting to default 24 to 120Hz
HDMI:EDID failed to find a matching detail format for 800x480p hfp:40 hs:48 hbp:40 vfp:13 vs:3 vbp:29 pixel clock:32 MHz
HDMI:EDID calculated refresh rate is 66 Hz
HDMI:EDID guessing the format to be 800x480p @70 Hz
HDMI:EDID found unknown detail timing format: 800x480p hfp:40 hs:48 hbp:40 vfp:13 vs:3 vbp:29 pixel clock:32 MHz
HDMI:EDID established timing I/II bytes are 00 00 00
HDMI:EDID standard timings block x 8: 0x0101 0101 0101 0101 0101 0101 0101 0101 
HDMI:EDID adding mandatory support for DMT (4) 640x480p @ 60Hz
HDMI:EDID filtering formats with pixel clock > 162 MHz or h. blanking > 1023
HDMI:EDID no known preferred format has been set
HDMI:EDID filtering preferred group has been changed from Invalid to DMT
HDMI:EDID best score mode initialised to DMT (4) 640x480p @ 60 Hz with pixel clock 25 MHz (score 0)
HDMI:EDID best score mode is now DMT (4) 640x480p @ 60 Hz with pixel clock 25 MHz (score 36864)
HDMI:EDID preferred mode is updated to DMT (4) 640x480p @ 60 Hz with pixel clock 25200000 Hz
HDMI:EDID has only DVI support and no audio support
edid_parser exited with code 0

From there I saw this interesting line:

HDMI:EDID guessing the format to be 800x480p @70 Hz

I know the display’s resolution is 800×480 so that has to be my clue for the new mode. The docs gave me the rest.

hdmi_cvt=<width> <height> <framerate> <aspect> <margins> <interlace> <rb>

Value Default Description
width (required) width in pixels
height (required) height in pixels
framerate (required) framerate in Hz
aspect 3 aspect ratio 1=4:3, 2=14:9, 3=16:9, 4=5:4, 5=16:10, 6=15:9
margins 0 0=margins disabled, 1=margins enabled
interlace 0 0=progressive, 1=interlaced
rb 0 0=normal, 1=reduced blanking

The next challenge is to enable the touchscreen: the driver is probably in the CD-ROM and I haven’t found it online yet.

The Slack-IRC gateway is a trick to lock-in customers

Well, here is another reason to resist using Slack:

[…]when you use /me on the IRC gateway while in private chat with someone, Slack just drops the message on the floor and doesn’t deliver it!

The company brags about their IRC gateway to lure in more groups and teams, but Slack and IRC are two totally different beasts: there will always be an increasing amount of pieces that get lost in translation.

The Slack-IRC gateway is just a trick to lock more users into the walled garden. Resist!

Source: rjbs’s rubric: The Slack IRC gateway drops your messages.

How To Use Vagrant And Git To Develop A WordPress Theme

 

Sometimes I like to sit down and play with technology. My colleague Mike Shroder mentioned VVV a few weeks ago and I had to try it. Check out this tutorial I wrote on how to create a new WordPress site, use Vagrant and git to develop a new theme locally, then push the modifications to a live site running on DreamHost (but it could run anywhere else, really).

Source: How To Use Vagrant And Git To Develop A WordPress Theme

Why the OpenStack community voting process fails and how to fix it

Open source communities offer a lot of democratic participation. The idea that you contribute to a project and have a say in its governance is a powerful one.  When it doesn’t work, those same projects turn their backs on active contributors and discourage newcomers. The most recent OpenStack elections for Individual members to the Board of Directors is a strong example of how community voting fails and how to fix it.

This time I watched the elections from the distance, as much of an outsider as I have ever been. Now that the results are in, I’m very disappointed to see confirmed four Individual board members — half of the total — whose inaction during 2016 should have not granted them reconfirmation.

It’s also extremely sad to see more than a few very active individuals have not been elected.  Of the eight elected, only one works for a smaller company and only one is mostly an OpenStack user (seven are primarily OpenStack vendors). The Individual members of the OpenStack Foundation were added to the bylaws to keep large corporate interests in check, and clearly this doesn’t seem to be working.

The OpenStack community has a huge problem here: good behavior and personal investments to improve the project don’t get rewarded. On the contrary, affiliation with large companies, spammy promotion, and geographic proximity seem to be more effective at granting a seat on the board. This has discouraged participation already, as some backchannel conversations have confirmed. You have to ask yourself, why would someone like Edgar Magana do what he has done for the short time he’s been on the board, when almost-inactive members get the votes?

A couple of immediate actions can be taken to improve the situation. First, acknowledge that an issue exists at the Board level, where too few small organizations and users are represented. Then, stop tolerating abuse of community resources like planet.openstack.org and use of the OpenStack logo. Actions should have followed OpenStack Foundation’s COO Mark Collier reminder to be nice during the campaign. Mark wrote:

With respect to local user groups and web channels, I think they should remain neutral ground that are open to all local community members.

But then the OpenStack logo (that’s another problem, known and unsolved for many years) was used to promote a single candidate as ‘our APAC‘ candidate. Who’s we exactly? OpenStack AU with the logo of the OpenStack Foundation? From my cursory glance at the candidates, there were others in APAC region, but I bet those candidates didn’t have direct access to the OpenStack AU Twitter feed.

OpenStack Australia suggesting to vote for Kavit as 'our APAC candidate'

And the shared Planet OpenStack (which is syndicated to Reddit and other places) was inundated for a week by the same advertising. My attempt to limit the damage to the community and send a signal was blocked.

One more thing: make the pages of the candidates more meaningful. They’re too wordy now, start with the generic bio and offer no link to hard facts. How many of the 3,000 voters actually read their pages (I bet they don’t, and we can easily find out with Google Analytics)? Members pages should show facts, not generic intention to make the world a better place. I always had the vision to collect data from analytics tools and show those in the individual member pages. Stackalytics already offers a pretty comprehensive view of what each person does, not just code-relate but emails, translations, work on bugs, and I bet more can be added from OpenStack Groups portal.

Communities need constant supervision and nurturing, they can’t be left unattended because as quickly as they have formed, they fall apart or at the very least lose critical focus. OpenStack is under tremendous pressure and now more than ever needs dedicated contributors to keep the project at the center of attention.

Wix fights against the GNU GPL creating another license

First Wix took code licensed under the GNU GPL, used it to enhance their code and shipped the combined work under a license not compatible with the GNU GPL, violating the rights of copyright holder Automattic.

Now, they’ve taken code distributed under the MIT license, very permissive, and relicensed under a new license they created ad-hoc. They call the new license “The Enhanced MIT License”, which is exactly like the MIT License, with one exception:

Any distribution of this source code or any modification thereof in source code format, must be done under the Enhanced MIT license and not under any other licenses, such as GPL.

The license file is basically a political manifesto against the copyleft licenses (like the GNU GPL), where they use the derogatory adjective ‘viral’ to describe the persistent nature of the four freedoms granted by the license.

Does this EMIT license conform to the definition of open source? Maybe… but my smell test says this is a messy license.  In the “Official wording” section (the part in legalese) I read:

the licensee is prohibited to change the license of the Software to any “viral” copyleft-type license

But in the FAQ above they say:

if you add/change the source code, the license must be kept as Enhanced MIT license.

which is not the same thing. Has this been reviewed by an attorney? Until it has, I wouldn’t touch this code with a 10-foot pole.

Source: Wix abandons WordPress GPL editor fork in favour of original MIT library – blocks relicensing | React, etc. Tech Stack

Medium is “pivoting”

I’m glad to read Ev Williams finally admitting that:

the broken system is ad-driven media on the internet. It simply doesn’t serve people. In fact, it’s not designed to.

He’s a smart person, I’m sure the next iteration of Medium will be interesting, no matter what the outcome will be.

Source: Renewing Medium’s focus