I need to send bulk data to an MQTT topic on a server hosted by AWS. I'm trying to use datamode option the serial_lte_modem sample but I'm running in to lots of problems.
I connect successfully to the broker via the XMQTTCON command. Then I send the;
AT#XMQTTPUB="<topic-obscured>","",0
When I follow this with bulk data, even with small chunks like 32-bytes, I get things like;
[00:01:13.392,059] <inf> slm_at_host: Enter datamode
[00:01:13.480,804] <wrn> slm_at_host: data buffer full (480)
[00:01:13.481,384] <inf> slm_at_host: Raw send 32
[00:01:13.490,692] <inf> slm_mqtt: datamode send: 0
[00:01:13.676,086] <wrn> slm_at_host: data buffer full (480)
[00:01:13.676,666] <inf> slm_at_host: Raw send 32
[00:01:13.677,581] <inf> slm_mqtt: datamode send: 0
[00:01:14.673,645] <wrn> slm_at_host: data buffer full (509)
[00:01:14.674,255] <inf> slm_at_host: Raw send 3
[00:01:14.675,201] <inf> slm_mqtt: datamode send: 0
After that the interface is pretty messed up. I can't even send the termination sequence to get out of it.
when I look at the code I see in raw_rx_handler
/* Second, save data to buffer */
ret = ring_buf_put(&data_rb, data, datalen);
if (ret != datalen) {
LOG_ERR("enqueue data error (%d, %d)", datalen, ret);
uart_rx_disable(uart_dev);
return -1;
}
ret = ring_buf_space_get(&data_rb);
if (ret < UART_RX_LEN ) {
LOG_WRN("data buffer full (%d)", ret);
uart_rx_disable(uart_dev);
return -1;
}
it seems like right after data is but in the ring buffer, it has to read empty or the uart_rx_disable is called. I tried to modify this, but it didn't really help.
So I guess I want to know if there might be a problem here, or if I'm potentially using datamode wrong and need to modify.