6 Replies Latest reply on Jun 23, 2015 5:52 PM by CMata_Intel

    "hciconfig hci0 piscan" not executing at startup?

    AreM

      There's lots of code but it's simple and I just want to be clear. I'm running a startup .sh script to start Bluetooth on my Intel Edison.

       

      My code in the .sh file is very simple and looks like this:

      rfkill unblock bluetooth

      hciconfig hci0 piscan

      hciconfig hci0 up

      python SPP-loopback.py &

       

      Now, when I boot up my Edison and check bluetooth settings, I get this (notice that Discoverable is "no" - this is the problem):

      [bluetooth]# show

      Controller XX:XX:XX:XX:XX:XX

              Name: D1Edison

              Alias: D1Edison

              Class: 0x0c0110

              Powered: yes

              Discoverable: no

              Pairable: yes

              ...

              ...

              ...

              UUID: Serial Port               (00001101-0000-...)

              Modalias: usb:...

              Discovering: no

      [bluetooth]#

       

      Since the "UUID: Serial Port          (00....)" line is there, I know that my startup script ran (I double checked this). And when I check the system status (systemctl status <myfile>), the script is active with no errors.

       

      Now, I want my Discoverable settings to be "yes", and if I now systemctl stop <myfile> and then systemctl start <myfile>, I get this: (Discoverable now "yes")

      [bluetooth]# show

      Controller XX:XX:XX:XX:XX:XX

              Name: D1Edison

              Alias: D1Edison

              Class: 0x0c0110

              Powered: yes

              Discoverable: yes

              Pairable: yes

              ...

              ...

              ...

              UUID: Serial Port               (00001101-0000-...)

              Modalias: usb:...

              Discovering: no

      [bluetooth]#


      If the Serial Port line is there, the system ran the script and Discoverable must have been at "yes" at some point! I don't know why is shows up as "no" and I haven't been able to figure it out for a while. Anyone know a thing or two about running scripts at startup and can guide me?