Giter VIP home page Giter VIP logo

Comments (4)

maovidal avatar maovidal commented on July 17, 2024

That VI extracts an string from a message. The first two bytes determine the length of that string.
Check the section 1.5.3 UTF-8 encoded strings of the specification http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.pdf for more details.

from lvmqtt.

rddaz2013 avatar rddaz2013 commented on July 17, 2024

Thx

My Problem was if I send a message from a paho python client like '00test', my VI gets 'test'. If i "shut down" this sub-vi .-) i get '00test' but the topic wrong.

and on WIN the MQTT runs into Error 66 with the Read TCP but that is something else...

from lvmqtt.

maovidal avatar maovidal commented on July 17, 2024

May it be related to mixing the data types building that string?

'00test' may not be the correct string to send. The byte value for the symbol '0' is 0x30, so combining those two initials '0' will make the VI wait for 12,336 characters.

Actually 66 is a timeout error. I guess that if you were processing the received message treating the "Remaining Length" in the same way, you may have may have received that error while reading from the TCP port.

In this case, the correct data to send byte by byte is: 0x00, 0x04,'t','e','s','t'. Then the combined value for the first two bytes is 0x0004, then the VI will build the string with the next 4 characters: "test".

from lvmqtt.

rddaz2013 avatar rddaz2013 commented on July 17, 2024

'00test' may not be the correct string to send. The byte value for the symbol '0' is 0x30, so combining those two initials '0' will make the VI wait for 12,336 characters.

I think that is what is happening... python send a real '00test' string..but i think the VI handles the header of the mqtt (fix length or something else) quite different.

I guess that if you were processing the received message treating the "Remaining Length" in the same way, you may have may have received that error while reading from the TCP port.

Error 66 that is a problem if the loop..open close the TCP connection every time...if the timeout of the read is longer as the publisher holds the connection. I think if the keepalive timeout for default MQTT Broker > than the TCP timeout then it will work.

from lvmqtt.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.