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
asked a year ago508 views
2 Answers
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.

answered a year ago
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
EXPERT
sunrise
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