前回の記事では、カスタムコンポーネントで温湿度データを取得しましたが、今回はこれを Lambda として作成してみました。 全体の構成は下記のようになります。(デバイス間の結線は簡略化して描いています。) Lambda 関数を作るのはどんな方法でも構いませんが、今回は AWS SAM を使うことにしました。Lambda による処理の内容は下記のとおりです。 前回の記事にあるコードをベースに Modbus-RTU 経由で温湿度データを取得 取得した温湿度データを所定のファイルに出力 /tmp/Greengrass_modbus_sensor_lambda.log 10秒間隔でデータを取得してファイル出力 なお、デバイス側の設定は前回の記事の内容を踏襲するものとします。 (ggc_user の所属グループの変更や pymodbusのインストール等です) Raspberry Pi の Pytho