ThreeJS is tricky, but awesome.

Over the past few months I have been using ThreeJS to create a 3D model of the NFC Ring.

ThreeJS from Wikipedia:

Three.js is a lightweight cross-browser JavaScript library/API used to create and display animated 3D computer graphics on a Web browser. Three.js scripts may be used in conjunction with the HTML5 canvas element, SVG or WebGL.

The ThreeJS community is actually really helpful, I’m not saying other communities aren’t helpful or useful I just found that the ThreeJS community did a lot more to help get me started.  There are also quite a few demostration videos online that can be used as reference material.

The real power of ThreeJS comes when you mix it with the power of Blender.

Blender from Wikipedia:

Blender is a professional free and open-source 3D computer graphics software product used for creating animated films, visual effects, art, 3D printed models, interactive 3D applications and video games. Blender’s features include 3D modeling, UV unwrapping, texturing, raster graphics editing, rigging and skinning, fluid and smoke simulation, particle simulation, soft body simulation, sculpting, animating, match moving, camera tracking, rendering, video editing and compositing. Alongside the modeling features it also has an integrated game engine.

At first I was completely stuck, the video tutorials were out of date and the documentation far too fuzzy, finally I met someone on IRC who did the type of task I was trying to to accomplish every day as his day job.  Things fell into place quickly, so quickly I thought it would be worthwhile putting together a video showing how easy the process is to model an object and export it as something that can be used in ThreeJS:

Canvas is pretty much a no-go for the work I’m doing, it’s nice to have the fallback options there but Canvas just doesn’t have the features I need to display a ring in all of it’s glory.  With that in mind if a user wants to see the ring and doesn’t have WebGL supported they are shown a message how best to upgrade their browser.

Finally we should note both three.js and blender are open source projects, completely free and depend on community donation and support. They are both evolving under great leadership and they deserve the credit and respect they get.

This is what I was able to accomplish, I’m pretty proud of it.

You can see the source code and access the assets here

A modern forum for a modern web

Screenshot from 2014-04-16 17:56:11

We recently migrated our NFC Ring forum over from ProPHPBB (Hosted PHPBB) to NodeBB. Let’s be clear, in this blog post I’m not comparing like for like. ProPHPBB is a free service, it is open source, built on PHP and it’s been the cornerstone of forums on the web for years. NodeBB is the young kid on the block.

Let’s get this out of the way, we paid the NodeBB team 300$ for our migration from PHPBB. Hosting and support is costing us ~70$ per month. With the support we’re getting we feel it’s value for money, we didn’t pay anything for the service from ProPHPBB, it was ad supported.

The guys at ProPHPBB were also great, we’d usually get our SQL export within 12 hours of asking. Obviously if we were paying them a monthly fee we’d expect a quicker response or even the ability to dump our own SQL but so is life.

The ads on the ProPHPBB forum hosting were just far too offensive and damaged our brand. It’s kinda obvious that PHPBB’s days really are numbered, the design and implementation is just too dated now for it to ever really become relevant again, I gotta thank it for it’s service though, truly great software has a shelf life like any other product and we should celebrate the circle of life. Thank you team PHPBB and the community around that project!

NodeBB presents some other significant advantages than providing value for money:

  • We can map our sub-domain
  • We can use our SSL certs
  • We can use our new Oauth2 Identity provider to provide a single unified sign on.
  • It has a great chat feature and notification system.
  • Posts can be up/downvoted and favorited
  • It is Beautiful, the UI is perfect for our Brand.
  • Responsive CSS provides a nice mobile experience

Migration wasn’t completely smooth, this wasn’t a huge surprise because we have all been crazy busy but what mattered is that pretty much any time I hit a problem I could jump onto IRC and Julian would sort it out within a few hours.
I have no regrets about using ProPHPBB initially as it gave us a very quick start with forums. Ultimately though, I’m happy with our new home and it’s onwards and upwards for the NFC Ring Forum!

Getting started with Explore NFC on Raspberry Pi in 60 seconds (Also Raspbmc)

The docs from NXP are slightly over verboose, here I make the assumption you already have a Pi installed and know a little about SSH and using the Linux Terminal. It’s worth noting I’m doing some of these steps on Raspbmc too so things may differ slightly from your environment. I will try cover both wheezy and Raspbmc

Put module onto Raspberry Pi by y’know, putting it on the Pi.. Reboot..

SSH into your Pi username pi, password raspberry
ssh pi@your-pi-ip-address

Update your Pi and install some deps
SPI was added late 2013 so it might not be available in your Kernel, doing an update is easy, do..
sudo apt-get update && sudo apt-get upgrade && sudo apt-get install ca-certificates git-core cmake
— Make a cup of tea

cd ~ && sudo wget http://goo.gl/1BOfJ -O /usr/bin/rpi-update
sudo chmod +x /usr/bin/rpi-update && sudo rpi-update
sudo ldconfig

Note: If you get a prompt saying you might not need this firmware or it’s the wrong update then just skip this step.

Enable SPI (not required on Raspbmc)
sudo nano /etc/modprobe.d/raspi-blacklist.conf
— Comment out blacklist spi-bcm2708
— Change it to read (note the hash)
# blacklist spi-bcm2708

Enable Pi on Rasmbmc
sudo boblightd
For posterity further information about this fix is on this thread — Note that sudo boblightd toggles SPI pins so running it twice might not work..

Reboot
sudo shutdown -r now
— Make a cup of tea

Grab the demo polling app from my Git Repo of the NXP S/W
cd ~
git clone https://github.com/JohnMcLear/NXP-Raspberry-Pi-Card-Polling-Demo.git
cd NXP-Raspberry-Pi-Card-Polling-Demo
cmake source
make

— Make a cup of tea

Test
sudo ./card_polling

My end goal here is to use my NFC Ring to start/play/pause videos in xbmc using the Pi shield.. Wish me luck..

Q: I get Failed to open bal.
A: You forgot to run card_polling as sudo.. sudo ./card_polling

Why NFC Keyboard emulators / readers are a bad idea

For a while I was using an NFC Keyboard reader to automatically type my password into linux until one event really changed my perspective on this..

Obviously from a security perspective storing your password in plain text on an NFC tag is suicide, but let’s assume for a second only your computer has the key to read the NDEF record on your NFC Ring so even if someone else was able to read the NFC Ring they wouldn’t be able to figure out your password..

It doesn’t seem like such a bad idea now to emulate a keyboard and type in your password? Wrong.. You see what happens is that your computer can read that data at any point, so let’s say you are on IRC chatting away to your buddies and by accident you scan your NFC Ring. Boom, your password is pasted into the chat window, this is what happened to me and it sucked. To be fair to recover I only had to type passwd and provide my old and new password but still, it could have been way more painful..

Obviously a work around is to only enable keyboard emulation on the login screen but it’s still an interior and inadequete solution for logging into your desktop.

Basically Keyboard emulation for Auth sucks, don’t do it, or if you be fully aware of the pitfalls!

I’m doing a webinar about wearable technology

I’m excited to be doing a webinar for Farnell / Element 14 on the 24th of September. The topic is wearable technology.

I will mostly be focusing on the potential of wearable rings but I will also cover bracelets and how I hope wearable technology can disrupt the resource hungry jewelry industry.

Attend the 9am GMT session
Attend the 3pm GMT session

It’s a free webinar so sign up now 🙂