IoT reference architecture for the edge domain

During my talk at Thingmonk last week, I showed the snippet of an IoT reference architecture that I developed covering the edge gateway domain.

Since I’ve yet to find amongst the many published IoT reference architectures any that decompose the edge and because several people asked for a copy, I thought I’d share it here for people to reuse. It’s simple but hopefully useful, and provides a starting point for proper design of solutions that exploit the edge.

Architecture overview diagram

iot-edge

Explanation of capabilities

The reference architecture shown above describes the key set of technology and organisational capabilities required in the deployment of edge applications.

Technology

  • Physical security mitigates the risk of tampering when devices are deployed in the field.
  • Device platform security protects the software platform, application code and data from unauthorised access.
  • The Device provides the hardware platform for application code and logic deployed at the edge.
  • Analytics models describe deployed analytics logic consumed by analytics runtimes in the edge software platform.
  • A Local Area Network provides the mechanism for the device to communicate with locally deployed applications, sensors and actuators, e.g. Bluetooth Low Energy, Zigbee etc.
  • Local Monitoring and Management tools enable administration and break/fix by local technicians servicing the installed hardware and software.
  • A Remote Monitoring and Management agent on the device enables diagnostics, monitoring and control of edge devices from the centre. This would be the preferred mode of operation since it does not require physical access to the deployed system.
  • Sensors and Actuators provide the link between the assets themselves and the device.
  • Assets monitored and controlled by the edge installation — i.e. the “things”.
  • Local applications support business operations conducted in the field.
  • An Application Runtime provides the programming environment for application logic deployed at the edge, e.g. NodeRED.
  • Control code is application logic deployed in the Application Runtime to orchestrate interactions with sensors and centre.
  • Sensor SDKs (Software Development Kit) facilitate development of sensor-driven applications to run at the edge by providing developer-friendly programmatic access to the sensor hardware.
  • Back-end SDKs facilitate communication with the centre by providing developer-friendly programmatic access to services at the centre and/or provided by third-parties.
  • A Wide Area Network connects the device to the data centre, for example via a cellular network or via wifi to the corporate network.

Organisational

  • Device and asset management is the central service management capability that deals with the ongoing monitoring and support for the hardware and software installation in the field.
  • Device installation and maintenance is the field-based service that installs and maintains the physical device, sensors and assets deployed in the field.

Brownfield IoT in manufacturing – new blog post

Following on from Thingmonk last week, I’ve just published a blog post on the IBM Watson IoT blog about one of the growing focus areas within the manufacturing industry.

Let me know what you think.

Thingmonk 2016

I had great fun at Thingmonk 2016 yesterday over in Shoreditch. Even better, I had the chance to present a talk, so if you’re interested, I’ve put it up on Slideshare.

Enjoy!

 

Been a little while…but then not!

I realised the other day that it’s been a little while since I wrote here on this, my personal blog. Regular readers will remember my  last post was a personal one, about the sad demise of my running mojo. That story is long overdue an update, and I will write one (in case anyone’s interested how that ended up).

I haven’t, however, stopped putting my thoughts out there and whilst this blog has been relatively quiet recently, I’ve been quoted and writing elsewhere. It felt a bit grandiose creating a Press page, but I thought it’d be a good way of not losing what I’d been doing, and sharing for anyone who is interested.

Wanted: safe return of running mojo

In a departure from my usual technology topics, I’m going back to my other passion today and writing a post about running. It’s a personal one, so if it’s a bit “problem page” for you then I’ll understand if you skip over it.

Last year was a pretty extraordinary one for me in that I found myself doing the one thing I said I’d never do which was run a marathon. Three times. So bitten was I by the marathon bug in fact that this year I’ve signed up for the North Dorset Village Marathon, the Bournemouth Marathon, Endure24 (as a duo) and will probably run a third marathon towards the end of the year. My focus therefore has been primarily on getting the right preparation for North Dorset which takes place in just over four weeks time.

What seems like an eternity ago (but was actually a matter of a couple of months ago) I ran a great twenty mile training run, followed by a hard and enjoyable speed work session with my running club, Hedge End. I was feeling great – fit, strong and confident. Then, I immediately got a cold. No biggie, but it disrupted my training. Just as I was coming back, I then developed a pain in my right knee, later diagnosed as anterior knee inflammation. This meant that I ran a total of about ten miles in four weeks as February turned to March. With the help of some exercises from a physio, I’ve got myself back and building my miles back up. I have a plan that will take me through to North Dorset that is achievable, the knee feels fine and so I should be on track again.

Except I’m still not feeling right.

