9 years, 6 months ago.

lwM2M PUT doesn't work - mbed NXP LPC1768 - last firmware version of the microcontroller: 141212

/media/uploads/pnysten/capture2.cap

Blocks management - lwM2M PUT doesn't work - mbed NXP LPC1768 - last firmware version of the microcontroller: 141212

Hello,

As you can see in the attached tcpdump file, while our server sends a CoAP "PUT" (on UDP) with a payload exceeding the size of a block, the device (mbed application board) doesn't answer. Moreover checking the logs of the device, I don't see that it's going through my part of the code (see below). Is it possible to change anything in the code of the firmware to be able to do this? Thank you,

Pascal

/* Only PUT method allowed */ static uint8_t firmware_resource_cb(sn_coap_hdr_s *received_coap_ptr, sn_nsdl_addr_s *address, sn_proto_info_s * proto) { sn_coap_hdr_s *coap_res_ptr = 0; char *firmware_binary = '\0';

pc.printf("Firmware updating-------\r\n");

if(received_coap_ptr->msg_code == COAP_MSG_CODE_REQUEST_PUT) { FILE *fp;

firmware_binary = (char*)malloc(received_coap_ptr->payload_len * sizeof(char)); memcpy(firmware_binary, (char *)received_coap_ptr->payload_ptr, received_coap_ptr->payload_len);

fp = fopen("/local/LWM2M_NanoService_Ethernet_LPC1768.bin", "w");

if (fp) { fprintf(fp, firmware_binary); fclose(fp); pc.printf("Firmware copied\r\n"); } else { pc.printf("fopen returned null.\r\n"); } coap_res_ptr = sn_coap_build_response(received_coap_ptr, COAP_MSG_CODE_RESPONSE_CHANGED); sn_nsdl_send_coap_message(address, coap_res_ptr);

pc.printf("Resetting...\r\n"); mbed_reset();

status=1;

}

Question relating to:

More advanced NanoService Demo for LPC1768 App Board using OMA Lightweight Objects
Be the first to answer this question.

Assigned to Pascal Nysten 9 years, 6 months ago.

This means that the question has been accepted and is being worked on.