-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multicast Fail with RAK3372 #16
Comments
@dev-sce After I add this line "service_lora_clear_multicast();" Do you see anything here in ChirpStack? I trigger the sending to the multicast group. I added the callback but can not see anything in the console too. |
I managed to use the default LoRaWAN_OTAA example. Then I added the device to Multicast group using ChirpStack API. The LoRaWAN_OTAA example can receive the downlink in Base64. So I will skip this issue in RAK code. |
Correction.
After that it seems RAK will save the Multicast session in flash. Conclusion, we will need the code to join multicast in Arduino code for RAK module.
I still can not reproduce the "Add Multicast Fail" issue again. Weird. Conclusion: this "service_lora_clear_multicast();" fixes this issue the very first time the RAK module join multicast. |
Update. And the fix by @dev-sce works. |
Setting the Multicast key using AT command works perfectly. |
Unfortunately, I haven't had the time this week to work on this subject. I'll be working on it again at the end of next week. Setting the Multicast key using AT command is a good idea. Switching to multicast with api.lorawan.addmulc works on rare occasions for me too. I suspect it's linked to the uninitialised variable as explained in my first post, which might explain why it only works in rare cases. In my case, even with my fix, I can't get any multicast data from ChirpStack to the devices. Unfortunately, I haven't made any progress on this point. Maybe in the second half of next week. If I understand correctly, you did manage to multicast data to a device. Are you sure it was multicast as in my discussion? If so, I'd like to know how. Concerning the McGroupID, I don't think it matters and it was on 2 as in the previous example from the RAK forum. |
Hope it helps you during your debugging. https://iotthinks.com/create-lorawan-multicast-group-and-send-multicast-downlink/ |
I did some tests at the end of last week and I can confirm that using the AT commands (AT+ADDMULC) works fine and that using the RAK API (api.lorawan.addmulc) does not work. I've finally been able to switch to multicast with your help @IoTThinks, and I'd like to thank you for it. However, I still can't achieve multicasting in B mode, but the problem seems to lie in the fact that our Lorawan gateway (RAK2287) doesn't have GPS. We ordered the version with GPS input to test B-mode multicasting. |
This ticket follows a discussion I had on the RAKwireless forum.
There seems to be a problem with the RUI3 API for switching to multicast mode, using the example Lorawan_Multicast project below:
I get the following result:
I’ve found a workaround that allows me to switch to multicast. However, this solution makes me think that there may be a bug in the RAK3172 API.
I debugged the program to find out what was going wrong and I realised that the problem was with the ‘service_lora_addmulc’ function called when the ‘api.lorawan.addmulc’ function was called.
I noticed that the function iterates over the McSession_group to find one with an address of 0 (*1). However, in my case, none of them is 0, and so I end up with the error ‘UDRV_PARAM_ERR’ (*2).
I suspect that this involves the use of an uninitialised variable ‘McSession_t McSession_group[LORAMAC_MAX_MC_CTX];’. This structure can be initialised via the ‘service_lora_clear_multicast’ or ‘service_lora_rmvmulc’ functions, but these are never called in the example code.
I therefore modified the ‘api.lorawan.addmulc’ function to add the initialisation of the ‘McSession_group’ variable at the start of the call:
This allows me to connect in multicast mode.
The text was updated successfully, but these errors were encountered: