Raspberry Heaven

Two years ago I started to tinker with the Arduino platform and created a simplistic garage door opener by coupling a fairly inexpensive Leonardo board with a even cheaper ESP8266 WiFi board. It took quite a bit of work, figuring out how to configure the WiFi with the ESP8266, and struggling with its unreliability. I also wrote a little iOS test app so that I can control the garage door opener with my iPhone.

After numerous hours and a total bill of materials for less than $20, here is a short video on the fruits of my labour about a couple of years ago:

I have been tracking the Raspberry Pi platform for quite sometime, but always found them to be comparably expensive to the Arduino boards, especially all I needed was something to get on my WiFi network, and be able to respond to a remote request to effectively flip the proverbial switch. So when I found out that you can get a Raspberry Pi Zero W for $13.45 CAD at CanaKit.com, I was pretty excited to give it a try.

I purchased the Pi Zero W as well as the Pi 3 Model B. Why not?

Spent a good chunk of yesterday to:

  • Followed the instructions on raspberrypi.org to download and copy the image to a 16GB micro SD flash drive.
  • I needed to ensure that there is an empty file named "ssh", so that I can ssh to the board remotely from my Mac. I was too lazy to find the keyboard, mouse, and required cables. Thanks to Michael Smalley for providing this very helpful page.
  • Configure the WiFi settings with the good instructions provided by David Maitland.

After the above, the Pi board just needs power and nothing else, and I was able to establish an ssh session from my Mac to continue on with the configurations.

  • First I updated the environment.

    sudo apt-get update
    sudo apt-get dist-upgrade

  • Then installed the Java Developer’s Kit

    sudo apt-get install oracle-java8-jdk

  • Installed Node.js along with Express and wrote a super simple Express app. The instructions by Yannick Loriot were really helpful. Did not try to use apt-get to install node, because it ended up crashing the board with a kernel panic. That path led to many lost hours.

    wget https://nodejs.org/dist/latest/node-v7.7.2-linux-armv7l.tar.gz
    npm install express --save

    Update 2017-03-14: The armv7l apparently only worked for the Pi 3, but for the Pi Zero W, I had to get the arm6l version.
  • Installed Samba, so that I can use my editors on my Mac to edit code.

    sudo apt-get install samba

    Note that we had to use smbd to restart the service after configuration.

    sudo systemctl restart smbd.service

Once I have my development environment all setup and that all the networking stack is working properly. I can then start to play with the GPIO pins that came with the Pi. The idea is to provide a simple web service app powered by Node.js and Express to turn on or off or simply toggle a GPIO pin, acting as a switch, which I can hookup to a relay.

I first downloaded the wiringpi package.

sudo apt-get install wiringpi

I used the above package to get familiar with the GPIO mechanism and play around with it on the BASH command line.

Once I was comfortable with the concept, I wanted to hook it up with the Express app which I did with the onoff npm module. I spent this morning creating a simple Swift iOS app, and wired the Pi to the relay.

You can see it all working in the video below. When I press the button on my test app from my iPhone, you’ll see the red LED blinking denoting a pulse on the switch — think of this as you press the garage door opener. The yellow wire is the USB cable that is just feeding the board with power. Thrilling!

I am not finished yet. I still have to make the iOS app and web service more secure and switch from the Pi 3 to the Pi Zero, but not this weekend. However, my initial impression of the Raspberry Pi platform is much simpler for me, coming from a software background. My hardware skills are at best rusty from my university days. The micro controller environment of the Arduino platform is also very finicky and more difficult to debug. There is nothing like working with a real operating system with a mature development stack.

I also used my wattage meter to figure out how many watts the system was drawing, and it only peaked at less than 3W. That’s pretty good!

Too Quick to Judge

I was exercising on my recumbent stationary bicycle one day with my iPad, which I use to watch YouTube videos during my one hour-long session on the bike. I did not want to disturb anyone, so I also have my bluetooth headset paired with the iPad. Everything was working fine, and I am working towards a dripping sweat when my bluetooth headset ran out of batteries. What an inconvenience when you are in the middle of a workout!

