Libelium is offering new technical support channels, to contact with de Technical Support team to solve any issue our doubt please contact with your sales agent or visit our contact site



Post a new topicPost a reply Page 1 of 1   [ 6 posts ]
Author Message
 Post subject: Problem with LoRaWAN Downlink
PostPosted: Fri Jun 24, 2016 11:45 am 

Joined: Wed Jun 15, 2016 8:58 am
Posts: 3
Hi,

my LoRaWAN Module with Arduino Uno + Multiprotocol Shield v2.0
https://www.cooking-hacks.com/lorawan-radio-shield-for-arduino-868-mhz
operating in LoRaWAN mode won't receive any data from my kerlink gateway within the LoRaWAN.sendConfirmed() command.

This is pretty odd, since my second LoRaWAN +Arduino+ Multiprotocol Shield operating in P2P (LoRaWAN.macPause()) is receiving both data frames: the uplink frame to the gateway and exactly 1s later the corresponding downlink frame from the gateway.
My first LoRaWAN is waiting 180s before time out and getting no answer at all.

Switching the role of first and second LoRaWAN chain yields exactly the same result. Also powering only the first Arduino. The kerlink gateway is only a few meters away, and is operating within the same setup for the channels as the standard ArduinoLoRaWAN.LoRaWAN_01a_configure_module_868 example.

I tried different software settings:
a) different examples from libeliums ArduinoLoRaWAN (Version1.2) library
b) modify examples to use only one frequency+ data rate setting
c) varying the delayRX1 between 0-5s (also on the back end side)
d) modify examples to set delayRX1(1000) setRX2Parameters();
but always the same timeout answer (the return value for sendConfirmed() is 2) for the first LoRaWAN module after 180s (the second LoRaWAN in P2P mode is receiving both up- and downlink).

It seems to me that the software stack in the LoRaWAN module has a problem in understanding the downlink frame. In contrast to the P2P mode, where the PHYPayload (i doubled checked this with the one the gateway is sending) from the downlink frame is conveyed to the arduino sketch (and could be decrypted manually).

So, is there any way to convince the LoRaWAN stack within the LoRaWAN module to do this job automatically (as it is supposed to do)?


Top
 Profile  
 
 Post subject: Re: Problem with LoRaWAN Downlink
PostPosted: Mon Jun 27, 2016 9:02 am 

Joined: Mon Sep 28, 2009 12:06 pm
Posts: 11366
Hello Stefan,
sendConfirmed() function uses this command:
Code:
mac tx cnf <channel> <data>

you can see the meaning in at reference manual (section 2.4.2):
http://ww1.microchip.com/downloads/en/D ... 01784B.pdf
the module responses with "ok" indicating parameters and configurations are valid and the packet was forwarded to the radio transceiver for transmission
and the gateway responses with "mac_tx_ok" indicating uplink transmission was successful and no downlink data was received back from the server.
Regards


Top
 Profile  
 
 Post subject: Re: Problem with LoRaWAN Downlink
PostPosted: Wed Jun 29, 2016 9:51 am 

Joined: Wed Jun 15, 2016 8:58 am
Posts: 3
Thanks for your reply and providing the documentation of the LoRaWAN module.
In the case of unconfirmed frames, both responses are as you wrote:
Code:
mac tx uncnf <channel> <data>
response 1: ok
response 2: mac_tx_ok

and the gateway receives the msg.

However in the case of confirmed frames i get the mac_err response:
Code:
mac tx cnf <channel> <data>
response 1: ok
response 2: mac_err

The uplink data frame PHYPayload is
Code:
8008070605000000033A9248524664C40398A8ACB7EC9AC0BE6D64EA

the decrypted FRMPayLoad is as in the arduinoLoRaWAN-library (v1.2) example LoRaWAN_03_join_abp_send_confirmed 0102030405060708090A0B0C0D0E0F, with the NwSKey and AppSKey from that example.
The gateway sends to the backend
Code:
{"rxpk":[{"tmst":36927972,"time":"2016-0629T07:48:20.822448Z","chan":3,"rfch":0,
"freq":867.100000,"stat":1,"modu":"LORA","datr":"SF9BW125","codr":"4/5","lsnr":12.8,
"rssi":-37,"size":28,"data":"gAgHBgUAAAADOpJIUkZkxAOYqKy37JrAvm1k6g=="}]}

