Posts Tagged ‘Raspberry Pi’

h1

Tinkering for dummies

January 24, 2015

I received an email:

I’ve listened to a few podcasts and now am officially a fan. I’m curious about “tinkering” for dummies

I realize that I like to tinker but always run into the reality that my technical skills don’t match up with my creativity.

I am wondering if you would suggest a pathway of least resistance for someone who is interested in tinkering. 

Time is always a constraint but I am serious about learning how to code and also learning about embedded systems but not sure if learning python for example is the best way to start.

This seems like a great question, one I’m sure other people have.

However, I’m a terrible person to answer it because I come at the problem of tinkering from exactly the opposite direction. Since programming is my job, tinkering can be difficult because it feels like work instead of play.

Still, I want to encourage the writer so I’ll try to answer. I invite you to suggest other things in comments.

I think the the very short answer is buy a kit. A kit means you’ll get something that probably works and some instructions. Then you can tweak it to be more along the lines of what you want.

And, in general, I think the path of least resistance is Arduino. Their community and system is set up to teach you things (and to hide the tricky details). It started out as a way for educators and artists to approach technology so they don’t expect you to know a lot of coding. There are many Arduinos (the UNO is my fav) so the next question is what do you want to tinker?

Learning by doing is great but difficult to maintain if you don’t have a direction. Self motivation is much easier if you have a goal, ideally an achievable, amusing, and share-able goal.

Say you want to make a watch or small desk display, start with the MicroView (and programmer). If you want to go all out (or you really have no idea where to start), get the Sparkfun Inventor’s Kit. With the MicroView, you get more tutorials with hardware in the inventor’s kit. Without the MicroView, you still get a wonderful grouping of sensors and lots of tutorials (and an Arduino board).

On the other hand, robots are awesome and seeing something move is deeply satisfying. The Parallax BOEBot (“Board of Education” Bot) is educational (and fun). It was designed for high schoolers so you’ll likely feel brilliant and idiotic in turns (c’mon, you remember being a sophomore, right?). You can get it from Parallax more cheaply but you have to build more of it yourself. (Also, you may need an Arudino UNO for those kits to add smarts to your robot.)

As you start to tinker, decide what you want to do with your limited time. Building from the ground up is an advanced exercise, often leading to frustration. Toddling, baby steps are more fun.

But what if you want light up shoes (or bike helmet)? Lights are an awesome way to get hooked on tinkering,* there are so many beautiful blinking patterns. For that, you probably want to look into the Flora system (oh! they also have a budget pack). It is designed to be wearable which is pretty neat.

Do you have annoyances in your house? Something that would be better if you could assure yourself from work or phone? Maybe knowing that the garage was down, the stove off, or the door locked? For this, I’d suggest Electric Imp (and you’ll need the breakout board as well). It connects to WiFi well and is straightforward to program. It isn’t quite Arduino easy but there are lots of tutorials.**

Finally, do you want to make a big system? Like a balloon that can take pictures and use a GPS and then connect to your home network? While I like BeagleBone Black for engineering use, I’d suggest starting with a Raspberry Pi. These are both little computers, cheap enough that you can blow one up without feeling too guilty. The Pi is designed to be a learning environment and there are many excellent tutorials. The Beagle has an excellent community as well so it may be a toss up between them. And if you’ve already started to learn Python, well, these are the boards for you. They’ll let you use Python, explore Linux, and get some hardware experience without ever worrying you’ll run out of RAM or processing power. If you get a touchscreen (like this one for BBB), these small computer feel like, well, small computers: infinitely flexible.

Which brings me to my next point, once you have a direction, look for  a tutorial for something similar. Even if you aren’t building something exactly the same. For example, if you like the look of MicroView and want to try making a watch, even though Wordy is a ring, my tutorial on building it may give you ideas.  Look at the “Learn” sections on Adafruit and Sparkfun for ideas if you don’t have a project in mind. These companies (as you may have noticed from the above links) sell tinkering hardware. They write tutorials to keep you engaged (so then you buy more hardware). You may also find inspiration from Hackaday and Make. You can document your project on Hackaday.io, I’ve been pleased at the niceness of the community there.

Tinkering from scratch without a guide is a like baking cookies without a recipe. If you are experienced, it is completely possible to start with a blank slate. I know from experience and reading cookbooks that cookies should usually have between 1 part butter, 2 parts sugar, and 3 parts flour to 2-3-4 (b-s-f). I can make almost any cookie I can think up. But as you start out, some guidance to success is hugely important. Otherwise you end up with Strawberry-Mint cookies*** and everyone is very disappointed that the lovely promise turned into, um, that.

My final word on getting started tinkering: don’t feel guilty when you stop for a weekend or two. This is for you, it is your hobby. It might be educational but it isn’t required for life. The less guilt you feel, the more likely you are to come back to it when you get interested again.

