IoT server development with MeteorKitchen & Cloud9

c9-mk

Once the sensors are in place and your board is publishing data to an MQTT broker, the next steps are to aggregate, display and action. I recommend you try a free account with cloud9 (https://c9.io/c/mdINlHY8cba) and developing in YAML (https://en.wikipedia.org/wiki/YAML) with MeteorKitchen (http://www.meteorkitchen.com/).

From Wikipedia:- “Meteor, or MeteorJS, is a free and open-source JavaScript web framework written using Node.js. Meteor allows for rapid prototyping and produces cross-platform (web, Android, iOS) code. It integrates with MongoDB and uses the Distributed Data Protocol and a publish–subscribe pattern to automatically propagate data changes to clients without requiring the developer to write any synchronization code. On the client, Meteor depends on jQuery and can be used with any JavaScript UI widget library.”

From MeteorKitchen website:- “Meteor Kitchen” is a code generator for Meteor.js. Just describe your application in a simple JSON file and let meteor-kitchen build a complete Meteor application for you. I looked at this and saw that MeteorKitchen also works with YAML and I found this to be a revelation – web development by definition, not having to worry about javascript syntax – you have to try it for yourself!

Cloud9 offers hosted workspaces pre-configured for many common programming platforms and I chose Node.js. Right there in your browser you will see a fully-functional IDE running within a configured Ubuntu instance. In my C9 workspace console I installed Meteor, MeteorKitchen and JSON-YAML parser:

curl https://install.meteor.com/ | sh
curl http://www.meteorkitchen.com/install | /bin/sh
npm install -g js-yaml

There are many examples shown in MeteorKitchen, but as we are discussing IoT, lets take a look at:

https://github.com/perak/kitchen-examples/blob/master/example-iot/example-iot.yaml

The result? – a working reactive web app showing live sensor data, written in 44 lines of code. Enough said, go try!

Samsung IoT platform – wireless everything!

artik5-dev

Samsung recently announced their dev kit for Artik 5 IoT devices. In stock at Digi-Key, priced at £70 and delivered in 3 days. Note that the pic above shows the whole dev kit – Artik 5 is the plug-in board located left of centre. Artik 5 provides ARM7 dual-core CPU @ 1GHz, 512MB LPDDR3 + 4GB eMMC. The module is well-connected wirelessly with WiFI, BLE 4.1 and ZigBee. In addition, there is LoRa (SigFox) and Z-Wave hardware installed on the dev board. To ease development, Arduino connectors and libArduino enable simple prototyping with the Arduino IDE. The eMMC comes with Fedora 22 installed and it took me 30 mins to register on https://developer.artik.io/ configure WiFi and run htop:

Also built-in to the dev board are USB console, MicroSD, audio, 2nd USB port, JTAG, Secure Element – TEE (TrustZone), LiPo battery support and connectors for camera and 480×800 display.

This has to be the most flexible, low-cost and productive way to learn and develop IoT wireless solutions in your favourite coding language – top marks to Samsung! – available here: http://www.digikey.co.uk/product-search/en?keywords=artik

Mobile solutions – browser or native apps?

mobile apps

The demise of the native app, both on the desktop and mobile has been forecast since the development of HTML5. These two articles give a clear insight into the current state-of-play.

First, a view from product marketing: https://moz.com/blog/mobile-web-mobile-apps-invest-marketing-whiteboard-friday

Second, a high-level technology comparison for product management: http://waracle.net/html5-vs-hybrid-vs-native-app-development/

And if you want to get started right now:  https://developers.google.com/web/progressive-web-apps?hl=en

 

European General Data Protection Regulation

EU-flag

The concept of an EU common data privacy policy was first proposed in 2012 and has now been agreed upon by the EU commission, parliament and council.

Quoting from the press notice released 15th December (http://europa.eu/rapid/press-release_IP-15-6321_en.htm):

  • The General Data Protection Regulation will enable people to better control their personal data. At the same time modernised and unified rules will allow businesses to make the most of the opportunities of the Digital Single Market by cutting red tape and benefiting from reinforced consumer trust.
  • The Data Protection Directive for the police and criminal justice sector will ensure that the data of victims, witnesses, and suspects of crimes, are duly protected in the context of a criminal investigation or a law enforcement action. At the same time more harmonised laws will also facilitate cross-border cooperation of police or prosecutors to combat crime and terrorism more effectively across Europe.

This press release also states the following:

  • European rules on European soilcompanies based outside of Europe will have to apply the same rules when offering services in the EU.

I would suggest also taking a look at the following URL as it headlines penalties for non-compliance and data privacy breach – €100million fine?

http://www.cloudindustryforum.org/content/european-general-data-protection-regulation-time-get-serious-about-data-security

 

Raspberry Pi Zero – MVP?

Raspberry Pi Zero

I ordered two of these last Thursday from The PiHut (http://thepihut.com/) and they turned up this morning. I am impressed by the size and the immediate compatibility with my existing B+ project. I splashed out on a board only and the bundle with their essential kit.

For this test, I simply transferred the micro-SD card and USB  WiFi adapter from a running B+. The micro USB to standard USB socket came with the kit.

The picture above shows a Raspberry Pi Zero fitted with DIL socket (also provided in the kit) on the GPIO pins so it can sit nicely in the T-Cobbler Plus. Note that the power is supplied via a power monitor that shows current with an active WiFi connection; standalone, running linux, no active apps, current consumption is around 0.08A.

The Zero is an interesting solution for IoT; board area is around 1/3 of the B+, then choose any kind of wireless networking; Bluetooth, WiFi and/or GSM. It runs the same Broadcom chip originally used on the A+, but at a faster clock speed. The GPIO pinout is identical to the B+.

The Raspberry Pi Zero costs £4 quantity 1 – great value!

IoT ThingSpeak server on a Scaleway ARM server with Docker

in a recent post I mentioned the excellent value provided by a Scaleway ARM-based server instance (https://nicbkw.com/serious-cloud-presence-for-e2-99-month/). ThingSpeak (https://thingspeak.com) is well-known in the IoT world as an open source “Internet of Things” application and API to store and retrieve data from things using HTTP over the Internet or via a Local Area Network. With ThingSpeak, you can create sensor logging applications, location tracking applications, and a social network of things with status updates. Docker is a great way to abstract your solution into easily defined virtual containers (https://www.docker.com/).

Thingspeak is open-source and the install is available for download (https://github.com/iobridge/ThingSpeak). It has proved to be a scaleable architecture, built on Puma/Ruby on Rails with a MySQL database.Thingspeak in an x86 Docker environment is already supported, but I struggled to find anything similar for ARM.

So, I adapted the x86 install, replacing the required base images with two available for ARM architecture on Docker hub (https://hub.docker.com/). It was also necessary to add ruby on rails to the install. The resulting Docker build scripts are here: https://github.com/nicbkw/docker.thingspeak

Be aware that the install takes around 30 minutes due to the need to build and compile some components from source for the ARM platform. I would try this on a Raspberry PI, but mine are both in use ;-).

 

Internet of Things – are you ready for IPv6?

IoT-header

Say Internet of Things and understanding is split into: “my refrigerator will order milk over the internet” or “hackers can take control of my car”, but mostly “yeah – already got that to control my central heating”. Techies (like me) just go misty-eyed over all of these new gadgets.

IoT is much bigger than all of this. Over the past three years, enterprises have had to learn how to manage employees own devices connecting to corporate WiFi. This has required a huge uplift in WiFi bandwidth requirements and the ability to recognise and control access for many more devices as employees look for corporate data (email, CRM, price lists, etc.) on their smartphones and tablets.

Now imagine the mulitple of devices if every room, corridor and stairway has lighting, heating, aircon, occupancy and door locks advise and control through IoT devices. Then consider IoT signalling maintenance requirements of drinks and snacks machines. Car parks using IoT to show empty spaces. The list goes on; how will enterprise IT admin connect these devices through corporate WiFi?

The data rate will be small (and hopefully each device will talk to an internal gateway server, not over the internet) but each device will have a unique physical address and a requirement for an IP address – there will be a need to consider IPv6. Is your enterprise network IPv6 capable? Does your DNS allow IPv6 mapping?

IPv6 was first described in 1998 (Internet Protocol, Version 6 (IPv6) Specification,S. Deering, R. Hinden (December 1998)) – but how many enterprise networks are capable of supporting this extended IP addressing scheme?

I access the internet via BT Business Broadband; testing my browser capability using http://test-ipv6.com/ shows that BT DNS supports only IPv4 name resolution. So I just have to wait for BT to enable IPv6 addressing – or should I consider DNS that is already IPv6 capable? As an enterprise, you have to do this now!

For a way forward with IPv6, take a look at: https://www.opendns.com/about/innovations/ipv6/

 

Serious cloud presence for €2.99 /month

scaleway

I am a bit of a geek and consequently end up trying new hardware, apps and frameworks all the time. One issue with this is maintaining a reliable OS image. I am currently fiddling about with IoT hardware that runs a trusted connection to a web server to avoid broad internet access. Evaluating each new framework inevitably results in library inconsistencies and unstable platforms with unexpected errors. One way forward is to run in containers and consensus is that Docker (https://www.docker.com/) is the leading solution.

Recently, I was looking to run Docker on ARM platforms. Why ARM? – great return out of extremely lightweight, low-cost computing platforms. Earlier this year, hypriot (http://blog.hypriot.com/post/dockercon2015/) showed more than 2,000 docker containers running static web servers on a single Raspberry Pi2. OK – an interesting exercise.

For a cloud server with dedicated hardware, take a look at Scaleway (https://www.scaleway.com/imagehub/docker/) – they build their own hardware and each user gets their own 4 ARM cores, 2GB memory, 50GB SSD disk, 1 reserved public IPv4 and 200Mbit/s un-metered bandwidth (https://www.scaleway.com/features/) for €2.99 /month – this is  good stuff!