B4R Library rCurieBLE - Arduino 101 BLE

Discussion in 'B4R Libraries' started by Erel, Sep 5, 2016.

  1. Erel

    Erel Administrator Staff Member Licensed User

    With this library it is simple to connect to the Arduino 101 board with an Android or iOS device.
    Arduino 101 instructions: https://www.b4x.com/android/forum/posts/448783/

    It is similar to B4i peripheral implementation: BLE (Bluetooth Low Energy) Peripheral

    It creates a service (0001) with a readable characteristic (1001) and a writable characteristic (1002).

    The NewData event is raised when a central device, the iOS or Android device, writes to the writable character.
    The DataAvailable event on the central device is raised after a call to CuriePeripheral.Write.

    Note that messages are limited to 20 bytes. Don't try to send more as it will break the connection.

    A B4A + B4R example is attached.
     

    Attached Files:

    Jpiti, paragkini and Beja like this.
  2. Erel

    Erel Administrator Staff Member Licensed User

    Second example:

    The Arduino 101 sends the measured temperature and pressure. It is connected to a BMP180 module.
    The values are displayed on a connected iPhone.

    upload_2016-9-5_11-29-55.png
     

    Attached Files:

    Last edited: Sep 5, 2016
    Jpiti, Peter Simpson and Beja like this.
  3. Beja

    Beja Expert Licensed User

    20 bytes are more than enough for telemetry communication.

    Thank you Erel so much
     
    Last edited: Sep 8, 2016
  4. Beja

    Beja Expert Licensed User

    One question!
    Can one use Uno or Mega? or it has to be 101 (I am using B4A only).
     
  5. Erel

    Erel Administrator Staff Member Licensed User

    This library will only work with the Arduino 101 built-in BLE module.
     
    Beja likes this.
  6. Beja

    Beja Expert Licensed User

    Thanks Erel,
    I ordered 101.. hopefully will receive it tomorrow.
     
  7. Beja

    Beja Expert Licensed User

    Hi Erel,
    Yesterday I received my 101 and tried the Android/101 example above.. the B4A is working fine and stuck on "Trying to connect"
    The 101 app cannot compile and said missing a library.. I copied the rCurieBLE (XML) in B4R library folder. besides I can't see the Arduino 101 in the Board selector list.
    Any guidance appreciated.
    Beja
     
  8. Erel

    Erel Administrator Staff Member Licensed User

  9. Beja

    Beja Expert Licensed User

  10. Erel

    Erel Administrator Staff Member Licensed User

    Are you sure that the rCurieBLE library is checked?
     
  11. Beja

    Beja Expert Licensed User

    Hi Erel,
    I copied the rCurieBLE.xml file to the b4r libraries directory.. what else should I do?
    Thanks in advance.
     
  12. Beja

    Beja Expert Licensed User

    This is where I saved it, but not showing in the libraries pane.

    B4R_LIBS.jpg
     
  13. Erel

    Erel Administrator Staff Member Licensed User

    1. Configure Windows to show the extension files.
    2. B4R libraries are made of a folder and xml file. You must keep this structure.
    3. the libraries folder should only contain xml files and other folders.
     
    Beja likes this.
  14. Beja

    Beja Expert Licensed User

    Thanks Erel, thumps up!
    All working now except the 101 BT is not discovered.. I am posting this in the questions forum.
     
  15. tigleth

    tigleth Member Licensed User

    Hello
    I set the 101 up in arduino and it runs sketches ; I ran the arduino example (on their site) for ble using nRF connect with my moto2g and it switches pin 13 led on and off. When I run BLEcentral it just stays on " trying to connect" . The phone sees the b4r_perif in the Bluetooth list. Any ideas will be appreciated.

    Thank you
     
  16. Erel

    Erel Administrator Staff Member Licensed User

    You need to run the B4R program from the first post on the board.
     
  17. tigleth

    tigleth Member Licensed User

    Hello

    I am running the B4R program from the first post 1.b4r on 101 and BLEcentral on moto2g, stays on " trying to connect" . When I click connect on b4r i get the message
    Error opening port
    jssc.SerialPortException: Port name - COM4; Method name - openPort(); Exception type - Port not found. When I look in device manager COM4 is on the 101.

    Thank you
     
    Last edited: Nov 24, 2016
  18. Erel

    Erel Administrator Staff Member Licensed User

  19. tigleth

    tigleth Member Licensed User

    Hello

    the b4r example is working; tested with nRF Connect; led off on; it is the b4a example that stops at " trying to connect ".

    Thank you
     
  20. Erel

    Erel Administrator Staff Member Licensed User

    Are you checking the logs?
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice