- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi guys,
I am using XDK IoT edition and Sparkfun Arduino block, I was wondering that is it possible to turn on the Bluetooth service in Intel Edison when it is power on without keying in the command :
rfkill unblock bluetooth bluetoothctlThanks
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hello chaos39,
Yes, it is indeed possible and it is actually really easy. You can do it through a system service, I wrote a document on how to create one. I suggest you to read it and if you have any doubt, please let me know and I'll be glad to help you. The guide can be found in https://communities.intel.com/docs/DOC-111103 https://communities.intel.com/docs/DOC-111103.
-Peter.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi Peter, I have read the link that you have given, however I am confused as the example is a program to auto- start instead of power on the Bluetooth, not sure if you have an example code to automatically power on the Bluetooth.
Thanks !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Sure, I can give you simple example on how to do it. This is the configuration I would use:
turn_on_bt.sh:
# !/bin/sh
rfkill unblock bluetooth
turn_on_bt.service
# !/bin/sh
[Unit]
Description=turn on BT
[Service]
ExecStart=/home/root/turn_on_bt.sh
Type=idle
[Install]
WantedBy=basic.target
Try that and let me know.
-Peter.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi Peter, It may sound like a stupid question to ask but do I need to put the # !/bin/sh ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
It's not, in fact it's a more than valid question.
The line # !/bin/sh in that code is the shebang, in simple words, it lets the parent shell know which interpreter has to be used to run the script.
Or as Wikipedia mentions, under Unix-like operating systems, when a script with a shebang is run as a program, the program loader parses the rest of the script's initial line as an interpreter directive; the specified interpreter program is run instead, passing to it as an argument the path that was initially used when attempting to run the script.
If you would like to learn more about shebang, I'd suggest you to read the following documents:
https://en.wikipedia.org/wiki/Shebang_(Unix)
https://bash.cyberciti.biz/guide/Shebang
-Peter.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page