Shallow Thoughts

Akkana's Musings on Open Source Computing, Science, and Nature.

Wed, 23 Apr 2014

Some code from PiDoorbell

If anyone has been waiting for the code repository for PiDoorbell, the Raspberry Pi project we presented at PyCon a couple of weeks ago, at least part of it (the parts I wrote) is also available in my GitHub scripts repo, in the rpi subdirectory. It's licensed as GPLv2-or-later.

That includes the code that drives the HC-SR04 sonar rangefinder, and the script that takes photos and handles figuring out whether you have a USB camera or a Pi Camera module.

It doesn't include the Dropbox or Twilio code. For that I'm afraid you'll have to wait for the official PiDoorbell repo. I'm not clear what the holdup is on getting the repo opened up.

The camera script, piphoto.py, has changed quite a bit in the couple of weeks since PyCon. I've been working on a similar project that doesn't use the rangefinder, and relies only on the camera to detect motion, by measuring changes between the previous photo and the current one. I'm building a wildlife camera, and the rangefinder trick doesn't work well if there's a bird feeder already occupying the target range.

Of course, using motion detection means I'll get a lot of spurious photos of shadows, tree limbs bending in the wind and so forth. It'll be an interesting challenge seeing if I can make the code smart enough to handle that. Of course, I'll write about the project in much more detail once I have it working.

It looks like the biggest issue will be finding a decent camera I can control from a Pi. The Pi Camera module looked so appealing -- and it comes in a night version, with the IR filter removed, perfect for those coyote, rabbit and deer pictures! -- but sadly, it looks like its quality is so poor that it really isn't useful for much of anything. It's great for detecting what types of animals visit you (especially at night), but, sadly, no good for taking photos you'd actually want to display.

If anyone knows of a good camera that can be driven from Linux over USB -- perhaps a normal digital camera that supports the USB camera protocol? -- please let me know! My web searches so far haven't been very illuminating.

Meanwhile, I hope someone finds the rangefinder and camera driving software useful. And stay tuned for more detailed articles about my wildlife camera project!

Tags: , ,
[ 11:57 Apr 23, 2014    More hardware | permalink to this entry | comments ]

Thu, 17 Apr 2014

Back from PyCon

I'm back from Montreal, settling back in.

