knolleary / pubsubclient

A client library for the Arduino Ethernet Shield that provides support for MQTT.
http://pubsubclient.knolleary.net/
MIT License
3.82k stars 1.47k forks source link

In long json string why getting "" at the values in json string? #386

Open varshathakur243 opened 6 years ago

varshathakur243 commented 6 years ago

{"vol":"235","sys":"5755.9","h1":"0.00","pr:"","vl":"235","vol":"7657.5",} having 32 such data and string size is 1000, max packet size is 1024 edited in the lib, getting no error when small string size but when increasing the number of data the starting data are in perfect string form thn some data is missing and than again the right string is available.see "pr" with no numeric value and direct "vl" is started.need help.

knolleary commented 6 years ago

How long is your topic? The max packet size has to fit both your topic and your payload - plus a 4 bytes of fixed header.

varshathakur243 commented 6 years ago

Topic is just "123456" and for my convince I have changed the size of max packet to 2048 so that it does not give any kind of error. My string on server is like this {"SKVA":"0.00","Vr":"0.00","Vy":"0.00","Vb":"0.00","SKW":"0.00","Vry":"0.00","Vyb":"0.00","Vbr":"0.00","SKWh":"0.00","Ir":"0.00","Iy":"0.00","Ib":"0.000","SKvarh":"0.00","Pr":"","SKvah":"0.00.00","Pb":"","KVRr":"0.000.00","KWr":"","KVRy":"0.00","KVRb":"0.00","SKVAR":"0.00","KAr":"0.00","KAy":"0.00","KAb":"0.00","HZ":"0.00","SI":"0.00","AVLL":"0.00","AVLN":"0.00"} 32 parameters but here only 27 and 28th is without value see "Pr", after pr I have 2,3 more parameters but they are skipped and sequence is also changed means "Pb" must be next to "Pr"BUT directly "SKvah" with two decimal points(I don't know why ). And after that the string is normal. Any suggestions?

On 22 Jan 2018 3:52 pm, "knolleary" notifications@github.com wrote:

How long is your topic? The max packet size has to fit both your topic and your payload - plus a 4 bytes of fixed header.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/knolleary/pubsubclient/issues/386#issuecomment-359381533, or mute the thread https://github.com/notifications/unsubscribe-auth/AiCJ91UHAVOZtcfZzAEG0h7yCVzbEh6Iks5tNGFggaJpZM4Rmbor .

varshathakur243 commented 6 years ago

Any kind of suggestions?

On 22 Jan 2018 4:21 pm, "Thakur Varsha" varshathakur2429@gmail.com wrote:

Topic is just "123456" and for my convince I have changed the size of max packet is 2048 so that it does not give any kind or error. My string on server is like this {"SKVA":"0.00","Vr":"0.00","Vy":"0.00","Vb":"0.00","SKW":" 0.00","Vry":"0.00","Vyb":"0.00","Vbr":"0.00","SKWh":"0.00" ,"Ir":"0.00","Iy":"0.00","Ib":"0.000","SKvarh":"0.00","Pr":" ","SKvah":"0.00.00","Pb":"","KVRr":"0.000.00","KWr":""," KVRy":"0.00","KVRb":"0.00","SKVAR":"0.00","KAr":"0.00"," KAy":"0.00","KAb":"0.00","HZ":"0.00","SI":"0.00","AVLL":"0. 00","AVLN":"0.00"} 32 parameters but here only 27 and 28th is without value see "Pr", after pr I have 2,3 more parameters but they are skipped and directly "KVRr" with two decimal points(I don't know why ). And after that the string is normal. Any suggestions?

On 22 Jan 2018 3:52 pm, "knolleary" notifications@github.com wrote:

How long is your topic? The max packet size has to fit both your topic and your payload - plus a 4 bytes of fixed header.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/knolleary/pubsubclient/issues/386#issuecomment-359381533, or mute the thread https://github.com/notifications/unsubscribe-auth/AiCJ91UHAVOZtcfZzAEG0h7yCVzbEh6Iks5tNGFggaJpZM4Rmbor .

varshathakur243 commented 6 years ago

Any suggestions please

On 22 Jan 2018 9:18 pm, "Thakur Varsha" varshathakur2429@gmail.com wrote:

Any kind of suggestions?

On 22 Jan 2018 4:21 pm, "Thakur Varsha" varshathakur2429@gmail.com wrote:

Topic is just "123456" and for my convince I have changed the size of max packet is 2048 so that it does not give any kind or error. My string on server is like this {"SKVA":"0.00","Vr":"0.00","Vy":"0.00","Vb":"0.00","SKW":"0. 00","Vry":"0.00","Vyb":"0.00","Vbr":"0.00","SKWh":"0.00"," Ir":"0.00","Iy":"0.00","Ib":"0.000","SKvarh":"0.00","Pr":"" ,"SKvah":"0.00.00","Pb":"","KVRr":"0.000.00","KWr":"","KVRy" :"0.00","KVRb":"0.00","SKVAR":"0.00","KAr":"0.00","KAy":"0. 00","KAb":"0.00","HZ":"0.00","SI":"0.00","AVLL":"0.00","AVLN":"0.00"} 32 parameters but here only 27 and 28th is without value see "Pr", after pr I have 2,3 more parameters but they are skipped and directly "KVRr" with two decimal points(I don't know why ). And after that the string is normal. Any suggestions?

On 22 Jan 2018 3:52 pm, "knolleary" notifications@github.com wrote:

How long is your topic? The max packet size has to fit both your topic and your payload - plus a 4 bytes of fixed header.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/knolleary/pubsubclient/issues/386#issuecomment-359381533, or mute the thread https://github.com/notifications/unsubscribe-auth/AiCJ91UHAVOZtcfZzAEG0h7yCVzbEh6Iks5tNGFggaJpZM4Rmbor .