obgm / libcoap

A CoAP (RFC 7252) implementation in C
Other
804 stars 424 forks source link

Problem with Sara #190

Open goran-mahovlic opened 6 years ago

goran-mahovlic commented 6 years ago

I have problem with sending data from SARA-N211 module Server seams to understand data, but there is some problem with parsing url

With linux I send with: cat tele.json | coap post "coap://xxxxxxxxxxxx:5683/1/11"

tcpdump of arived linux packet linux_tcpdump

and parsing of linux url loks ok linux_ok

But when I send same url with same data from SARA tcpdump n211_tcpdump

url does not get parsed as it should n211_notok

If someone can help me. Should I contact ublox to solve this in fw (could take some time, and probably lots of users will get confused) Or you can somehow fix parsing?

mrdeep1 commented 6 years ago

Sara is not parsing the URI as per https://tools.ietf.org/html/rfc7252#section-6.4 point 8, breaking it down into different Uri-Path options and so should be fixed anyway. I would raise this with ublox.

libcoap's representation of the resource follows https://tools.ietf.org/html/rfc7252#section-6.5 point 6 and will not get changed. So the resource determination (as created and transmitted by sara) is correct - 1%2F11 .

There is nothing stopping you creating a resource with coap_resource_init() called 1%2F11 which your post can talk to.

goran-mahovlic commented 6 years ago

Tnx, It is on ublox now https://forum.u-blox.com/index.php/19593/sara-n211-is-not-parsing-the-uri

Problem is that I want to use Thingsboard, and there I cannot change resource it is already /api/xx/xx So I cannot send messages to it...

I will note here if I get response from ublox...

Anisbelakremi1993 commented 6 years ago

Hello goran-mahovlic,

I am facing the same issue as you with sara N211 and thingsboard. Did you find a solution or a workaround?

Thanks in advance

goran-mahovlic commented 6 years ago

Hi,

I have answer, and workaround.

Network operator need to have huawei platform implemented . Our network operator does not have huawei platform implemented, so I use Sara coap but on server side I have crosscoap - https://github.com/ibm-security-innovation/crosscoap Then in node red I get http request and forward coap request to real coap server.