Greengrass core IoT OTA on Raspberry PI

0

Hi,

I want to perform OTA feature to update a Linux application on Raspberry PI running on green grass core. Can you please help me to understand if this is possible with greengrass? Or OTA on Greengrass is more specific to updating the Agent/Greengrass core sotftware?

Thanks, Bala

asked a year ago663 views
3 Answers
1

Hi Bala,

over-the-air update of application code is natively supported by Greengrass.

You just need to package your application code as a Greengrass component, and by deploying it to the device, Greengrass takes care of the rest:

  • downloading the code to the device and all the dependencies that have been defined in the component recipe,
  • shutting down the previous version of the application if any,
  • starting the application using the new code.

In case the application fails to start, Greengrass can rollback to the previous working version ensuring that your device remains functional.

For a generic introduction to Greengrass v2, including developing custom components you can follow this workshop: https://catalog.us-east-1.prod.workshops.aws/workshops/5ecc2416-f956-4273-b729-d0d30556013f/en-US

Cheers,

Massimiliano

AWS
EXPERT
answered a year ago
  • Thanks Massimiliano for the response :). Basically, I am looking for an OTA feature to upgrade the c- based Telematics application which would get data from different sensors and send to cloud in real time. I see 2 options to perform OTA upgrade on raspberry pi 1) OTA agent with embedded c sdk and 2) Greengrass core IoT. Can you please suggest for my scenario which option is appropriate.

    Thanks, Bala

  • See Greg answer below about the embedded C-sdk use and the possible integration of your application with Greengrass by using the C++ SDK. Integrating your applicaiton with Greengrass, you can leverage Greengrass features, such as the mqttproxy to send the collected data to AWS IoT Core.

    This said, you can leverage Greengrass to update your C-based application code. Just package it as a component: the application code is your artifact, and the Run lifecycle a shell script to execute it.

    Massimiliano

  • Thank you Massimiliano for the response :)

1

Hi Bala. Greengrass doesn't support the OTA feature out of the box because it has Greengrass deployments instead. You could certainly build a custom Greengrass component to interact with the AWS IoT job topics and process a custom job document or the OTA job document. However, I think it may be easier to build on top of Greengrass deployments; have a custom component that does the upgrade as a result of a new deployment. Could this Linux application be packaged as a Greengrass component?

You may also consider the Greengrass Systems Manager Agent:

Systems Manager can be used to manage the underlying OS of the Greengrass core device (as distinct from the Greengrass nucleus and components).

profile pictureAWS
EXPERT
Greg_B
answered a year ago
  • To clarify, when I said "Greengrass doesn't support the OTA feature out of the box" I meant specifically AWS IoT OTA feature rather than over the air updates in the more general sense.

0

Thanks Greg for the quick response. The linux application would run on the raspberry pi to collect data from multiple sensors connected to it. It would be easier If the application can be packaged as a component in greengrass. I will take a look at these options that you mentioned. Do you have any demo link available to try?

Thanks, Bala

answered a year ago
  • Hi Bala. The workshop link Massi provided is the best way to get to know Greengrass. The embedded C SDK is intended more for resource constrained MCUs. On a more powerful hardware like the RPi, I would normally recommend Greengrass because it does more undifferentiated heavy lifting for you.

    However C is not an ideal choice for a Greengrass component because the C SDK doesn't support Greengrass IPC. Are you committed to C as a language? Could existing C code go into a C++ component?

  • Thanks Greg !! this information help me to decide which option to pick. I'm actually looking for the specific AWS OTA feature where an OTA job is scheduled, monitor the complete update status, securing the application, rollback in case of errors etc. Using Greengrass the application can be updated using component deploy, but I think it is not the same AWS OTA feature. However, it serves my purpose to update the app and if I have to update the complete image then this is not the right option. Definitely Greengrass can uplift the development work on Rpi, but just for upgrading an application over the air, I would be underusing it's features.

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