MQTT - what's in the packet?

Hello, I have a RAK2287 which is supplied with chirpstack on board.

I have found, when viewing incoming messages on the chirpstack gui, that there are a number of fields listed there which do not appear in the MQTT packets sent out on the application/myapplicationID/device/mydeveui/rx topic.

These include (but are not limited to):
txinfo->loRaModulationInfo->bandwidth
txinfo->loRaModulationInfo->spreadingFactor
txinfo->loRaModulationInfo->codeRate

Please could someone point me to the code that decides what is included in the MQTT packet, so I can edit it on my RAK2287 to include some of the “missing” fields.

Many thanks for your help.

Thank you for your response. I’m a bit new to all this. I’m going to write down what I’ve understood and perhaps you’d be good enough to tell me whether I’m correct and then answer my questions?

My understanding:
The file integration.proto lives on the pi of my RAK2287 and defines which fields will be sent out over MQTT when certain events happen (eg an uplink event). If I want to change what fields are in the MQTT data for an event, I need to change the relevant part of the integration.proto file.

My questions:

  1. Where is the integration.proto file stored on the Pi?
  2. Where is the list of available fields? (In other words, adr, dr, f_cnt, f_port etc are listed in the integration.proto file, but what is the equivalent text for one that’s not listed, eg coding rate)?
  3. Could you give me an example of how I could add, for example, coding rate to the MQTT output for an uplink event?

If it’s of any use, I got my Pi code from here: https://downloads.rakwireless.com/LoRa/RAK2287-Mini-PCIe/Firmware/ and it reports itself as V4.2.3R.

Thank you for any help you can offer.

Those proto files describe the content of different objects used in integrations (in this case). They are also used to generate bindings for different languages to interact with the payloads.

The default marshaler for MQTT integrations is still JSON, so you should be able to just print out the entire payload and look up each fields’ meaning in the proto files.

I do apologise if I’ve missed your point but some of the fields I’m interested in, such as the ones I listed (bandwidth, spreading factor and coding) are not present in the MQTT data I’m getting. But they are present on the DEVICE DATA screen in Chirpstack.

Screen snippet of DEVICE DATA page on Chirpstack, showing bandwidth, spreading rate and coding rate:
image

Screen snippet of MQTT data. Bandwidth, spreading rate and coding rate not present.

Is there a way I can add bandwidth, spreading factor and coding rate to the MQTT data sent out by my RAK2287?

Thank you.