|
Post by rhyssman on Dec 26, 2016 13:59:20 GMT
Hi Everyone I have found that Int Values recieved from the MQTT network have an inherited limitation to 16bit value even though the value is specified as a long (32bit) in the message payload. I have traced the issue to sprintf in the processing function (Gateway v2.4 Line 320,321,322)
if (IntMess) { // send integer value load sprintf(buff_mess, "%d",mes.intVal); } Modifying this to
if (IntMess) // send integer value load ltoa(rfmes.intVal, buff_mess, 10); } No issues with stability and stops the rollover. According to this ltoa function uses less resources.
Thought computorist might like to merge this into his next version of the gateway.
|
|
|
Post by papa on Dec 27, 2016 15:43:14 GMT
Thanks for looking into this, ryssman.
However, after trying what you posted, I believe there are at least 2 concerns with it.
1) There is no left curly bracket after "if (IntMess)" to match the right curly bracket below. if (IntMess) instead of if (IntMess) {
2) The IDE compiler chokes on rfmes not being declared.
|
|
|
Post by rhyssman on Dec 27, 2016 23:19:52 GMT
Hi Papa
Thanks for the feedback. Responses to your concerns
1. My mistake when pasting , must have deleted it. 2. My mistake I changed the buffer variable name for easier reading.
So final fix compatible with computorist code is:
if (IntMess) { // send integer value load ltoa(mes.intVal, buff_mess, 10); }
|
|
|
Post by computourist on Dec 29, 2016 6:56:12 GMT
Hi Rhyssman,
Thanks for pointing this out. I will incorporate this in the next version of course.
Regards,
Computourist.
|
|