Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
New Contributor II
2,546 Views

Bluetooth HC-06 data at tty

Jump to solution

Hello,

Forgive me I'm a bit of a newbie here,

I have managed to connect a bluetooth module, HC-06, to the Galileo Gen 2 through the mini pci-e wifi/bluetooth card. The bluetooth module(HC-06) is connected to an analog sensor and arduino. How do I go about finding this data within the linux command line on the Galileo? I have sent data this way to a PC which has a bluetooth dongle, so that information is easily captured through a terminal on a COM port. I eventually want to have my C++ code reading the bluetooth data.

Edit** I believe to focus on "tty" if I can find out which tty my bluetooth module is using?

Advice appreciated


Accepted Solutions
Highlighted
Employee
34 Views

Hi BMEJ,

I misunderstood the configuration you were using but I think now I understand what you are using, please let me know if I'm wrong.

On an Arduino Board you have the HC-06 module

On the Galileo you have the N135 module connected to the mPCIe slot.

You are trying to receive data through Bluetooth from the Arduino+HC-06module to the Galileo Board.

If you want to do this, I suggest you to look into this document: http://www.intel.com/content/dam/support/us/en/documents/edison/sb/edisonbluetooth_331704007.pdf Bluetooth User Guide (It is for Edison but it will help you too)

You can send and receive data by using rfcomm or another protocol that will allow you to create a code for Bluetooth. If you want to use C code the library is located on /usr/include/bluetooth. You can also use Python and install pyBluez.

I hope this helps and gives you and idea on how to start.

Regards,

Charlie

View solution in original post

0 Kudos
7 Replies
Highlighted
Employee
34 Views

Hi BMEJ,

You can find information about the devices connected to the mPCIe port by running lspci –v and checking the files in /sys/bus/pci/devices and /sys/class/pci_bus

Some questions about this:

The HC-06 uses serial communication, why you didn't use the pins 0 and 1 in order to use the module as a UART?

Could you provide the output you have after running ls /dev? It seems that you should have a ttyACMx on /dev, can you see this device?

Have you installed a specific driver for this?

What is the outcome of running uname –a?

Regards,

Charlie

Highlighted
New Contributor II
34 Views

Thanks for the reply,

I was a bit weary about seeing serial information via the pci-e bluetooth connection. So i suppose it's not happening. I connected by using bluetoothctl then pairing the device, but I suppose that's no indication that any data is transferrable, but like I said, I'm a noob.

edited*long and ugly.

I didn't see any references using lspci -v about my hc-06 module.

Are you recommending that I get another hc-06 module and connect it to pins 0 and 1 to send the data via bluetooth?

Thanks

Heres some output:

root@galileo:~# ls /dev

autofs loop-control ptyp7 ptyqe tty17 tty38 tty59 ttypb urandom

block loop0 ptyp8 ptyqf tty18 tty39 tty6 ttypc vcs

bus loop1 ptyp9 ram0 tty19 tty4 tty60 ttypd vcs1

char mem ptypa random tty2 tty40 tty61 ttype vcs12

console mmcblk0 ptypb rfkill tty20 tty41 tty62 ttypf vcs2

core mmcblk0p1 ptypc rtc tty21 tty42 tty63 ttyq0 vcs3

cpu mmcblk0p2 ptypd rtc0 tty22 tty43 tty7 ttyq1 vcs4

cpu_dma_latency mqueue ptype shm tty23 tty44 tty8 ttyq2 vcs5

disk net ptypf snd tty24 tty45 tty9 ttyq3 vcs6

esramtest0 network_latency ptyq0 spidev1.0 tty25 tty46 ttyGS0 ttyq4 vcsa

fd network_throughput ptyq1 stderr tty26 tty47 ttyS0 ttyq5 vcsa1

full null ptyq2 stdin tty27 tty48 ttyS1 ttyq6 vcsa12

fuse port ptyq3 stdout tty28 tty49 ttyp0 ttyq7 vcsa2

hpet ppp ptyq4 tty tty29 tty5 ttyp1 ttyq8 vcsa3

