如何避免与 GoPro 摄像机的连接超时

How to avoid timed out connection to GoPro camera

我在 Windows Vista PC 上使用批处理文件来控制和下载来自 GoPro Hero 3+ Black 摄像机的媒体。多亏了https://github.com/KonradIT/goprowifihack的WiFi hacking机智,你可以curl URLs告诉相机开始和停止录制,改变模式等。然后我可以使用wget从下载文件相机到我的硬盘。

我的问题是,在我的循环运行大约 9 次之后(它会有所不同)我失去了连接:

curl: (7) failed to connect to 10.5.5.9 port 80: Timed out

我正在做的事情是否使连接过载?

以下是我认为与我的问题相关的代码:

echo off
setlocal enabledelayedexpansion

REM turn on the camera
curl http://10.5.5.9/bacpac/PW?t=password^&p=%%01
timeout 10 /nobreak

REM delete all previous files
curl http://10.5.5.9/camera/DA?t=password
timeout 10 /nobreak

REM begin recording video
curl http://10.5.5.9/bacpac/SH?t=password^&p=%%01
timeout 60 /nobreak

REM stop recording
curl http://10.5.5.9/bacpac/SH?t=password^&p=%%00

for /l %%a in (1,1,1000) do (

    REM download video files
    wget -b -r -A .MP4 -nH --cut-dirs=3 http://10.5.5.9:8080/videos/DCIM/100GOPRO/
    timeout 10 /nobreak

    REM change to timelapse mode
    curl http://10.5.5.9/camera/CM?t=password^&p=%%03
    timeout 5 /nobreak

    REM begin timelapse
    curl http://10.5.5.9/bacpac/SH?t=password^&p=%%01
    timeout 200 /nobreak

    REM end timelapse
    curl http://10.5.5.9/bacpac/SH?t=password^&p=%%00

    REM download JPEGs
    wget -b -r -A .JPG -nH --cut-dirs=3 http://10.5.5.9:8080/videos/DCIM/100GOPRO/
    timeout 10 /nobreak

    REM change to video mode
    curl http://10.5.5.9/camera/CM?t=password^&p=%%00

    REM wait for awhile until the next measurement
    timeout 200 /nobreak

    REM delete all files (since enough time has elapsed for them to be downloaded)
    curl http://10.5.5.9/camera/DA?t=password
    timeout 10 /nobreak

    REM begin recording video
    curl http://10.5.5.9/bacpac/SH?t=password^&p=%%01
    timeout 60 /nobreak

    REM end recording video
    curl http://10.5.5.9/bacpac/SH?t=password^&p=%%00
)
endlocal

问题似乎是 运行 wget 在后台录制更多媒体时会使相机过载并导致其关闭 Wifi。

wget 中删除 -b 参数以避免 wget 运行 在后台修复此问题。