element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
microbit
  • Learn
  • Learning Center
  • STEM Academy
  • microbit
  • More
  • Cancel
microbit
microbit Forum HowTo:  Connect a phone or tablet to the BBC micro:bit
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join microbit to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 1 reply
  • Subscribers 47 subscribers
  • Views 3152 views
  • Users 0 members are here
  • bluetooth
  • firmware
  • webusb
  • usb otg
  • micro:bit
  • usb
  • otg
Related

HowTo:  Connect a phone or tablet to the BBC micro:bit

jharris1993
jharris1993 over 6 years ago

Note:
This posting may become a work-in-progress with the possibility of updates as I go along.

 

One of the really NICE things about the micro:bit is that it is a really-and-truly "shirt-pocket" system,  If you get the tiny power-board add-on with the 3v button cell, you can have the entire working thing in your pocket.  Pairing the micro:bit with a tablet and/or smartphone gives you the opportunity to have a truly portable development environment without having to lug a huge system around with you.

 

There are two possibilities here:

  1. Using Bluetooth.
  2. Using the micro:bit's USB port via OTG. ("unofficial" beta)

 


 

Using Bluetooth:

Just about everything under the sun nowadays supports Bluetooth to one extent or another and the micro:bit is no exception.  So much so that Samsung has developed a micro:bit app for Android.  Using this, you can create software and write it to the micro:bit for testing.  There is, however, one teeny-tiny fly in that ointment.  It only works ONCE.  After you've flashed over your first program, you cannot do it again.

 

Why?  Because "Bluetooth" is not the default communications protocol for the micro:bit, "radio", (a proprietary packet-radio protocol), is the default and it displaces Bluetooth.  The result of this is that, (usually), you can flash the micro:bit once and once only.  This is why the Samsung app has so many negative reviews.  Additionally, MicroPython completely removes Bluetooth capabilities - including the base-level pairing functionality - as there isn't enough room.  With respect to MicroPython, part of the workaround is to use a web editor and flash something, which re-enables Bluetooth pairing.

 

Workaround:

Neil Kenyon wrote a really excellent article on how to re-establish Bluetooth communication with a micro:bit.  His "Correct Answer" gives a list of steps to follow that will allow you to re-flash your micro:bit after flashing it the first time.  I have not yet tried it but, based on what I know about it and what I've read, these steps sound spot on.  They've also received a LOT of excellent feedback, so I'd go try that.  In fact, as soon as I finish writing this, I'll go try it myself.

 


 

Using the micro:bit's USB port:

Since the micro:bit has a USB port and since the USB port is the primary programming interface for the micro:bit, it makes sense to plug your micro:bit into your device's USB port using an easily obtained OTG connector.

 

OTG?  Yep.  Stands for "On The Go" and is an implementation of a new USB standards extension that allows devices like phones and tablets to act as "computers" instead of "devices".  The idea is that instead of plugging your phone or tablet into your computer, you can plug things into the phone or tablet as if it was the computer itself.  Which is handy.  A tablet with a wired, (or wireless), mouse/keyboard can be really convenient as a portable workstation.

 

Unfortunately, like Bluetooth, it's not as easy as it sounds.  Why not?  Simple.  The current release firmware from Mbed/micro:bit does NOT implement OTG master-device functionality.

 

Workaround:

"Update" the firmware to a beta version that has a patch that enables OTG functionality.  It can be found on GitHub here:
https://github.com/microbitedupl/shared/blob/master/fix/2018-microbit-daplink-android-mount_problem/firmware/kl26z_micro…

This is a 7z (7-zip) archive file that contains one binary file that can be flashed in maintenance mode. (See: How to upgrade the firmware on the micro:bit)  The discussion talks about HEX files, but binary files can be flashed too.

 

Note:  This is "unreleased" experimental firmware that has been patched to enable OTG and shows as version 0246.  (The latest release is 0250)  You are welcome to use it, however do not update to this firmware version unless:

  1. You have a particular and specific need for the OTG functionality.
  2. You are interested in providing beta test feedback to the Micro:bit Foundation.

 

Reason #2 is probably one of the best reasons.  Providing the people at the Micro:bit Foundation with feedback on how well the OTG patch works on various phones and devices is crucial information that may well speed implementation of the OTG patch into the main firmware branch.

 


 

Other possibilities:  (For experienced users only!)

There are two other emerging possibilities:

  1. WebUSB  (Highly experimental)
  2. Web Bluetooth  (Still in development)

 

Note that these are emerging technologies and are strictly experimental in nature.  Because of this, you can, and should, expect there to be issues with them.  Handle with care!

 

WebUSB is an emerging technology that the micro:bit Foundation is encouraging people to test.  Information can be found here: Beta testing - Web USB

Note:  This is highly experimental and - due to recently discovered security concerns - may not even work.  Google is actively addressing these concerns and they may be solved by the time you read this.

 

Web Bluetooth is a very new technology that has attributes similar to WebUSB - and similar security concerns.  I first heard about it in an e-mail from the Micro:bit Educational Foundation, but have not found anything else about it, not even a beta program yet.  I suspect that it is still in development as I have seen several Github projects involving Web Bluetooth.

 


 

Let me know what you find out.

 

Jim "JR"

  • Sign in to reply
  • Cancel

Top Replies

  • neilk
    neilk over 6 years ago +2
    Hi Jim Nice summary. Just looking at the issue of Bluetooth - BLE - connectivity, you might like to look at MIT AppInventor's micro:bit BLE extension: http://iot.appinventor.mit.edu/#/ If you want to play…
Parents
  • neilk
    neilk over 6 years ago

    Hi Jim

     

    Nice summary.

     

    Just looking at the issue of Bluetooth - BLE - connectivity, you might like to look at MIT AppInventor's micro:bit BLE extension:

    http://iot.appinventor.mit.edu/#/

     

    If you want to play with micro:bit BLE at a lower level, Nordic's NRF Connect will let you connect to a micro:bit with 1 or more BLE services active and read and write characteristics.

     

    Most of the micro:bit BLE services are not registered so this will help with interpretation:

    https://lancaster-university.github.io/microbit-docs/resources/bluetooth/bluetooth_profile.html

     

    Bitty Software: https://www.bittysoftware.com/ has some fun stuff for BLE interaction with a micro:bit.

     

    Have fun!

     

    Neil

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • neilk
    neilk over 6 years ago

    Hi Jim

     

    Nice summary.

     

    Just looking at the issue of Bluetooth - BLE - connectivity, you might like to look at MIT AppInventor's micro:bit BLE extension:

    http://iot.appinventor.mit.edu/#/

     

    If you want to play with micro:bit BLE at a lower level, Nordic's NRF Connect will let you connect to a micro:bit with 1 or more BLE services active and read and write characteristics.

     

    Most of the micro:bit BLE services are not registered so this will help with interpretation:

    https://lancaster-university.github.io/microbit-docs/resources/bluetooth/bluetooth_profile.html

     

    Bitty Software: https://www.bittysoftware.com/ has some fun stuff for BLE interaction with a micro:bit.

     

    Have fun!

     

    Neil

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube