Reputation: 51
I'm trying to learn oneM2M standard using Eclipse OM2M. There is 1 infrastructure node (in-cse) and 1 middle node (ms-cse) which running the ipe sample.
I can GET information from the infrastructure node by sending the following
curl --request GET \
--url 'http://localhost:8080/~/in-cse?=' \
--header 'Content-Type: application/xml' \
--header 'x-m2m-origin: admin:admin' \
--data '<m2m: ae xmlns: m2m = "http://www.onem2m.org/xml/protocols" rn = "MY_SENSOR">
<api> app-sensor </ api>
<lbl> Type/sensor Category/temperature Location/home </lbl>
<rr> false </ rr>
</ m2m: ae>'
then I'm receiving
<?xml version="1.0" encoding="UTF-8"?>
<m2m:cb
xmlns:m2m="http://www.onem2m.org/xml/protocols"
xmlns:hd="http://www.onem2m.org/xml/protocols/homedomain" rn="in-name">
<ty>5</ty>
<ri>/in-cse</ri>
<ct>20230306T095413</ct>
<lt>20230306T095413</lt>
<acpi>/in-cse/acp-264201706</acpi>
<cst>1</cst>
<csi>in-cse</csi>
<srt>1 2 3 4 5 9 14 15 16 17 23 28</srt>
<poa>http://127.0.0.1:8080/</poa>
</m2m:cb>
but when I'm doing
curl --request POST \
--url 'http://localhost:8080/~/in-cse?=' \
--header 'Content-Type: application/xml' \
--header 'x-m2m-origin: admin:admin' \
--data '<m2m: ae xmlns: m2m = "http://www.onem2m.org/xml/protocols" rn = "MY_SENSOR">
<api> app-sensor </ api>
<lbl> Type/sensor Category/temperature Location/home </lbl>
<rr> false </ rr>
</ m2m: ae>'
I got AE resource /in-cse not found.
what i'm doing wrong ?
(I'm using the default configuration provided by OM2M)
Upvotes: 1
Views: 98
Reputation: 3843
I think there are a couple of problems with your requests.
First, in the second request the URL looks a bit strange. I think it should be http://localhost:8080/~/in-cse
(without the "?=" at the end).
Second (but perhaps not the problem here), in the first request, an http GET request shouldn't have a body (the "--data" part). It is not really forbidden, but is ignored by the receiver and may have strange side effects.
Also, if you want to learn about oneM2M technology then I like to point to a series of oneM2M tutorials in the form of Jupyter Notebooks (disclosure: I am the author): https://wiki.onem2m.org/index.php?title=OneM2M_Tutorials_using_Jupyter_Notebooks You can either work through these tutorials online, or download them and install them locally. The tutorials also come with their own CSE.
Upvotes: 0