The PiDoorbell tutorial went well, in the end. Of course just about everything that could go wrong, did. The hard-wired ethernet connection we'd been promised didn't materialize, and there was no way to get the Raspberry Pis onto the conference wi-fi because it used browser authentication (it still baffles me why anyone still uses that! Browser authentication made sense in 2007 when lots of people only had 801.11g and couldn't do WPA; it makes absolutely zero sense now).

Anyway, lacking a sensible way to get everyone's Pis on the net, Deepa stepped as network engineer for the tutorial and hooked up the router she had brought to her laptop's wi-fi connection so the Pis could route through that.

Then we found we had too few SD cards. We didn't realize why until afterward: when we compared the attendee count to the sign-up list we'd gotten, we had quite a few more attendees than we'd planned for. We had a few extra SD cards, but not enough, so I and a couple of the other instructors/TAs had to loan out SD cards we'd brought for our own Pis. ("Now edit /etc/network/interfaces ... okay, pretend you didn't see that, that's the password for my home router, now delete that and change it to ...")

Then some of the SD cards turned out not to have been updated with the latest packages, Mac users couldn't find the drivers to run the serial cable, Windows users (or was it Macs?) had trouble setting static ethernet addresses so they could ssh to the Pi, all the problems we'd expected and a few we hadn't.

But despite all the problems, the TAs: Deepa (who was more like a co-presenter than a TA), Serpil, Lyz and Stuart, plus Rupa and I, were able to get everyone working. All the attendees got their LEDs blinking, their sonar rangefinders rangefinding, and the PiDoorbell script running. Many people brought cameras and got their Pis snapping pictures when the sensor registered someone in front of it. Time restrictions and network problems meant that most people didn't get the Dropbox and Twilio registration finished to get notifications sent to their phones, but that's okay -- we knew that was a long shot, and everybody got far enough that they can add the network notifications later if they want.

And the most important thing is that everybody looked like they were having a good time. We haven't seen the reviews (I'm not sure if PyCon shares reviews with the tutorial instructors; I hope so, but a lot of conferences don't) but I hope everybody had fun and felt like they got something out of it.

The rest of PyCon was excellent, too. I went to some great talks, got lots of ideas for new projects and packages I want to try, had fun meeting new people, and got to see a little of Montreal. And ate a lot of good food.

Now I'm back in the land of enchantment, with its crazy weather -- we've gone from snow to sun to cold breezes to HOT to threatening thunderstorm in the couple of days I've been back. Never a dull moment! I confess I'm missing those chocolate croissants for breakfast just a little bit. We still don't have internet: it's nearly 9 weeks since Comcast's first visit, and their latest prediction (which changes every time I talk to them) is a week from today.

But it's warm and sunny this morning, there's a white-crowned sparrow singing outside the window, and I've just seen our first hummingbird (a male -- I think it's a broad-tailed, but it'll take a while to be confident of IDs on all these new-to-me birds). PyCon was fun -- but it's nice to be home.

Tags: , ,
[ 10:20 Apr 17, 2014    More conferences | permalink to this entry | comments ]

Sun, 06 Apr 2014

Snow-Hail while preparing for Montreal

Things have been hectic in the last few days before I leave for Montreal with last-minute preparation for our PyCon tutorial, Build your own PiDoorbell - Learn Home Automation with Python next Wednesday.

[Snow-hail coming down on the Piñons] But New Mexico came through on my next-to-last full day with some pretty interesting weather. A windstorm in the afternoon gave way to thunder (but almost no lightning -- I saw maybe one indistinct flash) which gave way to a strange fluffy hail that got gradually bigger until it eventually grew to pea-sized snowballs, big enough and snow enough to capture well in photographs as they came down on the junipers and in the garden.

Then after about twenty minutes the storm stopped the sun came out. And now I'm back to tweaking tutorial slides and thinking about packing while watching the sunset light on the Rio Grande gorge.

But tomorrow I leave it behind and fly to Montreal. See you at PyCon!

Tags: , , , , ,
[ 18:55 Apr 06, 2014    More misc | permalink to this entry | comments ]

Thu, 27 Mar 2014

Email is not private

Microsoft is in trouble this week -- someone discovered Microsoft read a user's Hotmail email as part of an internal leak investigation (more info here: Microsoft frisked blogger's Hotmail inbox, IM chat to hunt Windows 8 leaker, court told). And that led The Verge to publish the alarming news that it's not just Microsoft -- any company that handles your mail can also look at the contents: "Free email also means someone else is hosting it; they own the servers, and there's no legal or technical safeguard to keep them from looking at what's inside."

Well, yeah. That's true of any email system -- not just free webmail like Hotmail or Gmail. I was lucky enough to learn that lesson early.

I was a high school student in the midst of college application angst. The physics department at the local university had generously given me an account on their Unix PDP-11 since I'd taken a few physics classes there.

I had just sent off some sort of long, angst-y email message to a friend at another local college, laying my soul bare, worrying about my college applications and life choices and who I was going to be for the rest of my life. You know, all that important earth-shattering stuff you worry about when you're that age, when you're sure that any wrong choice will ruin the whole rest of your life forever.

And then, fiddling around on the Unix system after sending my angsty mail, I had some sort of technical question, something I couldn't figure out from the man pages, and I sent off a quick question to the same college friend.

A couple of minutes later, I had new mail. From root. (For non-Unix users, root is the account of the system administrator: the person in charge of running the computer.) The mail read:

Just ask root. He knows all!
followed by a clear, concise answer to my technical question.

Great! ... except I hadn't asked root. I had asked my friend at a college across town.

When I got the email from root, it shook me up. His response to the short technical question was just what I needed ... but if he'd read my question, did it mean he'd also read the long soul-baring message I'd sent just minutes earlier? Was he the sort of snoop who spent his time reading all the mail passing through the system? I wouldn't have thought so, but ...

I didn't ask; I wasn't sure I wanted to know. Lesson learned. Email isn't private. Root (or maybe anyone else with enough knowledge) can read your email.

Maybe five years later, I was a systems administrator on a Sun network, and I found out what must have happened. Turns out, when you're a sysadmin, sometimes you see things like that without intending to. Something goes wrong with the email system, and you're trying to fix it, and there's a spool directory full of files with randomized names, and you're checking on which ones are old and which are recent, and what has and hasn't gotten sent ... and some of those files have content that includes the bodies of email messages. And sometimes you see part of what's in them. You're not trying to snoop. You don't sit there and read the full content of what your users are emailing. (For one thing, you don't have time, since typically this happens when you're madly trying to fix a critical email problem.) But sometimes you do see snippets, even if you're not trying to. I suspect that's probably what happened when "root" replied to my message.

