Using Lambda with python to comunicate with AWS Iot Core

0

Hello, i have been reading a lot of documentation, but its taking too much time and still can't find what i need. I need to use several lamda fucntions to do different things with IoT Core. First i need to add and remove lora gateways and devices invoking the lambda function from a php (the invoking part shouldn't be a problem). Second i need to send data to the device through a lambda function. Basically how to implement AWS python SDK in lambda.

the motive is that I don't want to have and EC2 instance for this and the php should have the lower load possible.

Nico
已提问 1 年前521 查看次数
2 回答
0

Depending in your solution, but most gateways run with the GreenGrass software from aws iot. You can run this on rpi or similar instances. And make a bridge between mqtt and device protocol.

You van manage this with the api call's, but you load them with certificates and they will automatic connect and register to the iot core and subsrcribe to topics.

For data communication from lambda, you can publish messages with python: https://aws.amazon.com/premiumsupport/knowledge-center/iot-core-publish-mqtt-messages-python/

If you want to run a php frontend, you have two options. Either communicatie directly from php to mqtt. Or create an api gateway with lambda's and connect your php with the rest api of the api gateway.

已回答 1 年前
0

You mean AWS python SDK or AWS IoT device sdk python ?

If its AWS Python SDK, you can use iot wireless api operations (boto3)

To add/remove the lora gateway and devices, there are api operations create_wireless_device(),
create_wireless_gateway(),
delete_wireless_device(),
delete_wireless_gateway()

To send the data back to the lora device,
send_data_to_wireless_device() - https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/iotwireless.html#IoTWireless.Client.create_wireless_device

If you are talking about AWS IoT device sdk python, there is no api operations for iotwireless yet.

AWS
专家
sunrise
已回答 1 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则