This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

SLM HTTP client hangs with large payload

I recently switched  from 1.5.1 to 1.6.1 and I'm now finding the SLM is misbehaving.

When I try to send a large payload such as 933 bytes of data, I find the CTS signal goes low after 274 bytes of data were sent.  (There is some buffering in my mcu so probably less received at SLM uart) 

It seems like the SLM data mode uses a ring buffer that is only 256 lines and the datamode cannot handle payloads longer than this.  

Please confirm large payloads work in 1.6.1.  

Also any advice on how to get debug logging from SLM_AT_HOST and SLM_AT_HTTPC ?  I'm running from SES with stock SLM example...

Parents Reply Children
  • The OK's are coming after receiving +XHTTPCREQ=1    and before receiving +XHTTPCREQ=0, therefore the SLM is in datamode.  I am not sending AT commands, and they should not be received while in datamode anyway.  

    After reviewing the code, it seems in datamode that every time data is sent to the network port by httpc, a "\r\nOK\r\n" is produced.  There are 2 triggers for sending data  according to the "Running in data mode" documentation (https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/applications/serial_lte_modem/doc/slm_data_mode.html?highlight=datamode)  one of those triggers is  a "time limit trigger" which explains the periodic "OK" when data is pending.     This is fired from the inactivity_timer_handler in slm_at_handler.

    It would be really helpful if the documentation mentioned that an OK would be received on the UART whenever data is sent on the network port.  This behavior appears to be specific to httpc... its in httpc_datamode_callback.    I reviewed other instances of datamode, and none of them include this behavior.  

    BTW, in slm_at_httpc.c there is code that returns values other than 0/1.. lines 510..512 which reports error from the socket send/recv.  It would be a good idea to update the documentation, an external implementer like me would need to know that this could occur.  In my current code this would be treated as an unexpected response, and an error reported.  In production, those errors would cause a massive cascade of paperwork explaining why an error occurred, what the root cause was, what corrective actions were taken, etc (e.g. several days with tons of meetings with the quality team).  On the other hand, if I expect these values could occur during normal operation, I can prevent that in the design phase with a few simple comments and an extra conditional clause in the code.

    Finally, I'm still unable to get debug logs after the bootloader jumps to the application.   Any help at all with the debug logs would be really really appreciated.  For unmodified 1.6.1, changing the line in prj.conf did not have any effect. 

    Maybe you could post a prj.conf that you've confirmed works? 

    Also any special steps I need to take after modifying prj.conf?

  • Hi,

     

    Anthony Ambuehl said:

    BTW, in slm_at_httpc.c there is code that returns values other than 0/1.. lines 510..512 which reports error from the socket send/recv.  It would be a good idea to update the documentation, an external implementer like me would need to know that this could occur.  In my current code this would be treated as an unexpected response, and an error reported.  In production, those errors would cause a massive cascade of paperwork explaining why an error occurred, what the root cause was, what corrective actions were taken, etc (e.g. several days with tons of meetings with the quality team).  On the other hand, if I expect these values could occur during normal operation, I can prevent that in the design phase with a few simple comments and an extra conditional clause in the code.

     The socket calls will return the errno, which can be many different types of return, based on what the failure is. Please see errno.h (https://github.com/nrfconnect/sdk-zephyr/blob/master/lib/libc/minimal/include/errno.h) for more information.

     

     

    Anthony Ambuehl said:
    BTW, I found that debugging is working when I monitor with J-Link RTT viewer.  For some reason, it does not work from SES.

    Could you share the debug log when the issue occurs?

     

    Kind regards,

    Håkon 

Related