awslabs/aws-iot-core-integration-with-nvidia-deepstream

Deepstream message broker stoped working after installing IoT core

paravarzar-shahrokh opened this issue · 8 comments

Hi,
I am deploying the deepstream in two ways on Xavier Jetson's Nvidia device. First, directly install the deepstream and activate the messagebroker and run the deepstream using the terminal command line. The second way deploy and run the deepstream using IoT Greengrass and making component and let the IoT Greengrass run the deepstream automatically. The main objective is to automatically boot up the camera and deepstream pipeline and send the messages to AWS using the deepstream messagebroker. Running the application using the terminal is working properly, however, after installing the IoT Greengrass core the deepstream is running but the messagebroker stops working and I am not able to see the messages on greengrass message subscribe.
The following is part of the messages I am receiving ,
$aws/events/presence/connected/App5vision-deepstream-MQTT
June 29, 2021, 15:52:00 (UTC-0600)
{
"clientId": "App5vision-deepstream-MQTT",
"timestamp": 1625003520347,
"eventType": "connected",
"sessionIdentifier": "e22672bd-9ed0-4f2b-ad3d-335e1d4e7542",
"principalIdentifier": "19484ac814fd7135be4b6028715431a7be32ee7d1d71a15659841774f2870d97",
"ipAddress": "216.123.206.224",
"versionNumber": 46
}
$aws/events/presence/disconnected/App5vision-deepstream-MQTT
June 29, 2021, 15:51:25 (UTC-0600)
{
"clientId": "App5vision-deepstream-MQTT",
"timestamp": 1625003485677,
"eventType": "disconnected",
"clientInitiatedDisconnect": false,
"sessionIdentifier": "d324a2ad-b75e-48b6-ac23-128ad68172f2",
"principalIdentifier": "19484ac814fd7135be4b6028715431a7be32ee7d1d71a15659841774f2870d97",
"disconnectReason": "CONNECTION_LOST",
"versionNumber": 44
}

$aws/events/presence/connected/app5VisionDeviceExavierIoT
June 29, 2021, 15:53:33 (UTC-0600)
{
"clientId": "app5VisionDeviceExavierIoT",
"timestamp": 1625003613869,
"eventType": "connected",
"sessionIdentifier": "1650acdb-6fe3-449c-bbf9-77b47fb615f3",
"principalIdentifier": "79c00efbb84db2b427e550b881937b41c12b9bb26a62c08c4df53de48f3a5939",
"ipAddress": "184.68.253.54",
"versionNumber": 70
}
$aws/events/presence/disconnected/app5VisionDeviceExavierIoT
June 29, 2021, 15:53:33 (UTC-0600)
{
"clientId": "app5VisionDeviceExavierIoT",
"timestamp": 1625003613827,
"eventType": "disconnected",
"clientInitiatedDisconnect": false,
"sessionIdentifier": "1650acdb-6fe3-449c-bbf9-77b47fb615f3",
"principalIdentifier": "79c00efbb84db2b427e550b881937b41c12b9bb26a62c08c4df53de48f3a5939",
"disconnectReason": "DUPLICATE_CLIENTID",
"versionNumber": 69
}
$aws/events/presence/connected/app5VisionDeviceExavierIoT
June 29, 2021, 15:52:03 (UTC-0600)
{
"clientId": "app5VisionDeviceExavierIoT",
"timestamp": 1625003523235,
"eventType": "connected",
"sessionIdentifier": "1650acdb-6fe3-449c-bbf9-77b47fb615f3",
"principalIdentifier": "79c00efbb84db2b427e550b881937b41c12b9bb26a62c08c4df53de48f3a5939",
"ipAddress": "216.123.206.224",
"versionNumber": 69
}
$aws/events/presence/disconnected/app5VisionDeviceExavierIoT
June 29, 2021, 15:51:59 (UTC-0600)
{
"clientId": "app5VisionDeviceExavierIoT",
"timestamp": 1625003519530,
"eventType": "disconnected",
"clientInitiatedDisconnect": true,
"sessionIdentifier": "c27dea69-fee9-45af-ab4c-3801e7121825",
"principalIdentifier": "79c00efbb84db2b427e550b881937b41c12b9bb26a62c08c4df53de48f3a5939",
"disconnectReason": "CLIENT_INITIATED_DISCONNECT",
"versionNumber": 67
}
$aws/events/presence/connected/app5VisionDeviceExavierIoT
June 29, 2021, 15:51:59 (UTC-0600)
{
"clientId": "app5VisionDeviceExavierIoT",
"timestamp": 1625003519402,
"eventType": "connected",
"sessionIdentifier": "c27dea69-fee9-45af-ab4c-3801e7121825",
"principalIdentifier": "79c00efbb84db2b427e550b881937b41c12b9bb26a62c08c4df53de48f3a5939",
"ipAddress": "216.123.206.224",
"versionNumber": 67
}
$aws/events/presence/disconnected/app5VisionDeviceExavierIoT
June 29, 2021, 15:51:26 (UTC-0600)
{
"clientId": "app5VisionDeviceExavierIoT",
"timestamp": 1625003486180,
"eventType": "disconnected",
"clientInitiatedDisconnect": true,
"sessionIdentifier": "4ae1c60a-4b0b-41dc-81ff-87e5ee65e122",
"principalIdentifier": "79c00efbb84db2b427e550b881937b41c12b9bb26a62c08c4df53de48f3a5939",
"disconnectReason": "CLIENT_INITIATED_DISCONNECT",
"versionNumber": 65
}

Hi, if I am understanding correctly, you are using the IoT certificate of Greengrass to connect to AWS IoT core? Or are you using a separate set of certificate? Have you made sure that those IoT things have the right permissions to publish to the topics you are using?

If your application is running as a Greengrass component, you can also check the logs in /greengrass/logs. Please let me know if you see error printed by this component.

You are absolutely right about these benefits Greengrass can bring. Please also try Greengrass v2, it provides even more flexibility in the things you do.

Theoretically, the two MQTT clients should not interfere each other. We have tried it before. Are you connecting to AWS IoT core? Or are you using Greengrass as an MQTT broker? Since after your DeepStream client becomes a component in Greengrass, certificate locations might need to be changed. Do you have logs, we can take a look together.

@paravarzar-shahrokh are you using the same cert for both the Greengrass and deepstream applications?

Ah, I understand now. You should use the deepstream cert and put the details into the config file. If you use Greengrass v2, instructions are in this blog post:
https://aws.amazon.com/blogs/iot/using-aws-iot-greengrass-version-2-with-amazon-sagemaker-neo-and-nvidia-deepstream-applications/

But, as @yuxiny2586 suggested, please post logs and we can try to troubleshoot.