Communicate sockets with components

0

Hello. I deployed component to Raspberry Pi with AWS IoT Greengrass. The Raspberry pi is in normal condition. The deployment status of the components is also normal.

But I have an error. I set it as an artifact to the file I uploaded on the S3 bucket. My artifact is a file for socket communication.

This is what I think.

  1. Deploy components in AWS IoT Greengrass.
  2. When the deployment is completed, the server file for socket communication is executed.
  3. If I run a client file on my computer, I can connect to each other and communicate with each other.
  4. Then, another file in the artifact, the face recognition file, can be executed to make an inference.

But I have an error here. Socket communication seems to be connected. However, the print statement that the socket was opened does not appear in the log. So I'm curious. Was it wrong to connect socket communication with components? I'm confused. Because if I run the temperature and humidity measurement file instead of the face recognition file in number 4 above, it runs well!

Strangely, the face recognition function does not work. Is it because face recognition takes a long time? Then can I fix this by modifying the components?

I don't know if it's a component problem or a socket communication problem. I always look forward to your reply.

This is my Raspberry Pi's log. <My Component's Log> 2022-11-07T11:19:51.555Z [INFO] (pool-2-thread-20) com.james.socket: shell-runner-start. {scriptName=services.com.james.socket.lifecycle.run.script, serviceName=com.james.socket, currentState=STARTING, command=["cd /home/pi&&. pracvenv/bin/activate&&cd socketserve&&python3 socketserver.py"]} 2022-11-07T11:21:49.203Z [WARN] (Copier) com.james.socket: stderr. /home/pi/pracvenv/lib/python3.7/site-packages/h5py/init.py:40: UserWarning: h5py is running against HDF5 1.10.6 when it was built against 1.10.4, this may cause problems. {scriptName=services.com.james.socket.lifecycle.run.script, serviceName=com.james.socket, currentState=RUNNING} 2022-11-07T11:21:49.204Z [WARN] (Copier) com.james.socket: stderr. '{0}.{1}.{2}'.format(*version.hdf5_built_version_tuple). {scriptName=services.com.james.socket.lifecycle.run.script, serviceName=com.james.socket, currentState=RUNNING} 2022-11-07T11:21:49.205Z [WARN] (Copier) com.james.socket: stderr. WARNING:tensorflow:No training configuration found in the save file, so the model was not compiled. Compile it manually.. {scriptName=services.com.james.socket.lifecycle.run.script, serviceName=com.james.socket, currentState=RUNNING}

<Greengrass Log> 2022-11-07T11:19:59.699Z [INFO] (pool-2-thread-10) com.aws.greengrass.deployment.DeploymentDirectoryManager: Clean up link to earlier deployment. {link=/greengrass/v2/deployments/previous-success} 2022-11-07T11:19:59.972Z [INFO] (Thread-4) com.aws.greengrass.deployment.IotJobsHelper: Received empty jobs in notification . {ThingName=Raspberrypi4} 2022-11-07T11:34:35.021Z [WARN] (Thread-4) com.aws.greengrass.mqttclient.AwsIotMqttClient: Connection interrupted. {clientId=Raspberrypi4, error=The connection was closed unexpectedly.} 2022-11-07T11:34:35.260Z [INFO] (Thread-4) com.aws.greengrass.mqttclient.AwsIotMqttClient: Connection resumed. {clientId=Raspberrypi4, sessionPresent=true} 2022-11-07T11:34:35.272Z [INFO] (Thread-4) com.aws.greengrass.status.FleetStatusService: fss-status-update-published. Status update published to FSS. {trigger=RECONNECT, serviceName=FleetStatusService, currentState=RUNNING} 2022-11-07T11:34:35.299Z [INFO] (Thread-4) com.aws.greengrass.deployment.IotJobsHelper: No deployment job found. {ThingName=Raspberrypi4} 2022-11-07T11:45:08.486Z [WARN] (Thread-4) com.aws.greengrass.mqttclient.AwsIotMqttClient: Connection interrupted. {clientId=Raspberrypi4, error=The connection was closed unexpectedly.} 2022-11-07T11:45:10.725Z [INFO] (Thread-4) com.aws.greengrass.mqttclient.AwsIotMqttClient: Connection resumed. {clientId=Raspberrypi4, sessionPresent=true} 2022-11-07T11:45:10.728Z [INFO] (Thread-4) com.aws.greengrass.status.FleetStatusService: fss-status-update-published. Status update published to FSS. {trigger=RECONNECT, serviceName=FleetStatusService, currentState=RUNNING} 2022-11-07T11:45:10.767Z [INFO] (Thread-4) com.aws.greengrass.deployment.IotJobsHelper: No deployment job found. {ThingName=Raspberrypi4}

Thank you

1 Answer
0

Hi hyorim,

2022-11-07T11:34:35.021Z [WARN] (Thread-4) com.aws.greengrass.mqttclient.AwsIotMqttClient: Connection interrupted. {clientId=Raspberrypi4, error=The connection was closed unexpectedly.}

This can happen if your Greengrass core device not have permission to connect to IoT Core.

Take a look at our documentation. In this section you will find a minimal policy which shows all of the IoT permissions you need so that your Greengrass core can connect.

AWS
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions