Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating registration fail if no endpoint identifier #102

Closed
ieei0214 opened this issue Mar 8, 2016 · 5 comments
Closed

Updating registration fail if no endpoint identifier #102

ieei0214 opened this issue Mar 8, 2016 · 5 comments

Comments

@ieei0214
Copy link
Contributor

ieei0214 commented Mar 8, 2016

When I connect to DM server, the updating registration is fail because no endpoint identifier.

Is it necessary to send endpoint identifier to server? I don't see this param is required in spec.

I guess server doesn't recognize the update command and treat it as registration command. That's why return error.

Any idea?

Thanks in advance.

Updating registration...
Sending 22 bytes to [0.0.0.0]:5683
44 02 61 ED ED 61 A0 45 B2 72 64 0A 64 66 5A 58 D.a..a.E.rd.dfZX
6C 65 72 48 45 6C lerHEl
52 bytes received from [0.0.0.0]:5683
64 80 61 ED ED 61 A0 45 C0 FF 43 6C 69 65 6E 74 d.a..a.E..Client
20 6D 75 73 74 20 73 70 65 63 69 66 79 20 61 6E must specify an
20 65 6E 64 70 6F 69 6E 74 20 69 64 65 6E 74 69 endpoint identi
66 69 65 72 fier
Parsed: ver 1, type 2, tkl 4, code 4.00, mid 25069
Content type: 0
Payload: Client must specify an endpoint identifier

=> Registration update FAILED
@dnav
Copy link
Contributor

dnav commented Mar 8, 2016

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,

@boaks
Copy link

boaks commented Mar 8, 2016

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

@ieei0214
Copy link
Contributor Author

ieei0214 commented Mar 9, 2016

@ieei0214 ieei0214 closed this as completed Mar 9, 2016
@boaks
Copy link

boaks commented Mar 9, 2016

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);

@ieei0214
Copy link
Contributor Author

I'll try it. Thanks Achim :)

2016-03-09 16:04 GMT+08:00 Achim Kraus notifications@github.com:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants