Into 3D Printing I Go

I purchased a 3D printer last week, and did not have an opportunity to open it until today!

I purchased the Wanhao Duplicator i3 Plus. It was super easy to install. After numerous YouTube videos on reviews of different printers and how to operate them,
I decided on this one. I didn’t want a DIY kit, so I settled for this preassembled one.

The YouTube videos really helped to prepare me to avoid the gotcha’s, and before long I was doing my first print, which was this Okay hand signal.

I wanted to test the printer with something more challenging. I opted for the Comura Articulatum from www.thingiverse.com. I found out about this object from the Maker’s Muse YouTube review of the 3D printer that I purchased. As you can see from the video below, the print was pretty successful and it came with articulating joints! I’ll be learning more about 3D modelling and printing this long weekend. Fun times ahead.

Three Cheers for Software RAID

Last year, I built a NAS machine as referenced by my previous post here. This month, my media drive composed of an LVM logical volume of almost 5TB is almost filled.

This drive contains all purchased media and our home videos for Plex, as well as our time machine backups. To alleviate the storage shortage, I purchased two 4TB Western Digital WD40EFRX hard drives. This weekend I took the plunge and installed the two new drives into my NAS computer. In the spirit of the moment, without performing a backup, I proceeded to:

  • Use parted to partition the drives;
  • Use mdadm to create a RAID 1 device of the two drives;
  • Created a new LVM physical volume with the new RAID device;
  • Added the volume to the existing volume group;
  • Extend the logical volume to newly added 4TB;
  • and finally, Extend the ext4 file system to include the 4TB

In the end, I now have a near 9TB network drive that should last me for quite sometime.

In researching how to extend the logical volume, I also found out how I can upgrade my drives in my existing physical volumes to higher capacity drives without having to recopy everything to another drive first. This should come in handy in the future, because my NAS computer box has no more drive bays.

I know I probably should have taken a backup before this, but everything worked and I couldn’t be happier. Hurray, hurray, and hurray for software RAID.

A Mauritian Legacy of my Grandfather

On May 17th, 2017 a Mauritian Chinese newspaper, Hua Sheng Bao (华声报), published an article on how my maternal grandfather Wu Tao Xing (吳桃興), also known as Ng Thow Hing to all of my relatives, reminded us all how my grandfather participated in the formation of a mutually prosperous China – Mauritius diplomatic relationship that lasted until today.

I personally have known bits and pieces of the story, but this article apparently written by family members of my grandfather shed more depths to how he was instrumental to the founding of the Chinese Embassy in Mauritius.

It is too bad that the newspaper does not have a web site, at least none that I can find, but one of my cousins from Mauritius was kind enough to provide a photo of the original article which I’ve included here. Below the original I also provided a translation that my beloved wife was patient enough to do with me.

The original article:

Our translation:

This year marks the 45th anniversary of the establishment of formal diplomatic relationship between China and Mauritius. At the time when the agreement is still being established, this is a momentous event amongst the Chinese expat from Mauritius. A new generation of Mauritian Chinese are now among us, many of whom are not aware of such an occasion and how important it was to Mauritius. This story is worth retelling for those new generation.

In 1972 when the agreement is reached, Mr. Wu Huan Hing 吳桓興 (Gong Gong’s brother), Director of the Beijing Cancer Hospital, acted as the facilitator and arranged for the first Prime Minister of Mauritius, Sir Seewoosagur Ramgoolam, to come to China to discuss the possibility and development of diplomatic relationship between China and Mauritius. Mr. and Mrs. Ng Thow Hing 吳桃興 (Gong Gong and Po Po), and Mr. Wu Pan Hing 吳泮興 was part of the Mauritian delegation during the visit to China.

Once the relationship is established, the Chinese Premier Zhou Enlai 周恩來 promised to assist in the creation of the Mauritian airport, hospital, and subsidized in other infrastructure improvements. The success of this relationship continues today and China is still a prime benefactor for Mauritius. As a descendent of Mr. Ng Thow Hing 吳桃興, we are proud that this heritage is part of our family history.

Afterwards, when China wants to establish an Embassy in Mauritius, it was Mr. Ng Thow Hing 吳桃興 who acted as a consultant to assist in the Embassy location.  Mr. Ng Thow Hing refused to accept any commission sighting his heartfelt connection to the motherland. Once the Embassy is completed, Mr. Ng Thow Hing 吳桃興 and his family members have always been invited — until his passing — to future Embassy celebrations in recognition for his contribution in the establishment of China – Mauritius relationship.

The son of Sir Seewoosagur Ramgoolam presented the CSK Medal to Mr. Ng Thow Hing 吳桃興 on the eve of the Mauritius Independence and Republic Day. A large part of Mauritius prosperity can be said, is owed to China’s assistance a direct result of the very same diplomatic relationship that Mr. Ng Thow Hing, 吳桃興 help to forge. All the key individuals mentioned in this article have passed away. As descendents of Mr. Ng Thow Hing, we will never forget how he was instrumental to the successful diplomatic relationship which both countries enjoy until today.

