Reply
Thread Tools
Posts: 58 | Thanked: 8 times | Joined on Aug 2010
#1
I did a trial to setup a 'Bluetooth serial port' between my N900 and my laptop(Ubuntu installed), but failed.
I record the process as below, please help to find the reason, thanks!

On the laptop side:
Code:
# hcitool scan
Scanning ...
	C8:97:9F:E3:28:44	Nokia N900
# export N900='C8:97:9F:E3:28:44'
On N900 side:
Code:
# hcitool scan
Scanning ...
	88:9F:FA:F3:F5:0A	BlueZ (1)
# export LAPTOP='88:9F:FA:F3:F5:0A'

To add the Serial Port protol, I execute the command on both sides:
Code:
# sdptool add --channel=10 SP
Serial Port service registered
Then I searched the services on laptop side:
Code:
# sdptool records $N900
...
Service Name: Serial Port
Service Description: COM Port
Service Provider: BlueZ
Service RecHandle: 0x10005
Service Class ID List:
  "Serial Port" (0x1101)
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 10
Language Base Attr List:
  code_ISO639: 0x656e
  encoding:    0x6a
  base_offset: 0x100
Profile Descriptor List:
  "Serial Port" (0x1101)
    Version: 0x0100
...
Then I searched the services on N900 side:
Code:
# sdptool records $LAPTOP
...
Service Name: Serial Port
Service Description: COM Port
Service Provider: BlueZ
Service RecHandle: 0x10006
Service Class ID List:
  "Serial Port" (0x1101)
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 10
Language Base Attr List:
  code_ISO639: 0x656e
  encoding:    0x6a
  base_offset: 0x100
Profile Descriptor List:
  "Serial Port" (0x1101)
    Version: 0x0100
...
On laptop side:
Code:
# cat /etc/bluetooth/rfcomm.conf 
#
# RFCOMM configuration file.
#

rfcomm0 {
#	# Automatically bind the device at startup
	bind yes;
#
#	# Bluetooth address of the device
	device C8:97:9F:E3:28:44;
#
#	# RFCOMM channel for the connection
	channel	10;
#
#	# Description of the connection
	comment "Example Bluetooth device";
}
On N900 side:
Code:
# cat /etc/bluetooth/rfcomm.conf 
#
# RFCOMM configuration file.
#

rfcomm0 {
#	# Automatically bind the device at startup
	bind yes;
#
#	# Bluetooth address of the device
	device 88:9F:FA:F3:F5:0A;

#	# RFCOMM channel for the connection
	channel	10;

#	# Description of the connection
	comment "BT COM TEST"; 
}
Then create the rfcomm0 on both sides:
Code:
mknod /dev/rfcomm0 c 216 1
chmod 666 /dev/rfcomm0
Load the conf file on both sides:
Code:
rfcomm -f /etc/bluetooth/rfcomm.conf
Start to connect on N900 side, but failed:
Code:
# rfcomm connect /dev/rfcomm0
Can't connect RFCOMM socket: Connection refused



Some hints below:

On laptop side, I can connect to N900 via below command, but only for a few seconds:
Code:
# hcitool cc C8:97:9F:E3:28:44
root@maemo-desktop:/etc/bluetooth# hcitool con
Connections:
	< ACL C8:97:9F:E3:28:44 handle 12 state 1 lm SLAVE 
root@maemo-desktop:/etc/bluetooth# hcitool con
Connections:
And also on laptop side, I can l2ping the N900:
Code:
# l2ping C8:97:9F:E3:28:44
Ping: C8:97:9F:E3:28:44 from 88:9F:FA:F3:F5:0A (data size 44) ...
44 bytes from C8:97:9F:E3:28:44 id 0 time 18.97ms
44 bytes from C8:97:9F:E3:28:44 id 1 time 15.46ms
44 bytes from C8:97:9F:E3:28:44 id 2 time 27.80ms
44 bytes from C8:97:9F:E3:28:44 id 3 time 20.50ms
44 bytes from C8:97:9F:E3:28:44 id 4 time 20.78ms
44 bytes from C8:97:9F:E3:28:44 id 5 time 29.30ms
44 bytes from C8:97:9F:E3:28:44 id 6 time 8.01ms
44 bytes from C8:97:9F:E3:28:44 id 7 time 19.67ms
Send failed: Connection reset by peer

Last edited by justforfun; 2011-09-11 at 16:22.
 

The Following 5 Users Say Thank You to justforfun For This Useful Post:
Posts: 58 | Thanked: 8 times | Joined on Aug 2010
#2
I guess it should be related with the passkey/pincodes, but I didn't know how to set the passkey/pincodes under the latest bluez version(installed via apt-get install bluez).

And I did another trial earlier with same process between N900 and laptop(Win7 installed + BlueSoleil + Serial port software), this one succeeds.

Could anyone help to analyse my process?
 

The Following User Says Thank You to justforfun For This Useful Post:
Posts: 16 | Thanked: 3 times | Joined on Oct 2011 @ germany
#3
hi did you managed to get it working?
 
Reply


 
Forum Jump


All times are GMT. The time now is 16:39.