How to use bluetooth to transfer data between Neo and Desk-top

From Openmoko

(Difference between revisions)
Jump to: navigation, search
(-cat)
 
(13 intermediate revisions by 8 users not shown)
Line 1: Line 1:
First you should modify this file in your desk-top computer
+
This page , we will introduce about , how to active your Neo bluetooth device via host. You can follow these step to learn how to transfer data between Neo and PC.
  
 +
==configure your setting of host ==
 +
First you should modify this bluetooth setting file in your desk-top computer:
  
 
  > sudo vi /etc/default/bluetooth
 
  > sudo vi /etc/default/bluetooth
  
 +
then search for the keyword "/pand" to find  " PAND_ENABLED=0  "
  
then press "/pand" to find  " PAND_ENABLED=0  "
+
And now you should change the 0 into 1  
 
+
And now you should change the 0 into 1 ("PAND_ENABLED=1")
+
("PAND_ENABLED=1")
  
 +
After you modify the setting, use this command to restart bluetooth device.
  
 
  > sudo /etc/init.d/bluetooth restart
 
  > sudo /etc/init.d/bluetooth restart
  
 
 
 
 
Restart the bluetooth device.
 
 
After restarting the bluetooth, you will see Bluetooth PAN daemon information.
 
After restarting the bluetooth, you will see Bluetooth PAN daemon information.
  
That means you wake up the PAN daemon suscessfully:P
+
That means you wake up the '''PAN''' daemon successfully.
  
 
After that,you should pass the argument to let PAN daemon know what it should do now.
 
After that,you should pass the argument to let PAN daemon know what it should do now.
Line 23: Line 24:
 
  > sudo pand -s  
 
  > sudo pand -s  
  
this command let desk-top computer be a Server to listen the other linux-based devices
+
this command lets a desk-top computer be a server to listen to other Linux-based devices connecting to it through Bluetooth.
 
+
which is connecting it through the bluetooth.
+
  
 +
==On the Neo side==
 
In the Neo:
 
In the Neo:
  
 
  > echo "1" > /sys/bus/platform/devices/neo1973-pm-bt.0/power_on
 
  > echo "1" > /sys/bus/platform/devices/neo1973-pm-bt.0/power_on
 
  > echo "0" > /sys/bus/platform/devices/neo1973-pm-bt.0/reset
 
  > echo "0" > /sys/bus/platform/devices/neo1973-pm-bt.0/reset
+
 
 +
this command will search nearly bluetooth device.
 +
 
 
  > hcitool scan
 
  > hcitool scan
  
Line 41: Line 43:
 
  > ifconfig bnep0 10.0.0.2 netmask 255.255.255.0
 
  > ifconfig bnep0 10.0.0.2 netmask 255.255.255.0
  
Switch to the Desk-top computer :
+
Switch back to the Desk-top computer :
  
 
  >sudo ifconfig bnep0 10.0.0.1 netmask 255.255.255.0
 
  >sudo ifconfig bnep0 10.0.0.1 netmask 255.255.255.0
Line 53: Line 55:
 
// send the testing data to the Neo
 
// send the testing data to the Neo
  
If it does work,you will receive following information.
+
If it works ,you will receive following message:
  
 
PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
 
PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
64 bytes from 10.0.0.2: icmp_seq=1 ttl=64 time=xx.x ms
+
 
64 bytes from 10.0.0.2: icmp_seq=2 ttl=64 time=xx.x ms
+
64 bytes from 10.0.0.2: icmp_seq=1 ttl=64 time=xx.x ms
64 bytes from 10.0.0.2: icmp_seq=3 ttl=64 time=xx.x ms
+
64 bytes from 10.0.0.2: icmp_seq=2 ttl=64 time=xx.x ms
 +
64 bytes from 10.0.0.2: icmp_seq=3 ttl=64 time=xx.x ms
  
 
........
 
........
  
 +
==Start to transfer data==
 
Also,you can copy datas to the Neo.
 
Also,you can copy datas to the Neo.
  
Line 68: Line 72:
 
That's all.
 
That's all.
 
Enjoy:)
 
Enjoy:)
 +
 +
