Day 24: Moving towards the Mountain

Nick Ang
getting technical
Published in
6 min readJul 25, 2016
Of course an aspiring developer must choose a Mountain in Yosemite National Park

I have no idea how to ‘upload’ code into a Raspberry Pi as one would with an Arduino, though my general knowledge suggests that you don’t upload code to it so much as write and run code on it. The RP is a proper computer unlike the Arduino, which is mainly just a microcontroller.

How do they differ? I cannot tell the technical differences and have no interest in wasting time learning and reciting them, but if someone on the street asked me, I’d say that an RP is designed to function like a computer while the Arduino is for embedded, single-application projects that have lower performance requirements.

Throughout today I did, however, conduct a lot of research online. One question naturally led to another and I just kept on reading.

A day of Q&A

My first google search of the day: “How to write programs for Raspberry Pi”. That brought me to the Pi Foundation’s official introductory tutorial. I read and bookmarked it for use when my new RP (which I’ve yet to order) arrives.

How do the different versions of RP compare? A quick search later I found out that the prices are not that different across versions 1 to 3: $40, $50 and $53 SGD respectively on element14. They mainly differ in processor speed and, for the RP3, the fact that it has in-built Wifi and Bluetooth Low Energy. If I’m going to use an RP for this project, I’m going to use a RP3.

Now, which other components did I need…

Oh, a buzzer. Having no experience ever using a buzzer or any electronic component that reproduces sound, I flipped down my Macbook’s clamshell screen, retired into the leather backrest of my chair and started thinking of the best way forward.

Not long after, I recalled that my Arduino starter kit shipped with something called a piezo, and I remember having read that it’s used to recreate sounds. So I walked, full of hope, to the bookshelf to retrieve the Arduino guidebook and zealously flipped to the content page. I was right, there was a project called ‘Keyboard Instrument’, and it involved the use of a piezo to digitally reproduce keyboard tones.

Arduino starter kit’s ‘Keyboard Instrument’ project. I used this as a gateway to understanding piezo sounders.

Next moment, I was done setting up my Arduino Uno with the suggested components. Four buttons, a resistor ladder, a piezo sounder. Click! I added a ‘for’ loop that changed the tone so that a button press would play the piezo from the lowest to highest frequency and back again. It sounds a lot like a police siren and was incredibly fun to create.

Piezo sounder, buzzer… is there a difference between the two? Turns out, there is. A piezo sounder varies the tone it emits based on the square wave drive signal it receives, while a buzzer is more primitive in that it can only give off one fixed tone, with varying loudness based on the power passed to it. I’m going to need a piezo sounder, but a slightly beefier version of the one that came in the Arduino starter kit for higher volume.

At this point, I’m quite set on using the Raspberry Pi 3 with Raspbian OS as the basis for Project ICU. I still need software to handle the video streaming and to snap photos and attach them to emails.

In a previous project, I used another open source software — an OS called motionEye — to stream a video live as well as record video whenever motion is detected. For Project ICU, though, motionEye is too purpose-built to be usable. For one, it wasn’t designed to detect a button push, only motion, which will yield way more photos (and emails!) than I care to receive.

From a technical perspective, Project ICU should be easier to implement. Even though the open source movement has given rookies like me access to sophisticated motion detection software, I don’t claim to understand half of it. In fact, I haven’t even looked at the source code of ccrisan’s motionEye OS once, but I’m using it power my home security camera. With Project ICU I’m aiming to build something on my own as much as possible so as to fully juice the potential for learning.

Media center software

If I install Kodi (formerly Xbox Media Center, or XBMC) on both the RP3 and the Remix “Android PC” that I already own, I should technically be able to access whatever is on the former from the latter.

If this is true, there’s still one more thing to figure out: Will the RP3 as an access point be enough to act as the bridge between the 2 devices, or will I need to connect them to the internet (via Wifi) as a bridge? I would honestly be unpleasantly surprised if the two cannot communicate without internet the same way most new digital cameras are able to transfer photos to smartphones via Wifi protocol without going through the internet.

Raspberry Pi 3 as its own access point

“RP3 can operate as its own access point that devices connect to directly, enabling it to operate independently of other networks. This option would be the way to go if you wanted to have a single device, like an old phone or tablet, dedicated to being the display for the video stream.” (element14)

Through the above article I found another post with easy to follow instructions to setting up a RP3 as an access point using its in-built Wi-Fi module. Will be referring to this to configure my RP3 when it arrives.

As an aside, I just realised how much less intimidating articles like this have become since I started immersing myself in all-things-technical about three months ago. A welcome evolution, for sure!

Notes from Neil Gaiman’s commencement speech

Speech on vimeo.

Neil Gaiman is an author I’ve heard about a lot but have never read. Today after listening to his commencement speech at the University of the Arts, I have to borrow one of his books to see the kind of writing such an outstanding person produces. (A quick search tells me he has published over 60 books.)

One of the simplest and most powerful metaphors I’ve heard, courtesy of Neil Gaiman is this: envision your life’s goal as a mountain in the distance, and every single day, make your way towards it. Ask yourself whether the thing you’re doing today is a metaphorical step toward the mountain or away from it, and work accordingly.

This was such a brilliant speech I had to take notes and share parts of it here.

  • Keep checking that you’re having fun. There was a day when he looked up and had become someone who professionally replied to email, and who wrote as a hobby. Then he started answering fewer emails, and found himself writing much more.
  • You must make mistakes. “I hope you’ll make mistakes. If you make mistakes it means you’re out there doing something.”
  • Make good art. I’m keeping this in the list even though I’m sure I don’t understand precisely his meaning. “Do only what you can do best: make good art. Do it on the bad days, and do it on good days too.”
  • It’s ok to copy. “The urge at the start is to copy. Copying is not a bad thing. Most of us only find our voices after we’ve sounded like a lot of other people.”

Most poignant of all among the wise things Neil Gaiman said in his speech, this one stood out the most in my eyes:

The moment that you feel that you might just possibly be walking down the street naked, exposing too much of your heart and your mind and what’s on your inside, showing too much of yourself, that’s the moment you may be starting to get it right. — Neil Gaiman, author

Ok, I’m going to end today’s post with the quote.

This post is part of my 30-day commitment to write about my journey learning technical stuff. If you learned something, please recommend it so that more of us can share our learning.

Posts are published to Getting Technical.

--

--

Nick Ang
getting technical

Software Engineer. Dad, rock climber, writer, something something. Big on learning everyday.