Sending file through bluetooth crontab

Discussion in 'UDOO NEO' started by CCT, Jun 14, 2016.

  1. CCT

    CCT New Member

    Joined:
    Apr 21, 2016
    Messages:
    11
    Likes Received:
    1
    I want to send a file named "read.txt" using command: bluetooth-sendto. It works using the direct command on terminal "bluetooth-sendto --device=MACADDR path/to/read.txt". I want to execute it with this cron job:

    */1 * * * * bluetooth-sendto --device=MACADDR path/to/read.txt

    But it doesn't work. Redirecting the output of this command results an empty file:

    */1 * * * * bluetooth-sendto --device=MACADDR path/to/read.txt>path/to/err.log

    Permissions of directories and files are 777. Cronjob is settled for same user that can execute command from command line directly.
     
  2. CCT

    CCT New Member

    Joined:
    Apr 21, 2016
    Messages:
    11
    Likes Received:
    1
    I need to send data between two udoo through bluetooth...
     
  3. Laura

    Laura UDOOer

    Joined:
    Apr 22, 2016
    Messages:
    374
    Likes Received:
    156
    Can you clarify the process you're following on the receiving device, for the direct command and for the Cron job?
     
  4. CCT

    CCT New Member

    Joined:
    Apr 21, 2016
    Messages:
    11
    Likes Received:
    1
    On the receiving device i'm not following any process. When I send the the file through command line it works fine and the other board receives the file.
     
  5. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    The path to Read.txt is a complete path? So /home/user/udooer/read.txt
     
  6. CCT

    CCT New Member

    Joined:
    Apr 21, 2016
    Messages:
    11
    Likes Received:
    1
    The path is /home/udooer/reads.txt, and that is also the path that i used. Sorry if I wrote user.
     
  7. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    Last edited: Jun 16, 2016
  8. CCT

    CCT New Member

    Joined:
    Apr 21, 2016
    Messages:
    11
    Likes Received:
    1
    I also tried to put the command in a script and then try to launch that, but it doesn't work. I tried with other commands but I don't have this problem with them. Can still be a problem of the path?
     
  9. CCT

    CCT New Member

    Joined:
    Apr 21, 2016
    Messages:
    11
    Likes Received:
    1
    From the log file of the crontab:
    Jun 16 14:26:01 localhost CRON[2023]: (udooer) CMD (bluetooth-sendto --device=xx:xx:xx:xx:xx:xx /home/udooer/send.txt)
    Jun 16 14:26:01 localhost CRON[2016]: (CRON) info (No MTA installed, discarding output)
     
  10. CCT

    CCT New Member

    Joined:
    Apr 21, 2016
    Messages:
    11
    Likes Received:
    1
    There are other ways for two udoos to communicate with Bluetooth?
     
  11. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
  12. CCT

    CCT New Member

    Joined:
    Apr 21, 2016
    Messages:
    11
    Likes Received:
    1
    Thank you so much. This command solve my problem: obexftp –-nopath –-noconn –-uuid none –-bluetooth <BTAddr> –-channel <OPUSHChannelNo> –put <FileToPut>.
    Do you know if the channel is fixed or if it changes every time I shut down the device?
     
    waltervl likes this.
  13. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    I have no idea, just did a quick google search to help you :)
     
    Andrea Rovai likes this.
  14. CCT

    CCT New Member

    Joined:
    Apr 21, 2016
    Messages:
    11
    Likes Received:
    1
    Yesterday all worked well, now I'm getting this error:
    Suppressing FBS.
    Connecting..\done
    Tried to connect for 536ms
    Sending "/home/user/send.txt"...|failed: /home/user/send.txt
    The operation failed with return code 67
    Disconnecting../done
    Help?
     
  15. CCT

    CCT New Member

    Joined:
    Apr 21, 2016
    Messages:
    11
    Likes Received:
    1
    I can't send files with gui...
     

Share This Page