3 Replies Latest reply on Jun 9, 2015 1:17 PM by Intel_Peter

    Intel Edison - Arduino bluetooth connection/management/communication

    eyrdor

      Hi,

      I am new to the Intel Edison and wanted to find out a way to manage Bluetooth connections and information (e.g. MAC address) using Arduino Code (i.e. Libraries).

      My end goal is to manage Bluetooth settings, connections and communication using Arduino code to communicate (i.e. bidirectionally with data and files)  with an Android device.

       

      What have I been able to get running?:

       

      I am not able to use Eclipse (C++) or the Intel XDK iot due to certain firewall issues.

       

       

      Any help or direction is great appreciated.

      thanks

        • 1. Re: Intel Edison - Arduino bluetooth connection/management/communication
          Intel_Peter

          Hello eyrdor,

           

          What exactly are you trying to achieve?

          If you are trying to manage the Bluetooth setting, I believe you'll find it easier using the Linux side. For example you could use the hcitool command or the bluetoothctl environment.

          I'll leave you here the Intel® Edison Bluetooth* User Guide so you can gather more information about the Edison's Bluetooth capabilities.

           

          By the way, if you still want to use the Arduino side, I'd suggest you to create system calls. For example, I noticed that you asked how to get the Bluetooth's MAC address from the Arduino side, so here's a short example:

           

          void setup()
          {
            system("rfkill unblock bluetooth");
          }
          
          void loop()
          {
            system("hcitool dev > /dev/ttyGSO");
            delay(500);
          }
          

           

          Peter.

          • 2. Re: Intel Edison - Arduino bluetooth connection/management/communication
            eyrdor

            Hi,

            thanks Peter,

             

            My goal is to be able to dynamically connect to the Bluetooth component of the Edison from an Android application (using a provided MAC address through some other component),

            transfer some data/files etc. then have the option to cut the bluetooth connection from either the Arduino code end or the Android end (this I know).

             

            I am hoping to be able to manage the Bluetooth connection (i.e. being able to identify established connections, sending data through the bluetooth component etc) with the Arduino code with the Bluetooth component of the Edison acting as a slave in establishing connections.

             

            Thanks for that tidbit. I also found out there's a popen() command that enables me to pipe (i.e using FILE type) the results from the system call and was able to get it working. I just have strip the required sub-string from the returned result.

             

            Update* - Any tidbit pertaining to using C++ (Eclipse) or JavaScript (Intel XDK) are also welcome as I am trying to get around my firewall issue

            • 3. Re: Intel Edison - Arduino bluetooth connection/management/communication
              Intel_Peter

              Your project sounds interesting, I'm looking forward to see how it progress.

              I believe the easiest way (without creating your own app) to connect from your Android device is using an SSH client (on your Android device), and running a script (On the Edison's terminal) that sets up the Bluetooth as you like.

              Since what you are trying to do is change the Bluetooth settings, this is how I would approach this challenge.

               

              Peter.