Send file from CLI via obex-data-server

39 views
Skip to first unread message

Mario Balaban

unread,
Nov 13, 2009, 7:11:13 AM11/13/09
to obex-data-server developers
Hy,
is it possible to send a file to the device ( Phone) from command line
via obex-data-server? I need to send large files from a bash script
and I manage to send them via /usr/bin/obexftp but this is sooo slow
(12kb/s). I noticed that sending file via obex-data-sever is much
faster (110 kb/s) but I didn't found a way of invoking it to send a
file from my script.
Thanks.

Tadas Dailyda

unread,
Nov 13, 2009, 8:41:12 AM11/13/09
to ods-...@googlegroups.com
Hi,

Yes, it is possible. You have to download obex-data-server source
package and in test directory you will find ods-opp-test.py script which
you can use for this purpose.

Regards,
Tadas Dailyda

Mario Balaban

unread,
Nov 16, 2009, 5:38:47 AM11/16/09
to obex-data-server developers
Thanks for your attention,
I've googled a little bit but didn't found what are the right options
(script arguments) to send the file. All I found is how to receive the
file on the pc(
ods-server-test.py opp /tmp ).
Would you be so kind to tell me what are the right arguments to send
the file from the pc -> to the phone?
Thanks again.

Tadas Dailyda

unread,
Nov 17, 2009, 7:55:07 AM11/17/09
to ods-...@googlegroups.com
Very simple: ods-opp-test.py 00:11:22:33:44:55 file1 file2 file3
Or try running ods-opp-test.py --help, it will show what options are
available.

Cheers
> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google Groups "obex-data-server developers" group.
> To post to this group, send email to ods-...@googlegroups.com
> To unsubscribe from this group, send email to ods-devel+...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/ods-devel?hl=en
> -~----------~----~----~----~------~----~------~--~---
>
>

Message has been deleted
Message has been deleted

Mario Balaban

unread,
Nov 17, 2009, 11:52:10 AM11/17/09
to obex-data-server developers
Ok, I managed to send the file to the phone with the script, but now
there is another question:
the phone must not be in standby and it is asking if I want to save
the file. But with obex-data-server gui (and obexftp ) this did not
happen, the phone silently saved the file in the Shared Directory in
this case. Can the ods-opp-test.py script have the same behavior?
Thanks!!!

Tadas Dailyda

unread,
Nov 18, 2009, 7:46:41 AM11/18/09
to ods-...@googlegroups.com
No, it's not possible to change this behavior. Actually it depends on
the receiving device. Usually, when OPP bluetooth profile is used,
receiving device asks for confirmation. This cannot be changed from the
sending side. This does not happen with obexftp or obex-data-server when
using FTP profile because most devices don't ask for any confirmations
in FTP mode.

Regards,
Tadas
> --
>
> You received this message because you are subscribed to the Google Groups "obex-data-server developers" group.
> To post to this group, send email to ods-...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/ods-devel?hl=.
>
>
>

Mario Balaban

unread,
Nov 18, 2009, 10:32:28 AM11/18/09
to obex-data-server developers
Sorry if I'm annoying with my questions, but I really need to get this
script working on higher speed and without human interaction.
So, how can I set the FTP profile with obex-data-server script to send
the file from CLI (If it is possible) ?
Thank you very much.

Tadas Dailyda

unread,
Nov 21, 2009, 10:02:03 AM11/21/09
to ods-...@googlegroups.com
It is possible but I would not recommend you to do that (for using FTP
profile you have to pair with device first). Sorry for my late
reply...

Regards,
Tadas Dailyda

Mario Balaban

unread,
Nov 23, 2009, 7:14:13 AM11/23/09
to obex-data-server developers
No problem. Pairing is just once time operation, (vs per file save
file confirmation)
so after I have paired I can send files even after reboot my pc and
the Phone.
They still do recognize them self, If I'm not mistaken, (they did with
obexftp).
Anyway, I imagine that it would be possible to initiate "Paring" from
command line,
even if in that is not my case, wright?
Turning back to the initial question, how do use FTP profile to send
files (after I have them paired, for example from the Blueman applet)
to the phone from command line?
Thanks!

Mario Balaban

unread,
Dec 15, 2009, 4:35:30 AM12/15/09
to obex-data-server developers
Hello everybody,
is there any solution for the problem in the end?
Thanks.

Tadas Dailyda

unread,
Dec 15, 2009, 1:19:00 PM12/15/09
to ods-...@googlegroups.com
Yes. It is possible to send file using FTP profile from command line. In
obex-data-server source test directory, you can find ods-session-test.py
script. It is not really ready for use so you would have to fix it for
your needs (device address is hardcoded and it does a lot of operations
instead of just sending one file). Maybe a much easier way to do this
would be to change ods-opp-test.py (change 'opp' to 'ftp' at line 34).

Cheers,
Tadas Dailyda
> --
>
> You received this message because you are subscribed to the Google Groups "obex-data-server developers" group.
> To post to this group, send email to ods-...@googlegroups.com.
> To unsubscribe from this group, send email to ods-devel+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/ods-devel?hl=en.
>
>
>

Mario Balaban

unread,
Dec 22, 2009, 11:49:42 AM12/22/09
to obex-data-server developers
Yes! Thanks a lot! I modified the ods-opp-test.py the way you
indicated. Last question, if I can abuse, is it possibile to change
the remote directory (to save the file in a different path from ftp
root) ?
Thanks again!

Tadas Dailyda

unread,
Dec 23, 2009, 10:48:49 AM12/23/09
to ods-...@googlegroups.com
It is possible to do that, you can find an example in ods-session-test.py

Reply all
Reply to author
Forward
0 new messages