Shop OBEX P1 Docs P2 Docs Learn Events
RN-42 to PC demo??? — Parallax Forums

RN-42 to PC demo???

jsaddictionjsaddiction Posts: 84
edited 2014-06-17 12:40 in Accessories
Mr Savage,
I saw your learn write up on both the xb to pc and the bluetooth to pc demos. I am trying to build some interface schemes with bluetooth and android. I am teaching myself the Android platform and want to eventually create wireless test equipment using a tablet the RN-42 and or the SB6 wifi module. If you could will you post your demo code related to the RN-42? Thanks in advance.

Comments

  • SRLMSRLM Posts: 5,045
    edited 2014-06-11 19:59
    The main challenge is on the Android side. In particular, you need to use the SPP UUID (00001101-0000-1000-8000-00805F9B34FB) and have all your bluetooth port handling done in a background thread.

    The Android page on Bluetooth is a good place to get started:
    http://developer.android.com/guide/topics/connectivity/bluetooth.html

    Be prepared for some frustration on the threading.

    For me, it was easiest to require my users to first pair with the RN-42 via the Android's system properties. Then, in my app, I present them with a list of paired devices that they can connect to.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2014-06-12 08:38
    The code for the RN-42 should be linked right on the Learn page where you saw the article.

    Edit: confirmed, the links are on the second page of the article: http://learn.parallax.com/project/rn-42-bluetooth-pc-demo/assemble-bluetooth-unit
  • jsaddictionjsaddiction Posts: 84
    edited 2014-06-12 17:56
    Thanks for the link, I don't know how I missed it. Have you done any speed tests with it? I know my data aquisition will be bottle necked with bluetooth 2.1 but hopefully I can find a way around it. Alternatly I may step back and use an ADhoc wifi option.


    For the android software could you expand a little on what you did and how you went about it? Ever since I started working with HTML UI for various projects, I have been in love with using comon devices for project control (computers, tablets, smartphones). I would like to at the very least build a basic protocol over bluetooth to control whatever comes to mind.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2014-06-13 11:13
    The article we were talking about did not involve an Android App. However I did have the following example using one with the BoE-Bot and an RN-42 Bluetooth Module.

    http://www.savagecircuits.com/content.php?187-Bluetooth-BoE-Bot-Demo
  • NWCCTVNWCCTV Posts: 3,629
    edited 2014-06-13 17:17
    Would this by chance also work with an EBT?
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2014-06-15 23:03
    Electronic Benefits Transfer?
  • NWCCTVNWCCTV Posts: 3,629
    edited 2014-06-16 17:52
    Sorry: EBT = Easy Bluetooth.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2014-06-17 09:53
    Oh, okay. Well yes, it should work. The connection details between the module and the PC or Android device are somewhat irrelevant. Once they're connected in SPP mode (typical) and the correct COM port is accessed it's all just serial data.
  • NWCCTVNWCCTV Posts: 3,629
    edited 2014-06-17 12:40
    Thanks Chris, I will give it a try the next time I pull out my EBT.
Sign In or Register to comment.