Coder Social home page Coder Social logo

Comments (9)

knolleary avatar knolleary commented on May 28, 2024

As documented, this library works with any hardware that provides a Client.h implementation. A quick look at the library Sparkfun provides for this hardware shows it does provide a Client.h implementation - SFE_CC3000_Client.

So in the examples provided by the PubSubClient library, where it uses EthernetClient, you should use SFE_CC3000_Client. You'll have to refer to the examples provided by sparkfun for how to initialise the wifi connection and client.

from pubsubclient.

zuhryfayesz avatar zuhryfayesz commented on May 28, 2024

@knolleary ... Thanks for your guide. Its working like charm ... Happy !!!! 👯

from pubsubclient.

knolleary avatar knolleary commented on May 28, 2024

Great!

from pubsubclient.

zuhryfayesz avatar zuhryfayesz commented on May 28, 2024

Small problem again ... Call back function is not working ... publish is success from arduino to outside .. sorry for mentioning this late

from pubsubclient.

knolleary avatar knolleary commented on May 28, 2024

Can you share your code somewhere so I can see what you're doing?

from pubsubclient.

zuhryfayesz avatar zuhryfayesz commented on May 28, 2024

this is my code

https://codebender.cc/sketch:149812

my mail : [email protected]

from pubsubclient.

knolleary avatar knolleary commented on May 28, 2024

@zuhryfayesz sorry, not seeing any code

from pubsubclient.

zuhryfayesz avatar zuhryfayesz commented on May 28, 2024

@knolleary get the code from here .. sorry for d bad of my sharing ..

http://codeshare.io/lYRch

from pubsubclient.

knolleary avatar knolleary commented on May 28, 2024

@zuhryfayesz after your code connects the mqtt client and publishes, it then does this:

  // Make a HTTP GET request
  sclient.println("GET /index.html HTTP/1.1");
  sclient.print("Host: ");
  sclient.println(server);
  sclient.println("Connection: close");
  sclient.println();
  Serial.println();

This is sent straight to the mqtt server, which, as it isn't anything to do with mqtt, it kills the connection.

Once you pass sclient to the pubsubclient library, you cannot reuse it for other things.

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.