Please include the following information, in order for us to help you as effectively as possible.
-
What product do you wish to discuss? RAK4631, RAK3372, RAK11200, RAK11310, RAK11722?
RAK11720 -
What firmware are you using? (RUI3 or Arduino BSP or other IDE (e.g. STM32CubeIDE)?
RUI3 -
What firmware version? Can it be obtained with AT+VER=?
rak_rui:apollo3 4.1.1 -
Computer OS? (MacOS, Linux, Windows)
Windows -
What Computer OS version?
Windows 10 pro -
How often does the problem happen?
Registering Multicast session -
How can we replicate the problem?
running code sample in RUI3 documentation #addmulc -
Provide source code if custom firmware is used or link to example if
LoRaWAN | RAKwireless Documentation Center
RAKwireless example code is used.
void setup()
{
Serial.begin(115200);
#define OTAA_BAND (RAK_REGION_US915)
// OTAA Device EUI MSB
uint8_t node_device_eui[8] = {0x50, 0x59, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x01};
// OTAA Application EUI MSB
uint8_t node_app_eui[8] = {0x0E, 0x0D, 0x0D, 0x01, 0x0E, 0x01, 0x02, 0x0E};
// OTAA Application Key MSB
uint8_t node_app_key[16] = {0x45,0x53,0x43,0x2d,0x67,0x72,0x6f,0x75,0x70,0x20,0x4e,0x61,0x69,0x61,0x14,0x17};
//LoRaWan Multicast Session
uint8_t node_mc_address[4] = {0x01, 0x02, 0x03, 0x04};
uint8_t node_mc_AppSKey[16] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};
uint8_t node_mc_NwkSKey[16] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};
RAK_LORA_McSession session = {
.McDevclass = 2,
.McAddress = node_mc_address[0]<<24 | node_mc_address[1]<<16 | node_mc_address[2]<<8 | node_mc_address[3],
.McFrequency = 923300000,
.McDatarate = 0,
.McPeriodicity = 0,
.McGroupID = 2,
.entry = 0,
};
memcpy(session.McAppSKey, node_mc_AppSKey, 16);
memcpy(session.McNwkSKey, node_mc_NwkSKey, 16);
api.lorawan.appeui.set(node_app_eui, 8);
api.lorawan.appkey.set(node_app_key, 16);
api.lorawan.deui.set(node_device_eui, 8);
api.lorawan.band.set(OTAA_BAND);
api.lorawan.njm.set(1);
api.lorawan.deviceClass.set(RAK_LORA_CLASS_C);
api.lorawan.join();
//Wait for Join success
while (api.lorawan.njs.get() == 0)
{
Serial.print("Waiting for Lorawan join...");
api.lorawan.join();
delay(10000);
}
api.lorawan.adr.set(true);
api.lorawan.rety.set(1);
api.lorawan.cfm.set(1);
//LoRaWAN Multicast Setting
if(api.lorawan.addmulc(session) == true) {
Serial.println("Add Multicast Success");
} else {
Serial.println("Add Multicast Fail");
}
}
void loop()
{
}
Output:
Waiting for Lorawan join…+EVT:JOINED
Add Multicast Fail
Current Work Mode: LoRaWAN.