AWS Jobs, but without FOTA!

We've been using the AWS cloud integration for some time, and we also use the FOTA library to allow us to send firmware updates.

However, AWS jobs can be used for all sorts (especially for initiating /other/ file transfers) and I'm trying to extend the library. From reading through, it seems like I would need to be right down inside the aws_iot code to get a meaningful integration - and not without first disabling aws_fota as that takes all received AWS job messages.

Can you provide some guidance on how I might cleanly do this, in a way that doesn't make it harder for me to integrate NCS updates in the future?

My current thinking is to, basically, fork out the nrf/subsys/net/lib/aws* files into my repo and build it more like a Zephyr module than a subsystem. This is the most difficult to maintain as I would then be wholly responsible for that module - but I don't see an alternative. The aws_jobs library operates at the MQTT client level while the aws_iot library does not expose that client.

Parents
  • Here's how the aws_iot library handles the raw MQTT messages from lower in the stack:

    static void mqtt_evt_handler(struct mqtt_client *const c,
    			     const struct mqtt_evt *mqtt_evt)
    {
    	int err;
    	struct aws_iot_evt aws_iot_evt = { 0 };
    
    #if defined(CONFIG_AWS_FOTA)
    	err = aws_fota_mqtt_evt_handler(c, mqtt_evt);
    	if (err == 0) {
    		/* Event handled by FOTA library so it can be skipped. */
    		return;
    	} else if (err < 0) {
    		LOG_ERR("aws_fota_mqtt_evt_handler, error: %d", err);
    		aws_iot_evt.type = AWS_IOT_EVT_FOTA_ERROR;
    		aws_iot_evt.data.err = err;
    		aws_iot_notify_event(&aws_iot_evt);
    	}
    #endif
    
        ...

    You can see the FOTA library actually just sits on top of the aws_iot library - hooking out events that it wants and passing the rest back to the aws_iot library. I presume a jobs library would replace that, and then internally call the aws_fota library when the job was specifically a FOTA job (rather than some other job).

  • Hello, I've been assigned your ticket and will need to reach out to our developers. Can you please share what version of our nRF Connect SDK you are working on? 

    Have you looked at the AWS jobs library? 

    Kind regards,
    Øyvind

Reply Children
Related