1 Reply Latest reply on Jan 27, 2016 3:54 PM by PabloM_Intel

    Sending string from Android to Edison via Bluetooth

    mepler

      Hi all,

       

      I'm trying to build a simple Android app that accomplishes the following:

       

      - sees/pairs with Edison

      - prompts user to enter WiFi ssid + psk

      - send data as string over bluetooth to Edison

       

      On the Edison side:

       

      - receive string

      - configure wpa_supplicant.conf file accordingly

      - reboot

       

      I've been doing a lot of research into how BLE works and wanted to ask whether my approach is the best option.

       

      Right now I'm using the bleno library to create a Service that can read a string when sent. Within the same app file, I can use file manipulation calls to change the wpa_supplicant.conf file and reboot the system.

       

      Does that sounds like I'm on the right track? Seems like a lot to just get a string from one device to another. I had previously gotten this setup to work, allowing for pairing between Edison and a device without the need for bluetoothctl CLI and had it echoing strings back and forth using SPP but was unsure if that was accomplishing what I needed...any advice would be helpful. Thanks!

        • 1. Re: Sending string from Android to Edison via Bluetooth
          PabloM_Intel

          Hi mepler,

           

          It does seems like a lot of work just to send a string and manipulate a file, but you’re on the right track. That’s how it should be done. Regarding the setup that you already had, I believe that SPP is the most adequate profile to accomplish the desired behavior. You could also take a look at FTP (file transfer protocol), among the several profiles that come in the Edison Bluetooth Guide SPP and FTP are the ones that would work best.

           

          As you can see in the Bluetooth Guide, the Edison module supports all BlueZ profiles but just some of them have been validated, you might want to check the other profiles available in the BlueZ site as you might find some helpful information.

           

          Regards,

          Pablo