Coder Social home page Coder Social logo

Comments (5)

dnav avatar dnav commented on June 21, 2024

Hi,
I guess you are trying to connect to a server which is neither Leshan or wakaama.
You are right: the Update Registration message does not include the endpoint name. The location is enough to recognize the client.
It looks like your server dropped the client registration before your update message reched it.

Regards,

from wakaama.

boaks avatar boaks commented on June 21, 2024

Hi Ricky,

as always:
the more information you give about what your doing, the more feedback you will get :-).

Though the answer contains "text" (Client must specify an endpoint identifier), I would guess
you don’t use Wakaama as server. So which server do you use? Which version?

There was a change in the LWM2M TS at the beginning of 2015 ( 12. Feb. ) to map
the "update registration" not longer to "PUT" and use also "POST" instead.
So older server implementation may interpret a update with "POST" as registration
and therefore report an error.

Mit freundlichen Grüßen / Best regards

Achim Kraus

from wakaama.

ieei0214 avatar ieei0214 commented on June 21, 2024

Hi David and Achim,

Thanks for your information. You guys are kind. :)

Actually I don't know what the server is but I guess it's leshan server.
Search the key word can find in gitt hub.

Looks like the issue is caused by server. closed the issue.

http://goo.gl/Lr9HzA

121 http://grepcode.com/file/repo1.maven.org/maven2/org.github.leshan/leshan-core/0.1.4/leshan/server/lwm2m/resource/RegisterResource.java#121

http://grepcode.com/file/repo1.maven.org/maven2/org.github.leshan/leshan-core/0.1.4/leshan/server/lwm2m/resource/RegisterResource.java#

        if (endpoint == null || endpoint.isEmpty

http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/7u40-b43/java/lang/String.java#String.isEmpty%28%29())
{

122 http://grepcode.com/file/repo1.maven.org/maven2/org.github.leshan/leshan-core/0.1.4/leshan/server/lwm2m/resource/RegisterResource.java#122

http://grepcode.com/file/repo1.maven.org/maven2/org.github.leshan/leshan-core/0.1.4/leshan/server/lwm2m/resource/RegisterResource.java#

            exchange.respond(ResponseCode.BAD_REQUEST, "Client

must specify an endpoint identifier");

RickyLiu

from wakaama.

boaks avatar boaks commented on June 21, 2024

leshan 0.1.4, seems to be "very old", and the code shows the old TS (using POST/PUT for register and update). If it's possible, update the leshan to a more current version (0.1.11 ...).

Alternatively (not recommended) just for testing only:
Change core/registration.c, line 237 to use COAP_PUT (instead of the correct COAP_POST):

static int prv_update_registration(lwm2m_context_t * contextP,
                               lwm2m_server_t * server)
{
    lwm2m_transaction_t * transaction;

/*237*/ transaction = transaction_new(COAP_TYPE_CON, COAP_POST, NULL, NULL, contextP->nextMID++, 4, NULL, ENDPOINT_SERVER, (void *)server);
if (transaction == NULL) return INTERNAL_SERVER_ERROR_5_00;

coap_set_header_uri_path(transaction->message, server->location);

from wakaama.

ieei0214 avatar ieei0214 commented on June 21, 2024

I'll try it. Thanks Achim :)

2016-03-09 16:04 GMT+08:00 Achim Kraus [email protected]:

leshan 0.1.4, seems to be "very old", and the code shows the old TS (using
POST/PUT for register and update). If it's possible, update the leshan to a
more current version (0.1.11 ...).

Alternatively (not recommended) just for testing only:
Change core/registration.c, line 237 to use COAP_PUT (instead of the
correct COAP_POST):

static int prv_update_registration(lwm2m_context_t * contextP,
lwm2m_server_t * server)
{
lwm2m_transaction_t * transaction;

/237/ transaction = transaction_new(COAP_TYPE_CON, COAP_POST, NULL, NULL, contextP->nextMID++, 4, NULL, ENDPOINT_SERVER, (void *)server);
if (transaction == NULL) return INTERNAL_SERVER_ERROR_5_00;

coap_set_header_uri_path(transaction->message, server->location);


Reply to this email directly or view it on GitHub
#102 (comment).

RickyLiu

from wakaama.

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.