Saturday, June 10, 2017

Sugary Fun

The first project of summer vacation this year was sugar + water.


The first segment was to make hummingbird food for the hummingbird feeder I picked up from Dollar General (technically, it was my kids' Mother's Day present to me). I found many online resources, that most matched this one. The ratio is one part white sugar to 4 parts recently-boiled water (presumably to sterilize it). We followed the admonitions not to add food coloring, nor to change the proportions. I instructed my kids to measure how much the feeder would hold (then water the plants with the excess), and to calculate how much sugar to add to that much water. We then set that aside to cool overnight. I had them sample 1:4 sugar water for reference, and I was informed that hummingbirds are lucky because that's tasty.


If you wanted to continue on the hummingbird theme, here's a collection of hummingbird resources (maps, books, crafts).


The second segment was to make rock candy. The directions varied with the website, from as high as 3:1 down to a moderate 5:2. I went with the super-saturated note from Science Bob and stopped at 1:1 (possibly too low) when the sugar took much, much longer to dissolve in boiling water. I dipped popsicle sticks (made of untreated wood) in the solution, then rolled them in sugar, put clothespins above the sugar level, and placed the sticks in small (to the tall and narrow side) jars to wait for cooling and crystals. Next time, we might add flavors!


And now we wait impatiently for sugar crystals to grow ...


One piece of trivia from my college Optics class is (unverified) that sugar water circularly polarizes light, so you might be able to add on further science ...

Thursday, April 27, 2017

Beans

I read this article, So You Like Flavor? Don't Soak Your Black Beans! at Serious Eats that references an LA Times article, Don't soak your dried beans! Now even the cool kids agree.

