Tuesday, December 23, 2014

TIL: 3-way CFL bulb

I have a set of reading lamps, one everywhere we might sit and read, all with 3-way CFL bulbs. The lamp I use most often only had two settings: two clicks for OFF, two clicks for ON. Since I've had many 3-way incandescent bulbs before, I shrugged, and thought, "that's how it always goes: one filament burns out long before the other." I knew it was CFL, but I didn't put much thought into that because the "failure" mode was familiar. Tonight I decided to replace that bulb. And that's when I discovered it wasn't screwed in all the way. As soon as I screwed the original 3-way CFL bulb in all the way, it had four states again: HIGH, MEDIUM, LOW, and OFF. Now I wish I had checked sooner!

Friday, December 19, 2014

CLI to Google Calendar

After a few weeks of missing my old cli access to Google Calendar, and pushing the Try It! button with no success (yes, I customized it, but no, what I tried didn't work for me), I went looking (again) for another tool.

Hurrah! Look to gcalcli!

First I tried "pip install gcalcli; pip install vobject parsedatetime" but "which gcalcli" came up empty. I read the log file mentioned at the end of the pip install, ran a search on the most obvious error message, and re-ran it with sudo. Now it's working! I recommend "gcalcli list" to start.

The command I expect to use most often is

gcalcli --calendar 'Calendar' --title 'what is it' --where there --when '12/19/2014 10:00 PM' --duration 60 --description 'yay for description field finally!' add --details url
, and next
gcalcli --calendar 'Calendar' quick 'quick add text' --details url
(possibly). I have always wanted to be able to populate the description from the command line, but APIv2 only supported what's in Quick Add. Now that I've got another easy tool, I can forgive APIv3 for moving my cheese since it supports a feature I wanted.

Now if you'll excuse me, I need to pound on this new command line tool ...

Update: Oh, it works so well! I start at Spot the Station, I remove the irrelevant lines (too early, too short, or too low) with PrintWhatYouLike, and then I copy the remaining (relevant) lines.

That then becomes the starting point to fun with regular expressions! Although pbpaste is a Mac OS X tool hailing back to the NeXT days, Linux has tools like xsel and xclip that I hope are roughly equivalent.

clear; pbpaste | awk -F $'\t' '{ print "gcalcli --calendar \"Calendar Name\" --title \"ISS sighting\" --where \"Durham, NC\" --reminder 20 --when \""$1"\" --duration "$2" --description \""$3" max elevation, "$4" approach, "$5" depart\" add --details url" }' | sed 's/\ min\ /\ /g;s/\ above/°\ above/g'; echo

I like to glance at the commands before running them, just to be sure I haven't made some hideous formatting error about to be replicated at the speed of automation, and I like to check at least one of the resulting URIs to be sure the calendar entry survived the transfer. So far, so great!

Friday, December 5, 2014

TIL: Tube Wraps

I looked at these reindeer printable wraps for tp tubes for a minute before running to the bathroom to test my idea. (That's where I could find an empty tp tube, of course!) I measured it, then tested against another brand that of course had slightly different measurements so your mileage may vary.


You do need to be lucky on the intersection of paper sizes (US Letter in my case) and tube sizes, but today I learned you can get four tp tube wraps on a single sheet of paper! I'm thinking of printing some faces, and letting my young artist color to his heart's content! Then my young builder can assemble the village, and peace will reign while they are happily decorating.

Thursday, December 4, 2014

Bumps on the Arduino

So it hasn't been smooth sailing since I installed the Arduino libraries. This is why I was taking baby steps.

I followed the Adafruit directions for the HTU21D temperature and humidity sensor, and got ... nothing. Really nothing. One of my desperate ideas was to look for other libraries. I found SparkFun's HTU21D library, complete with a tutorial. The difference between the two libraries is that SparkFun has two error codes, 998 if sensor is not detected, and 999 if CRC is bad. I saw a whole lot of 998, and that was very helpful. No one likes to hit an error condition, but do you know what's worse? An error condition without an error message somewhere! I removed the Ethernet shield from the system. I ran Blink again just to be sure of my baseline. I ran a lot of continuity tests. (Tip: I always need at least one multimeter with the audible continuity feature.) I read the example code comment "use inline 330 ohm resistor if your board is 5V" and added resistors because my Nano is a 5V board. (Sadly, I didn't have any 330Ω resistors in my supplies. I did have a bag of 120Ω resistors from a long time ago, to use as signal terminators.) I ran even more continuity tests. I checked the 3V3 output voltage (3.28V) and the data line resistances (both about 360Ω). I think it's a dead sensor, possibly zotted before I added the inline resistors.

So, on to the ENC28J60 Ethernet shield for Nano. Again, the sample code didn't work. I tried EchoServer and TcpServer. I modified the example code to use a valid legacy IPv4 address (I decided the first test could be IPv4, even if my end goal is not to use legacy) on my home network, but I couldn't ping it, and I couldn't telnet to port 1000 on it. Additionally, my router didn't have a complete entry for it in its ARP table. Also, the link lights on the shield were off far more often than on. I ended up re-cabling everything in my computer room, both to simplify cables and connections, and to move the little unmanaged switch for extra ports to my desk so I could watch its blinking lights as well. Based on the indicators (no link lights on the ethernet shield, no link lights on the little switch, and no ARP entry on the router), I have to think this one is also dead. However, I also need to test this suggestion before giving up.

Yes, I think it's rather odd that two out of three components aren't working, and the two peripherals at that. It's possible that I need to work on some intermediate steps, to learn more about Arduino. Gee, more tinkering ...

Sunday, November 30, 2014

Google Calendar Sadness

I had been looking up ISS passes then adding to Google Calendar using the command line for a long time, but the last time I tried, it wouldn't work. After a quick search, that's because Google Calendar API v2 was deprecated on November 17, 2014. (I bet that's when my default calendar colors changed to garish, too.) There's one newer version of gdata-python-client than what I have installed, but since it was released more than a year before the the deprecation date, I doubt it uses APIv3.

From the look of the new client libraries, it's no longer as simple as google calendar add --cal Calendar "Event 11/17/2014 at 2:00 PM in Location" now. Very sad. I miss simplicity.

So, to replace just that command functionality, I guess I'll read about inserting events. sigh

Monday, November 24, 2014

Arduino Libraries

Update 2016-11-21: Since this post has many views, I want to point out that Arduino libraries are easier to install since IDE 1.6.2 (see these directions), and that EtherSia is my Arduino Ethernet library of choice because it supports IPv6 (single-stack) as well as the ENC28J60, W5500, and W5100 Ethernet controllers, and it's simple to change the Chip Select pin.

The next baby step with my Arduino is to load libraries into the IDE. (Yes, baby steps. It's easier for me to do in a short time that isn't as busy, and it's less likely that I'll get frustrated.) The directions to load Arduino libraries look easy enough. (Adafruit, Installing a Library on Mac OS X)

The library for the HTU21D is linked with the directions, another easy step.

And then, despite trying to keep it simple, I thought that first library was so easy, let me add the library for the ENC28J60 Ethernet. Alas, that was a rabbit hole! Here is my saga.

ENC28J60 and Arduino: a history, with an eye to IPv6 support

My journey starts here with Reflective Heat:

The official Arduino Ethernet Shield is based on the WizNet 5100 chip, which implements the IPv4 protocol stack in silicon. As a consequence, the Arduino Ethernet Shield cannot be used to implement an IPv6 stack.

Most people use the ENC28J60 in place of the WizNet 5100, either for its low cost, or because I wanted IPv6 support. And now I step through a littered history.

EtherCard is a driver for the ENC28J60 chip, compatible with Arduino IDE, from Jean-Claude Wippler. Adapted and extended from code written by Guido Socher and Pascal Stang ... but I don't see IPv6!

Back to Reflective Heat. The RHT IPv6 library for Arduino is based on the work of Pascal Stang, Xing Yu, and Guido Socher for EtherShield and IPv6EtherShield from Günther Hoelzl. And I note:

The earlier ipv6ethershield developed by Guenther Hoelzl was tested but found to be unstable and would not compile on the most recent versions of the Arduino Integrated Development Environment (IDE).
However, I'm a bit nervous about the RHT offering because it only discusses Arduino UNO and Mega, and I have the Nano. So I thought I'd keep looking. Apparently I don't know enough to stay away from rabbit holes!

Hey, I found a list of Arduino IPv6 library choices and Telecom Bretagne is newer! but I don't want a wireless sensor network because wireless isn't as reliable as wired Ethernet. There are directions but for wireless, so I continue to look.

I found a blog with a whole category for Arduino and this Ethernet! but no IPv6 when I searched the blog.

So once again, I found myself back at the beginning, reading about Contiki's μIPv6 stack ported for 1-wire (original site appears to be offline now), but wrong microcontroller and wrong sensor family. However, μIP will appear again, with better luck next time.

The first two libraries at Tweaking4All also lack visible IPv6 support, but discuss the same problem of having a Nano instead of an UNO or a Mega (same concern I had with RHT!). The first set is ETHER_28J60 + EtherShield (from Jose Muanis Castro; mentioned by RHT); the second one is EtherCard (mentioned above). However, the third library looks like a winner! Do I see a nod to μIP? ... drumroll please ...

UIPEthernet has some IPv6! although with a gotcha noted. But I'm reminding myself that my small goal tonight is to load libraries, just the libraries, and not to discover what might be broken later. There are examples to test first!

There are some posts about which CS (chip select) pin to use for various configurations. I like this post because it shows where to change the underlying code if you don't want to re-wire.

Tuesday, November 18, 2014

Getting Started with Arduino

After my first attempt, I can say that getting started with Arduino is almost as easy as the directions! I have an Arduino Nano v3.0 with ENC28J60 ethernet shield and HTU21D temperature and humidity sensor module. But for reference, I did need to download drivers at Step 3, just not the FTDI driver mentioned. I needed to install a PL2303 driver for OS X 10.7 "Lion". There are many other PL2303 driver choices, too: from Prolific itself, on a plugable list, and from mac-usb-serial.

My first swing at it didn't work (no blinking light, but instead an upload error). That problem turned out to be that I had plugged everything into my oldest (and smallest) breadboard. The blink program successfully uploaded and worked with just Nano, and with Nano+Ethernet, so I only had to remove that breadboard to get it working. The first troubleshooting tip I tried was "Try uploading with nothing connected to the board (apart from the USB cable, of course)." Yay, that was it!

I consider my toes dipped in the water!

Thursday, October 2, 2014

Make Plarn

The problem with plarn projects (for me) is how long it takes to make the plarn. Now that I've tried it, this is my new method to make plarn reasonably: spiral-cut plarn. I just tie the ends together if needed, without the joining splice.

Hit that link for the description with photos! What I do is fold the bag over (smoothly, neatly) four times, leaving an inch on one edge not in the folds. Then cut through all of the layers of the folds while leaving the spine untouched (that's fast!). For the last step, open the (remains of the) bag up and cut diagonals from one row to the next (that's easy). Now wind your plarn for storage, or get crafting!

I'm more likely to craft with plarn now! ... The first three projects were painfully slow due to plarn production.

Thursday, June 5, 2014


Sunday night, while getting my boys cycled through the bath (one at a time due to Karston's toe surgery; he didn't want to take any chances) and getting all of us ready for Monday and oh-my-goodness-how-did-it-get-this-late, I had the thought, "I don't have time for dinner." Not merely was I thinking I didn't have enough time for a healthy dinner that I prepared, I was thinking I didn't have time for any dinner.

Screeeeech! Stop! Put on the brakes!

I may think some silly things, but I'd like to think that I can notice some of it, and improve.

So I thought about the problem while eating a big green salad (luckily that's my favorite food!) that I threw together quickly. In fact, I made two salads so I could chop up the whole head of lettuce. What I do in the late afternoon is fix dinner for my boys, and then fix dinner for myself. Especially when I'm not sure what I want, that can take some time. So I came up with a new plan: I'll eat leftovers for dinner, and then fix something tasty for the next meal(s). I don't have to rush with that meal preparation because I will have just eaten.

And that's what I did last night. I ate the other salad I made, and then I roasted a pan of vegetables (zucchini, mushrooms, onions, and red and yellow bell peppers with a little olive oil and salt). The only drawback is that I made the kitchen smell so good, I want to stay up and eat! Luckily I was too tired to eat, so I went to bed instead.

Friday, April 25, 2014

Self-Irrigating Planter

This weekend, we made self-irrigating planters from recycled water bottles, and planted marigold seeds that I hope will germinate in time for Teacher Appreciation Week.

The Wisconsin Fast Plants program covers the basics of making this planter from recycled plastic bottles. I incorporated the helpful comments on Seattle Sundries, too. Those directions are really useful.

I started with my drill, and made many small holes on the shoulder of the water bottles. I put one larger hole in the shoulder of the water bottles and in the bottle cap. Next I used my utility knife to separate the top of the bottle from the base. I experimented with where to cut until I found what looked good to me. This completed the "adult only" portion of the craft; happily, they enjoyed watching.

I knotted two sections of cotton twine in the middle, and we poked the knot through the hole in the cap with a toothpick. The outside of the cap had four "legs" while the inside had a knot to keep from pulling through. Then the boys screwed the cap on the top of the bottle. Next we placed the top, cap down, into the bottom of the former water bottle. I handed out narrow strips of aluminum foil for the boys to line the planter. One of the comments was that roots don't like sunlight, so unless the plant is to be transplanted, the roots need to shielded. Aluminum foil was the suggestion I remembered, and, well, it's fun to shape! They put a straw over the foil and through the larger hole in the top, and used cotton twine and a small piece of duct tape to fasten the straw securely to the side. Then I scooped in potting mix. We soaked the potting mix with water, and poured out the excess water from the base. Next I cut sections of duct tape, and the boys wrapped all the way around to tape the tops to the bottoms. They put 4 seeds in each planter. To finish this (later), we will wrap the outside of the planter to minimize algae growth in the water (see last item on Fast Plants page).

I don't know how well it will work, but I added the straw to refill the water in the base so the plants can continue to self-irrigate by wicking up the cotton twine indefinitely.

Sunday, April 20, 2014

Spring Cleaning Pollen

I started with the idea to make Washable Swiffer Duster Covers from fleece, but I didn't want to cut all of those layers before sewing.

I started with a quarter yard of fleece, 9 inches by 60 inches. I had already used some in whatever project inspired me to buy it in the first place. I took what was left, and cut it in half long-ways. I looked at the length of the prongs on my Swiffer Duster, and started with accordion folds on the fleece, so 4-1/2-inches wide by back and forth folds. I tweaked it a few times to get the folds to work out (no partial lengths).

Next I realized that my sewing machine was NOT going to sew through all of those layers. In fact, it complained loudly just sewing through two layers of fleece (and this is supposed to be a quilting machine? really?), so I made as few seams as possible. I sewed two channels for the two prongs in the middle fold. Remember that the middle line of stitching doesn't necessarily go all the way to the end; check your duster on your fabric to see where to stitch and where not to stitch. I also put in a few stitches at each fold.

Since my sewing machine wasn't going to add as much to this project as I had planned, I needed another idea. (This is where flannel is better.) I took a detour through nylon snaps (this fleece was too thick for the snap prongs I had), but then I was holding the sharp awl from my snap kit for the next idea! With the awl, I worked a hole through all of the layers of fleece. I threaded some coordinating yarn through a large needle designed for yarn. I tied off the top all together, the bottoms on either side of where the prongs insert, and two holes in the middle to hold the middle layers together.

So finally, on to the last step! I cut half-inch-wide strips along the sides. I asked my boys if they wanted to use their scissors, but they wanted to snuggle and watch instead. Once the duster was done, Cale wanted to put it on, and then started dusting everywhere I pointed him. (Hurrah!) There's a lot of pollen on my brand new duster, but that's OK: it's washable and the pollen isn't covering everything now.

If your duster needs enhancement, a very light mist of mineral oil will probably help.

Wednesday, April 16, 2014

Homemade Laundry Detergent

I wasn't discouraged by my failures at fabric softener, so I decided to make laundry detergent. After reading several recipes (Wellness Mama, Happy Money Saver, and Nature's Nurture), I decided to use this amalgam.

4 cups hot water
1/2 cup grated soap
1 cup washing soda
3/4 cup borax
1/2 cup oxyclean (powdered sodium percarbonate)
1/4 cup baking soda
1/2 cup scented laundry detergent, or many drops of essential oils

Add hot water and grated soap to a large bowl. Stir until well mixed, heating in the microwave if that helps the soap go into solution. Stir in washing soda and borax. Stir in oxyclean and baking soda. If you want scent, mix in a scented laundry detergent or essential oils. Let cool in the bowl for 24 hours. Stir again, and transfer to a lidded bucket that looks to be about twice as large as needed. Place lid on bucket until you're ready to scoop thick goop into your washing machine!

I usually use the drink mixer attachment on my immersion blender to mix this, but anything from a spoon with plenty of elbow grease to a mixer should work. If it's too thick for your chosen mixing approach, add more water to make it tractable - but then you'll need to add more detergent to your laundry. I use a 2 Tbs scoop for my washer.

I found already-grated soap in the laundry section, so that was easy. For the scented laundry detergent, I used Gain, what my mom always used. My laundry "smells like home" although now full-strength Gain just smells too perfumed to me!

My advice on this recipe is to store it in a bucket about twice as big as you expect to need. After it cools for 24 hours, I would expect changes to be done, but this recipe waits a couple days and then really expands. It also gets very thick (I suppose you could use more water, but then you need an even larger storage vessel), so scooping it out from a bucket on this second batch is so much easier than trying to shake it out of the old laundry detergent bottle on that first batch! I don't recall this much expansion from my initial small trial batch made with essential oils instead of Gain, so that may be the difference. So: use a bucket with room for expansion. I didn't expect that much expansion, nor did I expect it to expand a few days after the 24-hour cooling period, so I did have some pressurized laundry soap shooting around my laundry nook. Luckily that was easy to clean in my case (and much of it was contained in the basin that the bottle was sitting in), but I don't want anyone else making this unaware of the delayed expansion. Yay, bucket!

But: does it work? Unfortunately, I can answer that; luckily, to the positive. One of my children had a sudden onset of digestive upset. We changed his clothes in the bathtub, and I shook what bits I could into the toilet. I was pretty sure his clothes were stained, but after rinsing, I put his clothes in the washer. All I had was my homemade laundry detergent, so it was time for the worst-case test. After washing, and again after drying, I could detect no smell and no sight of what had happened. I was very impressed! His clothes were so nasty going in (and I scrubbed the bathroom after cleaning him up), I had already written them off. And, surprise! All clean!

Homemade Fabric Softener (not!)

My dryer has been imparting a lot of static to my clothes, so I started my laundry make-my-own at static. Fair warning: all attempts so far have been failures.

  1. Commercial dryer sheets are so scented that I sneeze just getting one out! I tried making my own dryer sheets by soaking a piece of fleece in a solution of 1 part fabric softener to 6 parts water, and that worked but the fabric softener is itself commercial (same goes for using hair conditioner instead of fabric softener). This approach is also still scented, so not what I wanted.
  2. I tried using 2 Tbs of white vinegar in my washer's rinse cycle, but my clothes and especially towels smelled too strongly of vinegar for me. Yes, even with essential oils.
  3. Adding more baking soda than usual didn't seem to make a difference to static cling either.
  4. Since vinegar contains acetic acid, and baking soda is mildly alkaline, I don't think a mixture of vinegar and baking soda will be effective for very long after the first mixing. (I didn't try it, though. Sodium acetate might be great, but it might still have the vinegar smell. I didn't want to use more vinegar, and want to re-wash laundry. Again.)
  5. Finally, I tried crumpled aluminum foil in my dryer. It got very smoothly rounded in the dryer, but that's the only change I noticed.

That covers the suggestions at ThiftyFun as well as the extra foil one from lifehacker, but I do have another one to try that I hope will work.

Update: I tried the other idea, epsom salt, but it didn't reduce static for me. Looking at what Wikipedia lists for antistatic agents, I'm not hopeful to reproduce that with home chemistry.

Monday, February 24, 2014

Book Corner Bookmark

I made a book corner bookmark (with those very nice instructions) with my boys this weekend. I like this origami method because it uses a small square, no fancy shapes or templates. The fun part for me was selecting an interesting bit of "paper" - I like how the Hershey's Special Dark cocoa label looks as a bookmark. The fun part for them was using a white envelope corner, and coloring it to suit themselves. In fact, coloring was so much fun, we never got around to the monster inspiration!