aws/aws-iot-device-sdk-python

Cannot see message in the AWS IoT test client

weiboVictor opened this issue · 4 comments

Hello,
I find a really strange behavior that my lambda code is working well, however I could not see any mqtt message published to the iot cloud via console (Test).

I checked the local log for my lambda function, as you can see below, the IoTDataPlane confirms the payload. But when I go to Test console, nothing is shown up.

What is more interesting, if I change in the lambda code to publish to the topic "car1/sensors/ultrasonic" then it works! But no other topics work, for example, I tested to publish to topics like "car1/sensors", "car2/sensors", "car1/sensors/test", etc. I suppose at some point GG freeze the topic changes? as the topic "car1/sensors/ultrasonic" was the first topic I used to publish message, which worked at the right beginning.

[2020-03-09T18:09:26.682+01:00][INFO]-ipc_client.py:167,Posting work for function [arn:aws:lambda:::function:GGRouter] to http://localhost:8000/2016-11-01/functions/arn:aws:lambda:::function:GGRouter
[2020-03-09T18:09:26.69+01:00][INFO]-ipc_client.py:177,Work posted with invocation id [3bc343db-7dc9-4a88-6cde-f9f568b52c35]
[2020-03-09T18:09:31.698+01:00][DEBUG]-IoTDataPlane.py:126,Publishing message on topic "car1/sensors" with Payload "{"ultrasonic_M": 26, "infrared_LMR": 2, "local_time": "2020/03/09 T17:00"}"
[2020-03-09T18:09:31.698+01:00][DEBUG]-Lambda.py:96,Invoking Lambda function "arn:aws:lambda:::function:GGRouter" with Greengrass Message "{"ultrasonic_M": 26, "infrared_LMR": 2, "local_time": "2020/03/09 T17:00"}"
[2020-03-09T18:09:31.698+01:00][INFO]-ipc_client.py:167,Posting work for function [arn:aws:lambda:::function:GGRouter] to http://localhost:8000/2016-11-01/functions/arn:aws:lambda:::function:GGRouter
[2020-03-09T18:09:31.706+01:00][INFO]-ipc_client.py:177,Work posted with invocation id [0837678a-e72e-43f9-5aab-c3c2c655f038]
[2020-03-09T18:09:36.716+01:00][INFO]-ipc_client.py:167,Posting work for function [arn:aws:lambda:::function:GGRouter] to http://localhost:8000/2016-11-01/functions/arn:aws:lambda:::function:GGRouter
[2020-03-09T18:09:36.717+01:00][DEBUG]-IoTDataPlane.py:126,Publishing message on topic "car1/sensors" with Payload "{"ultrasonic_M": 26, "infrared_LMR": 2, "local_time": "2020/03/09 T17:00"}"
[2020-03-09T18:09:36.717+01:00][DEBUG]-Lambda.py:96,Invoking Lambda function "arn:aws:lambda:::function:GGRouter" with Greengrass Message "{"ultrasonic_M": 26, "infrared_LMR": 2, "local_time": "2020/03/09 T17:00"}"
[2020-03-09T18:09:36.721+01:00][INFO]-ipc_client.py:177,Work posted with invocation id [205ed2fa-6cb3-4dac-4e28-8200359d79c1]

My fault, it is a configuration issue.

Can you give a little more information about the config issue in case someone else has a similar problem?

I stupidly forget that I've set the filter rule in the IoT core to receive only the topic of "car1/sensors/ultrasonic". xD

Thanks for the followup!