Community
cancel
Showing results for 
Search instead for 
Did you mean: 
GMenv1
Innovator
1,013 Views

Edison Startup Script, Bleno, BLE

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

http://www.kurk.lt/projects/autostart-node-js-apps-on-Intel-Edison 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
0 Kudos
5 Replies
idata
Community Manager
46 Views

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: /docs/DOC-111103 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.

 

GMenv1
Innovator
46 Views

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
idata
Community Manager
46 Views

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.
idata
Community Manager
46 Views

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.

 

GMenv1
Innovator
46 Views

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

Reply