Git Product home page Git Product logo

Comments (3)

lawrence-jeff avatar lawrence-jeff commented on July 4, 2024

Similar question here - would like to pickup the ConnectAck value of 4 which according to the spec should indicate incorrect username and password - not seeing how to get the return value .. tried looking at the cpp and I see reference to ConnectAck being a class but can't figure out how to catch it

from pubsubclient.

Imroy avatar Imroy commented on July 4, 2024

I've just pushed an update. It's work I did in May last year but didn't get around to pushing to github - I hadn't tested it on actual hardware and was afraid of breaking peoples' projects (even though a lot of the work involved getting the old testing framework working again).

Anyway, one of the changes I made was that PubSubClient::connect() returns false if the return code in the CONNACK packet doesn't equal zero. If you really need the rc value I could add that.

from pubsubclient.

lawrence-jeff avatar lawrence-jeff commented on July 4, 2024

Great - thanks! I will test that and I can probably make that work. If your curious on the use case I have a project where the current code only supports anonymous connections but there is a request to also support U/P. There is already the concept of an ID/pwd for other purposes so my thought was I could just update the code to try anonymous first and if it gets rc 5 (what Mosquito at least sends when password is required) then catch that and retry with the existing username and password. That way no existing anonymous users have to change anything and I don't have to update the configuration UI with options around this mqtt security. Anyway appreciate the work, I really wish I was more proficient in c/c++ or I would try to help and submit a PR - I did notice the project you forked from has rc support if you ever do want to add it.
Thanks again and will test it out tonight and let you know
(For my test I will just pickup the failure, assume it may be due to u/p required, try one more time with U/p and if that still doesn't work consider it a failure)

from pubsubclient.

Related Issues (20)

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.