hugepages ptmx ptyq5 tty0 tty3 tty50 ttyp2 ttyq9 vcsa4

i2c-0 pts ptyq6 tty1 tty30 tty51 ttyp3 ttyqa vcsa5

iio:device0 ptyp0 ptyq7 tty10 tty31 tty52 ttyp4 ttyqb vcsa6

imrtest0 ptyp1 ptyq8 tty11 tty32 tty53 ttyp5 ttyqc zero

initctl ptyp2 ptyq9 tty12 tty33 tty54 ttyp6 ttyqd

input ptyp3 ptyqa tty13 tty34 tty55 ttyp7 ttyqe

kmem ptyp4 ptyqb tty14 tty35 tty56 ttyp8 ttyqf

kmsg ptyp5 ptyqc tty15 tty36 tty57 ttyp9 uio0

log ptyp6 ptyqd tty16 tty37 tty58 ttypa uio1

root@galileo:~# uname -a

Linux galileo 3.8.7-yocto-standard # 1 Tue Sep 29 22:16:33 GMT 2015 i586 GNU/Linux

0 Kudos
Highlighted
New Contributor II
34 Views

I guess was just hoping to use the bluetooth capability that the N135 has.

0 Kudos
Highlighted
Employee
35 Views

Hi BMEJ,

I misunderstood the configuration you were using but I think now I understand what you are using, please let me know if I'm wrong.

On an Arduino Board you have the HC-06 module

On the Galileo you have the N135 module connected to the mPCIe slot.

You are trying to receive data through Bluetooth from the Arduino+HC-06module to the Galileo Board.

If you want to do this, I suggest you to look into this document: http://www.intel.com/content/dam/support/us/en/documents/edison/sb/edisonbluetooth_331704007.pdf Bluetooth User Guide (It is for Edison but it will help you too)

You can send and receive data by using rfcomm or another protocol that will allow you to create a code for Bluetooth. If you want to use C code the library is located on /usr/include/bluetooth. You can also use Python and install pyBluez.

I hope this helps and gives you and idea on how to start.

Regards,

Charlie

View solution in original post

0 Kudos
Highlighted
New Contributor II
34 Views

Thanks Charlie,

I should have stated my goal more clearly.

I have several types of sensors. Using an analog sensor I have been able to read that info directly plugging it in to the Galileo, but I actually need to put that sensor somewhere else and send the info wirelessly. I could use bluetooth, or RF( I did get nRFL01 module) but i'm really just looking for the simplest solution as my coding skills are not great. If you have a suggested method for doing this, I'm all ears. I'm just here to learn.

Thanks

0 Kudos
Highlighted
Employee
34 Views

Hi BMEJ,

It will depend on the resources you have and the language in which you feel more comfortable.

With Bluetooth you will only need the boards and the Bluetooth modules, but if you use WiFi you will need more resources.

Have you started to work with the nRFL01?

I suggest you to look into the examples on the XDK:

https://software.intel.com/en-us/getting-started-with-the-intel-xdk-iot-edition IoT - Getting started with the Intel® XDK IoT Edition | Intel® Developer Zone

https://software.intel.com/en-us/iot/software/ide/intel-xdk-iot-edition IoT - XDK | Intel® Developer Zone

Also, take a look at the MRAA and UPM libraries:

http://iotdk.intel.com/docs/master/mraa/ mraa: Main Page

https://github.com/intel-iot-devkit/mraa/tree/master/examples mraa/examples at master · intel-iot-devkit/mraa · GitHub

http://iotdk.intel.com/docs/master/upm/ upm: Main Page

https://github.com/intel-iot-devkit/upm/tree/master/examples upm/examples at master · intel-iot-devkit/upm · GitHub

Regards,

Charlie

0 Kudos
Highlighted
New Contributor II
34 Views

Thanks Charlie,

I haven't got that far yet.

I will post an update when i get some data flowing. The nrf24l01 will be processed by an arduino (attiny or similar) and only send data when the analog sensor is triggered.

0 Kudos