I am using Coapthon and Helperclient libraries to get, put, post the data. I am using below mentioned code line to get the payload. it is working fine without any issue if pauload length size is not more than 1000.
response = self.client.get(path_check, timeout=30)
Jun 21, 2020 5:56:11 PM com.coap.dtls.test.ExampleDTLSClient$1 receiveData
INFO: received response, length53, hex payload:
But in some cases payload size is high "length1386", and it failed to get the payload:
Jun 21, 2020 5:56:21 PM com.coap.dtls.test.ExampleDTLSClient$1 receiveData
INFO: received response, length1386, hex payload:
And displays below mentioned error: AttributeError: 'NoneType' object has no attribute 'payload'
Can anyone help he how can I get high length payload? I am using python scripts and copathon libraries to achive it.
response = self.client.get(path_check, timeout=30)
CoAP is limited in its message size to a single UDP packet.
Usually, when the maximum size is exceeded, server and client fall back to what is called block-wise transfer. This allows transferring almost arbitrarily sized payloads.
In this concrete case, it appears on first glance that you are trying to access the response payload as a single response message's .payload
, which does not exist because there is no single response message – but the block layer of CoAPython should take care of that. You may have run into a bug in the library implementation, which is easiest discussed at its issue tracker .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.