How to send a multicast msg through lora-network-server

Home Forums Lora Network Server How to send a multicast msg through lora-network-server

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #31571
    Thomas Hermansson
    Participant

    Hi! I have a PC app that communicates with a Multitech Conduit mLinux box using MQTT. The Conduit in turn is serving a fleet of lora devices, all running in Class C. Sometimes we need to send configurations that are common for all devices, and would like to start using multicast for this instead of scheduling downlink packages for every one.

    I know how to do this on the device side, but I can’t find any documentation on how to actually get the gateway (lora-network-server in particular?) to send these packets. Technically they are just like any other downlink packet but the gateway has to understand that there is a multicast destination address setup, with its own network key etc.

    So I guess, any pointers would be helpful.. I assume both setting up a multicast group and also how to target the group in the MQTT message (unless its as simple as selecting the multicast destination as address).

    Thanks 🙂

    #31572
    Jason Reiss
    Keymaster

    What is your mLinux version?

    Checkout lora-query -x help

    Add a dummy ABP device and session with “multicast”: “C” in the session.
    lora-query -x device add
    lora-query -x session add

    device – end-device commands
    add – add a new end-device record
    format: device add
    example: device add ‘{“deveui”:”00-80-00-00-00-00-e1-9c”,”class”:”C”}’

    session – session commands
    add – add a session for a device
    format: session add
    example: session add ‘{“deveui”:”00-80-00-00-00-00-e1-9c”,”dev_addr”:”00112233″,”appeui”:”00-88-88-88-00-00-e1-9c”,”joineui”:”00-99-99-99-00-00-e1-9c”,”net_id”:”000017″,”app_senc_key”:”531bd9c5ec5d8ba5ef3b262cebfb3e66″,”fnwk_sint_key”:”531bd9c5ec5d8ba5ef3b262cebfb3e66″}’
    fields: deveui, appeui, joineui, dev_addr, net_id, app_senc_key, fnwk_sint_key, multicast (B or C)

    #31573
    Jason Reiss
    Keymaster
    #31574
    Thomas Hermansson
    Participant

    Hi Jason, thanks for this hint! I didn’t know lora-query and lora-network-server could do that (the documentation on the page you linked probably hasn’t been updated for many many years, it’s on 2.0.19 and I can’t see any multicast option in the session setup there). But I’ll certainly look for it in my version using the -x help option.

    Running mLinux 4 and lora-network-server 2.2.30 currently (I tried to find the mLinux 5 factory-images for MTCDT, but they aren’t available yet so had to go with the older mLinux 4). Actually I’m starting to wonder if they never will come up as they are not there for any of the 5.xxx releases at http://www.multitech.net/mlinux/images/mtcdt/

    #31575
    Thomas Hermansson
    Participant

    Hi again Jason, I now have the latest mLinux5 with lora-network-server 2.4.4 and lora-query -x help does list these options now so I should be good 🙂

    But if I may ask, I’m a bit confused about the various app keys and crypto keys etc possible… In the session add we have this example:

    example: session add ‘{“deveui”:”00-80-00-00-00-00-e1-9c”,”dev_addr”:”00112233″,”appeui”:”00-88-88-88-00-00-e1-9c”,”joineui”:”00-99-99-99-00-00-e1-9c”,”net_id”:”000017″,”app_senc_key”:”531bd9c5ec5d8ba5ef3b262cebfb3e66″,”fnwk_sint_key”:”531bd9c5ec5d8ba5ef3b262cebfb3e66″}’
    fields: deveui, appeui, joineui, dev_addr, net_id, app_senc_key, fnwk_sint_key, multicast (B or C)

    In my end device (I use an STM32 with the Semtech lora stack), it seems I can set these parameters for a multicast reception:

    if( address == curMulticastParams->Address ) {
    multicast = 1;
    nwkSKey = curMulticastParams->NwkSKey;
    appSKey = curMulticastParams->AppSKey;
    }

    So an address, which I assume maps to the fake “deveui” for the session, and two session keys – which I hope maps to one or more of the arguments above 🙂 Maybe the app_senc_key, fnwk_sint_key pair?

    Btw (and sorry for being a bit rusty on the lora security model as it was a year since I worked on this…) for the normal unicast I think we use “over the air” activation – have a hardcoded appkey and network address in the devices, and set these with matching values in the lora-network-server.conf on the gateway.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.