2016-03-17 31 views
0

我在Windows Vista PC上使用批处理文件来控制和下载GoPro Hero 3+黑色相机的媒体。感谢https://github.com/KonradIT/goprowifihack的WiFi黑客创意,您可以使用curl URL告诉相机启动和停止录制,更改模式等。然后我可以使用wget将文件从相机下载到我的硬盘。如何避免超时连接GoPro相机

我的问题是,经过通过我的循环或约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 

回答

0

这个问题似乎是在后台运行wget同时记录更多的媒体超载相机并使其关闭无线上网。

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