Multicast API and setup

I’m attempting to test a multicast scenario, but I’m having issues.

#1. Is there any relation to setting up a multicast-group in Applications web ui, and using grpc through node for example?

#2. I can’t seem to find a very comprehensive api guide for node js, am I missing something here? I’ve done the example to queue to a single device, but I can’t get over top dead center on anything else.

#3. The examples/class_c/main.go example in the fuota server would appear to create the session from scratch, vs a pre existing session, perhaps related to question #1.

My background is a reasonable amount of modern web coding and embedded development, so not really new to coding.

JS Example for future searchers.


const grpc = require("@grpc/grpc-js");

const mc_grpc = require("@chirpstack/chirpstack-api/api/multicast_group_grpc_pb");
const multicast_group_pb = require("@chirpstack/chirpstack-api/api/multicast_group_pb");
const api_multicast_group_pb = require("@chirpstack/chirpstack-api/api/multicast_group_pb");

// This must point to the ChirpStack API interface.
const server = "noreply.somewhere.com";

// The DevEUI for which we want to enqueue the downlink.
const multicast_group_id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxx84f5";

// The API token (can be obtained through the ChirpStack web-interface).
const apiToken = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxNiJ9.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxeSJ9.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxqY6E";


// Create the client for the DeviceService.
const mcService = new mc_grpc.MulticastGroupServiceClient(
    server,
    grpc.credentials.createSsl(),
);

// Create the Metadata object.
const metadata = new grpc.Metadata();
metadata.set("authorization", "Bearer " + apiToken);

let req = new multicast_group_pb.EnqueueMulticastGroupQueueItemRequest();

let item = new multicast_group_pb.MulticastGroupQueueItem();
item.setMulticastGroupId(multicast_group_id);
item.setFPort(50);
item.setData(new Uint8Array([0xFE, 0xED, 0xBE, 0xEF]));

let device = new api_multicast_group_pb.AddDeviceToMulticastGroupRequest();

/* NOTE: Do this once for each device
device.setDevEui('xxxxxxxxxxxxx0e5');
device.setMulticastGroupId(multicast_group_id);

mcService.addDevice(device, metadata, (err, resp) => {
    if (err !== null) {
        console.log(err);
        return;
    }
    console.log("Added device " + resp);
    console.log("Time: " + new Date().getTime());
});*/

req.setQueueItem(item);

mcService.enqueue(req, metadata, (err, resp) => {
    if (err !== null) {
        console.log(err);
        return;
    }

    console.log("MC Downlink has been enqueued with id: " + resp);
    console.log("Time: " + new Date().getTime());
});
  1. Some other questions, is there some non obvious reason why the web UI wouldn’t allow adding devices to a multicast group?

  2. After receiving a multicast, the device has to uplink before it will receive any more queued downlinks (RAK3172). What could be the cause?