I believe the picture below is a photo of him sporting the CSK medal that was mentioned above.

I may not share his surname, but needless to say that I still feel quite proud to be within his lineage! I personally will not forget the deeds he played in Mauritian / Chinese history, and I will do my best to share this momentous event with my kids.

Update: 2017-10-06

Yesterday, I received a Facebook post:

https://www.facebook.com/roland.tsangkwaikew/posts/10155043511043494

The post was from Roland Tsang Kwai Kew, he effectively provided some explanation and clarity on where the article that we based our translation may have been sourced from. Here is a related article from Le DefiMedia Group.

I really appreciated the fact that he attempted to get hold of me via Facebook. It is really good to find out that that someone out there is preserving, observing, and recording the Chinese Mauritian culture as well as the Sino-Mauritian connection.

Update: 2023-07-06

I did a search of my Granduncle (吳桓興) on Baidu (百度), and found this page. The page is filled with information about him, and a hospital in Beijing that is named after him, 北京市朝阳区桓兴肿瘤医院. Here is a link to their main web page on the Internet.

On a very selfish note, and probably the most egregious, name dropping action ever, I am pretty proud to have found a picture with my Granduncle (and his immediate family members), Grandaunt, Grandparents, my parents (and my sister), my aunt, and of course me back in the 1970’s when I was probably 3 or 4 years old.

I am in the front row, kneeling. My grandfather is wearing the hat, and my granduncle is to “his” right.

Celebration of a Mentor

This morning I woke up to the news that an influential friend who I have the pleasure of working with since 1999 have passed away.

He was a passionate leader driven by a bottomless source of aggressive energy. He gave me an opportunity to excel in my work and taught me what credibility actually means and how to achieve it. Although on the surface, he would project a demeanour of all work and no play. Underlying that tough surface lays a big and caring heart. Those who are close to him will know exactly what I mean.

Aside from my family, Derek is one of the few colleagues who not only influenced and defined my work ethics but also contributed greatly to how I live and think. He encouraged and supported me during my episode with cancer. He is always there professionally and his support is as formidable, and as valuable as a diamond pillar.

I write this to celebrate the difference that he has made in me, and I am forever grateful for that. My condolences to the Smyth family. He will be missed and I will continue to take my cue from his spirit of life. That is eternal.

My First Apple Watch App

The last couple of posts, I talked about using a Raspberry Pi board to act as a WiFi switch to my garage door opener. I first used a Raspberry Pi 3 Model B, and then switched to a smaller form factor and more power efficient Pi Zero W.

I spent a lot of time writing security code on both the Pi Zero and iOS App so that the cipher and keys are in sync. I even threw in a time based HMAC algorithm so that the code being sent from the iOS App to the Pi Zero rotates every 30 seconds. The challenge here was the use of different languages and packages involved. I am using Node.js on the Pi Zero, so I had to get the
crypto module from Node to work with the Apple’s <CommonCrypto/CommonCrypto.h> module in Swift. Since this is my first real Swift app, it took some time to sort things out. Why all the fuss with security? Because I only wanted certain devices (Phones and Watches that my family owns) to open my garage door.

I took the plunge to writing my first watchOS app. I thought it would be more convenient to open the garage door from the wrist instead of hunting for the iOS app on the phone and fiddle with the large screen.

After testing the stability of the WiFi on the device for over two weeks, I found the responsiveness to be pretty rock solid. Good job Raspberry Pi! I finally hooked it to my garage door opener, and long story short, I get to see the fruits of my labour. Check out the video below.

I am super happy with the outcome. I now have a remote garage door opener that will work anywhere in the world as long as I have WiFi. I don’t have an extra box lying around in the house that some suspicious third party manufacturer may have access to. This solution is totally private, secure, and power efficient!

Next step is to add a camera to the Pi so that I can actually monitor the garage door as it opens. The camera will be quite helpful if we have any drop off or pickups. I may even research how I can get Apple’s HomeKit connected to the unit.

On the software front, I still have to do some minor user interface clean up, and raise the security level another notch by using https.

Raspberry Pi Zero W with Relay

Last weekend I spent my time configuring the Raspberry Pi 3 Model B to trigger a relay. Tonight, I finally took the time to solder the 2 x 20 pin headers to the Raspberry Pi Zero W board. I wired it all up again and took a photo with a quarter coin, so you can appreciate how small the circuit is.

I had to make a minor software adjustment, because the Node.js version that I installed on the Pi 3 did not work. Apparently I had to get the armv6l version instead of the arm7l.

After a quick re-install from the above link, I was back in business.

Now I’m going to test the stability of the WiFi on the Pi Zero, before I make the final security touches to the software and then to the garage door opener!

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.