And, of course, a snoopy and unethical system administrator who really wanted to invade his users' privacy could easily read everything passing through the system. I doubt that happened on the college system where I had an account, and I certainly didn't do it when I was a sysadmin. But it could happen.

The lesson is that email, if you don't encrypt it, isn't private. Think of email as being like a postcard. You don't expect Post Office employees to read what's written on the postcard -- generally they have better things to do -- but there are dozens of people who handle your postcard as it gets delivered who could read it if they wanted to.

As the Verge article says, "Peeking into your clients' inbox is bad form, but it's perfectly legal."

Of course, none of this excuses Microsoft's deliberately reading Hotmail mailboxes. It is bad form, and amid the outcry Microsoft has changed its Hotmail snooping policies somewhat, saying they'll only snoop deliberately in certain cases).

But the lesson for users is: if you're writing anything private, anything you don't want other people to read ... don't put it on a postcard. Or in unencrypted email.

Tags: , ,
[ 14:59 Mar 27, 2014    More tech/email | permalink to this entry | comments ]

Fri, 21 Mar 2014

Flicker Morning

[Northern Flicker on our deck] "There's a woodpecker sitting on the patio", Dave said, shortly after we'd both gotten up. He pointed down through the gap where you can see the patio from upstairs. "It's just sitting there. You can go down and look through the door; it doesn't seem to mind."

Sure enough, a female northern flicker was sitting on the concrete patio deck, immobile except for her constantly blinking eyes and occasionally swiveling head. Definitely not a place you'd normally expect to see a woodpecker.

Some twenty minutes earlier, I remembered, I'd heard a couple of thumps on the roof outside the bedroom, and seen the shadow of wings through the drawn shades. I've heard of birds flying into windows and getting stunned, but why would one fly into a roof? A mystery, but I was sure the flicker's presence was related to the thumps I'd heard.

I kept an eye out while I made coffee and puttered around with normal morning chores. She wasn't budging from that spot, though she looked relatively alert, keeping her eyes open even while sitting immobile.

I called around. (We still don't have internet to the house -- Comcast keeps giving us the runaround about when they'll dig their trench, and I'm not entirely convinced they've even applied for the permit they said they'd applied for three weeks ago. Maybe we need to look into Dish.) The Santa Fe raptor center had a recorded message suggesting that injured birds be put in a cool dark box as a first treatment for shock. The Española Wildlife Center said if I thought she was injured and could catch her, they could take her in.

I did suspect she was injured -- by now she'd been there for 45 minutes or more, without moving -- but I decided to give her some time to recover before going for a capture. Maybe she was just in shock and needed time to gather herself before trying to fly. I went on with my morning chores while keeping an eye out for coyotes and ravens.

For two hours she remained there. The sun came out from behind the clouds and I wondered if I should give her some shade, food or water, but decided to wait a while. Then, as I was going back to the bird book to verify what kind of flicker she was and what gender, she suddenly perked up. Swiveling her head around and looking much more alert than before, she raised herself a little and took a few steps, to one side and then the other. More head swiveling. Then suddenly, as I was reaching for my camera again, she spread her wings and flew off. A little heavily and stiffly, but both wings looked okay.

So our morning's flicker adventure has a happy ending.

Tags: ,
[ 11:46 Mar 21, 2014    More nature/birds | permalink to this entry | comments ]

Thu, 27 Feb 2014

New house, no internet

[My new office] I'm writing this from my new home office in our new house, as I listen to the wind howl and watch out the big windows to see lightning over the Sangre de Cristo mountains across the valley.

We're nestled in the piñon-juniper woodlands of northern New Mexico. It's a big jump from living in Silicon Valley.

[The house is nestled in pinon-juniper woodland] Coyotes roam the property, though we don't catch a glimpse that often, and I think I saw a grey fox the first morning we were here. These past few weeks, Sandhill cranes have been migrating far overhead, calling their wild cries; sometimes they catch a thermal (once right over our house) and circle for a while, gaining altitude for their trip north.

And lightning -- summer thunderstorms were something I very much looked forward to (back in San Jose we got a thunderstorm maybe once every couple of years) but I didn't expect to see one so early. (I'm hoping the rain and wind will blow all the pollen off the junipers, so I can stop sneezing some time soon. Who knew juniper was such a potent allergen?)

And the night sky -- for amateur astronomers it looks like heaven. We haven't had a telescope set up yet (we're still unpacking and sorting) but the Milky Way is unbelievable.

