Hi,
I am trying to update the meter firmware using GuruxDLMS.c library. I am able to establish connection with the meter in Firmware Upgrade mode. Post this, while i am trying to read Image transfer enable status, block size and image transferred block status, meter isn't responding for the one of the TX sent by stack and stack is hanging in com_read function while returning with DLMS_ERROR_CODE_RECEIVE_FAILED error.
Request you let me know what could be the reason.
Please find below details for your analysis.
Authentication & Block cipher Key:- 2222222222222222
Code:
/***********************************************************************************/
int com_read(
connection* connection,
gxObject* object,
unsigned char attributeOrdinal)
{
uart1SendString("com_read\n");
int ret;
message data;
gxReplyData reply;
mes_init(&data);
reply_init(&reply);
if ((ret = cl_read(&connection->settings, object, attributeOrdinal, &data)) != 0 ||
(ret = com_readDataBlock(connection, &data, &reply)) != 0 ||
(ret = cl_updateValue(&connection->settings, object, attributeOrdinal, &reply.dataValue)) != 0)
{
//com_reportError("ReadObject failed", object, attributeOrdinal, ret);
uart1SendString("com_readDataBlock failed\n");
mes_clear(&data);
reply_clear(&reply);
return ret;
}
uart1SendString("com_readDataBlock success\n");
mes_clear(&data);
reply_clear(&reply);
return ret;
}
/***********************************************************************************/
int com_readDataBlock(
connection* connection,
message* messages,
gxReplyData* reply)
{
gxByteBuffer rr;
int pos, ret = DLMS_ERROR_CODE_OK;
//If there is no data to send.
if (messages->size == 0)
{
return DLMS_ERROR_CODE_OK;
}
bb_init(&rr);
//Send data.
for (pos = 0; pos != messages->size; ++pos)
{
//Send data.
if ((ret = readDLMSPacket(connection, messages->data[pos], reply)) != DLMS_ERROR_CODE_OK)
{
uart1SendString("readDLMSPacket_failed");
uart1SendString("\n\n");
return ret;
}
/***********************************************************************************/
In the above code, 'readDLMSPacket_failed' debug msg is printing, post that no other debug message is printing (i.e. code is hanging on this function return).
Debug Log:
TX: 7EA02C03A1543670E6E600C81E30000000038DFEF9FFE83658927B054D47F2E1768B30CDFF1AFD993E74015F5E7E
RX: 7EA025A10374778EE6E700CC173000000002E816ACA648BAC0957B8352B90AA4564B41941FFF7E
TX: 7EA02C03A1762672E6E600C81E3000000004C99ADBC43046F16DACF241AE959EA3F1CB8662C7C834911D1B4E0E7E
RX: 7EA028A10396E4C1E6E700CC1A30000000038339FE334965B84597DA53C729AC02226A23B07CDCA6CB7E
TX: 7EA02C03A198567CE6E600C81E3000000005347D1E66E0F9AAB9C77B155A6ADF8A1942B7DF4AEAF784ACD29FC87E
RX: 7EA025A103B81782E6E700CC1730000000042242AE7610BF4DFB811CD853A5D4B66A6878DA3D7E
TX: 7EA03603A1BA4961E6E600CB28300000000622D7633899B331BC1503A4F04B8E8058B4F3D2FB79DB75B1E4FD0C14C07AF3B8F2CB3AA1497E
RX:
TX: 7EA03603A1BA4961E6E600CB28300000000622D7633899B331BC1503A4F04B8E8058B4F3D2FB79DB75B1E4FD0C14C07AF3B8F2CB3AA1497E
RX:
TX: 7EA03603A1BA4961E6E600CB28300000000622D7633899B331BC1503A4F04B8E8058B4F3D2FB79DB75B1E4FD0C14C07AF3B8F2CB3AA1497E
RX:
TX: 7EA03603A1BA4961E6E600CB28300000000622D7633899B331BC1503A4F04B8E8058B4F3D2FB79DB75B1E4FD0C14C07AF3B8F2CB3AA1497E
RX:
readDLMSPacket_failed
Regards
Murali
Hi Murali, I also need the…
Hi Murali,
I also need the AARQ/AARE, or I can't decrypt this.
BR,
Mikko