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

CoAP Client using nRF9160: proxy-uri length issues

Hi Nordic Team,

I am developing a CoAP client on the nRF9160 DK, and am having trouble with longer proxy-uri's; short URIs (268 characters and below) work fine and the coap message reaches the server as expected. However, messages with longer proxy URIs (269 characters and above) fail to go through for some reason. For example:

The below (short) works fine

    char * proxy_uri = "http://127.0.0.1:3000/abc/europe-west1/coap-abc/abc-device/publishEvent?jwt=eyJ0eXAiO";
    ssize_t proxy_uri_len = strlen(proxy_uri);
    coap_packet_append_option(&request, COAP_OPTION_PROXY_URI, proxy_uri, proxy_uri_len);

But this one (longer) doesn't

    char * proxy_uri = "http://127.0.0.1:3000/abc/europe-west1/coap-abc/abc-device/publishEvent?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiJ9.eyJhdWQiOiJhaXPocmlzIiwiaXNzJjoiYXV0aDAiLCJleHTiOjE2MDk0Nzc1NTUsImlhdCI6MTYwOTQ2Njc1MX2.RBs-SSa8x9VpyvBRw_EA2CUihgle5yGDJa8f2DUoGXe8d1Vah6bABILZuuyFQXcEg0Mh1BLn1p6qmbwb8BnsNg";
    ssize_t proxy_uri_len = strlen(proxy_uri);
    coap_packet_append_option(&request, COAP_OPTION_PROXY_URI, proxy_uri, proxy_uri_len);

...and when I inspect the CoAP message using Wireshark, the proxy-uri option has the warning: Expert Info (Warning/Malformed): option longer than the package 

I tried setting the additional Zephyr CoAP config as follows

CONFIG_COAP_EXTENDED_OPTIONS_LEN=y
CONFIG_COAP_EXTENDED_OPTIONS_LEN_VALUE=800

...but had no luck.

Would anyone know what I could be missing? Is there some config whose default value I need to override?

Thanks.

Related