Turn your mobile phone into an IoT device

Daniel Béguelin recently posted a great developerWorks tutorial and video on getting started with IoT using just your phone.

Here in Africa, IoT devices are hard to obtain (and expensive) so these kinds of tutorials are vital when teaching IoT principles as Android smart phones are abundant (most Kenyans carry two!)

Readers of this blog (both of you ;-)) may recall I posted a similar tutorial myself earlier this year.

Here’s an update to the code snippet currently posted on the tutorial to address a formatting issue that will be fixed soon (and by the time you read this might be fixed already):

[{“id”:”215c6601.12d32a”,”type”:”ibmiot in”,”authentication”:”boundService”,”apiKey”:””,”inputType”:”evt”,”deviceId”:””,”applicationId”:””,”deviceType”:””,”eventType”:”accel”,”commandType”:””,”format”:”json”,”name”:”IBM IoT App In”,”service”:”registered”,”allDevices”:true,”allApplications”:””,”allDeviceTypes”:true,”allEvents”:””,”allCommands”:””,”allFormats”:””,”x”:264.1999969482422,”y”:434.1999969482422,”z”:”dc6a0ca6.7993b”,”wires”:[[“ce21edbb.320628″,”fdfdaaa2.a45678”]]},{“id”:”ce21edbb.320628″,”type”:”function”,”name”:”calc color”,”func”:”var accelZ = msg.payload.d.acceleration_z;\nvar r = 0.0;\nvar b = 0.0;\nvar g = 0.0;\nif (accelZ > 0) {\n\tg = Math.round(accelZ * 25);\n} else if (accelZ < 0) {\n\tr = 255.0;\n} else {\n\tr = 104;\n\tg = 109;\n\tb = 115;\n}\na = 1.0;\n\nmsg.eventOrCommandType = \”color\”;\nmsg.payload = JSON.stringify({\”d\”:{\”r\”:r,\”b\”:b,\”g\”:g,\”alpha\”:a}});\n\nreturn msg;”,”outputs”:1,”noerr”:0,”x”:437.1999969482422,”y”:430.1999969482422,”z”:”dc6a0ca6.7993b”,”wires”:[[“9df37edb.5d4588”]]},{“id”:”9df37edb.5d4588″,”type”:”ibmiot out”,”authentication”:”boundService”,”apiKey”:””,”outputType”:”cmd”,”deviceId”:”112233445566″,”deviceType”:”Android”,”eventCommandType”:”text”,”format”:”json”,”data”:”{\”d\”:{\”value\”:\”text\”}}”,”name”:”IBM IoT App Out”,”service”:”registered”,”x”:629.1999969482422,”y”:443.1999969482422,”z”:”dc6a0ca6.7993b”,”wires”:[]},{“id”:”fdfdaaa2.a45678″,”type”:”debug”,”name”:””,”active”:false,”console”:”false”,”complete”:”false”,”x”:442.1999969482422,”y”:364.1999969482422,”z”:”dc6a0ca6.7993b”,”wires”:[]}]

Also, my device wsn’t running Android 501, so I needed to recompile the apk code for Android 4x devices.

To save you the trouble I’ve put the Android 4x build on box.com here.

Happy IoTing!

Advertisements

Building Cognitive Apps powered by Watson and Bluemix

Hello and Welcome.

In this Lab we’re going to use Cognitive Computing powered by Watson with cloud innovation platform Bluemix to create an application that answers questions on subjects like Healthcare and Travel.

Cognitive computing is the next era of IT as we make great strides towards computing that can understand or comprehend similar to how we humans do. It’s incredibly complex and sophisticated, cutting-edge stuff. But don’t worry, with Bluemix and Node-Red it’s going to be ridiculously easy to build some cool apps that use it.

Seriously it will be easy.

Let’s get started.

1. Quick Guide to Cognitive Computing

We’re going to use Cognitive Computing that has been already trained with general knowledge on Travel and Healthcare topics.

We can decide how we want to collect these questions – it could be tweeted, texted, emailed, sent via a Mobile app, even spoken. Also we can decide how we want the answers to be delivered – again through Twitter, SMS, email, voice etc.

2. Deploying Node-Red

First let’s deploy Node-Red (if you don’t already have it running) in Bluemix.

It’s going to be really easy.

  • Log in to Bluemix.
  • Click on the Catalog link at the top.

1

  • Find the Node-Red Starter service in the Boilerplates section near the top and click on it.

2

The Node-Red Starter will give us a really cool visual programming tool, that’s great for rapid prototyping of apps. The tool will generate Javascript apps that run on Node.js.

Bluemix’s Node-Red Starter service will deploy a Node.js runtime, a Cloudant NoSQL database and a monitoring service all in one click.

  • Give your Node-Red service a name and hit create.

 4

Bluemix will now create and deploy your Node.js runtime, Cloudant NoSQL database in the cloud. That was easy!

  • Now click on the big red button to open up the Node-Red editor.

5

You’ll have a nice, shiny new place where we can rapidly build cool Bluemix apps.

Just like this…

w1

3. Deploying Cognitive Computing in Bluemix

We’re now going to use Bluemix to deploy our Watson service that answers questions on subjects like Travel and Healthcare.

Go back to the Bluemix catalog.

1

Find the Watson Bluemix services.

w2

Click on the Question and Answer service.

w3

You won’t need to come up with a name for it – but you’ll want to bind it to your Node-Red app.

To do this, click on the drop down box under App: that defaults to Leave unbound.

Choose your Node-Red instance. w5

Now hit Create.

pic9

Good.  So now you have an instance of the Watson Question and Answer service deployed in Bluemix and bound to Node-Red, ready for us to build some Watson-powered apps.

Go back to your Node-Red editor.

w1

And find the Watson Nodes… These enable us to incorporate the Watson services into our Apps.

Using other Watson Nodes in Node-Red

Note that to use any of these Watson Nodes in Node-Red you first need to deploy the corresponding service in Bluemix and bind these with Node-Red, as we just did with the Question and Answer service.

Now let’s use Node-Red to create programs that ask and answer questions.

Start by finding the Watson nodes.

w6

Click on the Question and Answer node and drag it onto the canvas. w8

Double click on the Question and Answer node to configure it.

Here you can choose the “specialist subject” you want to answer questions on. This Watson service in Bluemix has been trained with general knowledge on Travel or Healthcare.

Of course Watson can be trained to become an expert on specific subjects such as travel to a particular part of the world or certain aspects of healthcare such as Oncology, or any other topic where you need an expert.

To find about more about how Watson is trained see this video

Ok – so choose which you’d like to ask questions on. I’m starting with travel.

w7