*  My first tinkering project involved lightup high heels. The second involved halloween pumpkins lights (blue to purple flickering “candles”).

**  Heehee, I wrote that tutorial so total bias there.

*** Yes, that happened, ok? It was an accident with the mint and vanilla bottles looking similar. Quit laughing. Aw, to heck with it.

 

h1

Circle clockwise three times

August 14, 2014

I mentioned that I’m working on a Raspberry Pi project with video. It wasn’t going well.

I started with Python + SimpleCV because it looked easy and fun but then determined that frame rates of six frames per second would make it hard to show moving things. So I went a more native option: cross compiled C with OpenCV.

The problem with this path is that it feels like work.

While I strongly believe in life outside tech, I do some personal engineering-related projects. I consider the podcast my main personal project. But Element 14 has graciously been sending me hardware and the occasional check to write for them. This arrangement lets me learn new things and share my enthusiasm. It is pretty cool (zOMG, you guys, they pay me to goof off! If I whine enough, they send me even neater hardware! This is such a scam!)

But I do have a day job. Oh, don’t get me wrong, my billable hours are not totaling anywhere near 40. But I could be gardening, reading a book, writing a novel, designing my Halloween costume, or painting the ceiling; I could be doing other amusing things but I’ve opted to work on a technical project because I find it interesting. Getting paid is nice and directs my (often scattered) attention but it is not a large portion of my income (thus it is not motivation enough).

Having a project lose the joy of discovery and become a grind is not good for its prospects of completion. (Though I am excited about the end widget. But maybe it would be easier to do on my laptop. But then it isn’t embedded. Maybe there is an 8-bit microcontroller out there that needs me to do something with it. You know, my Halloween costume is likely to be pretty technical…)

Doing a project in Python on the Raspberry Pi is fun: hack it together, do a little experimentation, call it done enough, maybe revisit in a few weeks.  But it didn’t work, too slow. And then cross compiling and C felt workish, especially the starting over part. I actually had some things working in Python. I fought the evil of Linux video drivers. I learned about computer vision libraries too. It was fun in Python.

It was less fun in C. Though, realistically, I haven’t gotten to do much C, mostly build nonsense. But SimpleCV looks friendlier than OpenCV.

Imagine my disappointment to read that I can only expect ten frames per second in the C+OpenCV version. I don’t know how I missed that. It seems impossible. There is rasppivid video that is 30 fps, why can I get to something like 25? Oh, I know there is hardware acceleration and blah. blah, blah. But I want it. I want it more than they do. (Hey, you did read my Guardians review, right?)

So now I’ve found a different Python package, one with better Pi Camera integration. It is even linked from the Raspberry Pi Camera page. (Was it there before and I missed it? The idea of that makes me feel slightly insane. I looked around A LOT for Pi Camera stuff before deciding to leave Python).

The Camera Modes documentation shows some high frame rates.  The text later talks about all the interesting ways users can mess that up. And there is a section for rapid capturing and processing though I wasn’t clear that I could display them too. It would be interesting to try.

Ok, I think that, yes, I am going to restart the project but back to Python. All the paths are frustrating. But Python has the most potential for amusement and the chance that I’ll get beyond fighting tools and back to playing with gear. I hope.

 

h1

Here’s how you can’t do it too!

August 7, 2014

I just cross compiled an application for Raspberry Pi: camcv combines the Pi’s camera program raspivid with OpenCV.

It took hours and hours. Not just to build the cross compilers (though that did hours) and figure out cmake and figure out what code I needed, it took hours of tweaking and fiddling to make it work.

I suppose now I’m supposed to write up how I accomplished it, so you can reproduce it, glossing over the tricky bits and making it sound like a walk in the park.

First, I must give credit to

Well, and to be fair, I’m still at Step 3 of OpenCV and Pi Camera’s instructions (of 7 (and a half)). I finally got the program to compile but I have a new Raspberry Pi board and haven’t even powered it on. Oh heck, if I’m reading step 4 correctly, I haven’t actually managed to pull in OpenCV.

I had this neat plan for what to do with the Pi, a camera (two maybe!), and a small display. But I’ve been so battered by compiling something that already existed and isn’t even really what I meant to compile anyway.

I find that many Linux projects have this exponentially expanding scope. My initial initial plan was to play with the camera in python using the actually pretty simple SimpleCV computer vision tools. But it was horrifically slow (a known issue to people who have tried the python and camera but a new issue to a newbie like me).

Worse, I don’t know cross-compiling has been truly worth it. Is multiple hours of setup worth many times two minutes of recompile time? Also, the RPi Compute doesn’t have an Ethernet port so it isn’t as easy to set up a tftp that would all my device access to the cross compiled executables without even a scp copy.

So I’m not going to give you the “here’s how I did it”… I’m not even sure how to post my trees. And I went through so many strange turns, I’m not sure my results will be useful (“and then at step 1123, spin in your chair, clockwise three times, the next cmake .; make instruction will then work”).