2015年7月28日 星期二

Interview: Making the BBC Micro:bit Bluetooth Smart

Martin Woolley, Bluetooth SIG Technical Program Manager

Martin Woolley, Bluetooth SIG Technical Program Manager

Bluetooth Smart is a key element of the Micro:bit, the BBC’s much heralded educational computing device aimed at Year 7 children in the UK. Electronics Weekly talks to Martin Woolley, Bluetooth SIG Technical Program Manager, who led the work around Bluetooth, including creating a specific Micro:bit Bluetooth Profile…

Q: You must be pleased with the launch of the BBC Micro:bit and its embracing of Bluetooth Smart?

A: Absolutely. One million UK school kids will be receiving a BBC Micro:bit and for many of them this will give them their first taste of coding and of Bluetooth Smart too. We’re really excited about this!

Q: Being an educational initiative, everyone must wish it well and hope it makes an impact on the UK?

A: I should think so, yes. The word “strategic” gets bandied around a lot these days but the whole SIG believes this is one occasion where it’s right and proper to use it. We really think that this is an initiative that has strategic significance for the UK and it will hopefully help plug our apparent skills gap and pave the way for a new generation to embrace and drive forwards the Internet of Things.

I trace my career back to the day my form teacher brought a Commodore Pet microcomputer into school one day and right there and then a geek was born! I’m certain in the future we’ll hear young, British technology leaders saying that they first got interested in technology when they were given a BBC Micro:bit at school.

Micro:bit Collaboration

Q: To what extent was the Bluetooth SIG involved in the design?

A: We designed a Bluetooth Smart profile specifically for the BBC Micro:bit so it can be used “out of the box” right away. It’s an important part of the overall blend of technologies that make up the Micro:bit since it’s the part that enables the Micro:bit to communicate and connect to other Micro:bits, devices, phones, tablets, cameras and everyday objects all around.

Q: Was it just you, or a team?

A: It was a team covering various aspects of the project. I designed the profile in consultation with other Micro:bit partners, through a series of face to face workshops which the BBC ran. Others from the Bluetooth SIG took care of things like contracts, Bluetooth SIG membership and the process of getting the Micro:bit through the qualification and listing process.

The BBC Micro:bit, front and back

The BBC Micro:bit, front and back

Q: Who exactly did you work with? Samsung? Lancaster University?

A: Samsung, ARM and Lancaster University. And the BBC of course. From the very first meeting I was really impressed by the atmosphere of complete positivity and collaboration from all concerned. The BBC pulled together a fantastic team.

Q: You say you created a custom Bluetooth Smart profile specifically for the Micro Bit…

A: Yes, that’s right. The Micro:bit has its own particular set of capabilities and use cases envisaged for it which suggested from the start that it should have its own unique profile. The profile design was partly informed by the basic hardware features which the Micro:bit has and partly by considering the kinds of applications that people might want to use it for.

On the one hand there are Bluetooth GATT services that very obviously reflect fundamental device features, such as an Accelerometer Service and a Magnetometer Service that allows connected applications to exploit motion and directional data over Bluetooth Smart.

On the other hand, there’s a really flexible Event Service which allows bidirectional communication of various types of events between the Micro:bit and, for example, a smartphone. Either party can specify the type of events they are interested in being notified about through this service too.

For example, code running on the Micro:bit can indicate that it would like to be informed whenever the smart phone receives a phone call or incoming SMS message. When either of these events occurs, the smart phone application can use the same GATT service to tell the Micro:bit about the event and then the Micro:bit will do whatever it was programmed to do. We’re expecting the grid of 25 LEDs to get a lot of use in situations like this!

Q: Did you walk your own talk and use Bluetooth Developer Studio?

A: We most certainly did! Bluetooth Developer Studio is a new, free of charge tool for developers from the Bluetooth SIG which is currently in beta. It’s a profile design tool, a testing workbench and a code generator which can generate code for any number of target platforms including alternate Bluetooth Smart chips and their associated SDKs and smartphone platforms too.

The Micro:bit launch at the BBC

The Micro:bit launch at the BBC

I used the tool’s profile designer capability (which has a really nice drag-and-drop GUI, by the way) to design the first incarnation of the profile and then modify it as we completed the workshops and the requirements and ideas stabilised. With a couple of plugins created for the tool , we could also generate HTML reports detailing the profile design at various levels. These were circulated amongst the team for review when we weren’t physically in the same place. We’ll release those plugins for use by anyone – one of the benefits of Bluetooth Developer Studio is that it gives developers a chance to share their implementations with the larger Bluetooth developer community.

The BBC Micro:bit has a Nordic nRF51 Bluetooth Smart stack and this is one of the platforms supported in the beta version of Bluetooth Developer Studio. In a matter of days we generated code and handed it to Lancaster University who have developed the runtime firmware for the Micro:bit.

Micro:bit Bluetooth Smart profile

