From owner-freebsd-bluetooth@FreeBSD.ORG Tue Dec 14 02:33:39 2004 Return-Path: Delivered-To: freebsd-bluetooth@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6AC1C16A4CE for ; Tue, 14 Dec 2004 02:33:39 +0000 (GMT) Received: from web53409.mail.yahoo.com (web53409.mail.yahoo.com [206.190.37.56]) by mx1.FreeBSD.org (Postfix) with SMTP id DDCFA43D4C for ; Tue, 14 Dec 2004 02:33:38 +0000 (GMT) (envelope-from edwin_vinas@yahoo.com) Received: (qmail 77534 invoked by uid 60001); 14 Dec 2004 02:33:38 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=Kd55+EpALX1ZW7lUeTSYQth1Ki8t3zaN1TVkadYnsfYA04wiW7v23EkjRYQulQjeDZWzlQwzgEtmb+lwcTMhboIkFTnI3cXdtEi+/hXf+4A9kOlA+I9cYiqLwrj0TFjaqkM6K66ClB//dsP5/lGa6ULnevSx6wxreTCHdKlYvWc= ; Message-ID: <20041214023338.77532.qmail@web53409.mail.yahoo.com> Received: from [202.90.128.27] by web53409.mail.yahoo.com via HTTP; Mon, 13 Dec 2004 18:33:37 PST Date: Mon, 13 Dec 2004 18:33:37 -0800 (PST) From: "Edwin D. Vinas" To: Maksim Yevmenkin In-Reply-To: <41BDDA1C.70407@savvis.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii cc: freebsd-bluetooth@FreeBSD.org Subject: Re: FreeBSD-5.3 obexapp-1.3 Can't send file to PC from phone X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Dec 2004 02:33:39 -0000 Hi everyone! Yes, I finally have tested sending from my phone to my PC via Bluetooth through the help of Max. 1. Plug MSI Bluetooth dongle in your PC's USB port. 2. Start the bluetooth device. #/etc/rc.bluetooth start ubt0 3. Start the sdpd server #sdpd 4. Start the obexapp server #obexapp -s -S -C 10 -u misoy -r /home/misoy/bluetooth NOTE: - make sure /home/misoy/bluetooth is permission to misoy - to start all bluetooth processes, i wrote a program below #!/usr/bin/perl -w print "\Starting bluetooth device..."; system("/etc/rc.bluetooth start ubt0 &"); print "\nStarting the sdpd..."; system("sdpd &"); print "\nStarting the obexapp server..."; system("bexapp -s -S -C 10 -u misoy -r /home/misoy/bluetooth &"); Using the Perl script above, just plug-in the dongle and run the script. To transfer from phone to PC, it's easy, just initiate transfer it will send to that directory in ur PC. To transfer from PC to phone, just run obexapp as client as shown below: %obexapp -a misoy -C OPUSH (obexapp --h for help) To stop bluetooth system: 1. Stop bluetooth device misoy#/etc/rc.bluetooth stop ubt0 2. Stop sdpd misoy# ps ax | grep sdpd 695 ?? Is 0:00.00 sdpd misoy# kill -9 695 3. Stop the obexapp isoy# ps ax | grep obexapp 730 ?? Is 0:00.00 obexapp -s -S -C 10 -u misoy -r /home/misoy/bluetooth misoy# kill -9 730 So, when I login to my FreeBSD and after plugging-in the dongle, I just command: misoy# ./startBluetooth.pl Starting bluetooth device... Starting the sdpd... Starting the obexapp server...misoy# BD_ADDR: 00:0c:76:9a:36:6c Features: 0xff 0xff 0xf 00 00 00 00 00 <3-Slot> <5-Slot> Max. ACL packet size: 192 bytes Number of ACL packets: 8 Max. SCO packet size: 64 bytes Number of SCO packets: 8 These are the summary of commands: 1. Starting bluetooth device # /etc/rc.bluetooth start ubt0 2. Starting sdpd server # sdpd 3. Starting the obexapp server # obexapp -s -S -C 10 -u misoy -r /home/misoy/bluetooth 4. Starting obexapp as client % obexapp -a misoy -C OPUSH 5. Browsing bluetooth services of a device # sdpcontrol -l browse 6. Discovering other bluetooth devices # hccontrol -n ubt0hci inquiry 7. Knowing the name of device # hccontrol -n ubt0hci remote_name_request 00:10:60:a6:32:02 8. Giving a permanent name for devices (/etc/bluetooth/hosts) 9. Knowing the present bluetooth connections in the localhost # hccontrol -n ubt0hci read_connection_list - gives a connections handle etc. 10. Killing a connection handle # hccontrol -n ubt0hci disconnect 41 11. Pinging if host is up # l2ping -a 00:80:37:29:19:a4 12. Knowing the logical connections and baseband connections in localhost # l2control -a 00:02:72:00:d4:1a read_channel_list # l2control -a 00:02:72:00:d4:1a read_connection_list # btsockstat 13. Pairing local FreeBSD and remote bluetooth device # vi /usr/local/etc/hcsecd.conf device { bdaddr 00:80:37:29:19:a4; name "Pav's T39"; key nokey; pin "1234"; } # hcsecd -d -f /usr/local/etc/hcsecd.conf (will prompt for pin in your device) 14. Discovering what services available for a bluetooth device - sdpcontrol -a 00:60:57:b6:f7:b1 browse - gives Obex (file transer), Dial-up (accessing ISP via phone) or LAN PPP (accesing internet via dial-up to local FreeBSD) -known services - sdpcontrol -a 00:60:57:b6:f7:b1 search Known service names =================== CIP - Common ISDN Access CTP - Cordless Telephony DUN - DialUp Networking FAX - Fax FTRN - OBEX File Transfer GN - GN HID - Human Interface Device HSET - Headset LAN - LAN Access Using PPP NAP - Network Access Point OPUSH - OBEX Object Push SP - Serial Port 15. checking if your device supports LAN Access using PPP # sdpcontrol -a 00:60:57:b6:f7:b1 search LAN Thank you very much!!! -Edwin --- Maksim Yevmenkin wrote: > Hello Edwin, > > > I have a Nokia3660 and a newly installed > FreeBSD-5.3. > > I installed obexapp/openobex and was able to use > > obexapp to push a file to my phone's inbox but I > can't > > pull a file from my phone to my PC nor send a file > > directly from my phone to my PC. Here are some > > details. Hope you could help me coz if I can't > send > > bidirectionally, I cant transfer file from my > phone. I > > use my phone as portable storage device wherein I > save > > my files to my phone and open it at home's PC. If > you > > could help me make this thing work, many thanks to > > you! > > [snip] > > so far everything looks good to me. > > > - my target device is Nokia3660 > [00:60:57:b6:f7:b1] > > which has an OBEX file trasfer protocol > > > > - i want to my phone from FreeBSD and vise versa > using > > obexapp > > > > - i run sdpd > > > > - i run sdpcontrol -l browse > > > > Record Handle: 00000000 > > Service Class ID List: > > Service Discovery Server (0x1000) > > Protocol Descriptor List: > > L2CAP (0x0100) > > Protocol specific parameter #1: > > u/int/uuid16 1 > > Protocol specific parameter #2: > > u/int/uuid16 1 > > > > Record Handle: 0x00000001 > > Service Class ID List: > > Browse Group Descriptor (0x1001 > > ok. thats default (empty) sdpd(8) database, i.e. > *no* usable services > registered on your pc. that means remote device will > not be able to do > anything. > > > - i can connect to my phone using obexapp > > misoy# obexapp -a misoy -C OPUSH > > obex> > > > > - i can transfer a file from FreeBSD to phone > using > > Put command in obexapp > > misoy# obexapp -a misoy -C OPUSH > > vi /home/misoy/test.txt > > obex> Put test.txt > > put: local file> > > Cancelled > > obex> P > > put: local file> test.txt > > put: remote file> test.txt > > Success, response: OK, Success (0x20) > > obex> > > that's fine too. because in this case your pc is > acting as a *client*, > i.e. your pc (obexapp(1)) will query *remote* device > (phone) to find out > which services it offers. > > > - can't get file from my phone using Get of > obexapp > > maybe because i don't have a shared file > > > > - how about if i try to send file(picture) from my > > phone to PC (initiated file transfer from phone) > > * obexapp connection is of course turned off > > * sdpd is running in background > > * i select a pic form my phone > > * send it to my freebsd machine > > * then, i got an "Unable to connect!" message in > my > > phone. > > well, that's just it. you have to run bluetooth > service *server* on your > pc in order to accept pictures/files etc. in > addition to that *local* > sdpd(8) must be running (which you have) *and* > bluetooth service *must* > be registered with local sdpd(8). otherwise the > phone will not be able > to find the service on your pc. > > > - i tried running obexapp server in FreeBSD > > %obexapp -s -C 10 -r /home/misoy/bluetooth/ > > * still "Unable to connect!" is the error when i > send > > file from my phone > > in order to *offer* services to the remote clients, > you need two things: > > 1) run sdpd(8). you need to start it as root. once > you run it make sure > it continues to run. 'sdpcontrol -l browse' (again, > you need to run it > as root) is way to see if sdpd(8) is running and > what services are offered. > > 2) run bluetooth service server (in your case > obexapp(1)). all bluetooth > service servers *will* register service with local > sdpd(8) > automatically, but you *need* to start them as root. > again, once you run > it make sure it continues to run. > > so, in your case, you want to do the following: > > make sure /home/misoy/bluetooth directory exists and > writable for user > 'misoy'. > > # sdpd > # obexapp -s -S -C 10 -u misoy -r > /home/misoy/bluetooth/ > > note that i added two more options to the obexapp(1) > command: > > '-S' will make to obexapp(1) to chroot(2) into > /home/misoy/bluetooth > > '-u misoy' will make obexapp(1) to drop root > privileges and run as > 'misoy' user. > > after you run these command run > > # sdpcontrol -l browse > > and *should* see 'OBEX Push' service. if you do not > see it, then you > need to check if obexapp(1) is running, and if its > not - then check > /var/log/messages for errors. > > keep in mind that you *can* have obexapp(1) running > as *server* in the > background and use obexapp(1) as *client* at the > same time. > > thanks, > max > ===== --- http://www.geocities.com/edwin_vinas/ If others think 10 minutes ahead; Filipinos must think 10 years ahead. --- __________________________________ Do you Yahoo!? Dress up your holiday email, Hollywood style. Learn more. http://celebrity.mail.yahoo.com