That made me wonder How to Soak Dried Beans (from the US Dry Bean Council). They recommend and describe the hot soak method to reduce cooking time and to result in consistently tender beans. I looked up cooking times at How To Cook Dried Beans (from What's Cooking America) and Bean Varieties (from the US Dry Bean Council), giving more credence to the latter. Then I read How To Cook Beans in the Oven (from The Kitchn).

I used to (cold) soak my beans overnight, then cook for 8 hours in the crock-pot. After that research, I have a new method (that takes just about as long).

I pour 2 cups of pinto beans and 10 cups of water into my dutch oven. I heat it to boiling on the stove, then boil for 7 minutes. Now I place the dutch oven inside the oven (for heat retention) for 4 to 24 hours; I usually let the beans sit overnight. Before cooking, I exchange the soaking water (outdoor plants love these nutrients!) with fresh water. I add minced garlic or garlic powder and ground cumin at this point. I return the dutch oven of soaked pinto beans to the oven, and bake at 350 degrees for 2 hours. Around 1 1/2 hours, I add 1/2 teaspoon of salt, stir, and test the beans for done-ness. I expect 6 cups of cooked pinto beans from 2 cups of dried beans.

Thursday, April 13, 2017

VirtualBox and shared clipboard

Based on the number of results from a search, I feel grateful that I haven't had the shared clipboard between the Mac OS X 10.11 host of my work laptop and the Xubuntu 16.04 guest break sooner.

I read the documentation. I read many of the search results, including this older thread. Those commands gave me error messages! (This is useful, not terrible.)

/usr/bin/VBoxClient-all: 31: /usr/bin/VBoxClient-all: /usr/bin/VBoxClient: not found
/usr/bin/VBoxClient-all: 32: /usr/bin/VBoxClient-all: /usr/bin/VBoxClient: not found
/usr/bin/VBoxClient-all: 33: /usr/bin/VBoxClient-all: /usr/bin/VBoxClient: not found
/usr/bin/VBoxClient-all: 34: /usr/bin/VBoxClient-all: /usr/bin/VBoxClient: not found
/usr/bin/VBoxClient-all: 35: /usr/bin/VBoxClient-all: /usr/bin/VBoxClient: not found

I did a directory listing to look at the available VBox scripts, and saw that those were symlinks. Based on that, if I had to guess, the VBoxClient script was renamed to VBoxClient-all without updating the script itself where it called itself. Doh! The simplest fix was not to edit the script giving the errors but to add a symlink for the "old" name. The symlink solution will also aid any other scripts that were also not updated to call the new name.

user@guest:~$ cd /usr/bin
user@guest:/usr/bin$ ls -l VBox*
lrwxrwxrwx 1 root root 27 Jan 18 08:58 VBoxBalloonCtrl -> ../share/virtualbox/VBox.sh
lrwxrwxrwx 1 root root 62 Jan 18 10:06 VBoxClient-all -> /usr/lib/x86_64-linux-gnu/VBoxGuestAdditions/98vboxadd-xclient
lrwxrwxrwx 1 root root 46 Jan 18 10:06 VBoxControl -> /opt/VBoxGuestAdditions-5.0.32/bin/VBoxControl
lrwxrwxrwx 1 root root 27 Jan 18 08:58 VBoxHeadless -> ../share/virtualbox/VBox.sh
lrwxrwxrwx 1 root root 27 Jan 18 08:58 VBoxManage -> ../share/virtualbox/VBox.sh
lrwxrwxrwx 1 root root 27 Jan 18 08:58 VBoxSDL -> ../share/virtualbox/VBox.sh
user@guest:/usr/bin$ sudo ln -s /usr/lib/x86_64-linux-gnu/VBoxGuestAdditions/98vboxadd-xclient VBoxClient
user@guest:/usr/bin$ ls -l VBox*
lrwxrwxrwx 1 root root 27 Jan 18 08:58 VBoxBalloonCtrl -> ../share/virtualbox/VBox.sh
lrwxrwxrwx 1 root root 62 Apr 12 11:04 VBoxClient -> /usr/lib/x86_64-linux-gnu/VBoxGuestAdditions/98vboxadd-xclient
lrwxrwxrwx 1 root root 62 Jan 18 10:06 VBoxClient-all -> /usr/lib/x86_64-linux-gnu/VBoxGuestAdditions/98vboxadd-xclient
lrwxrwxrwx 1 root root 46 Jan 18 10:06 VBoxControl -> /opt/VBoxGuestAdditions-5.0.32/bin/VBoxControl
lrwxrwxrwx 1 root root 27 Jan 18 08:58 VBoxHeadless -> ../share/virtualbox/VBox.sh
lrwxrwxrwx 1 root root 27 Jan 18 08:58 VBoxManage -> ../share/virtualbox/VBox.sh
lrwxrwxrwx 1 root root 27 Jan 18 08:58 VBoxSDL -> ../share/virtualbox/VBox.sh

That might have been sufficient, but I thought this command also sounded promising.

user@guest:/usr/bin$ sudo rcvboxadd setup
Removing existing VirtualBox DKMS kernel modules ...done.
Removing existing VirtualBox non-DKMS kernel modules ...done.
Building the VirtualBox Guest Additions kernel modules ...done.
Doing non-kernel setup of the Guest Additions ...done.
You should restart your guest to make sure the new modules are actually used

And the report after a reboot is: OUCH! Lesson 1: do not try to install the HWE kernel (hardware enablement)! Virtual Box is not happy when you mess with the kernel. (Longer version: installing HWE conflicted with virtualbox-guest-x11 and that's necessary. I thought virtualbox-qt would be sufficient, but that didn't seem to be the case.) Without a skilled administrator, I don't think I would use that VM again! Lesson 2: make a snapshot before kernel upgrades! Or just any ol' time, because backups are good! I suspect the symlink helps too, but overall VBox feet were shot in the process of trying to restore the shared clipboard.

Monday, March 6, 2017

Chocolate Cake

In recognition of this cluster of birthdays, I present my favorite chocolate cake recipe that I have made for many years, originally seen by me on the back of the Hershey's Cocoa container. However, I have discovered some enhancements for that original recipe. Every time I try a different recipe for chocolate cake, I wish I had made that recipe instead (with one exception: this chocolate mug cake with peanut butter: "The One" Chocolate Mug Cake at Budget Bytes).

The first tip I learned in graduate school. One of the other students made the most delicious chocolate cake, so I asked her for the recipe. As she told me, I realized it's the same recipe, so I asked her for her technique instead. She sifted her flour while I, through a combination of following my original recipe that said unsifted flour and laziness (woo hoo! no sifting!), did not. Thank you, Gail! Made with sifted flour, the color of the cake was lighter, the texture softer, the crumb finer, and the overall taste better.

The second tip I learned from reading this posting of that recipe: do not add as much boiling water as listed. Wow, that helped! At this point, I didn't think the recipe could get any better. I'm glad I continued to make minor changes anyway.

I read a blog post (that I can't find now) where the author had used many different brands of cocoa powder to make brownies (I believe). The overall conclusion was that dutch-processed cocoa was preferred by this informal tasting panel. This led me to search for dutch-processed cocoa, and to discover that it's hard to find! I finally found Fair Trade Organic Baking Cocoa from Equal Exchange at Weaver Street. It was on sale, so how could I resist? The chocolate cake was even better! The chocolate taste was simultaneously more gentle and more present: delicious!

At this point, I believe this is the pinnacle of homemade chocolate cake, with those three tips. However, I admit that I am curious to know how much method makes a difference (often, like sifting flour, method makes a tremendous difference). When I was growing up, my mother assured me that The Creaming Method was The Right Way To Make A Cake, but that Two-Stage Method has its supporters too.

Although I couldn't find the post that sent me on the trail of dutched cocoa, I did find some other fun references.


Tangentially related to cocoa powder is the discussion of Baking Powder and Baking Soda at Joyofbaking.com noting the origin of Devil's food cake.

To which I say, have some more chocolate cake. It's for science!

Tuesday, January 10, 2017

How Icy Was It?

My cul-de-sac was quite icy on Monday (yesterday); I'd estimate that there was one 4-foot-square patch of pavement after the snow plow came through twice, and the rest was an inch thick of hard-packed ice. After three days below freezing (yes, even during the daylight hours!), the ice had bonded to the pavement in places. Notice that ice isn't mentioned with "Neither snow nor rain ..." I was expecting a package yesterday, so I looked at the tracking status. Here's what it said:

LOCATION, No Access, We attempted to deliver your item at 5:37 pm on January 9, 2017 in LOCATION but could not complete the delivery because the employee did not have access to the delivery location. Your item will go out for delivery on the next business day.

I maintain that means too much ice!!! However, I'm glad my postal carrier wasn't risking his neck in sub-freezing temperatures after dark trying to deliver a package that can wait until today (should be above freezing in about an hour).

Sunday, November 20, 2016

IPv6, Arduino, and temperature

Referring to what I learned last time, I installed the SparkFun library for the HTU21D. Then I did a simple mash-up of MiniHTTPServer and SparkFun_HTU21D_Demo, and it worked on the first try. I think I spent so much time starting two years ago being frustrated with the uIP library that I guess I don't expect Arduino to be simple, or even to work. However, I can now read temperature and humidity over IPv6 for around $25 from eBay, now that I found a working IPv6 (single-stack) library in EtherSia. I'm not complaining, but it just feels anticlimactic after all those months of arguing with the first Ethernet library to have the second Ethernet library work right away with minimal effort.

Lesson (re)learned: Always use the right tool for the job.

For future reference, this sketch would not work with an Arduino with less memory than the Nano v3; it needs that 2kB of SRAM. My hardware is HTU21D for temperature and humidity, NanoShield and EtherSia for IPv6 Ethernet, and Arduino Nano v3.

My code with EtherSia_ENC28J60:
Sketch uses 12,162 bytes (39%) of program storage space. Maximum is 30,720 bytes.
Global variables use 1,263 bytes (61%) of dynamic memory, leaving 785 bytes for local variables. Maximum is 2,048 bytes.

My code, but claiming EtherSia_W5100:
Sketch uses 11,864 bytes (38%) of program storage space. Maximum is 30,720 bytes.
Global variables use 1,259 bytes (61%) of dynamic memory, leaving 789 bytes for local variables. Maximum is 2,048 bytes.

SparkFun_HTU21D_Demo:
Sketch uses 5,656 bytes (18%) of program storage space. Maximum is 30,720 bytes.
Global variables use 460 bytes (22%) of dynamic memory, leaving 1,588 bytes for local variables. Maximum is 2,048 bytes.

Packet Printer (EtherSia_ENC28J60):
Sketch uses 7,406 bytes (24%) of program storage space. Maximum is 30,720 bytes.
Global variables use 1,053 bytes (51%) of dynamic memory, leaving 995 bytes for local variables. Maximum is 2,048 bytes.

Mini HTTP Server (EtherSia_W5100):
Sketch uses 8,112 bytes (26%) of program storage space. Maximum is 30,720 bytes.
Global variables use 1,025 bytes (50%) of dynamic memory, leaving 1,023 bytes for local variables. Maximum is 2,048 bytes.

Saturday, November 19, 2016

Arduino Nano with IPv6

I haven't touched my Arduino Nanos in a while because they didn't do IPv6 with the arduino_uip library I thought would work. However, I poked around again, and found EtherSia, so I thought I would give it a try. In the intervening time, I have switched from Mac to Linux for my daily driver.

I went to the Arduino Getting Started page, and downloaded the latest version of the IDE for Linux. I connected my Nano v3 that has the FTDI controller, so I selected Tools (menu) > Board > Arduino Nano and Tools > Port > /dev/ttyUSB0. The software selected Tools > Processor > ATmega328 automatically (which is correct for the Nano v3, but not what the hardware-specific page says to expect). I selected the "Blink" sketch (the hardware equivalent of "Hello, World!", from File (menu) > Examples > 01.Basics > Blink), clicked on Verify, clicked on Upload, and my Arduino Nano is blinking at me.

The relevant output line from lsusb for me was:

Bus 003 Device 047: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC

When I run Tools > Get Board Info, I get
BN: Unknown board
VID: 0403
PID: 6001
SN: Upload any sketch to obtain it

No drivers were downloaded; it just worked. Despite knowing that I should quit while I'm ahead (so I can have dinner at a reasonable time), I wanted to try IPv6 from EtherSia! I went to Sketch (menu) > Include Library > Manage Libraries. I put "ethersia" in the Search box, it showed up, I clicked on Install next to the (most recent) version number, and that was just too easy. File > Examples > EtherSia > Minimal. I knew I would want it, so I brought up Tools > Serial Monitor as well. I switched it to 38400 baud (as mentioned in the sketch), and again it just works! I could even ping6 it!

Now I just need to see how it feels about reporting temperature and humidity from HTU21D over IPv6 into my monitoring. That can wait until after dinner!