Never mind, in a very minimal test to verify PR #74 it seems to work exactly as I'd intended (with the callback which I had also tried, rather than
'close' event), so the issue may be elsewhere in the application.
Hopefully skipping past the "
undefined.close()" error will shed some further light.
registerOptionrequired even for expected incoming headers? Trying to implement a 'terminate observation' request to use instead of
'finish'event per draft-ietf-core-observe-16 - but I seem to not receive the header at all?
Thanks. Issue I'm having is that
'finish' seems to fire after ack packets dropped, but other end is still expecting notifications. Worked around this as above - but then I get an error when I "write after end", if I write after
Not sure how this happens, because the default
'finish' listener doesn't seem to
end. Any idea?
@mcollina Not sure how I missed this previously - but my complaints above are based on observation not supporting draft 16, and your readme clearly states it implements draft 11.. which doesn't make mention of it.. D'oh!
Any interest in updating it? I think it's pretty useful - because I consistently have the following problem:
The problem is that B can't say "hey, A, you need to start again". What I'd like, and D16 allows, is for B to keep writing, not caring whether A acks or not. Termination would occur only when A makes a GET Obs request with the Observe option set to
1 instead of
I think the only change needed should be to stop the
'finish' event from closing the stream. Then if the present behaviour is desired, we need only
res.end() when the event happens.
I've a question or actually it's an idea.
My idea is to operate a single LED(with ws2812 driver) backed by an NodeMCU devkit(esp8266) with the corresponding NodeMCU firmware moduls
for CoAP and ws2812. This "thing" should get a request from a Raspberry Pi running Node.js with your node-coap libary serving a request client.
Further there will be an webbrowser interface where node-coap should act as an http-coap proxy.
It should simply take a query to the ws2812 modul via udp/coap http://nodemcu.readthedocs.org/en/dev/en/modules/ws2812/
It seems to me that, with a little effort, it should be possible to realize this project relativly easy.
Do you agree to my conclusion?
Later there should be some more of this single backed leds which all should get request from the pi.
Now... As I'am more a diy-guy than a professional developer I really need some community backup.
Do you know some community where I could find people working on things like this?
And are you willing to help me understand node-coap :D
thx in advance
node-coapin an app... would I just not worry about a "friendly" name for the option and just register like...
coap.registerOption("3003", toBinary, toString)??