No Downlink messages

(Rbohara) #1

I am using PI+IC880a gateway and arduino+hoperf(rfm96) LoRa node .

There are only uplink messages in gateway traffic. I have implemented encoder function in application's Payload Formats. There are no downlink messages from app/gateway. If I simulate a downlink message then it is received by LoRa node.
could someone tell me what am i missing?


Are you sending messages to you application from an external source? If so, how (mqtt, ...)?

(Rbohara) #3

Yes I have external Lora node based on arduino and rfm95. I send temperature and humidity values to the gateway.


You state you are missing downlink messages. What should trigger those downlink messages?

(Rbohara) #5

This is my decoder function

function Decoder(bytes, port) {
  if (port === 1) {
    var  h = parseInt(bytes[0]);
    var t = parseInt(bytes[1]);
  return {temperature: t, humidity: h};

encoder function is following>

function Encoder(object, port) {
  // Encode downlink messages sent as
  // object to an array or buffer of bytes.
 var bytes = [];

  if (port === 1) {
    bytes[0] = object.temperature > 24? 1 : 0;
    bytes[1] = object.humidity > 60 ? 1:0;
  return bytes;

I understand that based on my encoder function application should transmit downlink message to LoRa node , I am not sure though how does it work

(Arjan) #6

No. You'd still need to use something like MQTT to send object with temperature and humidity to TTN, which will then use the encoder function to queue a smaller payload for the actual downlink.

(As an aside: you can only send a few downlinks per day, so sending a response which is fully based on the data in the last uplink that the node has sent, is a waste of bandwidth. Of course, that's fine for testing. Also, two booleans/bits 1 or 0 would easily fit in a single 8 bits byte; no need to send 2 bytes for that.)


2 posts were split to a new topic: Gateway downlink questions?

(Arjan) #8

A post was merged into an existing topic: Gateway downlink questions?

(Rbohara) #9

This is the backend routing of ttn network

I send temperature and humidity to LoRa gateway from lora node. As shown in the picture gateway route a message to application. I see packets received in Application Data section on ttn website. Now where do I have to implement MQTT to send downlink packet from application to my Lora node.

(Arjan) #10


(Rbohara) #11

Thanks a lot for the information. I have implemented the same using ttn send node in Node Red.