Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Novice
924 Views

Problem in Using SPP for Bluetooth in Edison using Arduino

Jump to solution

Dear All,

I am trying to use the on-board bluetooth module. I read that it is possible by enabling the SPP through the command line. I followed https://software.intel.com/en-us/articles/turn-onoff-edison-arduino-on-bd-led-via-bluetooth-spp-by-i... Turn on/off Intel(R) Edison Arduino on board LED via Bluetooth SPP by using the IoT dev kit | Intel® Developer Zone and https://software.intel.com/en-us/blogs/2015/05/19/communicate-to-arduino-code-with-your-android-phon... IoT - Communicate to Arduino code with your Android* Phone by Bluetooth Serial Port Profile (SPP) on Intel® Edison | Int… but it end up saying

"read error Bad file descriptor"

 

"open error No such file or directory"

I think there is some problem in creating and accesing the pipe. Please help. I am not efficient in Python. Anything in Arduino IDE will work for me. Thanks in anticipation.


Accepted Solutions
Highlighted
Employee
7 Views

Hello iamfarazahmad,

You can find instruction on how to manually set SPP from Linux in or if you are interested in running SPP-loopback.py, you can find instructions on how to do it in .

If what you want to do is to start the SPP connection with an Arduino IDE sketch, then your best option would be to make system calls from your code in order to get the expected behavior.

Peter.

View solution in original post

0 Kudos
5 Replies
Highlighted
Employee
8 Views

Hello iamfarazahmad,

You can find instruction on how to manually set SPP from Linux in or if you are interested in running SPP-loopback.py, you can find instructions on how to do it in .

If what you want to do is to start the SPP connection with an Arduino IDE sketch, then your best option would be to make system calls from your code in order to get the expected behavior.

Peter.

View solution in original post

0 Kudos
Highlighted
Novice
7 Views

Thanksfor the reply. Can you help me out to how to call spp from arduino sketch? I need to send and receive data over bluetooth to my arduino sketch.

Highlighted
Employee
7 Views

I would first make Bluetooth to be set automatically on boot, you can learn how to do it with this guide: . Then I would create a shell script that set everything up for SPP manually. It should look like the following:

# !/bin/sh

sdptool add --channel=22 SP

rfcomm watch /dev/rfcomm0 22 > /dev/null &

bluetoothctl << EOF

discoverable on

quit

EOF

sleep 1

cat /dev/rfcomm0 > /dev/ttyGS0

Then you will have to make that shell script executable with the command chmod +x YOUR_SCRIPT.sh. Finally you should be able to run this shell script from your Arduino code with a system call like the following:

system("sh /home/root/YOUR_SCRIPT.sh);

You should then see the SPP output on the Arduino Serial Monitor.

Peter.

0 Kudos
Highlighted
Community Manager
7 Views

Hi Peter,

Is there a way that you could do this so that the SPP output is on the Intel XDK console?

Thanks,

Noah

0 Kudos
Highlighted
Employee
7 Views

Where exactly do you want the messages to appear? Could you please give me an example of how you would like to receive the messages?

-Peter.

0 Kudos