So, I want do an application for my university IOT project and I decided to use node-red, but I'm having some issues specifically with the protocol CoAP in node-red and I don't know the cause.
The problem is that, I can't connect to my server with the request node from (node-red-contrib-coap) and this doesn't make sense to me because (node-red-contrib-coap) it's based on Matteo Collina's [node-coap] for node.js and with Matteo Collina's [node-coap] I used an identical script, but of course for node.js and I can connect normally to my server and receive a response, even with a python application I can do the same, so I really don't know why this is only happening on node-red (node-red-contrib-coap) ...
The error:
"13 Apr 06:40:04 - [info] [coap request:coapAC09] TypeError: The "chunk" argument must be one of type string or Buffer. Received type number
13 Apr 06:40:04 - [info] [coap request:coapAC09] client error
13 Apr 06:40:04 - [info] [coap request:coapAC09] Error: getaddrinfo ENOTFOUND [bbbb::12:4b00:2f4:ac09]
13 Apr 06:44:11 - [info] [coap request:coapAC09] Error: No reply in 247s"
The request node configuration:
The script in node.js (works fine):
const coap = require('coap')
const req = coap.request({hostname:'bbbb::12:4b00:2f4:ac09', pathname:'/d'})
//const req = coap.request('coap://[bbbb::12:4b00:2f4:ac09]/d') this works as well
req.on('response', (res) => {
res.pipe(process.stdout)
})
req.end()