def pair(self):
#This is a pairing procedure needed for HERO4 and HERO5 cameras. When those type GoPro camera are purchased the GoPro Mobile app needs an authentication code when pairing the camera to a mobile device for the first time.
#The code is useless afterwards. This function will pair your GoPro to the machine without the need of using the mobile app -- at all.
print("Make sure your GoPro camera is in pairing mode!\nGo to settings > Wifi > PAIR > GoProApp to start pairing.\nThen connect to it, the ssid name should be GOPRO-XXXX/GPXXXXX/GOPRO-BP-XXXX and the password is goprohero")
code=str(input("Enter pairing code: "))
context = ssl._create_unverified_context()
ssl._create_default_https_context = ssl._create_unverified_context
response_raw = urllib.request.urlopen('https://10.5.5.9/gpPair?c=start&pin=' + code + '&mode=0', context=context).read().decode('utf8')
print(response_raw)
response_raw = urllib.request.urlopen('https://10.5.5.9/gpPair?c=finish&pin=' + code + '&mode=0', context=context).read().decode('utf8')
print(response_raw)
wifi_ssid=input("Enter your desired camera wifi ssid name: ")
wifi_pass=input("Enter new wifi password: ")
self.gpControlCommand("wireless/ap/ssid?ssid=" + wifi_ssid + "&pw=" + wifi_pass)
print("Connect now!")
评论列表
文章目录