I am using AWS LAMBDA triggered by AWS IOT. My IOT device is publishing the message and will trigger AWS Lambda. After analyzing the message I need to send the analyzed data back to the IOT device. My IOT device has subscribe to the topic and waiting for my message to receive.
Point here is I need to send the analyzed data from my lambda function using MQTT protocol.
I have used boto3 to send the data:
client = boto3.client('iot-data')
response = client.publish(
topic='test/topic1',
#note:
qos=0,
payload=eventText
)
But the above code sends the data using HTTP which I don't want. I need to use MQTT protocol to send the data. Is it possible to send it? if yes, what is the other method?
Also, my second doubt is.. even if data is sent using HTTP, it is received by my IoT device waiting to receive a message over MQTT protocol. Is it meant like HTTP is converted to MQTT? but who did it?
I have already gone through the How can I publish to a MQTT topic in a Amazon AWS Lambda function? but all used boto3 which uses HTTP.
Thank you in advance.