This is my first real injury in nearly five years of running and I’m discovering that the one thing that physio can’t fix is the damage being injured does to your mind. Compared to what others have been through I’ve barely suffered at all so please excuse the whinge, but it has totally knocked the confidence out of me. I find myself chasing that good feeling of a few weeks ago, and just can’t seem to get there. My training distances and times are respectable, yet the real endurance I’m having to rediscover is between my ears. I ran a ten kilometre training run tonight, time respectable but could easily have stopped after three miles even though my legs were fine. That I managed to power through, mainly down to giving myself milestone landmarks to reach and focus, hopefully means this could be a turning point but I’m still worried that my elusive mojo might not materialise in time. The voice in my head is still posing questions like “have I trained enough?”, “have I lost all my endurance?”, “will I even finish the race?” and even knocking my physical appearance.

I’ve tried mixed training (the one good thing about the injury is it has caused me to start triathlon training), music (uplifting, memory-jogging, even amusing) and diet but just can’t yet get that good feeling back again. I’m sure this is a matter of time thing, and others have recovered from far worse than I have but I’m interested to know how people do cope with this aspect of the comeback trail or indeed hear advice that people might have.

So, for those who have experienced this phenomenon, I’m interested to know – how did you get your mojo back?

Wearable Technology Show 2015

I was pleased to be asked to attend the Wearable Technology Show 2015 in London last week as both a panellist and as a speaker.

I used the occasion to share a point of view on the importance of design and human factors in the adoption of wearable applications. If you’re interested, I’ve posted the slides on Slideshare, and you can read a longhand version of the paper on the Crunchwear blog.

Calling a REST service from Swift — a quick example

I figured this would be a recurring theme, so thought I’d write it down for posterity, not least so I didn’t lose it. The scenario is a common one — we have a mobile app for iOS written in Swift where in response to some kind of user trigger we need to go off to the server to do some work via a REST endpoint using JSON as our protocol format. Here’s a snippet I created to do exactly this, a variation on a couple of similar examples but with a couple of notes of things I found along the way.

Let’s assume we’re in a simple View Controller where we’re responding to stimulus from the user in the form of a button. I have an action handler called getData to respond to a button push.

@IBAction func getData(sender: AnyObject) {
   dispatch_async(dispatch_get_main_queue(), {
      self.getJsonData()
   })
}

You will notice a couple of things. Firstly we’re calling a another function on the controller that will actually do the heavy lifting. I’ve separated that out purely to make things easier to read and follow. The second thing is that I’m using the Grand Central Dispatch mechanism in Swift to spin off the action into a separate thread. This follows general good practice for user interface that you shouldn’t do work on the main thread that might block for some period of time, such as writing to the network or disk. Doing so could cause your app to hang and potentially be shut down by iOS as being unresponsive as a result (Apple themselves explain this nicely).

So now to the main guts of the code. In my simple case here I’m doing an HTTP GET of a JSON feed that returns an array of items that looks a bit like this:

[
  {
    "device": "TEST",
    "event": "Testing",
    "date": "2014-08-12T08:31:25.449Z",
    "_id": "53e9d0ddf5d6a92100b8254c"
  },
  {
    "device": "TEST",
    "event": "Testing2again",
    "date": "2014-08-12T09:25:25.062Z",
    "_id": "53e9dd85f5d6a92100b8254d"
  }
]

Here’s the function that does the work of going off to the server to get the feed.

func getJsonData() {
   var urlPath = "http://myserver/myaudits"
   var url = NSURL(string: urlPath)
        
   var session = NSURLSession.sharedSession()
   var task = session.dataTaskWithURL(url!, 
      completionHandler: {
         data, 
         response, 
         error -> Void in
         
            println("Task completed")
           
            if(error != nil) {
                println(error.localizedDescription)
            }
            var err: NSError?
            
            var results = NSJSONSerialization.JSONObjectWithData(data, 
               options: NSJSONReadingOptions.MutableContainers, 
               error: &err) as NSArray
            
            if(err != nil) {
                println("JSON Error \(err!.localizedDescription)")
            }

            println("\(results.count) JSON rows returned and parsed into an array")
            
            if (results.count != 0) {
                // For this example just spit out the first item "event" entry
                var rowData: NSDictionary = results[0] as NSDictionary
                var deviceValue = rowData["device"] as String;
                println("Got \(deviceValue) out")
            } else {
                println("No rows returned")
            }
        })
        
   task.resume()
}

Note that I’m explicitly casting the parsed JSON as an NSArray. One thing I discovered is that Swift isn’t massively tolerant if you get this wrong, for example if the JSON resolves to an Object, then you need to cast to an NSDictionary. Rather than return a useful message, it simply crashed the app. Now of course this was due to a genuine developer gaffe, but still it soaked up a fair amount of time trying to work out what was wrong.

With that, you should be all set. Hope this is useful.