I define a standard downlink unconfirmed data frame, always sended back at the proper time to the LoRaWAN module:
Code:
{"txpk":{"modu":"LORA","codr":"4\/5","size":14,"data":"YAgHBgUgAAADKkrsne4=",
"datr":"SF9BW125","ipol":false,"freq":867.1,"powe":14,"prea":0,"rfch":0,"tmst":37927972}}

which converts to PHYPayload
Code:
6008070605200000032C2FD24401

which has 23 as decrypted FRMPayload.
The gateway logs states that the downlink data frame is sended at the correct time.
So the downlink data is sended at the beginning of the first receiving window RX1.

Is there something wrong with the downlink data? Is it just missing the first receiving window RX1 of the RN2483?


Top
 Profile  
 
 Post subject: Re: Problem with LoRaWAN Downlink
PostPosted: Thu Jun 30, 2016 8:39 am 

Joined: Mon Sep 28, 2009 12:06 pm
Posts: 11366
Hello Stefan;
We have run the example "LoRaWAN_03_join_abp_send_confirmed" with your payload, and this is the commands:

Code:
Arduino -> sys get ver
LoRaWAN -> RN2483 1.0.1 Dec 15 2015 09:38:09
           ok
Arduino -> mac join abp
LoRaWAN -> accepted
Arduino -> mac tx cnf 3 8008070605000000033A9248524664C40398A8ACB7EC9AC0BE6D64EA
LoRaWAN -> ok
           mac_tx_ok
Arduino -> mac save
LoRaWAN -> ok


And the data received in Loriot backend is:
Code:
0102030405060708   9:23:16               34      (enqued data sent)
0102030405060708   30/6/2016 9:23:16   868.300   SF7 BW125 4/5   -117   6.5   28   3   800807060[..]


Your problem seems to come from the backend provider or in your gateway configuration. You must use your own APP_SESSION_KEY, NWK_SESSION_KEY and APP_KEY and configure DEVICE_EUI and DEVICE_ADDR. See Example 1.

Regards


Top
 Profile  
 
 Post subject: Re: Problem with LoRaWAN Downlink
PostPosted: Thu Jun 30, 2016 9:09 am 

Joined: Wed Jun 15, 2016 8:58 am
Posts: 3
Hi,

thanks, your log convince me that the uplink to gateway is working fine (your PHYPayload is the one that is created with my devices).

Ok, i can answer my Question
Quote:
Is there something wrong with the downlink data?


The resulting PHYPayload is correct, however the way the gateway is sending it is wrong, in:
Code:
{"txpk":{"modu":"LORA","codr":"4\/5","size":14,"data":"YAgHBgUgAAADKkrsne4=",
"datr":"SF9BW125","ipol":false,"freq":867.1,"powe":14,"prea":0,"rfch":0,"tmst":37927972}}

the option "ipol":false have to be "idol":true.
To compare it with the notion in LoRaWAN Module
"ipol":false // send in P2P mode (macPause())
"idol":true // send in MAC mode (macResume())

I was using the example in the documentation of NetworkServer3.0 from Semtech. Of course the detailed explanation in that document states the above difference in contrast to their own example ;)

This solves my problem, now i get correct receive data from LoRaWAN.sendConfirmed(<port>,<payload>).


Top
 Profile  
 
 Post subject: Re: Problem with LoRaWAN Downlink
PostPosted: Fri Jul 01, 2016 7:17 am 

Joined: Mon Sep 28, 2009 12:06 pm
Posts: 11366
You are welcome. Thanks by your contribution.
Regards


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 6 posts ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Libelium theme based on 610nm Style by Daniel St. Jules of http://www.gamexe.net


© Libelium Comunicaciones Distribuidas S.L. | Terms of use.