Sending CoAP requests using Python

0 votes

Just like sending an HTTP request, can I also send CoAP requests with Python? Although I got a lot of errors, this is how I tried to do it first:

rec = reuest.get(coap://localhost:5683/other/block)

Is there another way? Or am I missing something?

Aug 24, 2018 in IoT (Internet of Things) by Bharani
• 4,580 points

1 answer to this question.

0 votes

It can be done using a library like CoAPython as your CoAP client:

from coapthon.client.helperclient import HelperClient

client = HelperClient(server=('', 5683))
response = client.get('other/block')

'response' is an instance of the type Response and its available methods are listed in the documentation, which you'll need to build.

Whatever you need to do with the response, just use the documentation to figure out its methods and get the desired results.

answered Aug 24, 2018 by nirvana
• 3,120 points

Related Questions In IoT (Internet of Things)

0 votes
1 answer

Azure IoT Hub : Sending messages using Python via mqtt

The thing is that IoT Hub is not ...READ MORE

answered Jan 4, 2019 in IoT (Internet of Things) by Upasana
• 8,620 points
0 votes
1 answer

Sending more than 8 byte through UART on Raspberry Pi using Android Things!

So, you can send 234212441325454543595674859764 in ASCII, ...READ MORE

answered Aug 24, 2018 in IoT (Internet of Things) by nirvana
• 3,120 points
0 votes
1 answer

Sending Web requests from my Web server to my IoT device

You need to start an HTTP server ...READ MORE

answered Jan 8, 2019 in IoT (Internet of Things) by nirvana
• 3,120 points
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,452 views
0 votes
0 answers
0 votes
1 answer

Send CoAP requests using Python

You can use a library like CoAPython ...READ MORE

answered Oct 15, 2018 in IoT (Internet of Things) by nirvana
• 3,120 points
0 votes
1 answer