I am using MQTT Paho, and I have 2 questions about it:

  1. How many words can I send as a payload message? For example, can I send all lines below as one payload?

    T1 M6
    (Linear / Feed - Absolute)
    G0 G90 G40 G21 G17 G94 G80
    G54 X-75 Y-75 S500 M3  (Position 6)
    G43 Z100 H1
    G1 Z-20 F100
    X-40                   (Position 1)
    Y40 M8                 (Position 2)
    X40                    (Position 3)
    Y-40                   (Position 4)
    X-75                   (Position 5)
    Y-75                   (Position 6)
    G0 Z100
  2. If any of these lines don't work, can I make it send message to the broker? These lines are G-Code of CNC machine. Usually, when any line isn't executed, the whole program will stop at that line. Is it the same with MQTT?


1 Answer 1


First question:

The payload of the message is limited to 268,435,456 bytes (256Mb) (see the Stack Overflow question What is the maximum message length for a MQTT broker?)

Your second question doesn't make sense, but basically assuming the whole g-code is in one message it will all be delivered or not. It's up to you how you to implement the taking a received message and passing it to the machine.

  • my second question is: is there any Technic to make the subscriber publish a message to broker when any of these lines isn't executed by CNC machine . hardillb Dec 17, 2017 at 15:36
  • 1
    That's up to you to implement, based on how you send commands to the machine and what responses it gives. We don't have access to the hardware so have no idea how it works
    – hardillb
    Dec 17, 2017 at 15:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.