Raspberry PiZeroW Camera Module

20190913_140539

When you’ve gotten used to Amazon Prime and free shipping, purchasing inexpensive items from other online retailers where the shipping doubles the cost of the item makes it harder to impulse buy items. An item for $5 that costs $7 in shipping often doesn’t get bought. Even a pair of items that cost $16 together that then cost $7 in shipping cause me to delay the purchase.

20190913_143154

Because I was purchasing a Raspberry Pi 4 and Raspberry Pi USB-C Power Supply from Sparkfun, I decided to throw in another Pi ZeroW and case for another $16. I then added the Raspberry Pi Camera module because the case has an optional cover enclosing the camera and I wanted to see how it all worked together. I only wish I’d realized that there was a Noir version, because I’ve always wanted to play with infrared photography.

Having recently streamlined the installation of a Pi Zero, I installed the camera and Pi ZeroW in the case, put the configured micro sd card in place, plugged it into my HDMI monitor just to watch it boot and applied power. I never saw anything on the monitor. The Pi ZeroW only has a single LED, which is generally on, but blinks for micro sd activity. Because I’d closed the case, the LED wasn’t visible, and with no monitor activity I was wondering if I’d gotten a bad board.

20190913_143130

I opened the case and powered it on again, this time I knew I was seeing LED activity. I did a quick search of my network for new devices and found the new board was responding on ssh and appeared to be working correctly other than no HDMI output.  I was even able to take a snapshot with the camera using the command:

raspistill -o image.jpg

I decided to test booting the device without the camera installed. That worked fine, and I had HDMI output during the boot process. Now I started to wonder if perhaps the power supply I was using didn’t provide enough power. Perhaps the camera and the HDMI device were mutually exclusive in the amount of power required

A lot of searching on the web resulted in nothing about the power required for the camera affecting the HDMI output. I found that I might be able to reduce the power requirements by 25mA by turning off the HDMI, but that the Pi ZeroW was already the lowest power draw available. https://www.jeffgeerling.com/blogs/jeff-geerling/raspberry-pi-zero-conserve-energy

I found the tvservice command and the -s option with the camera installed was resulting in a different result from without the camera installed.

