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

AT Commands for JSON POST (Serial LTE Modem) Example

I'm running the Serial LTE Modem firmware and utilizing the reference docs in the LTE Link Monitor Terminal (My commands in yellow, blue/grey text is response)

NCS 1.4, SLM firmware, https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/applications/serial_lte_modem/doc/HTTPC_AT_commands.html

AT+CFUN=1

OK

AT+CFUN?

<bunch good things showing its connecting>

AT#XHTTPCCON=1,"test.domain.com",5000

#XHTTPCCON:1

OK

AT#XHTTPCREQ="POST","/post2","Host: test.domain.com:5000\nAccept: */*\nContent-Type: application/jsonl charset=utf-8\nContent-Length: 34",34

OK

#XHTTPCREQ:1

#XHTTPCREQ:1

OK

\n{"key1":"value1", "keyZ":"valueZ"}

OK

AT#XHTTPCCON=0

#XHTTPCCON=0

OK

Ready

Now my server does not see the JSON payload, I've tried multiple things on #XHTTPCREQ:1, but my server is just seeing this as an attempt at a form submission without a proper data payload (at least my little python-based Flask echo server does).  This makes no sense to me as I specifically sent the content-type to be application/json.

Im trying to evaluate these boards as a drop-in replacement option for Digi LTE modems (We're consistently getting 28-300+ second connect time with Digi, and 3-6 second connect time with the NRF9160 chips) on a custom MCU board we're using, so the preference is to get an AT Command protocol in place as those MCUs already interface over AT commands.

I just want to get a "hello, world" equivalent working with JSON payload over HTTP before I start looking at HTTPS/MQTT options going forward.  Any help here would be greatly appreciated.

~Evan

Parents Reply Children
Related