SX126x-Arduino
SX126x-Arduino copied to clipboard
MULTICAST - is it possible with your lorawan stack?
Hello guys,
Is it possible to use multicast with your stack? Is there any example of implementation on the node (firmware) side? thanks a lot!
Theoretically it should work, but I never got it to work on the LoRaWAN server side.
I tested with my WisBlock-Sensor-For-LoRaWAN code. What you need is the Multicast credentials:
/** Structure for multicast group entry */
MulticastParams_t test_multicast;
/** Multicast network session key, must be the same as in the Multicast group in the LNS **/
uint8_t _mc_nwskey[] = {0xc2, 0x52, 0x19, 0xc3, 0x69, 0xae, 0x0a, 0xc4, 0xa9, 0x17, 0x61, 0xee, 0x1b, 0x8d, 0xc4, 0xc5};
/** Multicast application session key, must be the same as in the Multicast group in the LNS **/
uint8_t _mc_appskey[] = {0x03, 0x76, 0xc3, 0xe7, 0x99, 0x3c, 0xe1, 0xcd, 0x64, 0xa6, 0x6d, 0xa0, 0x70, 0x88, 0xcc, 0xad};
/** Multicast device address, must be the same as in the Multicast group in the LNS **/
uint32_t _mc_devaddr = 0x7bca00be;
and then after the device has joined the network, you enable the Multicast:
// Add Multicast support
test_multicast.Address = _mc_devaddr;
memcpy(test_multicast.NwkSKey, _mc_nwskey, 16);
memcpy(test_multicast.AppSKey, _mc_appskey, 16);
LoRaMacStatus_t result = LoRaMacMulticastChannelLink(&test_multicast);
Serial.printf("MC setup result = %d\n", result);
But then I got stuck on the LoRaWAN server side (I use Chirpstack) how to actually send a MC packet. Never found out if it works.
Giving up on multicast. Cannot setup the server to test anything.