Issue Removing Multicast Group via API while AT Command Works - RAK3172

Hello everyone,
I am currently working with the LoRaWAN API on a RAK device and encountered an issue when trying to remove a multicast group.
Here’s the scenario:

  • When I use the following API command:
RAK_LORA_McSession multicast_list;
  while (api.lorawan.lstmulc(&multicast_list) == true && multicast_list.McDevclass != 0) 
{
      bool remove_status = api.lorawan.rmvmulc(multicast_list.McAddress);
      Serial.printf("Remove multicast group: %s\r\n", remove_status ? "Success" : "Fail");
 }

The function returns False, indicating that the multicast group was not removed.

  • However, when I execute the AT command manually:
AT+RMVMULC=11223344

The multicast group is successfully removed.

I have verified that McAddress is correctly set before calling the API. Could this be an issue with the API implementation, or am I missing something in the process?
Any insights or suggestions would be greatly appreciated.
Thank you in advance!

Welcome to RAK forum @Vanlong ,

I did some quick test and uses your code. I was able to add and removed ok. I am using TTN as LNS.

In my code session is used instead of multicast_list but they are totally the same as yours.

Thank you for your support!

It seems that there was an issue in the way I implemented my code. After reviewing it, I was able to resolve the problem. I really appreciate your help and guidance!