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