To test the Watson Question and Answer service let’s start by sending in some test questions and displaying Watson’s top response in the debug console.

Find and drag some Inject nodes onto the canvas.

w9

Double click on each Inject node, change the Payload type to string and compose a question to ask Watson. I like to name the Inject node with the question too.

w12

Repeat for as many Inject nodes as you like to ask as many questions as you want.

Go crazy. Have some fun. No really, go on.

Remember that you need to ask questions. Statements aren’t questions. And questions need to end with question marks.

w10

Wire all your Inject node questions into the Question and Answer node.

Now add a Debug node to the canvas and wire the output of the Question and Answer node into the Debug node.

w11

Cool. Now Deploy your first Cognitive Computing app!

13

Now make sure you’re displaying the Debug console.

w13

Now click on the Inject node buttons (the grey boxes on the left of the Inject nodes) to submit your questions to Watson and check the Debug console for the answers.

w14

Check out the answer Watson gives in the Debug Console.

w15

Not bad!

Try some more questions…

w16 w17 w18 w19 w20 w21

Yeah! Awesome!

Now imagine a travel agent that could give you helpful travel advice 24/7 through email, SMS text message, WhatsApp message, Twitter, etc…

If you want to display your question on the Debugconsole as well as the answer, wire your Inject nodes into Debugnodes too.

OK, let’s now try the Healthcare knowledge base.

Drag another Watson Question and Answer node to the canvas.w8

Configure it for the Healthcare corpus.

w7

Create more Inject nodes and configure these with Healthcare questions.

w22

Check out the answers.

w23 w24 w25

Now think of other ways to interact with the Watson Question and Answer service.

You can inject more questions through email with the Email node, through a Web app with the http node and even listening to questions posted on Twitter with the Twitter input node.

For submitting questions via Twitter you’ll want to set up a #hashtag which you monitor for the questions with Twitter input node. Then when the tweets come in, you’ll want to strip off the #hashtag so that Watson isn’t confused by it.

Hope you enjoyed this lab.

Building Hybrid Mobile apps with Cordova & Ionic and Mobile Backend-as-a-Service (MBaaS) with IBM Bluemix

Creating Hybrid Mobile Apps with IBM Bluemix Hands On Lab

Hello and Welcome. This week I’ve been at JKUAT (Jomo Kenyatta University of Agriculture and Technology) and Multimedia University of Kenya, sharing with faculty and students the power of cloud innovation platforms including how they can accelerate the creation of great Mobile apps.

This lab focuses on using Hybrid Mobile app development – with Apache Cordova and Ionic – together with Mobile Backend as a Service (MBaaS) provided by IBM’s cloud innovation platform Bluemix.

  1. First we’re going to create a Hybrid Mobile app on our local machine. This part will be fiddly because we’re developing this on the local machine.
  2. Then we’ll use Bluemix to create the Mobile Backend as a Service (MBaaS) which includes setting up a database, security etc. This bit will be easy peasey. Really.
  3. Then we’re going to use Bluemix to create an application that monitors tweets in Twitter, determines the mood of those tweets, and then sends us an SMS message with the ones that are positive. Seriously this will be easy too.
  4. Finally we’ll show you how to link the two together so that your Hybrid Mobile app can receive those positive tweets too.

Sweet.

Let’s get started.

  1. Create a Hybrid Mobile app

Let’s create a Mobile app that could be compiled to run on a range of different Mobile devices. We can test this Mobile app on our laptops using an emulator, or sign up and run it on our Mobiles.

Hybrid Mobile apps is a technique to use standard Web technologies – HTML5, CSS, Javascript – together with some clever frameworks and tools – namely Apache Cordova, Ionic, Bower, as well the SDKs for each device.

You can learn way more about Hybrid Mobile apps here. Often Hybrid Mobile is a good compromise between speed and ease of creating a Mobile experience across a wide range of devices. It can also lower the burden of maintaining multiple code-bases and keeping up with ever updating Mobile OS levels. Sure Native apps enable you to really control how the Mobile App looks and feels, but in many cases Hybrid is good enough. And Hybrid enables us to insert Native code where we need to access device-specific stuff like Cameras and GPS.

For this Workshop we’ll focus on Android – but all these steps can be used with a few tweaks for Apple iOS.

Ok – let’s start by getting the right pre-reqs onto our machine. Remember we’re not using Bluemix yet. We’ll use that for the Mobile Backend services – and it’ll be considerably easier!

  • – Install the Pre-Reqs

1.1.1 – Install Git

Git rocks. If you’ve never heard of it – it’s a revision control system that has become very popular for being quick and easy to use. By the way, Bluemix has built-in features for helping developers collaborate and share code which integrate with Git.

For our Workshop we’ll use Git to download a sample Hybrid Mobile App that some nice developers have already written and shared on Git.

Installing the Git tool means we can easily get this code using the command line.

  • Download Git here: http://git-scm.com/download/win
  • Note: While installing make sure you choose the option to enable Git to be run from the command line. If you missed that step, just re-install and change the option.

pic1

  • Now open a command line (cmd) and run the command git to make sure you can run from the command line.

pic2

1.1.2 – Install Node.js with npm

Node.js is a runtime for Javascript that screams (is fast) because of some clever stuff it does (an event-driven, non-blocking I/O model). Node.js also has a feature called npm that helps organise and manage packages of Javascript. We’ll deploy Node.js in the cloud with Bluemix later but we also need it on our laptops to test the Mobile App locally.

pic3

1.1.3 – Install your Mobile SDK

For this workshop we’re going to use the Android SDK. The great thing about Hybrid Mobile Apps is you can easily add the iOS SDK and build the same app for this platform later.

set JAVA_HOME=c:\Progra~1\Java\<jdkdir>

 

1.1.4 – Install WinAnt

This step is optional. But it may save problems later. The Android SDK uses ANT (Another Neat Tool), to build your Hybrid App, and often issues arise when the Android SDK can’t find ANT. It’s very irritating and fiddly to solve. Usually installing WinAnt fixes it.

 

Ok, these are all the pre-reqs we need to download to install. For the rest we’ll use git and npm to install.

Important – The Android SDK installation may open a window that looks similar to a regular Command Window. Close this and make sure you use a real command window for the next steps.

1.1.5 – Install Cordova

