5 Replies Latest reply on Mar 28, 2017 6:31 AM by Gregory@smartnotify

    Edison Startup Script, Bleno, BLE

    Gregory@smartnotify

      Hello,

      I'm using Bleno on Edison and all is working well, even using Rex's configuration steps.
      the problem is that each time the board is restarted, we have to redo the config steps. I've been trying to update the example here

      Open Automation Projects

      So that the board can go both in the "proper" bleno mode and runs the right app.
      but...I cannot see to get the right syntax/setup going.  Would anyone have a startup script that would duplicate Rex's config steps ?

       

      Merci!
      Gregory

        • 1. Re: Edison Startup Script, Bleno, BLE
          Intel Corporation
          This message was posted on behalf of Intel Corporation

          Hi Gregory,

          Thanks for your interest in the Intel Edison Platform.

          We would like to know if you are receiving some error message after enabling the script or while it is running. Also, we’d like to share this link: How to create a system service with systemd on Edison and Galileo’s eglibc image, this procedure is similar to the one you provided, however, it could help you.

          Regards,
          -Yermi A. 

          • 2. Re: Edison Startup Script, Bleno, BLE
            Gregory@smartnotify

            Yerni,

            Here is the problem...

            To use Edison in BLE mode with Bleno, you need to run this at each restart

             

            rfkill unblock bluetooth
            killall bluetoothd (or, more permanently) systemctl disable bluetooth
            hciconfig hci0 up

             

            What I need to figure out, and need help with, is where to put these 3 lines in the startup script (whether your link or mine) .  Do I need to create a specific service file (like in the example, in which case, what I have do not work) or do I update an existing script.

             

            Thank you!
            Gregory

            • 3. Re: Edison Startup Script, Bleno, BLE
              Intel Corporation
              This message was posted on behalf of Intel Corporation

              Hi Gregory,

              You can create a script and include those commands there, in order to do it, follow these steps:

              1. Create the script: vi my_script.sh

               

              #!/bin/bash
              # My first script
              rfkill unblock bluetooth
              killall bluetoothd (or, more permanently) systemctl disable bluetooth
              hciconfig hci0 up
              

               

                   2. Set up permission: chmod u+x my_script.sh


              Once you have created your script, we have to create a system service:

              1. Create the service file here: /etc/system/system
              2. /etc/systemd/system# vi my_service.service

               

              [Unit]
              Description = Setting up Edison BLE
              After = network.service
               
              [Service]
              ExecStart =/bin/bash /home/root/my_script.sh
               
              [Install]
              WantedBy = multi-user.target
              

               

                   3. Enable the service: systemctl enable my_service.service


              Now that you have created the script and enabled the service, every time you reboot the Edison your script should run and configure the Edison.

              Hope you find this information useful. If you any question please let us know and we’ll happy to help you.

              Regards,
              -Yermi A.

              • 4. Re: Edison Startup Script, Bleno, BLE
                Intel Corporation
                This message was posted on behalf of Intel Corporation

                Hi Gregory,
                 
                We would like to know if you tried our previous suggestions to create the script and the system service, also, if you have any question, let us know please.
                 
                Regards,
                -Yermi A.
                 

                • 5. Re: Edison Startup Script, Bleno, BLE
                  Gregory@smartnotify

                  Yermi,

                  Thanks for checking back in we've been running some tests based on the script and it looks like it is working.  Seems that our mistake was trying to put all the "startup" scripts in one place.

                   

                  thanks again

                  Gregory