# \[Solved\] Cant send command with a payload

**URL:** <https://forums.losant.com/t/solved-cant-send-command-with-a-payload/476>\
**Category:** Help\
**Created:** [May 1, 2017, 2:46pm UTC](https://forums.losant.com/t/solved-cant-send-command-with-a-payload/476 "2017-05-01T14:46:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Richard\_Laybourn](https://avatars.discourse-cdn.com/v4/letter/r/43a26b/32.png) [@Richard\_Laybourn](https://forums.losant.com/u/Richard_Laybourn)\
**Post date:** [May 1, 2017, 2:46pm UTC](https://forums.losant.com/t/solved-cant-send-command-with-a-payload/476/1 "2017-05-01T14:46:47Z")

</div>

I have setup a device and I send commands to this device with no payload no problem. However if i add a json payload to the command then nothing appears to be received at the device end. I am sending the command from the devices debug page. I have placed debug output in the “commandReceived” function and when I add a payload to my command this function appears not to trigger. Any ideas what might be stopping this command getting through or triggering the “commandReceived” function?

---

<div class="post-metadata">

**Author:** ![Dylan\_Schuster](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/dylan_schuster/32/2850_2.png) [@Dylan\_Schuster](https://forums.losant.com/u/Dylan_Schuster)\
**Post date:** [May 1, 2017, 2:54pm UTC](https://forums.losant.com/t/solved-cant-send-command-with-a-payload/476/2 "2017-05-01T14:54:45Z")

</div>

Without knowing what kind of device you’re using, seeing the payloads you’re sending, or the code running on your device, it’s hard to say for sure what the issue is. But my best guess is that the payloads you’re sending are too large. It’s an issue we’ve seen with a number of users.

Here’s a post detailing how to fix the issue. Please let us know if this was the problem!

> [@Sending commands with larger payloads](https://forums.losant.com/t/sending-commands-with-larger-payloads/135):
>
> If you’re using a Losant Builder Kit or the losant-sdk-arduino on another board, you’ll likely hit the default mqtt packet size limit defined in the underlying pubsubclient library. Unfortunately the packet is blocked before reaching any of your code, so it’s hard to debug. It simply looks like the command was never received. For example: { "foo" : "bar" } works, whereas { "somethingLarger" : "with a longer value" } doesn’t work. This is because the default packet size is 128, which provides en…

---

<div class="post-metadata">

**Author:** ![Richard\_Laybourn](https://avatars.discourse-cdn.com/v4/letter/r/43a26b/32.png) [@Richard\_Laybourn](https://forums.losant.com/u/Richard_Laybourn)\
**Post date:** [May 1, 2017, 3:08pm UTC](https://forums.losant.com/t/solved-cant-send-command-with-a-payload/476/3 "2017-05-01T15:08:44Z")

</div>

Thanks I just shortened down the command to the bare minimum and that fixed it
