coapjs / coap-cli

A command line interface for CoAP built on node-coap
Other
75 stars 30 forks source link

How do I send a parameter value? #12

Closed kevincannon closed 8 years ago

kevincannon commented 8 years ago

Hey - this is a great tool. I'm having a small issue - maybe you've an idea.

I'm trying to send a specific value to a node.

Here's the result of the GET command:

coap get coap://10.219.114.14:5683/15011/15012/
(2.05)  {"9023":"46.165.194.70","9024":"52.28.154.39","9025":"gateway","9026":"****","9032":"https://da2s1apgus9tm.cloudfront.net/gway/ota/version_info.json","9027":"YOUR_AP_SSID","9028":"****","9059":1462964924,"9060":"2016-05-11T11:08:44.051320Z","9055":100,"9062":0,"9061":0,"9029":"0.7.0032","9054":0}

But the 9032 node is a bit odd.

coap get coap://10.219.114.14:5683/15011/15012/9032
(4.04)  Not Found

Using the Copper Firefox tool, I send this.

{"9032":"my value"}

How might that translate to this tool? I tried a few things and couldn't get it to work. I tried:

echo "hello" | coap put coap://10.219.114.14:5683/15011/15012/9032

Thanks very much!

kevincannon commented 8 years ago

Answering my own question. A colleague helped me figure it out.

I used this successfully:

coap put -p '{"9032":"test"}' coap://10.219.114.14:5683/15011/15012/