Q: I know it is possible to customise profiles, but many use-cases are in existence. Why was a new profile needed?

A: A Bluetooth Smart profile consists of a collection of Bluetooth GATT Services, each of which consists of one or more ‘Characteristics’, each of which will have zero or more ‘Descriptors’. So these are the fundamental building blocks of a profile. There are adopted services already designed by the Bluetooth SIG which support some of the use cases and where appropriate, those standard services were included in the Micro:bit. For example the Battery Service and Device Information Service are both included in the profile.

In other cases like the “incoming phone call” use case mentioned previously, we needed something completely new just for the BBC Micro:bit. That said, it’s worth pointing out that the Micro:bit is completely programmable and so we hope that kids will learn enough about Bluetooth Smart and the underlying technicalities like GATT, wipe our profile off the device and replace it with their own! That would be a pretty healthy sign of success from our point of view.

Q: Can you give specific examples of functionality supported, and thus possible apps?

A: The full specification of the Micro:bit was announced by the BBC at their recent launch event and the Bluetooth profile provides access to the key hardware features such as the buttons, accelerometer, magnetometer, pins and LEDs. The Micro:bit is completely programmable though and so the profile could well be replaced by more enterprising kids with a different one.

BBC Micro:bit side-on

BBC Micro:bit side-on

The sky’s the limit really. We’ve seen and heard about all sorts of applications already. At the launch event alone there was a Flappy Bird-esque game you could remote control using the Micro:bit buttons. Micro:bits were also being used to trigger the taking of selfies with a smartphone, a remote control truck was being controlled using the Micro:bit accelerometer and apparently one enterprising and creative young developer put together ‘the story of pizza’ using the LED display!

Q: How is a profile actually expressed, if I wanted to create my own custom profile? Is it via XML?

A: If you use Bluetooth Developer Studio you work with an intuitive drag and drop GUI. Behind the scenes we use XML to represent the profile and its constituent parts – the services, characteristics and descriptors. When you generate code that will implement your profile on a particular target platform, you’re generating source code for a particular SDK and each SDK represents a profile in its own way. Some use XML, some use JSON and some require you to build an in-memory description of the profile at run-time by making calls to library functions from your firmware.

Bluetooth Developer Studio goes a long way to protecting you from these variations since you’re working in a platform agnostic way during the design phase and the code generation process takes care of platform variations for you.

Q: Where and how does this get built or compiled?

A: After generating source code from Bluetooth Developer Studio you switch into the native tool chain for the target platform. Doing this is often as simple as double clicking on one of the generated files and watching as the appropriate development tool launches and imports the generated code. It’s here that you make any final, manual adjustments to the code and then build it and flash it to your device.

Once it’s been flashed you can then return to Bluetooth Developer Studio and use the testing workbench to run test scripts against your device, communicating with it using Bluetooth Smart via a dongle plugged into your PC.

Q: Can we all view this Micro Bit profile? Is it publicly documented in any way – alongside the Current Time Service or Blood Pressure Service, for example?

A: It’s not available externally at the moment. We are in discussions with the BBC and the details with other resources relating to the Micro:bit may be released when the time comes.

The future

Q: Getting back to the Micro Bit specifically, what do you feel it brings to the party that wasn’t there before, with the Raspberry Pi or LittleBits or SAM Blocks, for example?

A: The BBC Micro:bit will complement other devices like the wonderful Raspberry Pi (I have two!) and the SIG is sure we’ll see some fantastic creations involving both devices working together coming out of classrooms. The Raspberry Pi is a full blown Linux computer with a traditional screen, keyboard and mouse whereas the Micro:bit is a simpler device with its LED grid and two buttons.

We’ll have to see how kids respond to the Micro:bit and the various tools being created for it but the expectation the BBC has is that the Micro:bit will make it easy for kids to produce exciting and educational results very quickly. It’s also wearable and very small so there are bound to be some great ideas that take advantage of these aspects. With its motion detector and Bluetooth Smart profile, never again will big brother/sister be able to sneak into a younger, Micro:bit owning sibling’s bedroom undetected again!

Q: Any prediction on how it will fare? Or even what sort of apps will emerge, any particular trends?

A: The SIG is hoping that this will be a huge success – the sort of apps that emerge is limited only by the imagination of the kids in the country’s classrooms. The main trend that we’re wanting to see emerge is the growth of a new generation of digital pioneers who will one day take the IoT into exciting new directions. It may be a few years before this is proven true!

Q: Thank you for your time. Let’s hope the project gets the success it deserves – a lot of people have put a lot of effort into it, I know. One to tell the grand-kids about, that you were involved?

A: I’m not quite ready for grand-kids yet – let’s not give my kids ideas, if you don’t mind! But yes, we hope this will be something to look back fondly upon and more importantly, something which energises Britain’s development of the country’s Internet of Things economy.

 



from News http://ift.tt/1JOL4sh
via Yuichun

沒有留言:

張貼留言