How can it be pushed data from LoRa gateway to TTU mote?

Hello all,

I was wondering how would it be possible to send data from a LoRa gateway towards any mote in the Lora network.

I see that my Kerlink Lora gatewy has got a feature called “push data to a mote”, where I can set the mote node address along with some data. However, on the TTU RN2483 chipset command reference I am not able to find a command that allows to receive, unless I go for disabling the LoraWan stack.

Therefore, I would be interested on knowing if someone has achieved or carried out experiment in such a way.

THanks in advance,

REgards

Hi ndarkness,

LoRaWAN protocol only opens receive slots after sending (in class A). You have to send something and then you will be able to receive. Use mac tx command and look for a mac_rx response.

Hi @scle

Thanks for replying, is that for any kind of device within the network? I mean, I can understand that mechanism for the motes/node but is that the same for the Gateway? Because it that case I don’t fully comprehend what is happening, how does the mote know that something is being sent for him if it hasn’t issued anything?

Thanks

Regards

Hi @ndarkness,

After each uplink (from mote to gateway) the network opens a downlink after one second (from gateway to mote) and another one after two seconds. Your TTU mote listens after one second and after two seconds if there are any messages for him. If there are no messages it will respond with mac_tx_ok and if it received a message it will respond with mac_rx <data>. See chapter 3 of the LoRaWAN specification.

Hi @scle

Now I can understand it better, thanks! However, after reading LoRaWan spec, I have a nother question more related to the real implementation in the TTU, since in order to check whether or not my mote has got something from the gateway I have to check if mac_rx has been received right? So, if I am transmitting mode and this string shows up, I will have to read the data as something send me back by the server , is that correct?

Hi @scle

I have maganed to send receive a message from the server, following your advice and the spec. But still I am not doing it completely correct since the server is waiting for my ACK to the sent data, how do I send back that acknowledge with mac tx cnf 1 command?

I am also trying to get data from a gateway to mote.

Are you sending data on rfch =0; ? because it looping here if i do that on a mote (not the one i use).
which gateway interface is that?

Hi @flits

No I am sending data on channel 10, I think it remains looping since the server requires an ACK according to the manual, so if the mote doesn’t give it back seems to be stack, that’s my conclussion but I am still looking into it.

That interface is the one of Kerlink gateway.

regards!

according to this manual
http://ww1.microchip.com/downloads/en/DeviceDoc/40001784E.pdf
mac tx type> <portno> <data>
would be able to response mac_rx <portno> <data>
but here i only get mac_tx_ok.

sending data to the same rfch as my mote seems to fail on the gateway, sending any other channel works.

That is fine, that means that your data was sent properly in that port towards the gateway. Now you have to manage to send data from your gateway, when your geteay sends out something your mote will show mac rx port data

Just in case you missed it, from The Things Network 2016 Update, emphasis mine:

Fair Access Policy: Practice

  • Golden rule: 30 seconds air-time per device per day
  • For 10 bytes of payload, this translates in (approx.):
    • 20 messages per day at SF12
    • 500 messages per day at SF7
    • more for SF7BW250 and FSK (local-area)
  • If your application requires more bandwidth, think of another solution
  • This allows for >1000 nodes per gateway
  • Downlink bandwidth is even more restricted
    • you can’t send all messages as ‘confirmed uplink’

I don’t know what the actual limit might be.

Hi @arjanvanb

What do you mean with that you cannot send all your messages as confirmed uplink? THat is only best effort?

Hi @ndarkness,

This is something happening in the gateway. But i have no knowledge about this. Might it be possible to send unconfirmed data to the mote in settings or something?

I also don’t know how to send a confirmation with RN2483. It might be doing so automatically when sending another message (try mac tx uncnf <p> <data>). You can also try to set automatic reply (check out doc of RN2483). But better would be to turn of confirmed downlink.

Continuing the discussion from How can it be pushed data from LoRa gateway to TTU mote?:

I have no clue, I managed to sent back a confirmation to the gateway but just once, then on the gateway I saw that the status of the message chaged to success, although I haven’t been able to repeeat it yet… To do that, I used a code snippet like this one, notice that I am using a different port number to send it since I read it in the command reference from RN2483, but I am not sure this is working because as I have mentioned I managed only once.

if (((String)receivedChars).substring(0,5) == “mac_rx”) {
Serial.println("Sever data-> " + (String)receivedChars);
Serial1.write("mac tx uncnf 2 ");//ACK for the server of the data!
return true;
} else
return false;

PS: do you now @scle a better way to check whether mac_rx has arrived?

This should be the way to check whether it is received, however it generates a lot of traffic. But there is an other way, with some latency. If you need to have low latency acknowledgement you should enable automatic replay mac set ar on. This does practically the same as your little script.

The gateway will wait forever for acknowledgement of the mote. The LoRaWAN specification (4.3.1.2) has some, though minimal, information regarding how acknowledgement is sent by a mote (end device). If you don’t need the low latency part you should just wait for the next transmission of the mote to confirm the downlink message.

HI @scle,

I have done as you mentioned, I enabled the automatic reply, and it seems to be working since I see again the acknowledge in the gateway, so this confirms as well that th gateway works with acknowledge at least from its web interface to send data to motes.

You are right, the LoraWan does not tell much about how the acknowledge should be sent from the mote… On the other hand, concerning more to an implementation way, the TX has to implement as well a mechanisim to check after each transmission if something was sent to him right?

I don’t get the question here actually. Could you be a bit more specific?

Sorry @scle,

What I meant was that in order to be able to receive data from the Gateway, the implementation of the tansmitter has to take care as well of the receiving part, given that after transmitting whatever, you should listen to anything that may be issued to you, right?

Does/will The Things Network also support class B and C devices (‘Bi-directional end-devices with scheduled receive slots’ and ‘Bi-directional end-devices with maximal receive slots’)?

Yes that is true. But RN2483 does that for you. It automatically listens to the receive windows after 1 and 2 secs and delivers to you the received messages (if there were any). An acknowledgement from ‘confirmed uplink’ will be sent in one of the two receive windows (with or without data). Furthermore a confirmed downlink package might be attached in which case it will wait for acknowledgement of the mote. Or a unconfirmed package is attached and it will not wait for acknowledgement.