[My new office, from the outside] We're in love with the house, too, though it's been neglected and will need a lot of work. It's by architect Bart Prince and it's all about big windows and open spaces. Here's me looking up at the office window from the garden down below.

Of course, not everything is perfect. To start with, in case anyone's been wondering why I haven't been around online much lately, we have no internet to the house until the cable company gets a permit to dig a trench under the street. So we're doing light networking by mi-fi and making trips to the library to use their internet connection, and it may be a few more weeks yet before we have a connection of our own.

I'm sure I'll miss the Bay Area's diversity of restaurants, though at the moment I'm stuffed with lamb, green chile and sopaipillas (a New Mexican specialty you can't really get anywhere else).

And of course I'll miss some of the people and the geeky gatherings, living in a small town that isn't packed with Linux and Python and tech women's user groups like the Bay Area. Still, I'm looking forward to the adventure.

And now, I'm off to the library to post this ...

Tags:
[ 19:36 Feb 27, 2014    More misc | permalink to this entry | comments ]

Fri, 07 Feb 2014

Early expirations: A surprise-a-minute with a ACA/CoveredCA health plan

I went to the pharmacy to pick up a prescription a few days ago. The pharmacist said "We don't seem to have any insurance on file for you." I said "That's funny, I just gave you my new insurance card about a week ago, at that window right over there." That would be my shiny new hard-won Blue Shield card with my Obamacare/ACA/CoveredCA plan number.

The pharmacist went into the back room and came back a minute later with a printout. "Looks like that insurance expired on 1/18. Was that a temporary plan number or something?"

"Well, if so, they sure never told us about it, and we've paid through the end of February."

He went to the back room again and got someone to call Blue Shield. And in 10 minutes (whew, I was worried they'd hit the same hour-long queue we individuals have to wait through ... I tried calling them with a billing question last week and had to give up when my phone battery ran out long before I got through the queue) they came back and gave me the prescription for $5.

Does that mean that the problem is solved and the early expiration date was just a mistake? Or did they do some one-time override, and I'll have to argue every time I go in using this card?

As it happens, I'll never know, since I'm about to leave the state. So I get to go through the ACA application process all over again (oh, joy!), this time in a new state using the federal Healthcare.org website, about which I've heard so many wonderful things. It'll be interesting to see how Healthcare.org stacks up now compared to the CoveredCA site back in November.

Tags: , , ,
[ 20:04 Feb 07, 2014    More misc | permalink to this entry | comments ]

Sun, 02 Feb 2014

Windshield Washer Fluid Freeze-out

I'm nearing the home stretch of a move from California to New Mexico. (I'll be writing about that eventually, but right now I'm in the middle of Moving Hell.) Since we're about to drive our cars out to a place that's getting freezing temperatures, Dave got the bright idea that we ought to replace our windshield washer fluid with a type that doesn't freeze at 32°F.

Easy, right? We drove down to Pep Boys -- and couldn't find any. All they had was marked as 32°. So we asked the gentleman at the counter.

Pep Boy: Sorry, we only carry the 32-degree kind. We're not legally allowed to sell the other kind.

Us: Uh, what?

Pep Boy: We're not legally allowed to sell the antifreeze type because it hardly ever gets down to freezing here.

Us: But what do people do when they're driving up to Tahoe or something?

Pep Boy: They start with the tank empty, stop partway up and buy some, and fill up there.

Us: ...

We drove down the street to O'Reilly's, to double check. O'Reilly's sells a concentrate with additives (methanol) for subfreezing temperatures. Just add water. Wait, what?

I did a web search when we got back home. Sure enough, the California Air Resources Board (CARB) has made it illegal to sell pre-mixed windshield washer fluid with methanol, because the methanol evaporates contributes to "ground level ozone and air pollution", according to The Hanford Sentinel: Looking for winter windshield washer fluid? Good luck!

It's illegal to sell pre-mixed. But it's legal to sell concentrate -- even though the concentrate contains far more methanol than pre-mixed would have.

Words fail me.

Tags: , ,
[ 19:30 Feb 02, 2014    More misc | permalink to this entry | comments ]

Syndicated on:
LinuxChix Live
Ubuntu Women
Women in Free Software
Graphics Planet
DevChix
Ubuntu California
Planet Openbox
Devchix
Planet LCA2009

Friends' Blogs:
Morris "Mojo" Jones
Jane Houston Jones
Dan Heller
Long Live the Village Green
Ups & Downs
DailyBBG

Other Blogs of Interest:
DevChix
Scott Adams
Dave Barry
BoingBoing

Powered by PyBlosxom.