Apache Cordova is a set of tools for creating Hybrid Mobile apps using HTML5, CSS and JavaScript. You can download and install Cordova from the Website (https://cordova.apache.org), but we’re going to do it the easy way using Node.js’ npm package manager.

  • Open a command line window
  • Run this command

npm install -g cordova

pic4

1.1.6 – Install Ionic

Ionic is a framework for creating Mobile App UIs in HTML5 and CSS. We’re using this to “render” the UI for our Hybrid App. Once again you can download and install Ionic from the Website (www. ionicframework.com), but we’re going to do it the easy way using Node.js’ npm package manager.

  • In your command line window, run this command

npm install -g ionic

 

1.1.7 – Install Bower

Bower is a handy tool for managing assets. We’re going to use it to manage the Hybrid Mobile app code. Again you can download and install Bower from the Website (www. bower.io), but we’re going to do it the easy way using Node.js’ npm package manager.

  • In your command line window, run this command

npm install -g bower

That’s it – we’ve installed everything we need to build our Hybrid app for the Android Platform.

Rather than write our app from scratch we’re going to use a ready-made one – called Bluelist. The nice developers who created it, shared it on IBM Jazzhub and we can use git to pull a copy down to our machine.

  • In your command line window, navigate to where you’d like to store the Bluelist app and then run this command

https://hub.jazz.net/git/mobilecloud/bluelist-mobiledata

  • It may take a while for the files to be pulled. When finished you’ll have a copy of this Mobile App.

2 – Mobile Cloud

Now we need to create the Mobile Backend Services – this is where we start using Bluemix.

2.1 – Create a Mobile Backend service

We’re going to use Bluemix to create a Mobile backend service – including a Mobile database and Mobile security. It’s going to be really easy.

  • Log in to Bluemix.
  • Click on the Catalog link at the top.

pic5

  • Find the Mobile Cloud service in the Boilerplates section near the top.

pic6

  • Click on the Mobile Cloud service

pic7

  • Give it a name

pic8

  • Hit Create

pic9

Now Bluemix will create a Mobile Cloud service including creating a Cloudant database, a cloud-hosted Node.js runtime (just like the one we’re using locally to run our Mobile app), a Mobile Quality service, Push notification and a Mobile Application Security Manager. Neat huh?

  • Now go to the Dashboard

pic10

You’ll see the Mobile Cloud service.

pic11

  • Check that it’s running.
  • Now click on Mobile Options at the top left.

pic12

  • We’ll need these credentials.

pic13

Now, we need to modify the www/bluelist.json file with the details from Bluemix, so that your Mobile App will be permitted to access the Mobile Cloud services.

  • Navigate to the directory where to cloned Bluelist.
  • Go into the bluelist-mobiledata-cordova directory
  • Then www
  • Now open thejson file for editing – in Notepad or similar.
  • Edit these values carefully – making sure to keep the “ marks and commas – using the values given by Bluemix.
  • Save the file.


{
"applicationId": "<INSERT_APP_KEY_HERE>",


"applicationSecret": "<INSERT_APP_SECRET_HERE>",


"applicationRoute": "<INSERT_APP_ROUTE_HERE>"

}

Great.

Now let’s run our Mobile app.

  • Go back to your Command prompt – or open a new one.
  • Navigate to the directory where to cloned Bluelist

cd c:\<wherever-you-put-it>\ bluelist-mobiledata

  • Change into the bluelist-mobiledata-cordova directory

cd *cordova

  • Install the Bower framework in this directory

bower install

 

  • Tell Cordova to prepare to build Hybrid Apps for the Android platform

cordova platform add android

  • Tell Ionic to build the Hybrid App for Android

ionic build android

Great. Now we have a working Hybrid Mobile App, that is ready to connect with Bluemix and store information in the Cloud database service.

Finally, tell the Android SDK to run your Android app using it’s emulator. This step will take around 5 minutes.

The Android Emulator should eventually appear. Be patient while it loads the Android OS, and then your Mobile App.

Pesky Ant Problems

ant

If you get an error about the Android SDK not finding Ant. Please refer to section 1.1.4 – Installing WinAnt to fix the issue.

Also see this guide: http://developer.android.com/tools/building/building-cmdline.html

Finally your Mobile App should load.

android

Test the app, by adding and removing items for the list.

load

If you get an error about not being able to connect to the cloud, check the credentials in the bluelist.json file. If you need to make corrections, close the emulator, re-build the app and try again.

could no

Now you can see the data being stored in Bluemix

  • Back in the Dashboard, click on the MobileData

Click on Manage Data

manage data

  • Expand the Data Classes section.
  • You’ll find you data here.
  • You can now add and remove data, either using the Mobile App interface or this interface.
  • You can even import data – in json format – by dragging it onto this page.

import

Now let’s put the Mobile App onto our phones!

To do this we need to sign the apk file that was generated and transfer it and install it on our phones.

To generate a release build for Android, we can use the following cordova cli command:

$ cordova build --release android

Next, find your unsigned APK file in platforms/android/bin

It will likely be called something like CordovaApp-debug.apk in the bluelist-mobiledata-cordova\platforms\android\ant-build directory.

Now, we need to sign the unsigned APK and run an alignment utility on it to optimize it and prepare it for the app store.

Let’s generate our private key using the keytool command that comes with the JDK. If this tool isn’t found, refer to the installation guide:

$ keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000

You’ll first be prompted to create a password for the keystore. Then, answer the rest of the nice tools’s questions and when it’s all done, you should have a file called my-release-key.keystore created in the current directory.

Note: Make sure to save this file somewhere safe, if you lose it you won’t be able to submit updates to your app!

To sign the unsigned APK, run the jarsigner tool which is also included in the JDK:

$ jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore CordovaApp-release-unsigned.apk alias_name

This signs the apk in place. Finally, we need to run the zip align tool to optimize the APK:

$ zipalign -v 4 CordovaApp-release-unsigned.apk Bluelist.apk

Now we have our final release binary called Bluelist.apk.

If we wanted, we could now release this on the Google Play Store for all the world to enjoy.

But for now we can put this on our phone (e.g. email it to yourself) and install your Mobile app.

(There are a few other ways to sign APKs. Refer to the official Android App Signing documentation for more information.)

  • Now transfer your signed apk file onto your phone – using a USB cable, email etc.
  • Install the apk file and run it.

References

https://hub.jazz.net/project/mobilecloud/bluelist-mobiledata/overview#https://hub.jazz.net/git/mobilecloud%252Fbluelist-mobiledata/list/master/bluelist-mobiledata-cordova

Signing your Mobile app

http://ionicframework.com/docs/guide/publishing.htmlhttp://developer.android.com/tools/publishing/app-signing.html

Bluemix Mobile and Internet of Things

Hello and Welcome.
In this Lab we’re going to use Bluemix to create an application that tracks movement in a Internet of Things sensor – in our case a smartphone using a cunning little Web app – and then raises alarms whenever the phone is moved.

We can then decide to do whatever we like with the motion alerts. Send SMS messages, Mobile Push notifications, emails to warn someone – just like we did in this earlier lab – but the difference it we don’t need any special sensors and devices – just a regular smartphone.

In this lab – for the sake for variety – we’ll alert people by generating a tweet.

Let’s get started.

  • Log into Bluemix.
  • Click on the Catalog link at the top.

1

  • Find the Node-Red Starter service in the Boilerplates section near the top and click on it.

2

The Node-Red Starter will give us a really cool visual programming tool, that’s great for rapid prototyping of apps. The tool will generate Javascript apps that run on Node.js.

Bluemix’s Node-Red Starter service will deploy a Node.js runtime, a Cloudant NoSQL database and a monitoring service all in one click.

  • Give your Node-Red service a name and hit create.

 4

Bluemix will now create and deploy your Node.js runtime, Cloudant NoSQL database in the cloud. That was easy!

  • Now click on the big red button to open up the Node-Red editor.

5

  • Now add an IBM Internet of Things node to the canvas.

1

We’ll configure this node a little later.

  • Meanwhile add a Debug node and wire this to the Internet of Things node.

2

  • Now go to your smartphone. Make sure you have a good Internet connection – ideally Wi-Fi.
  • Open a Web browser on your phone.
  • Navigate to phonesensor.mybluemix.net

IMPORTANT – On Android, you’ll need to use Chrome. The built-in browser won’t work.

You should see this screen and the Web app should automatically connect.

phone

Now go back to your Bluemix Node-Red screen.

Double click on the IBM Internet of Things node to configure it.

  • Set the Authentication to Quickstart
  • Carefully enter the Device ID number displayed on your phone into the Device ID box.

3

Now Deploy the app and switch to the Debug console.

14

You should see a steady flow of debug messages.

4

The phonesensor.mybluemix.net Web app is capturing data from your smartphone’s internal sensors and using the Internet of Things protocol MQTT to transmit this information in JSON format to Bluemix.

The accelerometer in your smartphone is capturing the orientation of the phone and how much motion.

Try rotating and shaking your phone to see the values change.

Now let’s write some Javascript to decide what to do when the phone moves significantly.

  • Add a Function node to the canvas.
  • Copy and paste the following Javascript into your Function node

if (parseFloat(msg.payload.d.accelY) > 2) {

randomstring = Math.random().toString().substring(0,5);

msg.payload = "YOU CAN'T TOUCH THIS!! @BenM4nn @Bluemix @Node-Red @IBMIoT http://wp.me/pER69-7Y " + randomstring;
} else return;
return msg;

This code will detect any motion where the accelerometer moves more than +2 in the Y-axis. This setting should detect someone picking up the phone, but it not too sensitive that it’ll trigger a false alarm when the phone is sat on the table.

It also puts a random number at the end of the status message. This helps bypass the duplication checks on Twitter.

13

  • Wire the IBM Internet of Things node into the Function node.
  • And wire the Function node into the Debug node.

7

Now Deploy the app and switch to the Debug console.

14

Rather than the steady flow of sensor events coming through, we’ll now only see debug messages if the phone is moved.

Test it by grabbing your phone. You should see debug messages appear telling you to put the phone back down!

8

Cool. So we can generate motion events from our phone and process these in Bluemix with Node-Red.

Finally let’s send a tweet whenever our phone is touched!

First though a warning!

Warning – Make sure you don’t forget to wire your output through a Delay node! Otherwise you’ll post loads of tweets each time your phone is touched! The sensor generates loads of messages per second!

tshirt

Ok – Let’s add that Delay node so we don’t forget later!

  • Find the Delay node and add it to the Node-Red canvas.
  • Wire the Delay node so that the Function node output also feeds into it. We can leave the Debug node wired too.

9

  • Double click on the Delay node to configure it.
  • Change the Action to “Limit rate to”…

10

  • Change the limit rate to 1 message per Minute
  • Check the box to drop (or discard) intermediate messages as we won’t need these.

11

Add a Twitter Output node (the grey terminal is on the right) to the canvas and wire the Delay node into it.

12

Now double click on the Twitter Output node. If you’ve already configured Twitter in Node-Red then you’re all set.

Otherwise follow these steps.

  • Double click on the Twitter input node you’ve created so we can configure it.

14

  • Click on the pen next to the “Log in as” box.

15

  • Click on the button to authenticate with Twitter. This will allow your Node-Red app to access Twitter using your Twitter ID.

9

  • Authorise Node-Red.
  • Now go back to the browser tab where Node-Red is running. You should see that your Twitter handle now appears in the dialog box.
  • Click Add

10

All set!

  •  Deploy your flow.

14

  • Shake your phone and you should see Debug messages coming through.

17

  • Remember to put your phone down to stop sending the messages!

Check your Twitter page, and you should see a Tweet from Bluemix!

tweets

Awesome!

So now you’ve created an Twitter-enabled Motion sensor alarm.

Remember!

Don’t forget to disable this – by deleting the connections to your Twitter node and re-deploying. Otherwise you’re going to flood your Twitter account with the same tweet. (Twitter may eventually intervene since the tweet text is the same).

Cool! Now experiment with other settings.

For example, try sticking your phone onto an object – like a chair – and see if you can configure an alert when the chair swivels or leans over.

Try different forms of alerts such as emails with the Email Output node or SMS with the Twilio Output node.

Most of all – Have fun!

Here are some instructions to help you set up your SMS Text messaging node that uses Twilio.

First, we’ll set up the SMS messaging node and check that it’s working.

Then we’ll wire the SMS messaging node into the flow we created.

Ok let’s go.

  • First find the Twilio node and drag it on the canvas.

25

  • Now double click on the Twilio node to configure it
  • Under Service choose External Service

26

  • Next to Twilio click on the pen icon.

27

Leave this screen open ready for us to set up a Twilio developer account and then we’ll paste the credentials into Node-Red here.

28

To activate your account, you’ll also need to supply your mobile number complete with the international dial code e.g. +254.

Twilio will send you an SMS with a code which you enter on the screen to finish activating your account.

Finally Twilio will assign you with a new virtual Twilio number.

 29

Important – For this demo to work in Africa, make sure you are assigned a United States virtual number i.e. one that starts with +1 as the international dialling code.

If you are assigned a number elsewhere, follow these steps to select a US number otherwise the SMS service won’t work. 

30

  • Click on the Release Number button

31

  • Choose Get It Now to get another number
  • Twilio may now generate a US number that starts in +1
  • However if it does not click on Choose your own number

32

  • Use the drop down to select United States. You may need to choose another country first to get it to select US numbers.

33

  • Choose a US number starting with +1 and click Get Started.

 

Now follow these steps to make sure you allow Twilio to send texts to your country.

 

Important – Check your text message permissions

Another common issue, is that the Twilio service doesn’t active SMS messaging to all countries by default.

Check that you can send Texts to your country as follows:

b1

  • Click on the GEOGRAPHIC PERMISSIONS tab.

b2

  • Click on the Messaging tab

b3

  • Scroll down to your country or click on the top check box to select all countries.

b4

  • Make sure your country is checked.

b5

 

34

  • Here you’ll find your AccountSID and AuthToken (click on the key icon to display this)
  • Copy and paste these two values carefully into the corresponding spaces in the Twilio node in Node-Red.
  • Copy and paste your Twilio (virtual) number into the From This is the number that texts will be sent from within Node-Red.
  • Click OK.

27

  • Now enter your own Mobile number in the SMS to This means that Twilio will send a text to your number.

36

Now test that your SMS node is working…

Wire an inject node into the SMS node and set the inject message to a string. Configure the inject node to SMS whatever string you like.

Deploy the node and press the inject node. You should shortly receive a text.

Now you can add an SMS alert – either to the phone being picked up to tell the person to put it back down, or to another phone.

Have fun!

Bluemix Twitter Sentiment Analytics with Twilio SMS messaging

Hello and Welcome.

In this Lab we’re going to use Bluemix to create an application that monitors tweets in Twitter, determines the mood of those tweets, and then sends us an SMS message with the ones that are positive.

Seriously this will be easy.

Let’s get started.

1. Quick Guide to Sentiment Analytics

We’re going to use Bluemix to create a Javascript app running on Node.js that collects tweets on our favourite hashtag and then analyses the text.

We’re going to get a score from this analytics – a value that represents the mood or sentiment the tweet indicates. If the vibes from the tweet is positive – e.g. “I love cats “This is a really awesome cat” the value we get from the sentiment analytics will be a positive number. If the tweets is neutral – e.g. “This is a cat” – the value will be zero or very low. If the feeling is negative – e.g. “Cat’s are stupid” – the value returned will be also.

cats

We can then decide what we want to do with this analysis. We could create cool graphs or funky heatmaps showing the mood of tweets on a particular subject.

What we’re going to do in this lab is simply annotate the tweet with the outcome, score and the appropriate smiley face and send them to our debug window. Whenever a tweet is positive, we’re going to forward the annotated tweet via SMS text message to our mobile phone.

The form of sentiment analytics we’re using is quite basic. For more advanced Twitter analysis see Bluemix’s new IBM Insights for Twitter service.

 

  1. Collecting Tweets in Real-time

First let’s create an app that captures tweets as they are tweeted.

It’s going to be really easy.

  • Log in to Bluemix.
  • Click on the Catalog link at the top.

1

  • Find the Node-Red Starter service in the Boilerplates section near the top and click on it.

2

The Node-Red Starter will give us a really cool visual programming tool, that’s great for rapid prototyping of apps. The tool will generate Javascript apps that run on Node.js.

Bluemix’s Node-Red Starter service will deploy a Node.js runtime, a Cloudant NoSQL database and a monitoring service all in one click.

  • Give your Node-Red service a name and hit create.

 4

Bluemix will now create and deploy your Node.js runtime, Cloudant NoSQL database in the cloud. That was easy!

  • Now click on the big red button to open up the Node-Red editor.

5

Start by finding the Twitter input node. Input nodes have little grey terminals on the left. Output nodes have their terminals on the right.

  • Create a Twitter input node by dragging it onto the canvas.

6

  • Now double click on the Twitter input node you’ve created so we can configure it.

7

  • Click on the pen next to the “Log in as” box.

8

  • Click on the button to authenticate with Twitter. This will allow your Node-Red app to access Twitter using your Twitter ID.

9

  • Authorise Node-Red.
  • Now go back to the browser tab where Node-Red is running. You should see that your Twitter handle now appears in the dialog box.
  • Click Add

10

  • Finish configuring the Twitter input node, by choosing the hashtag or text you want to apply analytics to e.g. #cats

11

Ok, let’s check to see that Node-Red is able to pick up the tweets.

  • Add a Debug node (Debug nodes are always output nodes).
  • Now wire the terminal of the Twitter input node into your Debug node, like this…

12

Great. Now we need to deploy this app to Bluemix.

  • Click on the Deploy button at the top right. It’s red because you’ve made new changes that haven’t been deployed yet.

13

Now make sure that your Debug console panel is displayed.

  • Click on the debug panel, just below the Deploy button.

14

Great. Now it’s a waiting game. Hopefully you picked a popular hashtag… We need to wait until the next person tweets on that hashtag. When they do you’ll see the tweet appear in your debug window. The tweet is in a JSON format, with lots of useful meta-data.

You can hurry this along by tweeting on the hashtag yourself of course 😉

Fortunately people are always tweeting about #cats so I didn’t have to wait too long!

15

Ok, so Bluemix is getting the tweets. Now let’s analyse them!

 

  1. Applying Sentiment Analytics

Rather than write our own code to analyse the tweets we’re going to re-use someone else’s. Even better, this code is already supplied by Node-Red in the form of a handy node!

First delete the connection you made between the Twitter input node and the Debug node.

  • Click on the connection and press the delete key on your keyboard.
  • Now find the Sentiment Analytics node and create a node by dragging onto the canvas.
  • Wire the Twitter input node into the Sentiment Analytics node.

16

Now let’s decide what to do with the output.

  • Find the Switch node and add this to the canvas.
  • Wire the Sentiment node into the Switch node.
  • Double click on the Switch node to configure it.

17

First, we’ll pass the Switch node the value generated by the Sentiment Analytics. We’re passing a JSON object with all the twitter meta data. The Sentiment Analytics node adds a sentiment element to the JSON. The score is added as msg.sentiment.score.

  • Enter “score” in the If msg. dialog box.
  • Now add conditions as below, so that in each case the Switch node creates a separate output terminal.
  • Use the +rule button to add additional conditions.
  • Click OK when finished.

18

Ok. Now let’s write some actual code!

We’ll start with the top Switch node terminal, which we configured for cases when the msg.sentiment.score value is positive.

  • Add a Function node to the canvas and wire the top output terminal of the Switch node into it.
  • Double click on the Function node.

19

Now we can write some Javascript.

Let’s take the positive tweets and insert some text at the beginning indicating that it was positive and include the sentiment score so we can see just how positive it was.

Here’s the code I used.

  • Copy and paste this into the Function.
  • Make sure you only have one call to return msg.


msg.payload = "Positive Comment :-) Score: " + msg.sentiment.score + " " + msg.payload;

return msg;

  • Copy and paste your Function node a couple of times and edit the code for the neutral and negative outcomes.

For example for the neutral case:

msg.payload = "Neutral Comment :-| Score: " + msg.sentiment.score + " " + msg.payload;
return msg;

And for the negative case:

msg.payload = "Negative Comment :-( Score: " + msg.sentiment.score + " " + msg.payload;
return msg;

  • Wire these new function nodes into the appropriate terminals of the Switch node – the Neutral function to the middle terminal, the Negative function to the bottom terminal.

21

  • Now wire all the Function nodes into the Debug node so we can see the annotated tweets with the scores in the Debug console window.
  • Don’t forget to Deploy!

22

Now we wait… and eventually you should see annotated tweets appearing.

23

Awesome!

 

Twitter rate limit

Occasionally you’ll see this error when working with Twitter. It means that the free developer APIs we use to talk to Twitter have pulled more tweets than Twitter allows us to do for free.

24

There are 2 ways to fix this. First, upgrade your developer API account to pay to access more tweets. Second, stop your Node-Red flow from reading from Twitter by deleting the node and re-deploying the flow. Then go and take a break, have a coffee, write a letter to a loved one, take an early lunch. When you come back later you’ll be able to carry on until you hit the limit again.

 

  1. Sending Positive Tweets via SMS

Finally, we’d like to notify ourselves whenever we find a positive tweet. Node-Red provides several built-in ways to do this. For example, we could:

  • Re-tweet them back into Twitter with the Twitter Output node
  • Email them with the Email Output node
  • SMS them with the Twilio Output node
  • Send them via HTTP to a Web application
  • Store them in a variety of databases

For this lab, we’ll send them to ourselves via SMS Text message.

First, we’ll set up the SMS messaging node and check that it’s working.

Then we’ll wire the SMS messaging node into the flow we created.

Ok let’s go.

  • First find the Twilio node and drag it on the canvas.

25

  • Now double click on the Twilio node to configure it
  • Under Service choose External Service

26

  • Next to Twilio click on the pen icon.

27

Leave this screen open ready for us to set up a Twilio developer account and then we’ll paste the credentials into Node-Red here.

28

To activate your account, you’ll also need to supply your mobile number complete with the international dial code e.g. +254.

Twilio will send you an SMS with a code which you enter on the screen to finish activating your account.

Finally Twilio will assign you with a new virtual Twilio number.

 29

Important – For this demo to work in Africa, make sure you are assigned a United States virtual number i.e. one that starts with +1 as the international dialling code.

If you are assigned a number elsewhere, follow these steps to select a US number otherwise the SMS service won’t work. 

30

  • Click on the Release Number button

31

  • Choose Get It Now to get another number
  • Twilio may now generate a US number that starts in +1
  • However if it does not click on Choose your own number

32

  • Use the drop down to select United States. You may need to choose another country first to get it to select US numbers.

33

  • Choose a US number starting with +1 and click Get Started.

 

Now follow these steps to make sure you allow Twilio to send texts to your country.

 

Important – Check your text message permissions

Another common issue, is that the Twilio service doesn’t active SMS messaging to all countries by default.

Check that you can send Texts to your country as follows:

b1

  • Click on the GEOGRAPHIC PERMISSIONS tab.

b2

  • Click on the Messaging tab

b3

  • Scroll down to your country or click on the top check box to select all countries.

b4

  • Make sure your country is checked.

b5

 

34

  • Here you’ll find your AccountSID and AuthToken (click on the key icon to display this)
  • Copy and paste these two values carefully into the corresponding spaces in the Twilio node in Node-Red.
  • Copy and paste your Twilio (virtual) number into the From This is the number that texts will be sent from within Node-Red.
  • Click OK.

27

  • Now enter your own Mobile number in the SMS to This means that Twilio will send a text to your number.

36

Great. We’re ready to send texts. Before we wire this into the rest of our Twitter Sentiment Analytics app, let’s test it to make sure it’s working. Inject nodes are a great way to test nodes, by passing messages into any node they’re connected to.

  • Add an Inject node to the canvas and wire this into the Twilio node.

37

By default the Inject Node sends a timestamp to the next node. You can edit the Inject Node to send something more interesting.

  • Change the Payload type to String.
  • Enter something interesting in the Payload box (not the Topic box).

38

  • Deploy your flow.

14

  • Now in order to inject this string into the Twilio node – and trigger it to send you an SMS, click on the small blue button on the left of the Inject node.

inject

  • Wait a moment – and hopefully your phone will buzz with a text from Bluemix.

40

  • If you don’t get a text after several minutes, check the Debug window for error messages and ensure your Twilio credentials and numbers are correct and in the right places.

Ok great – so we’re sending SMS from Bluemix.

Now let’s wire this up so that whenever someone posts a positive Tweet, we get the tweet and the sentiment analytics texted to our phones.

  • Wire the output of the Positive tweet function into the Twilio node.

001

  • Deploy!

14

Now the output from the Positive tweet function will be texted to your phone.

41

Cool!

Now you can experiment with other things you can do with Bluemix and Node-Red with the Twitter sentiment analytics.

But first don’t forget to delete the connection into the Twilio node and Re-Deploy, otherwise you’ll continue to receive text messages forever and ever!

 

you can’t touch this

my…my…my…music. hits me. so hard!

oh what memories come flooding back. the school trip to Isle of Wight. the day glo tee shirts. and M.C.Hammer explaining to the rest of the music world that he was now the zenith of popular culture. his reign only lasted until “Do the Bartman” hits the charts if I remember correctly.

mc-hammer-comeback

anyway. i’m back Strathmore University‘s iLab today with the great guys from TipHub. (you can read about my previous trip here). we’re running this hack event across 5 locations simultaneously. With Kenya as the HQ, hacks are also taking place in HubAccra in Accra, Ghana, Impact Hub in Washington, DC and Opportunity Hub in Affiliation with Georgia Tech University, Atlanta, GA.

i offered to fly, Phil Collins-style, between all the hacks, but the budget wouldn’t stretch that far and with the traffic in Nairobi, even Concord couldn’t get me to Atlanta in time.

however due to the time zone differences and Bluemix’s mighty DevOps powers of Git-integration, once today’s hacking in Nairobi crescendos and peters out, the baton (and the well-documented code) will be passed to the other teams so apply polish to the awesomeness we’ve created.

civichack

these hacks are all focused on addressing real problems that affect Africa dubbed the Diaspora Day of Civic Hacking. the projects are supported by diaspora (African’s who currently live abroad) who want to pool the creativity, energy and innovation of African’s burgeoning developer community.

the team has chosen a very worthy problem for their hack: creating a solution to help teachers in Africa take their teaching on students to the next level. this includes teaching disadvantaged in rural areas and nomadic tribespeople, who are unable to get into classrooms, and so use Mobile to bring the class to them.

the sponsor setting this particular challenge is Asante Africa, a non profit organization that provides underprivileged children in Kenya and Tanzania with access to education.

i’m here to show the how the latest tools and techniques – like the almighty Bluemix with his powers of DevOps, MBaaS and other awesome techwordsdejour as well as his ingenious side-kick  Node-RED – can help them achieve their goals faster, innovate collaboratively and be able to scale.

civichack2

for the solution, the hack team have focused on creating a great experience to engage the students, enabling them to learn using phones and tablets, at their own pace, and take quizzes and exams from the phone, delivering the results straight to the teachers. subsequent plans include revamping how teachers create, store, share and rate lesson plans, as well as bringing textbooks in Africa into the 21st century.

what the team realized they needed was an extensible content management system, that they could integrate with databases, email as Web and Mobile apps. Bluemix to the rescue with it’s new WordPress capability. the hack team were able to get started with Bluemix’s WordPress service rapidly, getting them from ideation to a wording environment in minutes.

so… why the reminiscing about MC Hammer?

last night i realized i needed to refresh the demos i’ve been using, and decided to tackle one i’d wanted to create last time i was in iLab but never got time to finish couldn’t figure out how to get working.

it’s a trivial app, of course. but a use case that could be extended and expanded by someone with far more time than me more skills that me. i call this masterpiece: WHO MOVED MY PHONE!!

so… the use case is that you want to create a solution to avoid someone taking your phone. of course, this could be extended to bags, cars, cats, cheese and girlfriends.

in other words – regarding my phone and with this solution in place – “you can’t touch this” with me knowing about it. see what i did there?

first stop. fire up the mighty Bluemix and climb astride its awesomeness (head over to bluemix.net). sign in, if you’ve got an account. or repent bitterly and lightly slap yourself with alternate open palms if you’ve not got yourself a Bluemix account yet. ok, good? feel better now?

batmeme

now go to the catalog page. you know, this one. get yourself the power of the Internet of Things. first grasshopper, deploy the Internet of Things service boilerplate right at the top of the Bluemix sweetshop. this is what will open up the giddy world of Node-RED. name it. deploy it, and you’ll be able to launch Node-RED by clicking on the URL of the app (look under the funky name you gave it on the dashboard) and brace yourself for an overdose of awesome.

next go back to the Bluemix sweetshop (catalog). scroll right down to the bottom. here you’ll find the Internet of Things Foundation. get it. now. this sucker is going to register your phone (you know, the one we’re creating an app so we don’t let anyone touch it… can’t touch it….remember? ok.) and manage it and all sorts of great stuff that i know everything about need to read up and learn.

ok so now we need to put some code-type-stuff on your phone. calm down. it’s gonna be ok. it’s just the IoT Starter. if you’re an iPhone head, head over here. if you’re an Android head, then this is the one for you.

now i need to hand you over to the experts for the tricky stuff. don’t forgot about me, ok? you sure? alright… follow Mike’s excellent instructions, and remember i got this working first time at 10pm on a Friday night with jetlag, so you’ll do just fine. ready? ok – go and follow the steps for the IoT Starter demo here.

are you back? ok… wow… thanks i thought i’d lost you. it was ok wasn’t it? good.

now you have a cute little sensor doohicky running on your beloved mobe. and you’ve set this baby up to report to it’s mummy, the IoT Foundation.

the IoT Starter app has just turned your phone into a multi-purpose sensor and there’s looks of cool stuff it can sense. we’re going to focus on the accelerometer – the gizmo that can detect movement in your phone. and no just how much motion, but in what direction on 3 axises as well.

iotstarter

ace. now we want to create an Internet of Things app to make the magic happen.

go back to your Bluemix app – the one that’s running your Node-RED instance.

next painstakingly re-create these gorgeous Node-RED flows, taking care to make sure the connectors between the nodes are in nice sweeping arcs and everything is nicely proportioned.

node-red-flow

or just import this Node-RED XML, by copying to the clipboard and using the importing menu thus:

import-option

ta-dah! oh yeah. you rock. have you ever considered a professional (Node-RED) modelling job? i know some people…

[{"id":"b07579df.b727","type":"twilio out","service":"_ext_","twilio":"",
"from":"","number":"+123456789","name":"Text Ben","x":927,"y":260,"z":"c3a0ff77.0a54b",
"wires":[]}, {"id":"3f5a5b7f.d13aec","type":"debug","name":"","active":true,"console":
"false","complete":"false","x":660,"y":93,"z":"c3a0ff77.0a54b","wires":[]},{"id":"b38ee693.22178","type":"ibmiot in","authentication":"apiKey","apiKey":"",
"inputType":"evt","deviceId":"","applicationId":"","deviceType":"","eventType":"","commandType":"",
"format":"json","name":"IBM IoT App In","service":"registered","allDevices":true,"allApplications":"",
"allDeviceTypes":true,"allEvents":true,"allCommands":"","allFormats":true,"x":183,"y":94,
"z":"c3a0ff77.0a54b","wires":[["3f5a5b7f.d13aec","6a28aa89.8317ec"]]}, {"id":"6a28aa89.8317ec","type":
"function","name":"Has someone moved my phone?","func":"if (parseFloat(msg.payload.d.acceleration_y) > 2) 
{ msg.payload = \"WHO's TOUCHED MY PHONE!!\";}\nelse return\nreturn msg;","outputs":1,"x":444,"y":269,
"z":"c3a0ff77.0a54b","wires":[["3f5a5b7f.d13aec","6bc0d04.533193"]]}, {"id":"6bc0d04.533193",
"type":"delay","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1",
"rateUnits":"minute","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":715,
"y":397,"z":"c3a0ff77.0a54b","wires":[["b07579df.b727"]]}]

right. so we’ve got an input node. go into the settings and configure it with the credentials you got from the Internet of Things Foundation.

cool. now got to the javascript function node and check you have code that looks like this:

function-node

alright. this is going to capture one of the accelerometer values from the phone and see if it’s detected some movement. sure – fiddle with the value if you want to get it ultra-touchy. at this setting, the act of merrily picking it up should raise the alarm. but make it more snarky if you want. it’s your phone.

now decide how to you want to be notified that someone is cruising (for a bruising). i’ve gone for SMS, but you can use the Twitter, Email or HTTP nodes.

configure your alarm raiser. if SMS, rock on over to Twilio and invite those great people to furnish you with a lovely virtual number and the power of Twilio. whack your virtual number in the “from” box and the number of your other phone, or the number of your personal body-guard, or local friendly lynch mob into the “To” field.

whatever you’re using, forget the limit node at your peril. this little fella will stop you accidentally sending yourself 30,000 text messages. i’ve been there. twice.

so there it is. your Node-RED debug window should print nothing at all, until your blessed, precious mobile is fondled by some devious troublemaker, at which point the alarm is raised and a text alert is dispatched.

disclaimer: i accept no responsibility for loss of phones. (the system is not 1000% full proof).

if you can figure out how to improve on this let me know. i mean, anything is possible. for example, can you extend this so that the mobe’s front phone camera takes a picture of the offender and uploads it to the Twittersphere so that social media mob justice swiftly follows? go on. i double dare you (no returns). of course, if you have Dobermans you could wire this baby into the remote control for their gate and unleash the very Hounds of Baskerville whenever your mobe is in a.n.other’s grubby mitts.

next i’d like to talk about how the other day, i was walking along the road and – STOP! hammer time!

Remixing Fashion at Asda George with APIs

by Ben Mann and Joshua Carr

George at Asda is a force to be reckoned with in the UK’s fashion industry, recently moving into the number 2 spot as Britain’s second biggest clothing retailer by volume. As described in our pre-Hackathon post, George are exploring how to increase the pace of retail innovation, by inviting London’s most creative developers to imagine and create a fresh set of apps.

To inspire creativity Asda partnered with Rewired State – an exciting UK company focused on bringing hackers together to rapidly prototype fresh ideas.

To provide developers with the tools and data to make their ideas a reality Asda partnered with IBM. The IBM team helped integrate Asda’s backend IT systems and present developers with a ready-made “wardrobe” of APIs that can be quickly mixed, matched and combined to create the next breed of retail apps.

Through a clean API portal – powered by IBM API Management – developers were quickly and easily able to tap into a wide range of George’s product data. The APIs provided details about George’s inventory of thousands of lines of clothes – including colours and variations, sizes and stock levels across hundreds of stores nationwide.

george1

Asda’s brief for the developers was simple yet challenging: discover ways to enhance the value of the George brand by creating new ways to engage with consumers. Oh – and be ready to showcase a working prototype of the idea by the following afternoon!

Day one kicked off with Asda George’s executive team briefing the developers on their goals and target market. They discussed the typical customer base for George – the Asda Mum who buys for her entire family – combined with a breakdown of how purchases are made and what goals Asda have for expanding their position while retaining their core values.

Next the IBM team introduced the developers to the APIs which provided the data sets about George’s clothing and stores for them to use in creating a new way to engage with the target shoppers. We also introduced the developers to the CloudFoundry-based cloud development platform Bluemix and a team of IBMers joined the hackers to build an exhibition app showcasing the Bluemix environment.

george2

Before long the developers had formed themselves into 11 teams, exploring the APIs and exploring imaginative ways to use these to create new solutions for shoppers. The teams experimented with a range of approaches – from helping shoppers create outfits and to trying on clothes virtually. Developers used a wide variety of technologies to build apps to tap into the apps including node.js, Ruby, PHP, Azure, Kinect, Twilio and Bluemix.

george3

Following a flurry of post-it-notes, gesticulating and the loud chatter of ideation, the teams had quickly produced mockups of the apps, which continued to be tweaked and enhanced while the serious coding got underway. One team even supplied an Internet of Things count down timer to measure the pressure of the deadline. The atmosphere was electric, and driven – not by a competitive spirit – but the desire to learn, to challenge themselves and to build skills.

As the teams worked away at their creations we managed to find out more about their plans and progress. However we didn’t anticipate how loud the sound of innovation can be – so apologies for the difficulty you may have in hearing the interview of the “music” of hacking!

Later that afternoon the IBM team spend some time reflecting on the reasons why progressive companies like Asda are exploring how Hackathons with APIs can stimulate more innovation and experiment rapidly and tap into the creativity of the broader developer community.

Simon Dickerson (API Management Technical Sales) and Charlie Cawood (UKI Sales leader for API Management) join me to discuss why an increasing number of pioneering companies are exploring the power of APIs to stimulate more creativity and experimentation as they look for fresh new ways to engage with their customers.

Many of the developers worked into the evening on their prototypes and the following morning the progress was impressive. Many of the apps already had working interfaces.

Developers were combining the Asda George APIs provided by IBM API Management platform with a variety of open data sources, external libraries and even bespoke hardware.

An IBM Team comprised of Allan Stockdill-Mander, Tina Selenge, and Joshua Carr used Bluemix to build a Mobile and Web app – dubbed getUP – that combined outfit creation with gamification. Aimed at the “Asda mum” the prototype app enabled them to create, show-off, and rate outfits created from George’s clothing range. It enables users to reward the outfits that looked great and were on trend and informing the rest of what’s currently a good look.

The prototype also enabled Asda Mums to create outfits for not just herself, but her whole family, letting them get in on the fun too. With suggested rewards of having trending outfits be made up on a mannequin in-store, potential discounts on trending outfits, as well as celebrities also getting involved. The idea of driving a buzz around a game that could be imported into Facebook was well received.

Later that afternoon the IBM team spend some time reflecting on the reasons why progressive companies like Asda are exploring how Hackathons with APIs can stimulate more innovation and experiment rapidly and tap into the creativity of the broader developer community. Simon Dickerson (API Management Technical Sales) and Charlie Cawood (UKI Sales leader for API Management) join me to discuss why an increasing number of pioneering companies are exploring the power of APIs to stimulate more creativity and experimentation as they look for fresh new ways to engage with their customers.

Mid-afternoon the count-down finished and the Hacks uploaded their prototypes to the code repo ready to present their ideas and creations to the judges.

Each of the 11 team presented a wide variety of tools that would engage, enable, and inspire their customers. These included apps that would process natural language, send SMS messages, a new breed of innovative mobile applications, in-store engagement opportunities, and apps that added a gamification experience.

The judges were very excited with the ideas and saw great potential to take many forward.

“This was an exciting opportunity for us and a first step in engaging the development community and it had a great turn out. The location was the perfect location to bridge between fashion and tech innovation and having a stable API environment helped the developers who attended focus on the actual development itself. In total twelve ideas were presented back to us many of which we could take forward to support our digital marketing efforts on the George brand.”

— Chris Chalmers, Digital Advertising, Performance Media Manager, Asda.

Check out the upcoming October edition of Wired UK for more information of the event and keep your eyes peeled on the George website over the coming months to be the one of the first to see innovation from an API hack taken into production!

george6

Congratulations to the winning prototypes that most captured the judges’ attention developed by @alexerax, @BenNunney and @carboia.

george7

If you’re interested in exploring how you can stimulate innovation through a similar event please get in touch.