Closed sezflynn closed 4 years ago
@sezflynn Thanks for p[ointing this. We are looking ito it and will get back soon.
Hi @PuneetRahejaMS, do you have an update on this issue?
Hi @sezflynn, @sharminProvoke,
Unfortunately, there is a known issue with the camera client api below the iotccsdk, where during a session a snapshot should be taken right after the camera is started to ensure stability of the snapshot function.
If an inference is detected before a test snapshot is taken first the snapshot fails and can crash the module. A quick way to work around the issue is to make sure the frame is clear of objects that will trigger inference during module startup. Say, for example, simply covering the camera lens for a few seconds while the module starts up.
So I added some code to make sure the camera was running and an initial snapshot was successful before progressing to the rest of the logic. I placed a piece of white paper in front of the camera and uploaded the new container; it still errors:
while True:
with create_camera() as camera_client:
try:
ipc_provider = camera_client.ipc_provider
camera_props.configure_camera_client(camera_client)
iot_hub_manager = IotHubManager(
protocol, camera_client, properties)
iot_hub_manager.subscribe_to_events()
// NEW CODE HERE:
camera_running = False
camera_success = False
while not camera_running:
print("[PKS INFO] Waiting for camera...")
if camera_client.vam_running:
print("[PKS INFO] Camera running, initial snapshot")
camera_running = True
try:
camera_client.captureimage()
camera_success = True
except Exception:
camera_success = False
if camera_success:
// RETURN TO ORIGINAL CODE FROM HERE:
person_detected = False
while True:
try:
while camera_client.vam_running and not person_detected:
with camera_client.get_inferences() as results:
for result in results:
if is_person(result, last_time):
print("[PKS INFO] Confirmed - object is a person!")
person_detected = True
azure_face_api_detect(camera_client, iot_hub_manager)
# face_api_thread = threading.Thread(
# target=azure_face_api_detect,
# args=(camera_client, iot_hub_manager))
# face_api_thread.start()
last_time = print_inference(
result, iot_hub_manager, last_time)
except EOFError:
print("EOFError. Current VAM running state is %s." %
camera_client.vam_running)
// etc....
The container cycles through the same set of errors about 7 times, with this extra error on the 6th and 7th tries:
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='192.168.72.7', port=1080): Max retries exceeded with url: /vam (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0xb5408eb0>: Failed to establish a new connection: [Errno 111] Connection refused',))
First log:
C:\Users\sezf
> adb shell / # docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c885cfe6cf35 pksiotpocreg.azurecr.io/pksaivision:0.2.6_debug-4-arm32v7 "python3 -u ./main.py" 12 minutes ago Exited (255) 2 minutes ago PksSmartVisionModule
668f73c0c2ad pksiotpocreg.azurecr.io/webstreammodule:0.0.20-arm32v7 "docker-entrypoint.s…" 6 days ago Up About an hour WebStreamModule
97f071b0ff20 mcr.microsoft.com/azureiotedge-hub:1.0 "/bin/sh -c 'echo \"$…" 6 days ago Up 6 minutes 0.0.0.0:443->443/tcp, 0.0.0.0:5671->5671/tcp, 0.0.0.0:8883->8883/tcp edgeHub
7e7a5195b3e6 mcr.microsoft.com/azureiotedge-agent:1.0 "/bin/sh -c 'echo \"$…" 6 days ago Up About an hour edgeAgent
/ # docker logs c885cfe6cf35
Create model_util
Create properties
Init Properties
Init CameraProperties
Init ModelProperties
Model already present and force update set to false
Python 3.5.2 (default, Jul 10 2019, 11:58:48)
[GCC 5.4.0 20160609]
Found IP: 192.168.72.7
ip address = 192.168.72.7
Create camera with no ipc_provider
2019-10-22 23:29:04,074 - iotccsdk - INFO - ipcprovider - connect:264 - API: http://192.168.72.7:1080/login data: {'username': 'admin', 'userpwd': 'admin'}
2019-10-22 23:29:04,234 - iotccsdk - INFO - ipcprovider - connect:266 - Login response: {"status":true}
2019-10-22 23:29:04,235 - iotccsdk - INFO - ipcprovider - connect:271 - connection established with session token: [session=b9eb44afa8]
2019-10-22 23:29:04,235 - iotccsdk - INFO - ipcprovider - __init__:326 - Connecting to: ws://192.168.72.7:1080/async
2019-10-22 23:29:04,238 - iotccsdk - INFO - ipcprovider - __send_request:212 - API: http://192.168.72.7:1080/video data {}
--- request header ---
GET /async HTTP/1.1
Upgrade: websocket
Connection: Upgrade
Host: 192.168.72.7:1080
Origin: http://192.168.72.7:1080
Sec-WebSocket-Key: SldmgzMR8WtM0/+R13qO9Q==
Sec-WebSocket-Version: 13
-----------------------
--- response header ---
HTTP/1.1 101 Switching Protocols
Upgrade: websocket
2019-10-22 23:29:04,253 - iotccsdk - INFO - camera - _get_supported_params:313 - resolutions: ['4K', '1080P', '720P', '480P']
2019-10-22 23:29:04,255 - iotccsdk - INFO - camera - _get_supported_params:314 - encodetype: ['HEVC/H.265', 'AVC/H.264']
Connection: Upgrade
2019-10-22 23:29:04,258 - iotccsdk - INFO - camera - _get_supported_params:315 - bitrates: ['512Kbps', '768Kbps', '1Mbps', '1.5Mbps', '2Mbps', '3Mbps', '4Mbps', '6Mbps', '8Mbps', '10Mbps', '20Mbps']
2019-10-22 23:29:04,259 - iotccsdk - INFO - camera - _get_supported_params:316 - framerates: [24, 30]
2019-10-22 23:29:04,260 - iotccsdk - INFO - camera - _get_supported_params:318 - Current preview settings:
Sec-WebSocket-Accept: DZMmoguhflAPbmbQxBgFT7Dg7V0=
-----------------------
2019-10-22 23:29:04,261 - iotccsdk - INFO - camera - _get_supported_params:319 - resolution: 1080P
2019-10-22 23:29:04,262 - iotccsdk - INFO - camera - _get_supported_params:320 - encodetype: AVC/H.264
2019-10-22 23:29:04,280 - iotccsdk - INFO - camera - _get_supported_params:321 - bitrate: 1.5Mbps
2019-10-22 23:29:04,281 - iotccsdk - INFO - camera - _get_supported_params:322 - framerate: 30
2019-10-22 23:29:04,281 - iotccsdk - INFO - camera - _get_supported_params:323 - display_out: 1
Configuring camera_client
2019-10-22 23:29:04,281 - iotccsdk - INFO - ipcprovider - __send_request:212 - API: http://192.168.72.7:1080/overlay data {'switchStatus': False}
2019-10-22 23:29:04,263 - iotccsdk - INFO - ipcprovider - on_open:347 - Starting heartbeat...
Turning analytics off
Turning preview off
2019-10-22 23:29:04,292 - iotccsdk - INFO - ipcprovider - __send_request:212 - API: http://192.168.72.7:1080/preview data {'switchStatus': False}
2019-10-22 23:29:04,301 - iotccsdk - INFO - ipcprovider - __send_request:212 - API: http://192.168.72.7:1080/preview data {}
2019-10-22 23:29:04,313 - iotccsdk - INFO - camera - _get_preview_info:382 - preview url: None
Configure preview (1080P, AVC/H.264, 1.5Mbps, 30, 1)
2019-10-22 23:29:04,314 - iotccsdk - INFO - ipcprovider - __send_request:212 - API: http://192.168.72.7:1080/video data {'resolutionSelectVal': 1, 'bitRateSelectVal': 3, 'fpsSelectVal': 1, 'encodeModeSelectVal': 1, 'displayOut': 1}
set preview state: on
2019-10-22 23:29:04,333 - iotccsdk - INFO - ipcprovider - __send_request:212 - API: http://192.168.72.7:1080/preview data {'switchStatus': True}
2019-10-22 23:29:05,100 - iotccsdk - INFO - ipcprovider - __send_request:212 - API: http://192.168.72.7:1080/preview data {}
2019-10-22 23:29:05,140 - iotccsdk - INFO - camera - _get_preview_info:382 - preview url: rtsp://192.168.72.7:8900/live
configure_overlay: inference
2019-10-22 23:29:05,142 - iotccsdk - INFO - ipcprovider - __send_request:212 - API: http://192.168.72.7:1080/overlayconfig data {'ov_color': '869007615', 'ov_width': 0, 'ov_start_y': 0, 'ov_type_SelectVal': 5, 'ov_position_SelectVal': 0, 'ov_height': 0, 'ov_usertext': 'Text', 'ov_start_x': 0}
configure_overlay_state: on
2019-10-22 23:29:05,205 - iotccsdk - INFO - ipcprovider - __send_request:212 - API: http://192.168.72.7:1080/overlay data {'switchStatus': True}
set_analytics_state: on
2019-10-22 23:29:05,226 - iotccsdk - INFO - ipcprovider - __send_request:212 - API: http://192.168.72.7:1080/vam data {'switchStatus': True, 'vamconfig': 'MD'}
2019-10-22 23:29:07,012 - iotccsdk - INFO - ipcprovider - __send_request:212 - API: http://192.168.72.7:1080/vam data {}
2019-10-22 23:29:07,030 - iotccsdk - INFO - camera - _get_vam_info:431 - RESPONSE: {'url': 'rtsp://192.168.72.7:8902/live', 'md_port': '', 'fr_port': '', 'ct_port': '', 'status': True}:
2019-10-22 23:29:07,031 - iotccsdk - INFO - camera - _get_vam_info:444 - vam url: rtsp://192.168.72.7:8902/live
Creating IoT Hub manager
Subscribing to method calls
Subscribing to module twin updates
[PKS INFO] Waiting for camera...
[PKS INFO] Camera running, initial snapshot
2019-10-22 23:29:07,431 - iotccsdk - INFO - ipcprovider - __send_request:212 - API: http://192.168.72.7:1080/captureimage data {}
Received twin callback
Received twin update: {'desired': {'TimeBetweenMessagesInSeconds': 12, 'ModelZipUrl': '', '$version': 14, 'Bitrate': '1.5Mbps', 'Resolution': '1080P', 'FrameRate': 30, 'HdmiDisplayActive': True, 'ObjectsOfInterest': '["ALL"]', 'VideoAnalyticsEnabled': True, 'ShowVideoOverlay': True, 'ShowVideoPreview': True, 'Codec': 'AVC/H.264', 'VideoOverlayConfig': 'inference'}, 'reported': {'SupportedEncodingTypes': 'HEVC/H.265 | AVC/H.264', 'SupportedFrameRates': '24 | 30', 'VideoOverlayConfig': 'inference', 'Codec': 'AVC/H.264', '$version': 6821, 'RtspDataUrl': 'rtsp://192.168.72.7:8902/live', 'Bitrate': '1.5Mbps', 'ObjectsOfInterest': '["ALL"]', 'RtspVideoUrl': 'rtsp://192.168.72.7:8900/live', 'FrameRate': 30, 'TimeBetweenMessagesInSeconds': 12, 'HdmiDisplayActive': True, 'Resolution': '1080P', 'VideoAnalyticsEnabled': True, 'ShowVideoOverlay': True, 'ShowVideoPreview': True, 'SupportedResolutions': '4K | 1080P | 720P | 480P', 'SupportedBitrates': '512Kbps | 768Kbps | 1Mbps | 1.5Mbps | 2Mbps | 3Mbps | 4Mbps | 6Mbps | 8Mbps | 10Mbps | 20Mbps', 'SupportedConfigOverlayStyles': 'text | inference', 'ModelZipUrl': ''}}
Send prop: {"Bitrate": "1.5Mbps"}
Send prop: {"FrameRate": 30}
Send prop: {"RtspVideoUrl": "rtsp://192.168.72.7:8900/live"}
Send prop: {"Codec": "AVC/H.264"}
Send prop: {"RtspDataUrl": "rtsp://192.168.72.7:8902/live"}
Send prop: {"Resolution": "1080P"}
Send prop: {"VideoOverlayConfig": "inference"}
Send prop: {"VideoAnalyticsEnabled": true}
Send prop: {"HdmiDisplayActive": true}
Send prop: {"ShowVideoOverlay": true}
Send prop: {"ShowVideoPreview": true}
Send prop: {"SupportedBitrates": "512Kbps | 768Kbps | 1Mbps | 1.5Mbps | 2Mbps | 3Mbps | 4Mbps | 6Mbps | 8Mbps | 10Mbps | 20Mbps"}
Send prop: {"SupportedConfigOverlayStyles": "text | inference"}
Send prop: {"SupportedEncodingTypes": "HEVC/H.265 | AVC/H.264"}
Send prop: {"SupportedFrameRates": "24 | 30"}
Send prop: {"SupportedResolutions": "4K | 1080P | 720P | 480P"}
Send prop: {"ModelZipUrl": ""}
Send prop: {"TimeBetweenMessagesInSeconds": 12}
Send prop: {"ObjectsOfInterest": "[\"ALL\"]"}
Confirmation of 204 received for {"Bitrate": "1.5Mbps"}.
Confirmation of 204 received for {"FrameRate": 30}.
Confirmation of 204 received for {"RtspVideoUrl": "rtsp://192.168.72.7:8900/live"}.
Confirmation of 204 received for {"Codec": "AVC/H.264"}.
Confirmation of 204 received for {"RtspDataUrl": "rtsp://192.168.72.7:8902/live"}.
Confirmation of 204 received for {"Resolution": "1080P"}.
Confirmation of 204 received for {"VideoOverlayConfig": "inference"}.
Confirmation of 204 received for {"VideoAnalyticsEnabled": true}.
Confirmation of 204 received for {"HdmiDisplayActive": true}.
Confirmation of 204 received for {"ShowVideoOverlay": true}.
Confirmation of 204 received for {"ShowVideoPreview": true}.
Confirmation of 204 received for {"SupportedBitrates": "512Kbps | 768Kbps | 1Mbps | 1.5Mbps | 2Mbps | 3Mbps | 4Mbps | 6Mbps | 8Mbps | 10Mbps | 20Mbps"}.
Confirmation of 204 received for {"SupportedConfigOverlayStyles": "text | inference"}.
Confirmation of 204 received for {"SupportedEncodingTypes": "HEVC/H.265 | AVC/H.264"}.
Confirmation of 204 received for {"SupportedFrameRates": "24 | 30"}.
Confirmation of 204 received for {"SupportedResolutions": "4K | 1080P | 720P | 480P"}.
Confirmation of 204 received for {"ModelZipUrl": ""}.
Confirmation of 204 received for {"TimeBetweenMessagesInSeconds": 12}.
Confirmation of 204 received for {"ObjectsOfInterest": "[\"ALL\"]"}.
2019-10-22 23:29:12,478 - iotccsdk - ERROR - camera - captureimage:602 - true
2019-10-22 23:29:12,481 - iotccsdk - INFO - frame_iterators - start:184 - result_src: rtsp://192.168.72.7:8902/live
2019-10-22 23:29:12,482 - iotccsdk - INFO - frame_iterators - start:185 - gstreamer cmd: gst-launch-1.0 -q rtspsrc location=rtsp://192.168.72.7:8902/live protocols=tcp ! application/x-rtp, media=application ! fakesink dump=true
2019-10-22 23:29:12,484 - iotccsdk - INFO - frame_iterators - start:188 - Platform: linux
2019-10-22 23:29:13,991 - iotccsdk - ERROR - ipcprovider - on_error:341 - Camera Restarted! Exiting!!
Last log:
2019-10-22 23:35:23,791 - iotccsdk - ERROR - ipcprovider - on_error:341 - Camera Restarted! Exiting!!
Create model_util
Create properties
Init Properties
Init CameraProperties
Init ModelProperties
Model already present and force update set to false
Python 3.5.2 (default, Jul 10 2019, 11:58:48)
[GCC 5.4.0 20160609]
Found IP: 192.168.72.7
ip address = 192.168.72.7
Create camera with no ipc_provider
2019-10-22 23:38:08,926 - iotccsdk - INFO - ipcprovider - connect:264 - API: http://192.168.72.7:1080/login data: {'userpwd': 'admin', 'username': 'admin'}
2019-10-22 23:38:13,404 - iotccsdk - INFO - ipcprovider - connect:266 - Login response: {"status":true}
2019-10-22 23:38:13,407 - iotccsdk - INFO - ipcprovider - connect:271 - connection established with session token: [session=dc3167a5322]
2019-10-22 23:38:13,408 - iotccsdk - INFO - ipcprovider - __init__:326 - Connecting to: ws://192.168.72.7:1080/async
2019-10-22 23:38:13,411 - iotccsdk - INFO - ipcprovider - __send_request:212 - API: http://192.168.72.7:1080/video data {}
--- request header ---
GET /async HTTP/1.1
Upgrade: websocket
Connection: Upgrade
Host: 192.168.72.7:1080
Origin: http://192.168.72.7:1080
Sec-WebSocket-Key: Bk/M1d+ruqVkwFJaGUXWrA==
Sec-WebSocket-Version: 13
-----------------------
--- response header ---
2019-10-22 23:38:13,423 - iotccsdk - INFO - camera - _get_supported_params:313 - resolutions: ['4K', '1080P', '720P', '480P']
2019-10-22 23:38:13,424 - iotccsdk - INFO - camera - _get_supported_params:314 - encodetype: ['HEVC/H.265', 'AVC/H.264']
HTTP/1.1 101 Switching Protocols
2019-10-22 23:38:13,424 - iotccsdk - INFO - camera - _get_supported_params:315 - bitrates: ['512Kbps', '768Kbps', '1Mbps', '1.5Mbps', '2Mbps', '3Mbps', '4Mbps', '6Mbps', '8Mbps', '10Mbps', '20Mbps']
2019-10-22 23:38:13,426 - iotccsdk - INFO - camera - _get_supported_params:316 - framerates: [24, 30]
2019-10-22 23:38:13,427 - iotccsdk - INFO - camera - _get_supported_params:318 - Current preview settings:
Upgrade: websocket
2019-10-22 23:38:13,427 - iotccsdk - INFO - camera - _get_supported_params:319 - resolution: 1080P
2019-10-22 23:38:13,429 - iotccsdk - INFO - camera - _get_supported_params:320 - encodetype: AVC/H.264
2019-10-22 23:38:13,429 - iotccsdk - INFO - camera - _get_supported_params:321 - bitrate: 1.5Mbps
2019-10-22 23:38:13,430 - iotccsdk - INFO - camera - _get_supported_params:322 - framerate: 30
2019-10-22 23:38:13,430 - iotccsdk - INFO - camera - _get_supported_params:323 - display_out: 1
Configuring camera_client
2019-10-22 23:38:13,431 - iotccsdk - INFO - ipcprovider - __send_request:212 - API: http://192.168.72.7:1080/overlay data {'switchStatus': False}
Connection: Upgrade
Sec-WebSocket-Accept: qe0b5+8GdKRstGtNqkdXJcy/5yA=
-----------------------
Turning analytics off
Turning preview off
2019-10-22 23:38:13,443 - iotccsdk - INFO - ipcprovider - __send_request:212 - API: http://192.168.72.7:1080/preview data {'switchStatus': False}
2019-10-22 23:38:13,444 - iotccsdk - INFO - ipcprovider - on_open:347 - Starting heartbeat...
2019-10-22 23:38:13,456 - iotccsdk - INFO - ipcprovider - __send_request:212 - API: http://192.168.72.7:1080/preview data {}
2019-10-22 23:38:13,466 - iotccsdk - INFO - camera - _get_preview_info:382 - preview url: None
Configure preview (1080P, AVC/H.264, 1.5Mbps, 30, 1)
2019-10-22 23:38:13,467 - iotccsdk - INFO - ipcprovider - __send_request:212 - API: http://192.168.72.7:1080/video data {'resolutionSelectVal': 1, 'fpsSelectVal': 1, 'displayOut': 1, 'encodeModeSelectVal': 1, 'bitRateSelectVal': 3}
set preview state: on
2019-10-22 23:38:13,484 - iotccsdk - INFO - ipcprovider - __send_request:212 - API: http://192.168.72.7:1080/preview data {'switchStatus': True}
2019-10-22 23:38:14,890 - iotccsdk - INFO - ipcprovider - __send_request:212 - API: http://192.168.72.7:1080/preview data {}
2019-10-22 23:38:14,953 - iotccsdk - INFO - camera - _get_preview_info:382 - preview url: rtsp://192.168.72.7:8900/live
configure_overlay: inference
2019-10-22 23:38:14,954 - iotccsdk - INFO - ipcprovider - __send_request:212 - API: http://192.168.72.7:1080/overlayconfig data {'ov_width': 0, 'ov_height': 0, 'ov_position_SelectVal': 0, 'ov_start_y': 0, 'ov_type_SelectVal': 5, 'ov_start_x': 0, 'ov_color': '869007615', 'ov_usertext': 'Text'}
configure_overlay_state: on
2019-10-22 23:38:15,061 - iotccsdk - INFO - ipcprovider - __send_request:212 - API: http://192.168.72.7:1080/overlay data {'switchStatus': True}
set_analytics_state: on
2019-10-22 23:38:15,155 - iotccsdk - INFO - ipcprovider - __send_request:212 - API: http://192.168.72.7:1080/vam data {'vamconfig': 'MD', 'switchStatus': True}
2019-10-22 23:38:21,847 - iotccsdk - INFO - ipcprovider - __send_request:212 - API: http://192.168.72.7:1080/vam data {}
2019-10-22 23:38:21,884 - iotccsdk - ERROR - ipcprovider - on_error:341 - Camera Restarted! Exiting!!
2019-10-22 23:38:22,310 - iotccsdk - ERROR - ipcprovider - __send_request:231 - HTTPConnectionPool(host='192.168.72.7', port=1080): Max retries exceeded with url: /vam (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0xb5408eb0>: Failed to establish a new connection: [Errno 111] Connection refused',))
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/urllib3/connection.py", line 157, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw
File "/usr/local/lib/python3.5/dist-packages/urllib3/util/connection.py", line 84, in create_connection
raise err
File "/usr/local/lib/python3.5/dist-packages/urllib3/util/connection.py", line 74, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py", line 672, in urlopen
chunked=chunked,
File "/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py", line 387, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/lib/python3.5/http/client.py", line 1122, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python3.5/http/client.py", line 1167, in _send_request
self.endheaders(body)
File "/usr/lib/python3.5/http/client.py", line 1118, in endheaders
self._send_output(message_body)
File "/usr/lib/python3.5/http/client.py", line 944, in _send_output
self.send(msg)
File "/usr/lib/python3.5/http/client.py", line 887, in send
self.connect()
File "/usr/local/lib/python3.5/dist-packages/urllib3/connection.py", line 184, in connect
conn = self._new_conn()
File "/usr/local/lib/python3.5/dist-packages/urllib3/connection.py", line 169, in _new_conn
self, "Failed to establish a new connection: %s" % e
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0xb5408eb0>: Failed to establish a new connection: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py", line 720, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "/usr/local/lib/python3.5/dist-packages/urllib3/util/retry.py", line 436, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='192.168.72.7', port=1080): Max retries exceeded with url: /vam (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0xb5408eb0>: Failed to establish a new connection: [Errno 111] Connection refused',))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/iotccsdk/ipcprovider.py", line 220, in __send_request
url, data=json.dumps(payload), headers=headers, params=params)
File "/usr/local/lib/python3.5/dist-packages/requests/sessions.py", line 546, in get
return self.request('GET', url, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.5/dist-packages/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='192.168.72.7', port=1080): Max retries exceeded with url: /vam (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0xb5408eb0>: Failed to establish a new connection: [Errno 111] Connection refused',))
Try to clean up before the end
2019-10-22 23:38:22,688 - iotccsdk - INFO - ipcprovider - __send_request:212 - API: http://192.168.72.7:1080/overlay data {'switchStatus': False}
2019-10-22 23:38:22,768 - iotccsdk - INFO - ipcprovider - __send_request:212 - API: http://192.168.72.7:1080/vam data {'vamconfig': 'MD', 'switchStatus': False}
2019-10-22 23:38:22,784 - iotccsdk - INFO - ipcprovider - __send_request:212 - API: http://192.168.72.7:1080/vam data {}
/ #
Okay, a couple of reboots seems to have cleared the above problems, camera is taking snapshots now!
We're getting snapshots and successfully passing them to azure face api. Thank you for your help @PuneetRahejaMS
Face detect sample fails when camera client attempts to capture image.
We removed threading and changed
main.py
to this:and added logging to
azure_face_api.py
:Here's a dump of the logs:
We're looking for any insight into what could be causing this error and where to from here in terms of resolving this issue.