Search Unity

Bluetooth Low Energy Plugins for iOS and Android

Discussion in 'Assets and Asset Store' started by Hotshot10101, Apr 17, 2015.

  1. Hotshot10101

    Hotshot10101

    Joined:
    Jun 23, 2012
    Posts:
    223
    Version 2.2 of my plugin for Bluetooth Low Energy on iOS and Android release recently.

    In this version we fixed a couple bugs and added some new callbacks.

    We also added the manufacturer specific data and the RSSI from the advertising packet so you can get iBeacon like functionality without having to actually connect to a device.

    In version 2.1 we added an all new example project that can connect to an RFduino device and a TI SensorTag.

    If you are getting into IoT and want to use Unity for your app development then Bluetooth LE for iOS and Android is the plugin for you.

    https://www.assetstore.unity3d.com/en/#!/content/26661
     
    OlliQueck and elias_t like this.
  2. memetic-arts

    memetic-arts

    Joined:
    Feb 27, 2011
    Posts:
    82
    Hi -

    Looks great, and for 10 bucks it's a no brainer . . . but just to confirm, with a potentially stupid question, your plugin will work with BLE devices like mbient labs metawear and Estimote, yes?
     
  3. Hotshot10101

    Hotshot10101

    Joined:
    Jun 23, 2012
    Posts:
    223
    As long as they are standard BLE devices, then the plugin should work fine.
     
  4. memetic-arts

    memetic-arts

    Joined:
    Feb 27, 2011
    Posts:
    82
    Awesome, thanks!
     
  5. MSFX

    MSFX

    Joined:
    Sep 3, 2009
    Posts:
    116
    Hi,
    Just want to check before purchase, what sort of callbacks are you providing? I'm assuming something along the lines of whether the device is immediate / near / far and some form of UID as I wish to use this with Estimote beacons...
     
  6. vilpasan

    vilpasan

    Joined:
    Apr 9, 2015
    Posts:
    6
    Hi,

    I am also interested in callbacks question...
    Does this plugin support BG monitoring to get region enter/exit notifications?
     
  7. Hotshot10101

    Hotshot10101

    Joined:
    Jun 23, 2012
    Posts:
    223
    When you do a scan you register 1 of 2 callbacks. One just receives a callback when a device is found that doesn't have any manufacturer specific data. The second callback gets called if the device has manufacturer specific data.

    Beacons use the manufacturer specific callback data to do what they do. This includes the Apple iBeacon protocol as well as others.

    This plugin does not do anything special for the beacon data. It is up to the user to decode the data, though it is really easy.

    The second callback also receives the RSSI value which can be used to determine distance. Again this is left to the user to utilize.

    Both are left to the user so that different beacon type protocols can be easily implemented without restriction to any one protocol.

    If you have more questions, please ask and I will do my best to answer.
     
  8. feel96

    feel96

    Joined:
    Jul 28, 2015
    Posts:
    2
    hello, I've purchased your plugin and have to say it worked very nicely after a bit of tinkering. I have two problems that I cannot solve regarding the plugin.

    1. For newer android devices, its asking for a 4 digit pin code when connecting to a pheripheral, is there anyway to lower the security settings to bypass this?

    2. On ios devices, there would be a popup requesting the user to turn bluetooth on when its not, but there are no similar characteristics on the android side, is it possible to have the same on android or implement some form of control over this?


    thanks
     
  9. Hotshot10101

    Hotshot10101

    Joined:
    Jun 23, 2012
    Posts:
    223
    Thank you for the compliments.

    1. I do not know of any way the plugin would be affecting this. It seems like this would be more a function of the device you are trying to connect to. It is the device that determines what kind of security it required. I have a tablet with 5.0 on it and it doesn't ask me for security on devices that don't require it.

    2. Again, there is nothing in the plugin that pops up any messages to turn on the Bluetooth. I am not sure where a popup might be coming from. Maybe the OS is detecting a request to connect and popping it up?
     
  10. feel96

    feel96

    Joined:
    Jul 28, 2015
    Posts:
    2
    thank you for your swift reply,

    regarding point 2, is there anyway to do something similar with the plugin? Or even a way to detect if bluetooth is swtiched on on the device.


    thanks
     
  11. zyndata

    zyndata

    Joined:
    Feb 15, 2015
    Posts:
    6
    Hi.
    I have few questions before buying.
    I'm using estimote beacons (http://estimote.com/) , can I designate device position in space by using your plugin? I'd like to know how far my device is from beacon placed on wall.
    How accurate is it?

    Thank you in advance
     
  12. carlos-martin-lucendo

    carlos-martin-lucendo

    Joined:
    Mar 4, 2015
    Posts:
    1
    Did it work with Mbient Metawear?
     
  13. Honoki_

    Honoki_

    Joined:
    Sep 15, 2014
    Posts:
    9
    hello~
    i am trying to make an android board game that will use bluetooth connection to connect two devices and play together. Is it possible with this plugins?
     
  14. rainymanyu

    rainymanyu

    Joined:
    Feb 15, 2016
    Posts:
    1
    how does writing specific characteristic works? do we get callback when it is successfully written?
     
  15. Hotshot10101

    Hotshot10101

    Joined:
    Jun 23, 2012
    Posts:
    223
    When you call the write characteristic method you pass in a callback. You also pass in a boolean flag of whether you want a write response. If the write response is successful you will get the callback called.
     
  16. VD_Billy

    VD_Billy

    Joined:
    Oct 7, 2014
    Posts:
    1
    Excuse me, does this plugin support Android 6.0?
     
  17. Hotshot10101

    Hotshot10101

    Joined:
    Jun 23, 2012
    Posts:
    223
    Yes it does. You have to add a line to the AndroidManifest.xml. If you have the latest version 2.9 then the instructions are in the PDF. Please let me know if you have any trouble finding it.
     
  18. ivanterra

    ivanterra

    Joined:
    Mar 23, 2015
    Posts:
    1
  19. Hotshot10101

    Hotshot10101

    Joined:
    Jun 23, 2012
    Posts:
    223
    ivanterra, are you the same person who is emailing with me about this? If so it is much easier to use email.

    If not please email my support email so we can figure out what is going on.

    That device claims to support BLE, so it should work. The trick will be in understanding their protocol and how to use BLE in general. I can help with this via email.
     
  20. NguyenPhuong3893

    NguyenPhuong3893

    Joined:
    Feb 14, 2016
    Posts:
    5
    Hi Hotshot10101 !
    Hope you make Tutorial Videos how to make an app Rename Bluetooth and Scan Bluetooth
    Thank you so much !
     
  21. Hotshot10101

    Hotshot10101

    Joined:
    Jun 23, 2012
    Posts:
    223
    Could you give me details on what you mean by Rename Bluetooth? I understand Scan Bluetooth.
     
  22. NguyenPhuong3893

    NguyenPhuong3893

    Joined:
    Feb 14, 2016
    Posts:
    5
    I want to rename Bluetooth's name with text in a textbox i type in, or text in a label.
    it changes Bluetooth's name when i click Button and then display Scan Bluetooth screen.
     
  23. Hotshot10101

    Hotshot10101

    Joined:
    Jun 23, 2012
    Posts:
    223
    There is not any built in function in the bluetooth specification for renaming a bluetooth device.

    You would have to control the firmware and then have your own command of some kind to send a new name to the device and have the device rename itself.

    If you don't want to change the actual name of the device and just want to change the name in your app, then that is up to you to do.

    There isn't anything in Bluetooth so there isn't anything in the plugin. The plugin only does whatever bluetooth allows.
     
  24. NguyenPhuong3893

    NguyenPhuong3893

    Joined:
    Feb 14, 2016
    Posts:
    5
    Thank you !
     
  25. Hotshot10101

    Hotshot10101

    Joined:
    Jun 23, 2012
    Posts:
    223
    You are welcome. Let me know if I can help any more.
     
  26. NguyenPhuong3893

    NguyenPhuong3893

    Joined:
    Feb 14, 2016
    Posts:
    5
  27. Hotshot10101

    Hotshot10101

    Joined:
    Jun 23, 2012
    Posts:
    223
    That app lets you change the name of the PHONE, not a device you are connected to.

    I am sure this is not available for iOS. Apple doesn't allow that kind of thing. They require the user to do it via the Apple Settings app.

    I am not planning on adding this functionality to Android because my plugin does not do anything with the phone as a discoverable device.
     
  28. NguyenPhuong3893

    NguyenPhuong3893

    Joined:
    Feb 14, 2016
    Posts:
    5
    could you add this function to your plugin, i really need that.
     
  29. Hotshot10101

    Hotshot10101

    Joined:
    Jun 23, 2012
    Posts:
    223
    This is not something that is part of what my plugin is meant to do. I am sorry if that doesn't work for you. If you email my support email and ask for a refund by giving me your order # I can request a refund from Unity.
     
  30. DeathQuake

    DeathQuake

    Joined:
    Oct 24, 2012
    Posts:
    64
    Are there any BLE plugins for windows that works on a HoloLens app made in Unity3D
     
  31. Hotshot10101

    Hotshot10101

    Joined:
    Jun 23, 2012
    Posts:
    223
    I do not know of any. I should probably do that.
     
  32. yifan024

    yifan024

    Joined:
    Jun 5, 2013
    Posts:
    19
    Hi, is the plug in support editor? Or I have to build out everytime to test? Thank you.
     
  33. Hotshot10101

    Hotshot10101

    Joined:
    Jun 23, 2012
    Posts:
    223
    You need to build for iOS or Android and run it on an actual device. Sorry for any inconvenience this causes.
     
  34. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    @Hotshot10101 Does this work on iOS 10? We are seeing issues with beacon reporting using another plugin and want to know if this will reliably give us the beacon data back?
     
  35. Hotshot10101

    Hotshot10101

    Joined:
    Jun 23, 2012
    Posts:
    223
    I have not had any trouble with it on iOS 10.

    I am not sure what problems you are having with the other plugin and if that is an OS thing or a plugin thing.

    If you do make the purchase and have issues, please use my support email to get support and I will help however I can.
     
  36. carterIV

    carterIV

    Joined:
    Nov 18, 2014
    Posts:
    2
    Hi Hotshot,

    I have bought recently your plugin but strangly, he don't work on my android device.
    I Probably forgot something, I don't know !
    I just want to use your plugin for an basic Beacons Scanning.
    Is it possible to have an tutorial ?

    Hope you can help me.
     
  37. Hotshot10101

    Hotshot10101

    Joined:
    Jun 23, 2012
    Posts:
    223
    Have you added the line to AndroidManifest.xml that is talked about in the PDF documentation?

    I do not have a tutorial yet for beacons. They are BLE devices, so you can scan for them and get the data. You have to do some of the work.

    The scan method in the plugin as 2 callbacks. Choose the second one and leave the first null.

    In the callback you get the RSSI and the manufacturer data as a byte[]. You can decode that using information on the internet with a google search about the packet format. Here is a good link:

    https://support.kontakt.io/hc/en-gb/articles/201492492-iBeacon-advertising-packet-structure

    Note that there is a proximity ID in that packet. That is the one to use to ID the beacon.
     
  38. carterIV

    carterIV

    Joined:
    Nov 18, 2014
    Posts:
    2
    Thank you for your reply.

    I keep you informed if I have other problems.
    have a good day !
     
  39. Ananas4k

    Ananas4k

    Joined:
    Aug 1, 2014
    Posts:
    21
    Hi I bought your asset, but when tested your example on my phone it didn't work.
    Please tell me what i am supposed to do.
    Thanks!
     
  40. Hotshot10101

    Hotshot10101

    Joined:
    Jun 23, 2012
    Posts:
    223
    What OS version are you using?
     
  41. Ananas4k

    Ananas4k

    Joined:
    Aug 1, 2014
    Posts:
    21
    Android 4.4
     
  42. Ananas4k

    Ananas4k

    Joined:
    Aug 1, 2014
    Posts:
    21
    I also tested on 5.1 device
     
  43. Hotshot10101

    Hotshot10101

    Joined:
    Jun 23, 2012
    Posts:
    223
    Well, that is not the problem then. If it is Android 6+ you need to add a permission line to the AndroidManifest.xml that is in the PDF documentation.

    I will need more information in order to figure out the problem you are having. It would probably work better if you emailed our tech support email address.

    One other thing to check is make sure the devices you are trying to scan are Bluetooth Low Energy. Classic bluetooth does not work with my plugin.

    What is the device(s) you are trying to detect?
     
  44. Ananas4k

    Ananas4k

    Joined:
    Aug 1, 2014
    Posts:
    21
    so HC-06 Wireless Bluetooth Transceiver RF Main Module won't work?
     
  45. Ananas4k

    Ananas4k

    Joined:
    Aug 1, 2014
    Posts:
    21
    I am just wondering could i refund this asset? I'm doing an application for a school project and if this doesn't work, I have no use for this asset.
    Thanks!
     
  46. Hotshot10101

    Hotshot10101

    Joined:
    Jun 23, 2012
    Posts:
    223
    Yea, HC06 is classic bluetooth.

    You will have to email me your order # and then I submit that to Unity for a refund. Usually takes a week to 10 days.

    I would suggest you don't post it here. Please email it.
     
  47. Ananas4k

    Ananas4k

    Joined:
    Aug 1, 2014
    Posts:
    21
    Where can i find your email.
     
  48. Hotshot10101

    Hotshot10101

    Joined:
    Jun 23, 2012
    Posts:
    223
    Ananas4k likes this.
  49. Ananas4k

    Ananas4k

    Joined:
    Aug 1, 2014
    Posts:
    21
  50. sgygkgk

    sgygkgk

    Joined:
    Apr 28, 2015
    Posts:
    6
    Hello Hotshot,

    I know that this tool is wonderful.
    However, it is regrettable only that "Android does not support being a Peripheral."

    Do you plan to support Android device to Peripheral?