Azure-Samples / Custom-vision-service-iot-edge-raspberry-pi

Sample showing how to deploy a AI model from the Custom Vision service to a Raspberry Pi 3 device using Azure IoT Edge
MIT License
186 stars 135 forks source link

Start module image-classifier-service failed on edge runtime #46

Closed czgtest closed 4 years ago

czgtest commented 5 years ago

To deploy the solution on an x64 PC From my ubuntu 18.04:

  1. Clone this sample
  2. Update the .env file with the values for your container registry and make sure that your docker engine has access to it 3.Build the entire solution by opening the control palette (Ctrl+Shift+P), select Build and push IoT Edge Solution (this can take a while...especially to build numpy and pillow...) and select the deployment.test-amd64.template.json manifest file 4.Deploy the solution to your device by right-clicking on the config/deployment.json file, select Create Deployment for Single device and choose your targeted device
  3. verify module image-classifier-service and camera-capture are not running. create module image-classifier-service failed in docker. image

docker logs camera-capture Time to process frame externally: 6 ms Time to display frame: 1 ms Wait time between frames :16 Total time for one frame: 17 ms Frame number: 106 Time to capture (+ straighten up) a frame: 6 ms Time to pre-process a frame: 1 ms Time to encode a frame for processing: 1 ms __sendFrameForProcessing Excpetion -HTTPConnectionPool(host='image-classifier-service', port=80): Max retries exceeded with url: /image (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f6ef817f208>: Failed to establish a new connection: [Errno -2] Name or service not known',))

docker logs edgeHub 2019-05-09 02:52:13 : Starting Edge Hub [05/09/2019 02:52:13.711 AM] Edge Hub Main() [05/09/2019 02:52:15.436 AM] Found intermediate certificates: [CN=iotedged workload ca:07/07/2019 06:42:18],[CN=Test Edge Device CA:07/07/2019 06:42:18],[CN=Test Edge Owner CA:07/07/2019 06:42:18] 2019-05-09 02:52:17.176 +00:00 [INF] - Created persistent store at /tmp/edgeHub 2019-05-09 02:52:17.255 +00:00 [INF] - Starting Edge Hub 2019-05-09 02:52:17.256 +00:00 [INF] - █████╗ ███████╗██╗ ██╗██████╗ ███████╗ ██╔══██╗╚══███╔╝██║ ██║██╔══██╗██╔════╝ ███████║ ███╔╝ ██║ ██║██████╔╝█████╗ ██╔══██║ ███╔╝ ██║ ██║██╔══██╗██╔══╝ ██║ ██║███████╗╚██████╔╝██║ ██║███████╗ ╚═╝ ╚═╝╚══════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝

██╗ ██████╗ ████████╗ ███████╗██████╗ ██████╗ ███████╗ ██║██╔═══██╗╚══██╔══╝ ██╔════╝██╔══██╗██╔════╝ ██╔════╝ ██║██║ ██║ ██║ █████╗ ██║ ██║██║ ███╗█████╗ ██║██║ ██║ ██║ ██╔══╝ ██║ ██║██║ ██║██╔══╝ ██║╚██████╔╝ ██║ ███████╗██████╔╝╚██████╔╝███████╗ ╚═╝ ╚═════╝ ╚═╝ ╚══════╝╚═════╝ ╚═════╝ ╚══════╝

2019-05-09 02:52:17.259 +00:00 [INF] - Version - 1.0.7.21905529 (f455ae2cd66db716c4bd8e7aaa7984ce092481c0) 2019-05-09 02:52:17.265 +00:00 [INF] - Loaded server certificate with expiration date of "2019-07-07T06:42:18.0000000+00:00" 2019-05-09 02:52:17.309 +00:00 [INF] - Created new message store 2019-05-09 02:52:17.311 +00:00 [INF] - Started task to cleanup processed and stale messages 2019-05-09 02:52:17.429 +00:00 [INF] - Created device scope identities cache 2019-05-09 02:52:17.447 +00:00 [INF] - Starting refresh of device scope identities cache 2019-05-09 02:52:17.586 +00:00 [INF] - Initialized twin manager v1. 2019-05-09 02:52:17.627 +00:00 [INF] - Initializing configuration 2019-05-09 02:52:17.680 +00:00 [INF] - New device connection for device customubuntuprod/$edgeHub 2019-05-09 02:52:17.806 +00:00 [INF] - Attempting to connect to IoT Hub for client customubuntuprod/$edgeHub via AMQP... 2019-05-09 02:52:21.771 +00:00 [INF] - Exiting disconnected state 2019-05-09 02:52:21.776 +00:00 [INF] - Device connected to cloud, processing subscriptions for connected clients. 2019-05-09 02:52:21.784 +00:00 [INF] - Processing subscriptions for client customubuntuprod/$edgeHub. 2019-05-09 02:52:21.797 +00:00 [INF] - Cloud connection for customubuntuprod/$edgeHub is True 2019-05-09 02:52:21.810 +00:00 [INF] - Connection status for customubuntuprod/$edgeHub changed to ConnectionEstablished 2019-05-09 02:52:21.817 +00:00 [INF] - Entering connected state 2019-05-09 02:52:21.823 +00:00 [INF] - Created cloud proxy for client customubuntuprod/$edgeHub via AMQP, with client operation timeout 20 seconds. 2019-05-09 02:52:21.839 +00:00 [INF] - Initialized cloud proxy 6d07fdd7-18f5-4337-b172-29c47923af4b for customubuntuprod/$edgeHub 2019-05-09 02:52:21.846 +00:00 [INF] - Created cloud connection for client customubuntuprod/$edgeHub 2019-05-09 02:52:24.826 +00:00 [INF] - Obtained edge hub config from module twin 2019-05-09 02:52:25.377 +00:00 [INF] - Set the following 1 route(s) in edge hub 2019-05-09 02:52:25.379 +00:00 [INF] - CameraCaptureToIoTHub: FROM /messages/modules/camera-capture/outputs/output1 INTO $upstream 2019-05-09 02:52:25.383 +00:00 [INF] - Updated message store TTL to 7200 seconds 2019-05-09 02:52:25.384 +00:00 [INF] - Updated the edge hub store and forward configuration 2019-05-09 02:52:25.388 +00:00 [INF] - Initialized edge hub configuration 2019-05-09 02:52:25.420 +00:00 [INF] - Starting timer to authenticate connections with a period of 300 seconds 2019-05-09 02:52:25.667 +00:00 [INF] - Scheduling server certificate renewal for "2019-07-07T06:39:48.0002760Z". 2019-05-09 02:52:25.671 +00:00 [INF] - Starting protocol heads - (MQTT, AMQP, HTTP) 2019-05-09 02:52:25.681 +00:00 [INF] - Starting MQTT head 2019-05-09 02:52:25.847 +00:00 [INF] - Initializing TLS endpoint on port 8883 for MQTT head. 2019-05-09 02:52:25.964 +00:00 [INF] - Starting AMQP head 2019-05-09 02:52:26.000 +00:00 [INF] - Started MQTT head 2019-05-09 02:52:26.156 +00:00 [INF] - Started AMQP head 2019-05-09 02:52:26.163 +00:00 [INF] - Starting HTTP head 2019-05-09 02:52:26.346 +00:00 [INF] - User profile is available. Using '"/home/edgehubuser/.aspnet/DataProtection-Keys"' as key repository; keys will not be encrypted at rest. 2019-05-09 02:52:26.417 +00:00 [INF] - Creating key {6bfd2c9b-fafe-45a0-9d1e-e518d6454428} with creation date 2019-05-09 02:52:26Z, activation date 2019-05-09 02:52:26Z, and expiration date 2019-08-07 02:52:26Z. 2019-05-09 02:52:26.447 +00:00 [WRN] - No XML encryptor configured. Key {6bfd2c9b-fafe-45a0-9d1e-e518d6454428} may be persisted to storage in unencrypted form. 2019-05-09 02:52:26.456 +00:00 [INF] - Writing data to file '"/home/edgehubuser/.aspnet/DataProtection-Keys/key-6bfd2c9b-fafe-45a0-9d1e-e518d6454428.xml"'. 2019-05-09 02:52:27.125 +00:00 [WRN] - Overriding address(es) '"http://+:80"'. Binding to endpoints defined in "UseKestrel()" instead. 2019-05-09 02:52:27.192 +00:00 [INF] - Started HTTP head 2019-05-09 02:57:25.435 +00:00 [INF] - Reauthenticating connected clients 2019-05-09 03:02:25.427 +00:00 [INF] - Reauthenticating connected clients 2019-05-09 03:07:25.425 +00:00 [INF] - Reauthenticating connected clients 2019-05-09 03:12:25.424 +00:00 [INF] - Reauthenticating connected clients 2019-05-09 03:17:25.425 +00:00 [INF] - Reauthenticating connected clients 2019-05-09 03:22:17.330 +00:00 [INF] - Started task to cleanup processed and stale messages for endpoint iothub 2019-05-09 03:22:17.351 +00:00 [INF] - Cleaned up 0 messages from queue for endpoint iothub and 0 messages from message store. 2019-05-09 03:22:25.422 +00:00 [INF] - Reauthenticating connected clients

docker logs edgeAgent

2019-05-09 03:17:56.786 +00:00 [INF] - Executing command: "Command Group: ( [Stop module image-classifier-service] [Start module image-classifier-service] [Saving image-classifier-service to store] )" 2019-05-09 03:17:56.786 +00:00 [INF] - Executing command: "Stop module image-classifier-service" 2019-05-09 03:17:56.788 +00:00 [INF] - Executing command: "Start module image-classifier-service" 2019-05-09 03:17:58.266 +00:00 [INF] - Executing command: "Saving image-classifier-service to store" 2019-05-09 03:17:58.267 +00:00 [INF] - Plan execution ended for deployment 2 2019-05-09 03:18:03.282 +00:00 [INF] - Module 'image-classifier-service' scheduled to restart after 05m:00s (04m:55s left). 2019-05-09 03:18:03.712 +00:00 [INF] - Updated reported properties 2019-05-09 03:18:08.720 +00:00 [INF] - Module 'image-classifier-service' scheduled to restart after 05m:00s (04m:50s left). 2019-05-09 03:18:13.731 +00:00 [INF] - Module 'image-classifier-service' scheduled to restart after 05m:00s (04m:45s left). 2019-05-09 03:18:18.741 +00:00 [INF] - Module 'image-classifier-service' scheduled to restart after 05m:00s (04m:40s left). 2019-05-09 03:18:23.751 +00:00 [INF] - Module 'image-classifier-service' scheduled to restart after 05m:00s (04m:35s left). 2019-05-09 03:18:28.760 +00:00 [INF] - Module 'image-classifier-service' scheduled to restart after 05m:00s (04m:30s left).

emmanuel-bv commented 4 years ago

https://github.com/Azure-Samples/Custom-vision-service-iot-edge-raspberry-pi/pull/62