VAPIX: firmwaremanagement.cgi #46
-
Hello all - long time reader, first time poster here. I needed to get the firmware version of a subset of camera IPs. I thought it would be straight forward. But sadly, not so, at least for me. I tried using a version of @mattias-kindborg-at-work python examples he had put in a different thread. But I can't seem to get it right. Anyone have any suggestions? Doesn't have to be python. Thanks in advance! ===================================== if len(sys.argv) != 4: ip = sys.argv[1] payload = { auth = requests.auth.HTTPDigestAuth(username, password) print(r.status_code) |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Hi @tonylom3. What language would you prefer the sample code to be written in? |
Beta Was this translation helpful? Give feedback.
-
Hi Mattias, I was trying to follow the Firmware status example listed here: ================================== `import requests url = "https://10.xx.xx.xx/axis-cgi/firmwaremanagement.cgi" payload = { response = requests.request("POST", url, json=payload, headers=headers) print(response.text)` ===================================== This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required. |
Beta Was this translation helpful? Give feedback.
-
Hi @tonylom3. I think the following code would work. import requests
import sys
if len(sys.argv) != 4:
print("Usage: firmware-status.py <ip> <username> <password>")
sys.exit(1)
ip = sys.argv[1]
username = sys.argv[2]
password = sys.argv[3]
auth = requests.auth.HTTPDigestAuth(username, password)
body = {
"apiVersion": "1.4",
"method": "status"
}
r = requests.post("http://{}/axis-cgi/firmwaremanagement.cgi".format(ip), json=body, auth=auth)
print(r.status_code)
print(r.text) When I call this I get the following response. python3 firmware-status.py 192.168.1.80 root mypassword
200
{
"apiVersion": "1.4",
"method": "status",
"data": {
"activeFirmwareVersion": "10.9.0",
"activeFirmwarePart": "6337444343"
}
} |
Beta Was this translation helpful? Give feedback.
Hi @tonylom3.
I think the following code would work.
When I call this I get the following response.