LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking
User Name
Password
Linux - Wireless Networking This forum is for the discussion of wireless networking in Linux.

Notices


Reply
  Search this Thread
Old 03-01-2006, 01:29 AM   #1
kitying
LQ Newbie
 
Registered: Feb 2006
Posts: 15

Rep: Reputation: 0
Bluetooth Receiving files problem


Hi, All

I have install my linux with openobex, bluez-util, bluez-libs

via Bluetooth, I can only send files to cellphone but not receive files from cellphone.

Would any one tell is there any issue I missed ?????

Thanks very much
 
Old 03-01-2006, 02:17 AM   #2
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,544
Blog Entries: 4

Rep: Reputation: 57
Lalala more information please.

What program are you using to send the files, what program are you using to try and receive the files? Do you even have a program to receive them or are you just trying to send and hoping for the best? What error messages are you getting and why didn't you post any of this first time around?
 
Old 03-01-2006, 09:05 PM   #3
kitying
LQ Newbie
 
Registered: Feb 2006
Posts: 15

Original Poster
Rep: Reputation: 0
Thanks very much for your help.

I tried to send and receive files by obex_test. It is success for sending. For Sending :

I follows the steps from http://www.resultspk.net/hackwireles...-2-sect-7.html :

1)sdptool add --channel=<<OPUSH channcel of cellphone>> OPUSH
2)obex_test -b <<btaddress of cellphone>> <<OPUSH channcel of cellphone>>
3) s (for server mode)

then I send file from cellphone. After a while, Linux machine is hanged, need to reset.

the followings are captured from hcidump :
HCI sniffer - Bluetooth packet analyzer ver 1.18
device: hci0 snap_len: 1028 filter: 0xffffffff
> HCI Event: Connect Request (0x04) plen 10
< HCI Command: Accept Connection Request (0x01|0x0009) plen 7
bdaddr 00:11:9F:7A:CA:44 role 0x01
Role: Slave
> HCI Event: Command Status (0x0f) plen 4
> HCI Event: Connect Complete (0x03) plen 11
< HCI Command: Write Link Policy Settings (0x02|0x000d) plen 4
handle 41 policy 0x0f
Link policy: RSWITCH HOLD SNIFF PARK
> HCI Event: Page Scan Repetition Mode Change (0x20) plen 7
> HCI Event: Command Complete (0x0e) plen 6
< HCI Command: Change Connection Packet Type (0x01|0x000f) plen 4
handle 41 ptype 0xcc18
Packet type: DM1 DM3 DM5 DH1 DH3 DH5
> HCI Event: Max Slots Change (0x1b) plen 3
> HCI Event: Command Status (0x0f) plen 4
> HCI Event: Connection Packet Type Changed (0x1d) plen 5
> ACL data: handle 41 flags 0x02 dlen 12
L2CAP(s): Connect req: psm 1 scid 0x0040
< ACL data: handle 41 flags 0x02 dlen 16
L2CAP(s): Connect rsp: dcid 0x0040 scid 0x0040 result 0 status 0
> HCI Event: Number of Completed Packets (0x13) plen 5
> ACL data: handle 41 flags 0x02 dlen 12
L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 0
< ACL data: handle 41 flags 0x02 dlen 14
L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 0
< ACL data: handle 41 flags 0x02 dlen 12
L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 0
> HCI Event: Number of Completed Packets (0x13) plen 5
> HCI Event: Number of Completed Packets (0x13) plen 5
> ACL data: handle 41 flags 0x02 dlen 14
L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 0
> ACL data: handle 41 flags 0x02 dlen 17
L2CAP(d): cid 0x0040 len 13 [psm 1]
SDP SS Req: tid 0x1 len 0x8
pat uuid-16 0x1105 (OBEXObjPush)
max 65535
cont 00



Do you have any ideas ?? Thanks very much for helping !!!!
 
Old 03-02-2006, 01:16 AM   #4
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,544
Blog Entries: 4

Rep: Reputation: 57
I've honestly never used obex_test, I found it too limiting. If you want something basic but a tad more powerful look at the ussp_push package, it contains a app to push files to your phone and an app to run as a server. If you plan on using this as more than just a way to copy stuff to your phone and want to implement security (probably not necessary at home) you can look at sobexsrv.
 
Old 03-02-2006, 03:09 AM   #5
kitying
LQ Newbie
 
Registered: Feb 2006
Posts: 15

Original Poster
Rep: Reputation: 0
Thanks for reply quickly.

Actually, I have installed sobexsrv. But I got the same problem, I run the server mode by sobexsrv and try to send file to it from cellphone, the Linux machine is hanged and need to reset. So I go back to try obex_test. Is there any setting on my linux to cause the problem ? (I am
a newbie to linux).

Thanks very much for your help in advanced
 
Old 03-02-2006, 05:00 AM   #6
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,544
Blog Entries: 4

Rep: Reputation: 57
Can you post your /etc/bluetooth/hcid.conf? Could be some overzealous default security settings or something. sobexsrv is a complicated app with very little documentation, something like these tools are extremely easy to use but at face value don't offer much in the way of lower-level configs. Give them a try for something basic I can help with, I've never used obex_test to be able to help with debugging any problems it's giving you.
 
