Sending proprietary mac-commands

Hello,

Referring to the LoRaWan specification, proprietary MAC command can be created (CID from 0x80 0xFF), I am trying to implement a new one.

I have changed my device lora stack to implement this command and I was wondering how to do it on the loraserver. According to LoRaWan specification classification, the request will be transmitted by the GW and the device will answer

I have checked the source files and I guess I have to:

  • add in internal/maccommand a new file to describe how to handle the request and the answer,
  • add my new command information in lorawan/master/mac_commands.go
  • change the service profile?

How do I trig the MAC command in a downlink?

Thanks,

Yoann.

You can do so using the API. Please see: https://github.com/brocaar/loraserver/blob/master/api/ns/ns.proto#L88.

message CreateMACCommandQueueItemRequest {
    // DevEUI EUI (8 bytes).
    bytes dev_eui = 1;

    // Command identifier (specified by the LoRaWAN specs).
    uint32 cid = 4;

    // MAC-command(s). In case multiple payloads are defined, then they
    // are always sent within a single frame.
    repeated bytes commands = 5;
}

Thanks for the quick answer!

Do I have to update also the service profile to make it works?

That is not needed. To handle uplink proprietary mac-commands (sent by your device), see: https://github.com/brocaar/loraserver/blob/master/api/nc/nc.proto#L17

(you need to implement your own network-controller API for this)

@brocaar

we have implemented network-controller API for Custom Mac command

message CreateMACCommandQueueItemRequest {
    // DevEUI EUI (8 bytes).
    bytes dev_eui = 1;

    // Command identifier (specified by the LoRaWAN specs).
    uint32 cid = 4;

    // MAC-command(s). In case multiple payloads are defined, then they
    // are always sent within a single frame.
    repeated bytes commands = 5;
}

how can i pass data value in maccommand?

can you please help us?

@brocaar @timekill22

can i send CreateMACCommandQueueItemRequest from GRPC api.

can you please guide us about Custom mac commands
Thanks

Dear sir, did you finish the job? I also want to custom mac command like design an ADR algorithm myself.