“No biggy”, I said. I took my bluetooth headset off and switch the audio on my iPad back to using its own speakers. All is good now, and went back to spinning the pedals. Less than 30 seconds later the video that I was watching on YouTube auto restarted itself. Another huge annoyance, as I fiddled with the progress bar of the video, and place it back to then original position. This happened a few more times, and after my workout I was cursing at the iOS YouTube app.

Okay, not a big deal. I know how to deal with erratic apps on my iPad. Let’s do the following:

  • Delete the YouTube app
  • Hard reset my iPad
  • Install the YouTube app again from the App Store

Everything should be fine now, right? NOT! Videos within the YouTube app continues to restart from the beginning after 15 to 30 seconds of playing. Perhaps something is wrong with the YouTube service. I decided to use the Safari browser to watch YouTube videos, and that worked without any problems.

After a couple of hours scratching my head on this problem, I stumbled upon the Bluetooth menu of the iPad settings and noticed that the iPad is still connected to my bluetooth headset that was out of battery. That is very strange. I tell the iPad to disconnect and forget this device, and VOILA! The YouTube App now works flawlessly. Apparently the “fake” bluetooth connection must be sending a backward click signal on a random basis causing the app to skip back to the front.

I learned something here. It was so easy for me to place the blame on the YouTube App when it is not its fault at all. In today’s interconnected world, functionality and features of our electronic toys are so dependent on layers and layers of infrastructure that we sometimes are too quick to judge the quality of the tech that you are in direct interface with. As this experience has shown, it is very possible that something else that is deeper within the interwoven, interdependent system that is wrong.

On a deeper level, I suppose the same lesson can be applied to people’s behaviours. So next time when you see people behaving in an awkward manner, don’t be quick to judge. Perhaps they just had a bad episode of sorts or there are other factors involved. Have a conversation or discussion to get to the root cause of the situation.

Mont Tremblant

This weekend the boys have a PA day on Friday. A PA day is when the teachers have to work but the students do not. This gives the family an opportunity to get away on an extended long weekend. We decided to go to Mont Tremblant with three other families.

We began our drive after school to Tremblant via Ottawa. To avoid traffic, we decided to take Hwy 7. The drive was dark and there was a small stretch where we had some white out conditions West of Ottawa. We made it to the village at around 1am. By the time we settled our stuff it was well past 3am before we went to bed.

It was all worth it when we woke up to this beautiful view in our bedroom window.

It is too bad that I sprained my thumb and wrist the day before so I couldn’t go skiing with the boys. Bummer!

The HooToo TripMate – Mobile Entertainment Cloud

During long road trips the kids in the car are typically bored out of their minds and inevitably they will ask the question, “Are we there yet?” way too many times. The airlines solved this problem with personal entertainment systems in front of each seat, where the passenger has the ability to choose his entertainment from a large variety of movies, tv shows, and games.

Over the past years, we have diligently converted all of our physical media, our purchased DVD’s, Bluray disks, and even some VHS tapes into digital media that can be stored and manipulated on hard disks or more recently SSD drives. We have found and used a device over the past three years to broadcast our own media in the car. The device is called NetShair Link Portable Wi-Fi Router & USB Media Hub. This device can take media from a USB hard disk that is connected to it and make the media on the hard disk available to mobile devices such as iPhones, iPads, and even laptops via WiFi. The NetShair worked well, but setting up the device was cumbersome and the performance of the device dropped when there are more than two devices connected to it. The iOS app was also outdated and difficult to use.

Recently we found a new solution offered by HooToo. The HooToo TripMate, provides the exact same functionality as the NetShair, but in a much usable form factor, because it has a 6000mAh battery that can be used to power the device or provide emergency charging for your phones or tablets. Whereas the NetShair requires you to always plug in the unit at all times.

Unfortunately, the mobile app for HooToo is also fraught with issues. For example the app will crash when two or more devices are playing simultaneously. What I found is simply using the web application that came with the device is good enough for setup.

After setting up the device, instead of using the app to play movies, I found the most stable way of playing movies from these devices is simply to use mobile Safari and point to the data folder, something along the lines of:

http://10.10.10.254/data/UsbDisk1/Volume1/

I found the native Safari video player performed with the best quality and stability when the maximum number of 5 connections are reached.