Old 03-02-2006, 10:13 PM   #7
kitying
LQ Newbie
 
Registered: Feb 2006
Posts: 15

Original Poster
Rep: Reputation: 0
Thanks very much, Here's content of hcid.conf

#
# HCI daemon configuration file.
#

# HCId options
options {
# Automatically initialize new devices
autoinit yes;

# Security Manager mode
# none - Security manager disabled
# auto - Use local PIN for incoming connections
# user - Always ask user for a PIN
#
security auto;

# Pairing mode
# none - Pairing disabled
# multi - Allow pairing with already paired devices
# once - Pair once and deny successive attempts
pairing multi;

# PIN helper
pin_helper /usr/bin/bluepin;

# D-Bus PIN helper
#dbus_pin_helper;
}

# Default settings for HCI devices
device {
# Local device name
# %d - device id
# %h - host name
name "BlueZ (%d)";

# Local device class
class 0x3e0100;

# Default packet type
#pkt_type DH1,DM1,HV1;

# Inquiry and Page scan
iscan enable; pscan enable;

# Default link mode
# none - no specific policy
# accept - always accept incoming connections
# master - become master on incoming connections,
# deny role switch on outgoing connections
lm accept;

# Default link policy
# none - no specific policy
# rswitch - allow role switch
# hold - allow hold mode
# sniff - allow sniff mode
# park - allow park mode
lp rswitch,hold,sniff,park;

# Authentication and Encryption (Security Mode 3)
#auth enable;
#encrypt enable;
}



Many Thanks !!!
 
Old 03-07-2006, 10:27 PM   #8
kitying
LQ Newbie
 
Registered: Feb 2006
Posts: 15

Original Poster
Rep: Reputation: 0
Sorry, reply so late !

I have download obex-push and have tried on it

It is able to send file by it, however the same as before, for receiving files, my linux got hanged :

[root@kitying_linux opd]# ./opd --mode OBEX --channel 10 -path /tmp/opd --sdp --metadata
opd[3705]: OBEX Push Daemon - version 0.2 started
opd[3705]: OBEX Object Push service registered with sdpd
opd[3705]: OBEX server listening on channel 10


Besides, I have also tried on gnome-bluetooth, hm..... the same.


Would any one can help help me !!!! Thanks !!!!
 
Old 03-08-2006, 07:59 AM   #9
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,544
Blog Entries: 4

Rep: Reputation: 57
Okay, are you sure you're using the correct RFCOMM channel? That could be causing problems, you can check which channel to use with sdptool.

If you are using the right channel then this is just weird. Do you get any output when trying to send a file to either opd or gnome-bluetooth? The both output some debugging stuff to the console when making a connection, do you get any or is it like nothings happening?
 
Old 03-09-2006, 03:56 AM   #10
kitying
LQ Newbie
 
Registered: Feb 2006
Posts: 15

Original Poster
Rep: Reputation: 0
Thanks ervy much for your reply.

1)rfcomm bind /dev/rfcomm0 <<bt address of cellphone>> <<OPUSH channel of cellphone>>
2)./opd --mode OBEX --channel <<bt address of cellphone>> -path /tmp --sdp --metadata

is it correct ? The cellphone I am using is Nokia 6260, the OPUSH channel I found is 9.

Hanged after a while of sending files from cellphone.

For gnome-bluetooth, after I started the server mode, i saw a bluetooth icon showed on the right side of the top panel. Then I tried to send file from cellphone. Before I can see the window of asking "do you receive..... ?", my linux hanged. (acutally, I have never seen that windows).


Thanks very much !!!
 
Old 03-09-2006, 05:34 AM   #11
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,544
Blog Entries: 4

Rep: Reputation: 57
There is no need to use rfcomm to create a link before running opd, try running it without releasing the rfcomm link and running opd again.
 
Old 03-10-2006, 12:56 AM   #12
kitying
LQ Newbie
 
Registered: Feb 2006
Posts: 15

Original Poster
Rep: Reputation: 0
I run the opd without running rfomm, but the same result got.

Anyway, I found that after I disable the audit by auditctl -e 0.
My linux won't be hanged any more, however, it still doesn't show any things afterwards.

Any I found these logs from /var/logs/messages :