[[Category:Bluetooth]]

Latest revision as of 06:53, 18 July 2009

This page , we will introduce about , how to active your Neo bluetooth device via host. You can follow these step to learn how to transfer data between Neo and PC.

[edit] configure your setting of host

First you should modify this bluetooth setting file in your desk-top computer:

> sudo vi /etc/default/bluetooth

then search for the keyword "/pand" to find " PAND_ENABLED=0 "

And now you should change the 0 into 1

("PAND_ENABLED=1")

After you modify the setting, use this command to restart bluetooth device.

> sudo /etc/init.d/bluetooth restart

After restarting the bluetooth, you will see Bluetooth PAN daemon information.

That means you wake up the PAN daemon successfully.

After that,you should pass the argument to let PAN daemon know what it should do now.

> sudo pand -s 

this command lets a desk-top computer be a server to listen to other Linux-based devices connecting to it through Bluetooth.

[edit] On the Neo side

In the Neo:

> echo "1" > /sys/bus/platform/devices/neo1973-pm-bt.0/power_on
> echo "0" > /sys/bus/platform/devices/neo1973-pm-bt.0/reset

this command will search nearly bluetooth device.

> hcitool scan

Put the wanted bluetooth's Mac (Address) in this line

> export PC_BT_ID=(bluetooth's Mac)
> pand -c $PC_BT_ID --service NAP --autozap
> ifconfig bnep0 10.0.0.2 netmask 255.255.255.0

Switch back to the Desk-top computer :

>sudo ifconfig bnep0 10.0.0.1 netmask 255.255.255.0

This means that desk-top computer will set up environment for connectiog the Neo.

Then, you can use the "ping" command to check whether the connection is build sucessfully or not.

> ping 10.0.0.2

// send the testing data to the Neo

If it works ,you will receive following message:

PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.

64 bytes from 10.0.0.2: icmp_seq=1 ttl=64 time=xx.x ms
64 bytes from 10.0.0.2: icmp_seq=2 ttl=64 time=xx.x ms
64 bytes from 10.0.0.2: icmp_seq=3 ttl=64 time=xx.x ms

........

[edit] Start to transfer data

Also,you can copy datas to the Neo.

> scp XXX.X root@10.0.0.2:

That's all. Enjoy:)

Personal tools

First you should modify this file in your desk-top computer


> sudo vi /etc/default/bluetooth


then press "/pand" to find " PAND_ENABLED=0 "

And now you should change the 0 into 1 ("PAND_ENABLED=1")


> sudo /etc/init.d/bluetooth restart


Restart the bluetooth device. After restarting the bluetooth, you will see Bluetooth PAN daemon information.

That means you wake up the PAN daemon suscessfully:P

After that,you should pass the argument to let PAN daemon know what it should do now.

> sudo pand -s 

this command let desk-top computer be a Server to listen the other linux-based devices

which is connecting it through the bluetooth.

In the Neo:

> echo "1" > /sys/bus/platform/devices/neo1973-pm-bt.0/power_on
> echo "0" > /sys/bus/platform/devices/neo1973-pm-bt.0/reset

> hcitool scan

Put the wanted bluetooth's Mac (Address) in this line

> export PC_BT_ID=(bluetooth's Mac)
> pand -c $PC_BT_ID --service NAP --autozap
> ifconfig bnep0 10.0.0.2 netmask 255.255.255.0

Switch to the Desk-top computer :

>sudo ifconfig bnep0 10.0.0.1 netmask 255.255.255.0

This means that desk-top computer will set up environment for connectiog the Neo.

Then, you can use the "ping" command to check whether the connection is build sucessfully or not.

> ping 10.0.0.2

// send the testing data to the Neo

If it does work,you will receive following information.

PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data. 64 bytes from 10.0.0.2: icmp_seq=1 ttl=64 time=xx.x ms 64 bytes from 10.0.0.2: icmp_seq=2 ttl=64 time=xx.x ms 64 bytes from 10.0.0.2: icmp_seq=3 ttl=64 time=xx.x ms

........

Also,you can copy datas to the Neo.

> scp XXX.X root@10.0.0.2:

That's all. Enjoy:)