내용으로 건너뛰기

"Activating" OTA agent based on AWS IoT's Job creation.

0

Hello,

I am currently implementing OTA functionality on an ESP32-S3 and I am looking for a way to activate the OTA agent on my device based on a notification. I believe I can subscribe to the /notify or /notify-next topic to but my only concern here is that having a constantly open MQTT subscription on the device. Is it possible to start the OTA agent and have a way for it to check for active jobs to determine whether or not to proceed or stop?

질문됨 3년 전336회 조회
1개 답변
0

Hi kevinah. The jobs/notify and jobs/notify-next topics are how your device gets notified that there's a job available for it to process. You need to be subscribed to get the notification. The OTA agent subscribes to jobs/notify-next here: https://github.com/aws/ota-for-aws-iot-embedded-sdk/blob/c3bd5840979cadfe1f9505e13e49cccb87333650/source/ota_mqtt.c#L358

When the OTA agent first starts up, it subscribes to that topic and publishes a /jobs/$next/get to get any jobs that may have been queued while it was offline.

my only concern here is that having a constantly open MQTT subscription

Subscriptions don't incur cost. Connection time and messaging do. Is there another concern?

The OTA agent includes a suspend/resume feature. This is normally used to handle intermittent connectivity. You could also use it suspend under different conditions. For example, a customer might suspend OTA when a device goes onto a cellular network and resume when it goes back on WiFi. Alternatively you might have your own custom topic that allows you to notify your application to suspend OTA (but this would require a subscription of course). More drastically, you could shutdown rather than suspend; this can unsubscribe too.

The OTA demos are worth studying if you haven't already: https://github.com/aws/aws-iot-device-sdk-embedded-C/tree/main/demos/ota

AWS
전문가
답변함 3년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

관련 콘텐츠