I also tried the VLC, Vidon, and the HooToo TripMate apps to play videos, but they were all inferior to Safari. For single user use, these apps are more than adequate, but we purchase these devices for family use, which means more than one user will be connected at the same time. I would say that VLC comes a close second, followed by Vidon, both can probably handle about two simultaneous connections. I would forget about the TripMate app all together to play videos for more than one connections.

I find that these devices are pretty handy especially when we are in a long drive or at a hotel room with limited WiFi or Internet service. However, the manufacturers could make them easier to use. The hardware is certainly adequate, but the software implementations can still use quite a bit of improvement.

Virtual Presence Drone

Instead of a telepresence robot on wheels as offered by Double Robotics, I think it would be an interesting idea to have a virtual presence quadcopter drone fitted with a 2 to 4 inch LCD, along with a camera and miniature mic and speaker system, about the size of a Maverick Drone (Update: This newly announced Dobby Drone fits the bill even better).

Individuals can remotely project themselves home or vice-versa, people working from home can project themselves into the office. The unit can have pre-programmed landing spots that will double as wireless charging stations for the drone. Another thought is to have magnetic ceiling (reverse landing) spots, where the drone can be magnetically-docked for charging and perhaps data syncing as well. When it is needed again, it will be released from the ceiling. Considerations can even be given, if the drone can double as a cosmetic lighting or fan fixture when not in use.

When in use, the person controlling it remotely via a smartphone app, simply control the drone at two fixed speeds, walking, and a slightly more brisk pace. I think this will greatly simplified the control of the drone and make it more manageable for everyone. Variable speeds and accelerations are simply not required when navigating indoors. This will also greatly improve safety considerations as well.

I think drone technology has come a long way with their auto-homing and anti-collision features. The applications for such a virtual presence drone could include but not limited to:

  • Security and monitoring
  • Telecommuting
  • Remote support
  • Virtual visitations (think grandparents, grandchildren, palliative care, etc.)
  • Other telepresence applications

Well you heard it here first. I hope some manufacturers pickup on this idea. I would buy three now. One for home, work, and one for the cottage.

The Hidden Value of VoIP

I received a call from a 547 area code. The caller had an East Indian accent and I was immediately suspicious about the call. She said that she was Windows Technical Support and she tells me that my Windows machine has been violated numerous times. At this point, I knew it was a scam so I played along to see what she wanted me to do. 

I challenged her to prove to me that she is monitoring my machine. When she indicated the ASSOC trick I knew this call was a full fledge scam, and proceeded to end the call.

Both my sister-in-law and my parents, like I are using VoIP for our land line calls. We all use voip.ms. I’ve been using them for years and they are reliable and dependable. They also allow you to filter calls, which I used to block all area codes from 545 to 550, because these are invalid area codes. I learned about these area codes after the call.

VoIP is not only about saving costs. Its hidden values also include call filtering as I used above, as well as call forwarding to a group of numbers, and detail call auditing. I use all these features frequently. 

We’ll See How Long We Last

Per my previous post, I tuned up my bike today, but felt too tired right afterwards to try it out. I was planning to defer the ride until tomorrow morning, but some how after dinner I found myself with renewed energy and wanted to give my new, tuned up bike a spin.

We have to start the New Year by completing all three rings on my Apple Watch. A work out that started out easy, turned quite fun. I used a YouTube Top 40 playlist of music videos, and gamed the work out. After a warm up, I forced myself to go into Zone 5 for a minute at the beginning of every song.

With this pattern, before I knew it I had an hour done, and my rings were completed. Apple has a pending Ring In the New Year challenge. We’ll see how long this discipline will last, but my goal is to complete the challenge this month!

Strava Workout Results (Click Image for Details)

It Only Took 2.5 Years!

On July of 2014, while cleaning my Cervelo R5 on a beautiful summer day,

Cracked lock ring

I noticed that my crank was wobbly. Upon closer inspection by Billy’s Pro Bike, the lock ring that fasten the crank to the spider of the crank was cracked. Long story short, I contacted Rotors in the US and their customer support was superb. I got a replacement spider and crank assembly. However I never took the opportunity to put it back on my bike. At the time I was riding with a used crank from Billy’s.

