aws-samples / aws-iot-core-lorawan

Quickly get started with AWS IoT Core for LoRaWAN with sample solutions (binary decoding, device and gateway monitoring, downlink, dashboarding, provisioning automation)
MIT No Attribution
78 stars 32 forks source link

Error: Building functions with python3.7 is no longer supported #54

Closed maurotag closed 1 month ago

maurotag commented 1 month ago

Hi

I am trying to implement the decoder using the instructions Approach A: using simulated decoder but it is generating the error: Building functions with python3.7 is no longer supported

I used AWS SAM CLI and AWS Cloud9 with same results.

sam build

    SAM CLI now collects telemetry to better understand customer needs.

    You can OPT OUT and disable telemetry collection by setting the
    environment variable SAM_CLI_TELEMETRY=0 in your shell.
    Thanks for your help!

    Learn More: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-telemetry.html

    Building codeuri:
    \aws-iot-core-lorawan-main\transform_binary_payload\src-iotrule-transformation runtime: python3.7 metadata: {}         architecture: x86_64 functions: TransformLoRaWANBinaryPayloadFunctionPython
    Building functions with python3.7 is no longer supported by AWS SAM CLI, please update to a newer supported runtime. Formore information please check AWS Lambda Runtime Support Policy:
    https://docs.aws.amazon.com/lambda/latest/dg/runtime-support-policy.html

    Build Failed
    Error: Building functions with python3.7 is no longer supported
maurotag commented 1 month ago

I solved the issue by myself. Lambda has a runtime support policy. The issue is this decoder was developed some years ago and Lambda has deprecaded Python 3.7. I replaced the runtime version of Python and NodeJS with the current ones running in the machine into the template.yaml file in \aws-iot-core-lorawan-main\transform_binary_payload.

(...) TransformLoRaWANBinaryPayloadFunctionPython: Type: AWS::Serverless::Function Name: !Sub "${AWS::StackName}-TransformLoRaWANBinaryPayloadFunctionPython" Properties: CodeUri: src-iotrule-transformation Handler: app.lambda_handler Runtime: python3.9 Layers:

(...)

TransformLoRaWANBinaryPayloadFunctionNode: Type: AWS::Serverless::Function Condition: IsNodeSupportEnabled Name: !Sub "${AWS::StackName}-TransformLoRaWANBinaryPayloadFunctionNode" Properties: CodeUri: src-iotrule-transformation-nodejs Handler: index.handler Runtime: nodejs20.x Layers:

(...)