我一直在尝试通过蓝牙将文件从树莓派发送到手机。我尝试使用 obexftp 来执行此操作,但它给了我返回代码 97。我无法找出该代码的含义或导致此问题的原因,并且希望对此事有任何见解。
控制台输入+输出:
pi@raspberrypi ~ $ obexftp -b C0:EE:FB:24:43:03 -v -p test.wav
Browsing C0:EE:FB:24:43:03 ...
Connecting..\done
Tried to connect for 25ms
Sending "test.wav"...|failed: test.wav
The operation failed with return code 97
Disconnecting../done
答案1
您需要按顺序指定目的地和来源。例如:
obexftp -b C0:EE:FB:24:43:03 -B 20 -c /some/dir/on_your/phone/ -p /full/path/to/this/test.wav
我记得它就像 -c 是“捕手”而 -p 是“投手”。捕手更重要,所以它先行。想想看,如果没有捕手,你的投手就毫无用处。
答案2
您好,我遇到了同样的问题,我也收到错误“返回代码 68”,我发现,在我手机的“根”文件夹上有 2 个“系统文件夹”:
root@chip:/home/chip# obexftp -b 1C:39:47:XX:XX:XX -B 20 -c / -l
Connecting..\done
Tried to connect for 562ms
Sending ""...|done
Receiving "(null)".../<?xml version="1.0"?><!DOCTYPE folder-listing SYSTEM "obex-folder-listing.dtd"><folder-listing version="1.0"><folder name="PHONE_MEMORY"/><folder name="EXTERNAL_MEMORY"/></folder-listing>done
Disconnecting..-done
所以有 2 个额外的目录:PHONE_MEMORY 和 EXTERNAL_MEMORY - 内部内存和 SD 卡,所以在我将正确的文件夹放入 -c 开关后,我得到以下成功结果:
root@chip:/home/chip# obexftp -b 1C:39:47:XX:XX:XX -B 20 -c /PHONE_MEMORY/tmp -p /home/chip/setup.json
Connecting..\done
Tried to connect for 393ms
Sending ""...|Sending "PHONE_MEMORY".../Sending "tmp"...-done
Sending "/home/chip/setup.json"...\done
Disconnecting..|done