Mar 10 12:36:00 localhost hcid[2108]: Bluetooth HCI daemon
Mar 10 12:36:00 localhost kernel: Loading keyring
Mar 10 12:36:00 localhost sdpd[2110]: Bluetooth SDP daemon
Mar 10 12:36:00 localhost kernel: - Added public key 42BD35A990375F72
Mar 10 12:36:00 localhost hcid[2108]: Unable to get on D-BUS
Mar 10 12:36:00 localhost kernel: - User ID: Red Hat, Inc. (Kernel Module GPG key)
Mar 10 12:36:00 localhost hcid[2108]: Read from control socket failed: Permission denied (13)
Mar 10 12:36:01 localhost kernel: pci_hotplug: PCI Hot Plug PCI Core version: 0.5
Mar 10 12:36:01 localhost hcid[2108]: Exit..
.
.
.
.
.
Mar 10 14:25:55 localhost opd[3813]: OBEX Push Daemon - version 0.2 started
Mar 10 14:25:55 localhost opd[3813]: OBEX Object Push service registered with sdpd
Mar 10 14:25:55 localhost opd[3813]: OBEX server listening on channel 9
Mar 10 14:26:59 localhost auditd[2067]: Audit daemon rotating log files
Mar 10 14:27:00 localhost kernel: audit: audit_backlog=257 > audit_backlog_limit=256
Mar 10 14:27:00 localhost kernel: audit: audit_lost=1 audit_rate_limit=0 audit_backlog_limit=256
Mar 10 14:27:00 localhost kernel: audit: backlog limit exceeded
Mar 10 14:27:00 localhost kernel: audit: audit_backlog=257 > audit_backlog_limit=256
Mar 10 14:27:00 localhost kernel: audit: audit_lost=2 audit_rate_limit=0 audit_backlog_limit=256
Mar 10 14:27:00 localhost kernel: audit: backlog limit exceeded
Mar 10 14:27:00 localhost kernel: audit: audit_backlog=257 > audit_backlog_limit=256
Mar 10 14:27:00 localhost kernel: audit: audit_lost=3 audit_rate_limit=0 audit_backlog_limit=256
Mar 10 14:27:00 localhost kernel: audit: backlog limit exceeded
.
.
.
.
.
.
.

Thanks very much for your help ! !!
 
Old 03-15-2006, 02:44 AM   #13
kitying
LQ Newbie
 
Registered: Feb 2006
Posts: 15

Original Poster
Rep: Reputation: 0
Hm..... I have met another problem.....

I have written a medlet to do some service searching for device nearby. Everytime, once the application try to seach service from my linux, my linux get hanged. I do think that, my linux some how doesn't answer then service inquiry.

As a result, it doesn't response to the request of file sending from cellphone ....... (comes up to the problem above)

Would any one knows what's the problem ?

Thanks very much.
 
Old 03-16-2006, 01:02 AM   #14
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,544
Blog Entries: 4

Rep: Reputation: 57
It seems that your linux is hanging every time an external device tries to make a connection. This is obviously not the desired result. Can you try a Knoppix live CD? It has some Bluetooth stuff installed and it'll allow you to check whether it's a hardware problem or software problem.
 
Old 03-24-2006, 03:12 AM   #15
kitying
LQ Newbie
 
Registered: Feb 2006
Posts: 15

Original Poster
Rep: Reputation: 0
Thanks for help !

That's me again, I have another problem playing with the bluetooth and linux

This time, I had wrote a small program run at linux, which sends a file to a bluetooth device via OBEX. However, it works for smaller size files. For those a bit larger files, it fails (connection closed during the sending process). And I have tried to send the same file by obexpush and obex_test, it works. The file used for testing is about 3M

Here is my program code :


showMessage("Connecting to Client .. ", true);
ClientSession conn = (ClientSession) Connector.open(targetServiceURL);
HeaderSet response = conn.connect(null);

int status = response.getResponseCode();
if(status != ResponseCodes.OBEX_HTTP_OK)
{
showMessage("OBEX connection error!!", false);
conn.close();
}
else
{
showMessage("Connected.", false);

showMessage("Reading Input File .. ", true);
InputStream is = (InputStream) (new FileInputStream(objectName));
int objectLength = is.available();
String type = getObjectType(objectName);
HeaderSet head = conn.createHeaderSet();
head.setHeader(HeaderSet.COUNT, new Long(1));
head.setHeader(HeaderSet.TYPE, type);
head.setHeader(HeaderSet.NAME, objectName);
head.setHeader(HeaderSet.LENGTH, new Long (objectLength));
showMessage( objectLength + " bytes Read. ", false);


showMessage("Opening OutputStream .. ", true);
Operation op = conn.put(head);
OutputStream os = op.openOutputStream();
showMessage("Opened.", false);

showMessage("Sending .. ", true);

// send the file to the client
int position = 0, n = 0;
while (position < objectLength)
{
int sendLength = ((objectLength - position > 1024) ? 1024: objectLength - position);
byte[] data = new byte[sendLength];

is.read(data);
showMessage("sendLength = " + sendLength + ", Position = " + position + ", File Size = " + objectLength + ". ", false);

os.write(data);
os.flush();

position += sendLength;
} */

showMessage("Closing Connection .. ", true);
is.close();
os.close();
op.close();
conn.disconnect(null);

conn.close();
showMessage("Closed. ", false);

showMessage("Bye bye !", true);


Would anyone has ideas ? Thanks very much !
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Receiving files with Kopete in KDE 3.5 hypn0tiq Slackware 2 02-18-2006 06:17 PM
Qmail Problem....? (Receiving mail) ysg08 Linux - Networking 3 01-17-2005 01:30 PM
problem receiving email King4lex Slackware 1 09-20-2004 03:52 PM
Receiving files via TFTP wswartz Linux - Software 8 09-20-2004 03:44 PM
Problem receiving files with Licq Reil Willy Linux - Networking 2 03-16-2004 05:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking

All times are GMT -5. The time now is 10:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration