Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

128
Views
Coap Client observe does not work for large message

On the client-side, I want to observe a resource with a large message and I'm getting a bad request as a status code.

I would like to intensify that for small and medium messages(size until 1K), it works well.

What do I need to do to get the payload for the large message? Am I doing something wrong?

const coap = require("coap");
const setup = {
    host: 'CLOUD_IP',
    observe: true,
    port: 5683,
    pathname: '/middlewareToCloud',
    method: 'GET'
}
const req = coap.request(setup)

// edit this to adjust max packet
req.setOption('Block2', Buffer.of(0x2))

req.on('response', (res) => 
{
    res.on('data', (data) => {           
        console.log(Buffer.from(data).toString('utf8'));
    })
    
});
req.end()

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!