I am having problem with the CoAP multicast requests. The problem is when i use the "multicast" address instead of the "unicast", i can ping the server but the CoAP request doesn't reach the server. I used the same request, i just changed the address. Any suggestion?
--
You received this message because you are subscribed to the Google Groups "openthread-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openthread-users+unsubscribe@googlegroups.com.
To post to this group, send email to openthread-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openthread-users/e7cc0173-7bf9-4640-ace2-2692f7cdc6b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
ThreadError Coap::ProcessClient(int argc, char *argv[])
{
ThreadError error = kThreadError_None;
otMessage *message = NULL;
otMessageInfo messageInfo;
otCoapHeader header;
// Default parameters
char coapUri[kMaxUriLength] = "test";
otCoapType coapType = kCoapTypeNonConfirmable;
otCoapCode coapCode = kCoapRequestGet;
otIp6Address coapDestinationIp;
VerifyOrExit(argc > 0, error = kThreadError_InvalidArgs);
// CoAP-Code
ConvertToLower(argv[0]);
if (strcmp(argv[0], "get") == 0)
{
coapCode = kCoapRequestGet;
}
else if (strcmp(argv[0], "post") == 0)
{
coapCode = kCoapRequestPost;
}
else if (strcmp(argv[0], "put") == 0)
{
coapCode = kCoapRequestPut;
}
else if (strcmp(argv[0], "delete") == 0)
{
coapCode = kCoapRequestDelete;
}
else
{
ExitNow(error = kThreadError_Parse);
}
// Destination IPv6 address
if (argc > 1)
{
SuccessOrExit(error = otIp6AddressFromString(argv[1], &coapDestinationIp));
}
else
{
ExitNow(error = kThreadError_InvalidArgs);
}
// CoAP-URI
if (argc > 2)
{
strlcpy(coapUri, argv[2], kMaxUriLength);
}
else
{
ExitNow(error = kThreadError_InvalidArgs);
}
// CoAP-Type
ConvertToLower(argv[3]);
if ((argc > 3) && (strcmp(argv[3], "con") == 0))
{
coapType = kCoapTypeConfirmable;
}
otCoapHeaderInit(&header, coapType, coapCode);
otCoapHeaderGenerateToken(&header, Thread::Coap::Header::kDefaultTokenLength);
SuccessOrExit(error = otCoapHeaderAppendUriPathOptions(&header, coapUri));
otCoapHeaderSetPayloadMarker(&header);
message = otCoapNewMessage(sInstance, &header);
VerifyOrExit(message != NULL, error = kThreadError_NoBufs);
// Embed content into message if given
if (argc > 4)
{
SuccessOrExit(error = otMessageAppend(message, argv[4], static_cast<uint16_t>(strlen(argv[4]))));
}
memset(&messageInfo, 0, sizeof(messageInfo));
messageInfo.mPeerAddr = coapDestinationIp;
messageInfo.mPeerPort = OT_DEFAULT_COAP_PORT;
messageInfo.mInterfaceId = OT_NETIF_INTERFACE_ID_THREAD;
if ((coapType == kCoapTypeConfirmable) || coapCode == kCoapRequestGet)
{
error = otCoapSendRequest(sInstance, message, &messageInfo,
(otCoapResponseHandler) &Coap::s_HandleClientResponse, NULL);
}
else
{
error = otCoapSendRequest(sInstance, message, &messageInfo, NULL, NULL);
}
sServer->OutputFormat("Sending CoAP message: ");
exit:
if ((error != kThreadError_None) && (message != NULL))
{
otMessageFree(message);
}
return error;
}
--
You received this message because you are subscribed to a topic in the Google Groups "openthread-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openthread-users/rY5-pRt4gOU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openthread-users+unsubscribe@googlegroups.com.
To post to this group, send email to openthread-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openthread-users/43e9c0c5-7eb6-4982-b8b3-276bbaeffde3%40googlegroups.com.
i used the same code but it doesnt work (err code = 30) ,but the CLI requests works !!!!!!! ( coap client get addr resource )
2017-04-20 9:00 GMT+01:00 KOUDA MOHAMED AMINE <kouda...@gmail.com>:
thank you,
Le dimanche 16 avril 2017 08:52:06 UTC+1, KOUDA MOHAMED AMINE a écrit :I am having problem with the CoAP multicast requests. The problem is when i use the "multicast" address instead of the "unicast", i can ping the server but the CoAP request doesn't reach the server. I used the same request, i just changed the address. Any suggestion?
--
You received this message because you are subscribed to a topic in the Google Groups "openthread-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openthread-users/rY5-pRt4gOU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openthread-use...@googlegroups.com.
To post to this group, send email to openthre...@googlegroups.com.
CoAP should work fine with multicast in OpenThread. Thread uses multicast addressing with CoAP for its control messages in a number of different use cases, so that functionality has been tested and certified.Can you provide more information on your environment and setup? Can you provide pointers to you code?--Jonathan Hui
On Sun, Apr 16, 2017 at 12:52 AM, KOUDA MOHAMED AMINE <kouda...@gmail.com> wrote:
I am having problem with the CoAP multicast requests. The problem is when i use the "multicast" address instead of the "unicast", i can ping the server but the CoAP request doesn't reach the server. I used the same request, i just changed the address. Any suggestion?
--
You received this message because you are subscribed to the Google Groups "openthread-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openthread-use...@googlegroups.com.
To post to this group, send email to openthre...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openthread-users/e7cc0173-7bf9-4640-ace2-2692f7cdc6b9%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "openthread-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openthread-use...@googlegroups.com.
To post to this group, send email to openthre...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openthread-users/f67fcfd0-ce00-4314-aa0b-2633f9e1e095%40googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "openthread-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openthread-users/rY5-pRt4gOU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openthread-users+unsubscribe@googlegroups.com.
To post to this group, send email to openthread-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openthread-users/e094e979-90d8-4dfc-a188-dd8566183e52%40googlegroups.com.
is that possible ??
2017-04-26 9:19 GMT+01:00 KOUDA MOHAMED AMINE <kouda...@gmail.com>:
how can i make something like this ( even without border routers ) ??
2017-04-26 7:24 GMT+01:00 KOUDA MOHAMED AMINE <kouda...@gmail.com>:
No, what i need really is to define the network topology ( the mesh ) .
so i want to send two-hops messages !! node1--->node4 passing through node 2 and node 3 for example. even if the source isnt an end-device it can be a router.
Le dimanche 16 avril 2017 08:52:06 UTC+1, KOUDA MOHAMED AMINE a écrit :I am having problem with the CoAP multicast requests. The problem is when i use the "multicast" address instead of the "unicast", i can ping the server but the CoAP request doesn't reach the server. I used the same request, i just changed the address. Any suggestion?
--
You received this message because you are subscribed to a topic in the Google Groups "openthread-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openthread-users/rY5-pRt4gOU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openthread-use...@googlegroups.com.
To post to this group, send email to openthre...@googlegroups.com.