logo

Could not compile stylesheet for simplistic. Using last compiled stylesheet.

Bluetooth COM Module Pairing

posted in IGEP COM MODULE
Tuesday, September 09 2014, 12:47 PM
0
Dear ISEE Community.

After apply your commands to configure the bluetooth on the COM Module, when I'm trying to pair the COM Module with my Android, it always asks to me for the pairing key. I haven't configured nothing about this key so, which is the method to pair that uses the default configuration of the COM Module?

I've read something about bluez-simple-agent, but this program is not present in the system and in the repositories.
How can I stablish connection between two devices?
Responses (8)
  • Accepted Answer

    maathor
    maathor
    Offline
    Tuesday, September 09 2014, 01:21 PM - #permalink
    0
    why don't you don't install bluez totally ?
    I'm interrested with your solution too,
    for the moment I made a little bash script launched at the init,
    hciconfig hci0 up
    
        echo "searching bluetooth devices"
        devBth=$(hcitool -i hci0 scan)
        while [[ ! $devBth == *:* ]]
        do
    	devBth=$(hcitool -i hci0 scan)
        done
        
    
        #i got the mac adress of bluetooth in the same pattern for all
        dev=${devBth:14:17}
        echo "trying to connect to -$dev-"
        ad=$(ls /var/lib/bluetooth/);
        path="/var/lib/bluetooth/$ad/pincodes"
        touch "$path"
    
        if grep -q "$dev" "$path"; then
    	echo "-- Recognized device"
        else
    	echo "-- Unrecognized device";
            #1256 will be the password for the new device
    	echo "$dev 1256" >> $path;
    	bluez-test-device trusted $dev yes; 
        fi
    
        getConn=$(pand --connect $dev -n)
        while [[ $getConn == *refused* ]]
        do
    	getConn=$(pand --connect $dev -n)
    	sleep 2
        done
        
        #i configure my IP adresse, to use the usb device like another ethernet device connected
        ifconfig bnep0 192.168.44.188 up
        exit 1


    works fine with me, but it's not the best way to do this...
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, September 09 2014, 01:50 PM - #permalink
    0
    I can't stablish the connection between the boards. My bluez package hasn't installed the "bluez-test-device" program, so I think that this package (4.101) hasn't got the totally of functions of the bluez package (bluez-test-device, bluez-simple-agent, etc...). This is the package installed with the image "igep-firmware-yocto-1.2.2-3".

    Which one are you using? Or which are the steps you use to run the bluetooth correctly?
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, September 10 2014, 01:27 PM - #permalink
    0
    I'm going crazy with this issue.

    I've tried all of the combinations and I don't obtain any solution.
    Every time I want to connect to my board from one of my android mobile, it always asks me for a PIN code that I don't put into the system files.
    After that, I tried to enter a pin (in /var/lib/bluetooth/XX:XX:XX:XX:XX:XX/pincodes , where I put the MAC address of my android mobile an the pin), trying to create a hcid.conf file (that as I read, this version of bluez doesn't use) and I can't continue with my project.

    Can you explain me if I have to edit some files of the bluetooth after configure it as you explain here: http://labs.isee.biz/index.php/How_to_setup_Marvell_bluetooth?

    Additionaly, I have to say that I don't install some extra packages from the repositories, so I don't have the bluez-simple-agent, obexftp and any other packages that I need to continue with my project development.

    Thank you
    The reply is currently minimized Show
  • Accepted Answer

    maathor
    maathor
    Offline
    Wednesday, September 10 2014, 02:21 PM - #permalink
    0
    Yeah, I'm using Linaro nano, and not yocto.
    To do this, I installed (with apt) some packages: bluez, bluez-compat and bluetooth, in my mind it was the bluez 3.XX ...

    I used the wiki you linked in your last reply, I do exactly the same command,
    My complete script i use is below :

    #!/bin/bash
    
    start() {
        echo "Init Bluetooth"
        mount -t debugfs none /sys/kernel/debug
    
    
        echo "Sharing Bluetooth and Wifi"
        echo "- custom register"
    
        echo "0xa58c 0x40865" > /sys/kernel/debug/lbs_wireless/wlan0/registers/wrmac
        echo "0xa58c 0x40865" > /sys/kernel/debug/lbs_wireless/wlan0/registers/wrmac
        echo "0xa5f0 0xa027181c" > /sys/kernel/debug/lbs_wireless/wlan0/registers/wrmac
        
        echo "- Init"
        stty -F /dev/ttyS1 ispeed 115200 ospeed 115200 cs8 -cstopb clocal -crtscts -parodd
        echo "-- Load Bluetooth configuration"
        bccmd -t bcsp -d /dev/ttyS1 psload -r /root/bluez.psr
        modprobe bluetooth hci-uart hidp l2cap rfcomm
        hciattach -s 115200 /dev/ttyS1 bcsp 115200 noflow
        echo "Starting Bluetooth"
        hciconfig hci0 up
        echo "searching device"
        devBth=$(hcitool -i hci0 scan)
        while [[ ! $devBth == *:* ]]
        do
    	devBth=$(hcitool -i hci0 scan)
        done
        
        dev=${devBth:14:17}
        echo "try to connect to -$dev-"
        ad=$(ls /var/lib/bluetooth/);
        path="/var/lib/bluetooth/$ad/pincodes"
        touch "$path"
    
        if grep -q "$dev" "$path"; then
    	echo "-- Recognized device"
        else
    	echo "-- Unrecognized device";
    	echo "$dev 1256" >> $path;
    	bluez-test-device trusted $dev yes; 
        fi
    
        getConn=$(pand --connect $dev -n)
        while [[ $getConn == *refused* ]]
        do
    	getConn=$(pand --connect $dev -n)
    	sleep 2
        done
        
        ifconfig bnep0 192.168.44.188 up
        exit 1
    }
    
    stop(){
        echo "stopping Bluetooth"
        ifconfig bnep0 down
        hciconfig hci0 down
    }
    ##MAIN
    case "$1" in
    	start)
    		start
    		exit 1
    		;;
    	stop)
    		stop
    		;;
    	restart|reload)
    		stop
    		start
    		;;
    	*)
    		echo $"Usage : $0 {start|stop|restart|reload}"
    		exit 1
    esac
    exit


    hope it's help ;)
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, September 17 2014, 02:03 PM - #permalink
    0
    Dear maathor:

    I tried to install the linaro-nano 12.04 version as I looked throw the wiki (./igep-media-create --mmc /dev/sdb --machine igep0030 --image linaro-nano-12.04-0.tar.bz2) using this command, an when I put the microSD card into the slot to start, on boot I see this message:

    init failed to create pty - disabling loggin for job
    


    After that, I could't start it. What is wrong?
    The reply is currently minimized Show
  • Accepted Answer

    Thursday, September 18 2014, 09:11 AM - #permalink
    0
    Hi gerteksa,

    This link explains the warning message: http://askubuntu.com/questions/126779/why-do-i-get-init-failed-to-create-pty-errors-on-boot

    Are you able to get a terminal prompt with linaro nano 12.04?
    The reply is currently minimized Show
  • Accepted Answer

    Thursday, September 18 2014, 09:26 AM - #permalink
    0
    Dear ISEE Community.

    I searched this issue in this web before. I have the possibility to enter to the terminal. But when I do the first step, int /etc/default there is no grub named file, so I can't continue doing this.
    The reply is currently minimized Show
  • Accepted Answer

    Friday, September 19 2014, 12:43 PM - #permalink
    0
    Hi gerteksa,

    The interesting part from link above is the technical explanation.

    Grub is a boot loader for x86 processor architecture so this doesn't apply to IGEPv2.

    Please note than Linaro distribution hasn't tested and supported as official Igep Yocto Firmware, this will have some warnings or bugs not solved yet.

    Related to your bluetooth problem, this is new for me and I cannot give you an answer yet
    The reply is currently minimized Show
Your Reply

SUPPORT


This email address is being protected from spambots. You need JavaScript enabled to view it.
This email address is being protected from spambots. You need JavaScript enabled to view it.
IGEP Community Wiki
IGEP Community Forum
IGEP Community Online Chat