eclipse-californium / californium

CoAP/DTLS Java Implementation
https://www.eclipse.org/californium/
Other
732 stars 367 forks source link

What are the right paramater settings for BlockWise Transer #889

Closed kalyanjanaki closed 5 years ago

kalyanjanaki commented 5 years ago

Am working on NBIOT project. We are using lwm2m for device management and OTA firware update. Am working on setting up coap server with firmware images so that device can download the same. for initial testing, I have set up the "cf-simplefile-server" provided int he "demo-apps" folder of branch 2.x. The server responds fine for the file SIZE 2KB but when i try the same with file with size 800KB i get below response.

11:16:35.651 INFO [RandomTokenGenerator]: using tokens of 8 bytes in length
11:16:35.659 INFO [CoapEndpoint]: CoapEndpoint uses udp plain
11:16:35.667 INFO [BlockwiseLayer]: BlockwiseLayer uses MAX_MESSAGE_SIZE=1024, PREFERRED_BLOCK_SIZE=512, BLOCKWISE_STATUS_LIFETIME=300000, MAX_RESOURCE_BODY_SIZE=8192, BLOCKWISE_STRICT_BLOCK2_OPTION=false
11:16:35.668 INFO [ReliabilityLayer]: ReliabilityLayer uses ACK_TIMEOUT=2000, ACK_RANDOM_FACTOR=1.5, and ACK_TIMEOUT_SCALE=2.0
11:16:35.670 INFO [CoapEndpoint]: Endpoint [coap://0.0.0.0:0] requires an executor to start, using default single-threaded daemon executor
11:16:35.684 INFO [UDPConnector]: UDPConnector starts up 1 sender threads and 1 receiver threads
11:16:35.687 INFO [UDPConnector]: UDPConnector listening on 0.0.0.0/0.0.0.0:54580, recv buf = 65507, send buf = 65507, recv packet size = 2048
11:16:35.687 INFO [CoapEndpoint]: Started endpoint at coap://0.0.0.0:54580
11:16:35.687 INFO [EndpointManager]: created implicit endpoint coap://0.0.0.0:54580 for coap
5.00
{}

ADVANCED

==[ CoAP Response ]============================================
MID    : 43748
Token  : 50FD8A2D86AE12F5
Type   : ACK
Status : 5.00
Options: {}
RTT    : 11 ms
Payload: 0 Bytes
===============================================================

What parameters need to be changed to support the image files up to the size of 4MB. Am new with COAP. Appreciate your help

boaks commented 5 years ago

Try to setup MAX_RESOURCE_BODY_SIZE in the Californium.properties or the NetworkConfig to the maximum used file size.

boaks commented 5 years ago

Does it work? You may have also a look at PR #793.

If it works for you, please close this issue.