LWM2M Client - Power Management/callback functions

Good day

I have noticed that when using a callback functions certain limitations exist.  For example, adding functions to the callback function will run into an error or a timeout.  Firstly, I wanted to ask what the limitations when using a callback function(specifically lwm2m ).  Secondly, I am using 

pm_device_action_run(uart_dev, PM_DEVICE_ACTION_SUSPEND);  and 
pm_device_action_run(uart_dev, PM_DEVICE_ACTION_RESUME);
to dynamically turn the UART on and off during the callback function.  I was able to switch the UART on but when I use pm_device_action_run(uart_dev, PM_DEVICE_ACTION_SUSPEND at the end of the function, the UART does not switch off despite the function returning a 0.  What could be the cause of this?  I am aware that these issues are rather specific and any advice would be worthwhile.
Kind regards,
Hassan
Parents
  • Hi Hassan,

    I would need additional information.

    Which NCS version do you use? Do you use lwm2m client sample? Have you modified the sample?

    I have noticed that when using a callback functions certain limitations exist.  For example, adding functions to the callback function will run into an error or a timeout.  Firstly, I wanted to ask what the limitations when using a callback function(specifically lwm2m ).

    Could you elaborate on this? What are you trying to achieve? Could you provide an example?

    I was able to switch the UART on but when I use pm_device_action_run(uart_dev, PM_DEVICE_ACTION_SUSPEND at the end of the function, the UART does not switch off despite the function returning a 0.  What could be the cause of this?

    Could you specify more precisely what is currently working and what is not working? Does RESUME work, but SUSPEND not? Could you describe/show where and how you use pm_device_action_run() in your code? What is expected behavior and what actually happens?

    Best regards,
    Dejan

  • Good day Dejan

    I am using the latest toolchain and am modifying the lwm2m client sample. I am using a temperature sensor via a UART to receive information using low power measures and publish onto a lwm2m servers.  As a result, I need to turn on and off the UART when a callback is initiated via the server.  Initially I had a problem whereby the UART wouldn't switch off even after pm_device_action_run(uart_dev, PM_DEVICE_ACTION_SUSPEND was used.  However now, the UART doesnt switch on in time and there callback will result in a timeout server side.  Ive noticed that adding long functions to this callback (or even a delay) will result in a timeout.  Which makes me wonder if this callback has limitations i'm not aware of.  Thank you in advance!

    Kind regards,

    Hassan

  • Hi,

    Which modem firmware version and SDK do you use?

    If you use modem firmware v1.3.x and NCS v2.2.0, you could have a look at additional configuration in LwM2M Client Utils.

    Best regards,
    Dejan

  • Good day

    yes I do use the latest firmware.  When I use

    CONFIG_LWM2M_CLIENT_UTILS_RAI=y in the prj file I do not see RAI being used.  I have to wait 60s before entering edrx mode.  Is there more I need to do to ensure it works as required?
  • Hi,

    Which network operator do you have? Does it support AS RAI?

    Best regards,
    Dejan

  • Good day

    I will have to contact them to make sure.  However, XRAI works well.  Have you any idea how I can get in functional for the callback function?

  • Hi,

    Could you specify your NCS and modem firmware version?

    Could you describe in more detail what was expected to happen in the first ("working") and second ("not working") case? What actually happened? Could you elaborate on "modem is used again"? When the function was not working, what actually happened? Do you have any log or modem trace?

    I have noticed that you have 4 open and 5 closed curly braces in non-working part of the code.

    Best regards,
    Dejan

Reply
  • Hi,

    Could you specify your NCS and modem firmware version?

    Could you describe in more detail what was expected to happen in the first ("working") and second ("not working") case? What actually happened? Could you elaborate on "modem is used again"? When the function was not working, what actually happened? Do you have any log or modem trace?

    I have noticed that you have 4 open and 5 closed curly braces in non-working part of the code.

    Best regards,
    Dejan

Children
No Data
Related