This is an archived copy of all my blog posts which is irregularly updated. For my latest blog posts see the Mbed Developer Blog.
  • Using AWS IoT as your LoRa backend

    Last week during re:Invent, Amazon announced AWS IoT. If you ignore all the fluff on the product page, the service is essentially a message broker. You throw messages over MQTT to Amazon, and you can set up rules to act upon those messages, for example to store the messages in a database. In Telenor Digital we’re working quite a lot with LoRa, Semtech’s wide area network solution, and we figured it would be worth an experiment to see how we can integrate our network with AWS IoT.

    Continue reading »

  • Awesome JavaScript snippets

    I have been writing mostly C and C++ in the last months, hacking away on LoRa and drones, but I had the pleasure of doing a week of JavaScript again, and I was reminded how much I love this weird, quirk and beautiful language. So today a write-up of some very useful patterns that show the power of JS.

    Continue reading »

  • Flying a drone in your browser with WebBluetooth

    There are tons of devices around us, and the number is only growing. And more and more of these devices come with connectivity. From suitcases to plants to eggs. This brings new challenges: how can we discover devices around us, and how can we interact with them?

    Currently device interactions are handled by separate apps running on mobile phones. But this does not solve the discoverability issue. I need to know which devices are around me before I know which app to install. When I’m standing in front of a meeting room I don’t care about which app to install, or even what the name or ID of the meeting room is. I just want to make a booking or see availability, and as fast as possible.

    Continue reading »

  • Building a smart meeting room w/ LoRa and Physical Web

    Ah! An empty meeting room. The moment you sit down however you’re being kicked out by someone who apparently ‘reserved’ the damn thing, and you’ll have to start your quest for some quiet working space all over again. Annoying. So when you’re finally used to first checking the calendar for the room, you’ll start to notice that there are people reserving rooms that they are not using at all!

    As we see smart suitcases, connected plants, and egg management devices appear I was wondering why our meeting rooms are still so dumb. When companies are building ‘smart’ meeting rooms, they usually don’t get further than just hanging an iPad next to the entrance. It’s time to create a proper smart meeting room.

    Continue reading »

  • JSConf.us

    In the past years I have been speaking at a variety of events, meetups and conferences, but for a JavaScript focused developer there’s only one mother of all conferences: JSConf.us. Originally started in 2009, a time before node.js was released, and where jQuery was the hottest library; it has grown to be the de-facto conference for everyone in the JS world, with sister conferences all over the world. In 2014 I already had the wonderful opportunity to speak at JSConf EU (video) and JSConf.Asia (video), and this year I was invited to complete the trio and speak at the 2015 edition of JSConf.us in Amelia Island, Florida!

    Continue reading »

  • Hack your phone: turn your volume buttons into GPIO ports

    As described in Firefox OS as an IoT platform, we are re-using existing phone hardware to build Gonzo, our wireless camera. While this has some major benefits, like more mature software and a cheaper pricepoint, it also has a major downside: because a phone motherboard is not meant to be an IoT board it doesn’t offer any extensibility points.

    A standard IoT dev board like the Raspberry Pi or Arduino comes with a number of General Purpose Input/Output (GPIO) pins. As a hardware developer you can use these pins to add new functionality to your board. For example, you can add new sensors to the board. For Gonzo we ran into the issue that we would like to add a LED light to the device, but the phone mainboard we use does not have GPIO ports.

    But we’re creative thinkers, so time for a hardware hack! Let’s re-map the volume buttons of your phone into generic GPIO ports.

    Continue reading »

  • Compiling cwebp for Android with PNG/JPEG support

    TL;DR: Pre-configured git repo. Clone it and run ndk-build.

    In an earlier post I described that power consumption is our main issue with Gonzo. We need the camera to run for a month or so on a single charge, and everything you do with the camera eats power away. A major cost in terms of battery life is uploading the photos that the camera takes. The photos that we take are 640x480, encoded as JPEG at 70% quality. That gives an average file size of a bit over 50 KB, and that takes 13 seconds to upload over a 2G connection. If we can get that down, that means less transmission time, and thus less power consumption.

    There has been quite some fuss over new image formats that should compress better, of which BPG looked very promising. Unfortunately it’s built on top of x265, and licensing issues are withholding me from using it in any production system. Next thing: WebP, Googles image format based on VP8.

    Continue reading »

  • Firefox OS as an embedded platform: Adding a new API to read arbitrary files

    As described in an earlier blog post we’re using Firefox OS as the OS for Gonzo, our wireless camera. The big advantage is the great set of built-in APIs that we can use to leverage functionality around dialing/SMS/camera/power management. However there are a couple of things we missed from the platform.

    Because the way Firefox OS is architectured all user code, like the actual code that powers Gonzo, runs in a web context. That means that the code is isolated in a sandbox and we cannot execute code outside of the sandbox or outside our privilege level. For IoT or embedded purposes that is actually quite a shame, as all the functionality that you want to use needs to be built into Gecko (the JS engine that powers Firefox & Firefox OS). For normal developers this is actually great. If I want to monitor the value of the proximity sensor it is a lot easier to write:

    Continue reading »

  • Firefox OS as an Internet of Things platform

    When developing Gonzo, our wireless camera, one of the big questions that pops up is: ‘Why does it run Firefox OS?’. At first it indeed seems like a weird fit, a camera that runs an operating system for mobile phones. An operating system that is even mostly targeted at the developing world. But Firefox OS is a better fit for embedded devices than you might think at first glance.

    If we’re talking about the Internet of Things from a prototype / hobby perspective there are two major players that create development kits. Arduino and Raspberry Pi. Both are electronics platforms that allow you to connect sensors, and use the sensor data as input for your applications. While that seems as a great fit for embedded IoT devices, both solutions came out extremely expensive for a camera project like Gonzo. The least we need are a dev kit, a camera, a GSM shield and an accelerometer (leaving the battery out), which translates into the following bill of material.

    Module Price
    Arduino Uno €20.00
    Camera module €25.73 ($31.95)
    GSM Shield €69.00
    Accelerometer €12.02 ($14.95)
    Total €126.75

    This shows in other components as well. Adding a decent touch screen to the material list will set us back another $144.95. When you think of this it’s actually completely crazy. Why do I need to shell out ~126 euros on Arduino modules while I can get a full smartphone with processor, memory, touchscreen, GSM, bluetooth, WiFi and accelerometer for… TWENTY-FOUR DOLLARS. That’s right. $24 retail price for a full smartphone off contract. And even better, it runs Firefox OS. If you look at the architecture of a phone like this (actually any Firefox OS phone), it looks like this:

    Continue reading »

  • A live feed from the canals

    Yes, a live feed from the Amsterdam canals through Gonzo, for everyone to admire. Actually the moment we speak the sun is setting, and Gonzo is taking a photo every 30 seconds to capture that magic moment. To see the live feed from Gonzo in your browser: click here.

    Photo taken at 16:26 (GMT+1)

    Continue reading »