On the first day of 2017, I took some time in the new year to tune my bike.

  • Replaced my worn out Dura-Ace 11-25 cassette with a brand new Ultegra 11-28 cassette, that I got at a Boxing Dale Sale at La Bicicletta;
  • Replaced a bent drop out that was bent out of shape in a multi-bike piled up during the spring of 2016;
  • Tune both my rear and front derailleurs;
  • Took my chain off and gave it a thorough cleaning and re-greasing;
  • AND FINALLY replaced by front crank assembly

Here are the results:

Brand new crank
New cassette Ultegra 11-28

It took me more than 4 hours. I guess I am not cut out to be a bike mechanic, and I better keep my day job!

I am so tired, I’ll test out the bike tomorrow.

Decrepit Smoke Alarms

17 years old smoke alarm

We moved into our current house in the fall of 1999. Today it would be 17 years at this house. The old smoke alarms came with the house and others have kindly reminded me that they are long overdue. These alarms are hardwired into the house’s 120V electrical circuits. With no batteries to replace, I thought they would just last forever. I did not know that they have a limited life span of 10 years.

Newly installed Kidde dual purpose smoke alarm

This fall, I did some research on replacement possibilities and settled for the Kidde brand. Costco also had a convenient 3 pack on sale. One of the three alarms also detect carbon monoxide gas, so that’s great, because I can now get rid of my old plugged in carbon monoxide detector as well. They arrived a long time ago, but it was just today that I had some free time to install them.

The installation process was much easier than I thought. With a Robertson screw driver, it only took me about 5 minutes to take the old one out and installed the new one.

When I tested them, I was also pleasantly surprised that when one trips, the remaining two alarms sound off as well. That’s a feature that I didn’t expect to have. Another feature of these new alarms is that they actually voice out in English that either fire or carbon monoxide gas has been detected. That was pretty cool too.

With these types of devices, I firmly believe in keep it simple and stupid (KISS), so Nest smoke alarms are out, more things to break and diagnose. All in all, a pretty productive morning prior to our Christmas Eve dinner.

Casper Mattress

I heard a lot about the Casper mattresses online, especially from podcasts that I listen to. They were always giving away discount codes and praising how wonderful the mattresses were.

We had our old mattress since 2004, so I think it was time for a change. This was a traditional mattress and certain parts were so worn out that hills and valleys on the mattress were clearly felt and seen.

We finally took the plunge and ordered a King size version of Casper for our master bedroom. It arrived on November 28th, but did not get the chance to open it and sleep on it until the night of the 29th. Why the delay? The mattress came in a tall box and I had a false understanding that it may take some time for the mattress to regain its shape.

Casper King Size Delivery Box
Casper King Size Delivery Box

Well, this concern turned out to be unwarranted. When I open the box, I found the mattress was folded in half and was rolled up, held together with a white cloth like material. When I tore the material away, the stored potential elasticity of the mattress cause it to unrolled itself. The mattress was also sealed with a plastic bag, and I made short work of that. Once the mattress was freed of its packaging constraints, it just literally sprang into its original King size shape in seconds. Pretty impressive to watch!

A couple of first impressions! Some people may not mind the synthetic smell that was immediately evident once the mattress broke out of its plastic wrappings. It was bearable but not likeable. Luckily it was a pretty good day, so we opened our windows and air out the mattress. Second, when I finally lay on the bed, I thought it may be too soft to my liking. I like my bed nice and firm.

I thought the softness of the bed was disappointing at first, and was concerned whether I would sleep well on it. On the first night as I lay on the bed, it felt different, like sleeping in a hotel room, something new. I toppled and turned until I found a position that finally allow me to enter into a state of slumber. To my amazement, I had a great first night sleep. The mattress is soft, but supports your body comfortably and firmly once you lay on it in a horizontal position. It is much softer than a traditional mattress if you sit on the edge of the mattress. The softness is balanced to conform to the contours of your body, especially when you sleep on your side. There were no uncomfortable pressure points.

It has now been four nights, and each night I slept straight through to the morning. This was not the case with the old mattress. I typically get up in the middle of the night. Maybe we are still in the honeymoon period with the mattress, but so far I like it!

We kept our old mattress just in case, but I think we are now convinced and the old mattress is on its way out. Oh, the smell subsided and I didn’t even notice it last night. Many people asked me about this mattress, so I hope you’ll find this impression useful.

As I finish this article while laying on the very mattress that I’m writing about, I am really enjoying the snuggly feel of it.