Closed TjazVracko closed 4 years ago
Alright,
so it turns out, I think, that it has to do with message size. I can send messages up to 2048 bytes long.
In bifravst_cloud.c
you have the folowing code:
static char rx_buffer[CONFIG_BIFRAVST_CLOUD_MQTT_RX_TX_BUFFER_LEN];
static char tx_buffer[CONFIG_BIFRAVST_CLOUD_MQTT_RX_TX_BUFFER_LEN];
static char payload_buf[CONFIG_BIFRAVST_CLOUD_MQTT_PAYLOAD_BUFFER_LEN];
but I can not find definitions for CONFIG_BIFRAVST_CLOUD_MQTT_PAYLOAD_BUFFER_LEN
or BIFRAVST_CLOUD_MQTT_PAYLOAD_BUFFER_LEN
anywhere.
Adding both defines to prj.conf
and setting them to 4096 seems not to change anything.
The error when sending big messages is 126
, which seems not to be the error related to size (90
). So can the error be related to anything else?
How can I adjust the message size limit?
Thank you for your help.
The modem drops messages exceeding ~2k bytes. Setting the aforementioned configurations to any greater than 2048 is redundant. Try reducing your packet sizes and see if that resolves the problem.
Yes, smaller messages work fine. Can I increase the limit on the modem or is the size limit hard-coded?
We can send the data in 2 parts using 2 separate messages. If ~2k bytes is a hard limit, then this is how we will do it.
Thanks
Can I increase the limit on the modem or is the size limit hard-coded?
The nRF9160 has a size limit of 2303 bytes for sending and receiving TLS packages, which cannot be changed which is due to the limited memory of the device.
Hello,
I am trying to add my own custom message to be sent over MQTT. I tried copying the existing method that is present in the code, so I created a
static struct k_delayed_work cloud_send_ram_data_work
, wrote the corresponding function and added the work to thecloud_update_routine(void)
function. When calling this function my function is called as well.Im my function,
static void cloud_send_ram_data(void)
, I fetch some samples from an ADC unit and I would like to send them over to aws. First, I created a new encoding function incloud_codec.c
, copying how other functions work, i.e: create a json object, add data to it, turn it into a string and add it to the msg struct. So far this works, except I can only add about 600 values, instead of the desired 1000. Is there some kind of msg encoding limit defined somewhere?So, I manage to encode the data, but when sending it with
err = cloud_send(cloud_backend, &msg);
I get the following error:This is immediately followed by
CLOUD_EVT_DISCONNECTED
How should I go about resolving this? Do I have to configure the message type somewhere to be able to send it, or do I maybe have to add something to the AWS config?
Thank you for the help.
Relevant code attached bellow:
added to main.c
added to cloud_codec.c