Code Monkey home page Code Monkey logo

qtcoap's People

Contributors

t-mon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

qtcoap's Issues

Error: "The server did not respond after 4 retransmissions."

After the discover request from a local californium server (as well as the test server coap://vs0.inf.ethz.ch/)t , the reply is treated as an error and the program exists after giving the error.
The error is Error: "The server did not respond after 4 retransmissions
What may be the cause of the error?

   void Core::onReplyFinished(CoapReply *reply)
    {
       if (reply->error() != CoapReply::NoError) {  // this is where the error comes
          qDebug() << "Error:" << reply->errorString(); // this line gives the error: Error: "The server did not respond after 4 retransmissions."
           reply->deleteLater();
           exit(-1);
       }

       if (reply == m_discoverReply) { 
           qDebug() << "Discovery finished";
           qDebug() << "------------------------------------------" << endl;
           CoreLinkParser linkParser(reply->payload());
           foreach (const CoreLink &link, linkParser.links()) {
               qDebug() << link;
               qDebug() << link.path();
               dataList.append(new dataobject(link.title(), link.path()));
           }
           qDebug() << "Data change emitted";
       } ...
   ......
   }
```

Error: Unknown reply received: Please report a bug if you get this message

The Core::onReplyFinished(CoapReply *reply) finished method does not recognize one of the replies of a get request and instead executes the last else of the method. What might be the problem here?

} else if (reply == m_reply) { // the get request should execute this 
    //qDebug() << "------------------------------------------" << endl << reply;

    QString path = reply->request().url().path();

    QString payload = reply->payload();

} else { //but instead executes part

    qWarning() << "Unknown reply received: Please report a bug if you get this message";

}

CoAP server example code

Hello t-mon,

First of all, I'd like to thanks so much for sharing the source code.
Would you please show how to build a simple CoAP server by using this library?

Thanks and Best Regards

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.