pi@WimPiZeroCamera:~ $ sudo /usr/bin/tvservice -s
state 0x40000 [NTSC 4:3], 720x480 @ 60.00Hz, interlaced
pi@WimPiZeroW:~ $ sudo /usr/bin/tvservice -s
state 0xa [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive

At least recognizing that difference was progress. For some reason under Raspian Buster the camera module is causing the HDMI output to be different. I found options in https://www.raspberrypi.org/documentation/configuration/config-txt/video.md that allow me to force the HDMI output to what I want. I changed /boot/config.txt with the following and now I’ve got both camera and video working properly.

# uncomment to force a specific HDMI mode (this will force [HDMI CEA (16) RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive)
hdmi_group=1
hdmi_mode=16

I hope that this helps someone else having problems with both camera and hdmi video output. I don’t know if this was specific to Buster since I never tried it under Jessie or Stretch.

USPS Informed Delivery Daily Digest and Netflix DVDs

I use the USPS service Informed Delivery and highly recommend it. I get a daily email from USPS with a scanned picture of most of the mail that will arrive in my mailbox that day. Occasionally the email will say that there were items that could not be scanned, but it’s very useful since I don’t check my mailbox on a daily basis, but don’t want to have important items sit for extended times.

My mailbox is fairly secure, but I’ve also read that Informed Delivery has both good and bad features for people related to mail theft or identity theft.

I’ve been getting Netflix DVDs in the mail since 2000.  I’ve always been slightly fascinated with the efficiencies the post office and Netflix have worked out. If I take a DVD mailer to my local post office here in Seattle, Netflix recognizes it has been returned the next business day. If I drop a DVD at the local post office on Tuesday, Netflix acknowledges it on Wednesday, and I’ve usually got the next DVD delivered Thursday.

Until recently the Netflix DVDs were scanned like all other mail.

2019-09-13 (3)

It appears to have changed at the beginning of September. Now there’s a pair of fixed images arriving with a link that will take you directly to Netflix.

2019-09-13 (2)

The new behavior isn’t bad since all the Netflix disk scans look very similar, but are interesting to note. I wouldn’t be surprised that the new full color image reduces bandwidth over individual scans along with added benefit of the link to Netflix.

My new favorite WiFi Analysis Program

I recently came across WinFi Lite, and while it claims to be in beta and for professionals only, it’s currently my favorite WiFi analysis program.  The fact that it was in the Microsoft store gives me the idea that it will uninstall cleanly if I decide to get rid of it later.

2019-09-10

The default view shows details about both 2.4 and 5 GHz networks nearby. The first picture was what it looked like when I ran it in my local Starbucks on my Microsoft Surface 4 Pro.  The next picture was what it looked like when I ran it in my apartment. In my apartment I was connected to my network via wired ethernet, so the Surface WiFi adapter wasn’t being used for my active connection. At Starbucks, I was connected to the WiFi.

2019-09-11 (1)

While I was at Starbucks, the number of networks it could see was 188. That number is visible in the top right of the image. Just to the left of that number are a set of buttons that allow you to look at 2.4GHz, 5GHz, or All available networks.

My apartment showed only 161 networks by comparison, but that number was bouncing around as it rescanned in both locations. I was surprised that the Starbucks had so many visible networks. There are a lot of details available in this tool, and it’s current price makes it an interesting tool to work with. I used to like inSSIDer, but the developers choice to dumb down the free version led me to drift away from it.

Headless Raspberry Pi Setup

I’ve been using a raspberry pi as a ADSB data feeder for FlightAware and FlightRadar24 for a while and the micro sd card developed a bad sector. That meant I needed to rebuild the installation. I really didn’t want to deal with connecting a keyboard, monitor, and mouse to the Pi for the installation. I found https://core-electronics.com.au/tutorials/raspberry-pi-zerow-headless-wifi-setup.html giving me useful information on how to avoid all that. I’m documenting my steps here for my own memory.

Step 1. Download the most recent version of Raspian Buster Lite from https://www.raspberrypi.org/downloads/raspbian/

Step 2. Download balenaEtcher portable from https://www.balena.io/etcher/

Step 3. Use Etcher to overwrite an SD card with the Raspian image I downloaded earlier.

2019-09-09 (28)2019-09-09 (29)2019-09-09 (30)2019-09-09 (31)2019-09-09 (33)2019-09-09 (34)

Step 4. Eject the flash card and close Etcher, then insert the flash card again, rejecting the option to format the drive.  The flash card is now formatted with multiple partitions, only the first is easily read in windows.

Step 5. create two files on the sd card boot partition. ssh and wpa_supplicant.conf. ssh is an empty file. wpa_supplicant.conf should have the following contents, customized for your WiFi Network:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US

network={
       ssid="MyNetworkSSID"
       psk="MyNetworkPassword"
}

Step 6. Eject your micro sd card, put it in the Raspberry Pi and power on the raspberry. You’ll need to wait a couple of minutes for the raspberry to finish several steps before you can connect to it over the network. The Raspberry Pi is expanding the native filesystem to fill the available space on the flash card, then rebooting another time with the new filesystem. You’ll need to figure out what IP address the Raspberry retrieved on your network. If you have access to your router, you may be able to see the attached devices and find the new Raspberry that way. I like the NirSoft Wireless Network Watcher to find what’s on my network https://www.nirsoft.net/utils/wireless_network_watcher.html.

Step 7. Connect to the Raspberry Pi with ssh. You’ll be using the default user and password to connect: “pi” and “raspberry”. I used the new Microsoft Windows Terminal in Windows 10 for this example. https://www.microsoft.com/en-us/p/windows-terminal-preview/9n0dx20hk701#activetab=pivot:overviewtab

2019-09-09 (35)

The Raspberry is up and running now. There are several steps I recommend to do immediately. Use sudo raspi-config to set the user password, the machine hostname, and the timezone you want the machine to use.

2019-09-09 (36)2019-09-09 (37)2019-09-09 (38)2019-09-09 (39)2019-09-09 (40)2019-09-09 (41)2019-09-09 (42)2019-09-09 (49)2019-09-09 (50)2019-09-09 (51)2019-09-09 (52)2019-09-09 (53)2019-09-09 (44)

After waiting for the raspberry to reboot and reconnecting via ssh, updating the software to the latest version is the next step.

sudo apt-get update -y
sudo apt-get upgrade -y
sudo shutdown -r now

2019-09-09 (47)

Then I install several tools that I like to have.

sudo apt-get install lighttpd mc mrtg lrzsz nmap dnsutils etherwake snmpd snmp arp-scan shairport-sync -y

My next steps are to get PiAware and FlightRadar up and running.

1970s Rain Jet Sprinkler Install Guide

Recently going through my parents old house documentation we came across this lawn sprinkler installation guide. I especially like the illustrations with Mr. Rain “Chet”.

This was all in a folder labeled Permanent Home Improvements Carrolton Texas. We moved out of this house in 1976. I’m quite happy that so much of my hording of history is purely digital, though it’s not filed as well as my parents paper files.

There was also a full color glossy brochure for Buckner 1972 Lawn and Garden Sprinkler Equipment

Annoying Flashing High Mount Stop Light on newer cars

I know that to some extent I’m yelling at the cloud. I’ve mostly seen this feature on new Toyotas, but I also recently saw it on a new BMW. 

Old Man Yells at Cloud

The CHMSL flashing feature seems to happen when a person first applies the brakes after a period of not using them. It blinks the lamp three times before leaving them on constantly. This feature might be useful when traveling at highway speeds and it’s been a long time since the person has put their foot on the brake, but when traveling in city traffic it seems that the light is just strobing constantly. With modern LEDs there is no warm up time, so it’s like a red strobe light is going off at eye level.

The last update I found on Wikipedia said that the lights were generally not permitted to flash, with a couple of linked rulings from 2010.

My searching for details found various forum questions and answers, including how to add blinkers as after market options, but no details as to where the rules may have changed, or if it’ll be a new requirement going forward.

I certainly hope that it’s a temporary trend that goes away.

iTunes, Microsoft Store, COM Interface Type Library

Several years ago I’d written a program to manipulate data in the iTunes library using the approved Apple COM API. Part of the way this works in a C program is to include a type library in the headers defining all of the function calls. When iTunes is installed in the traditional way, Apple embedded the type library in the executable, and the executable was installed in a traditional location.

#import "C:/Program Files (x86)/iTunes/iTunes.exe"
using namespace iTunesLib;

With the installation of iTunes from the Microsoft store, the iTunes executable no longer lives in that location. Today my application builds properly with the following import command, but it may change mysteriously with version changes and automatic updates via the store.

#import "C:/Program Files/WindowsApps/AppleInc.iTunes_12093.3.37141.0_x64__nzyj5cx40ttqa/iTunes.exe"
using namespace iTunesLib;

My program builds and runs more reliably than it used to, which I’m assuming is in part due to the fact that I appear to now be using a 64 bit version of iTunes, and all the extra work Apple put in to make iTunes more reliable on windows in general.

Finding the iTunes application itself was the hardest part of the transition. I’m happy the API still exists because Apple no longer hosts easy access to the documentation for the API, and http://www.joshkunz.com/iTunesControl/ seems to be the most complete and searchable information.