leshan
leshan copied to clipboard
Add support of write attribute in Leshan server demo
It would be good if we can have an option to perform write attribute on the demo server code, with operations Minimum Period, Maximum Period, Greater Than, Less Than, and Step.
Thx to @AButenko there is a REST API for this. (see #733) But still no UI.
To test it you can use :
curl -i -X PUT "http://localhost:8080/api/clients/yourendpointname/3/0/0/attributes?pmin=30&pmax=120"
curl -i -X PUT "http://localhost:8080/api/clients/yourendpointname/3/0/attributes?pmin=30&pmax=120"
curl -i -X PUT "http://localhost:8080/api/clients/yourendpointname/3/attributes?pmin=30&pmax=120"
Thx to @AButenko there is a REST API for this. (see #733) But still no UI.
To test it you can use :
curl -i -X PUT "http://localhost:8080/api/clients/yourendpointname/3/0/0/attributes?pmin=30&pmax=120" curl -i -X PUT "http://localhost:8080/api/clients/yourendpointname/3/0/attributes?pmin=30&pmax=120" curl -i -X PUT "http://localhost:8080/api/clients/yourendpointname/3/attributes?pmin=30&pmax=120"
Hello, I have the same issues and I tested the above command with Leshan Server demo but got the "INTERNAL_SERVER_ERROR(500)", also I tired this one”http://localhost:8080/api/clients/epname/3303/0/5700/attributes?pmin=30&pmax=120>=8.0&st=1.2”, I got “dquote>” from my terminal. I wonder do I need to modify the Leshan server demo? So what I am trying to achieve is the notify part, for example, if the temperature sensor value is over 8 then I get the obs notification, I already tried the SSEClient python script, it works and show all the obs results, so I wonder any instructions of how I can set to receive the obs result when the value is in certain scope? Thank you so much.
I just tested with a leshan-client-demo and I get :
HTTP/1.1 200 OK
Date: Wed, 29 Sep 2021 08:24:47 GMT
Server: Jetty(9.4.34.v20201102)
Content-Type: application/json
Content-Length: 116
{"status":"INTERNAL_SERVER_ERROR(500)","valid":true,"success":false,"failure":true,"errormessage":"not implemented"}
Meaning that all seems to works well at server side but we get a INTERNAL_SERVER_ERROR(not implemented) from the client.
This the expected behavior as Write Attribtues is not implemented for leshan client (see #534)