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 2 of 2   [ 17 posts ]
Go to page Previous  1, 2
Author Message
 Post subject: Re: LoRa Wan Not working properly
PostPosted: Thu Apr 19, 2018 12:15 pm 

Joined: Mon Sep 28, 2009 12:06 pm
Posts: 11366
Hi,

Could you set some print functions in the code to know what function is failing?

We have tried to compile the example to send packets with Arduino IDE 1.6.9 and it compiles. Please try to use that version.

Regards


Top
 Profile  
 
 Post subject: Re: LoRa Wan Not working properly
PostPosted: Thu Apr 19, 2018 4:21 pm 

Joined: Thu Apr 12, 2018 5:17 pm
Posts: 9
Hi,

Thanks for the tip to use 1.6.9 version. The compilation is ok now.

I set some prints in the code.
In the configure P2P the error started in the
Code:
 LoRaWAN.ON(socket);

which return 1 when should return 0. And the errors goes for all the following functions in the code.
It is curious because in one module I get a error in the ON(socket) functon but in the other module it doesn't get error, the ON fucntion returns 0 but the following function (macPause() ) returns 1, and the error follows the functions in sequence.

The send packages P2P function was successful upload in the board. The error LED blinks but stays OFF after a few seconds. But I put prints in the code
Code:
void loop()
{
  // Send packet
  error = LoRaWAN.sendRadio(data);
 
  // Check status
  if (error == 0)
  {
    //--> Packet sent OK
    digitalWrite(error_led, LOW);
    Serial.println("Ok");
  }
  else
  {
    //Error waiting for packets. error
    digitalWrite(error_led, LOW);
    Serial.println("Error");
  }

and the output is Error, despite the LED is off.

The receive packages P2P are also printing Error.

Any tips?

Regards.


Top
 Profile  
 
 Post subject: Re: LoRa Wan Not working properly
PostPosted: Fri Apr 20, 2018 11:55 am 

Joined: Mon Sep 28, 2009 12:06 pm
Posts: 11366
Hi,

Arduino only have one UART so it can't print through the serial monitor and communicate with the modules at the same time. It's for that we include the debug led to know if the functions work instead the print functions.

Please upload the example codes, we said in a previos messages, changing the frequency. You will see something like this

P2P_01_configure_module wrote:
sys get ver
mac pause
radio set pwr 15
radio get pwr
radio set freq 868100000
radio get freq
radio set sf sf12
radio get sf
radio set cr 4/5
radio get cr
radio set bw 125
radio get bw
radio set crc on
radio get crc



P2P_02_send_packets wrote:
sys get ver
mac pause
radio set pwr 15
radio get pwr
radio set freq 868100000
radio get freq
radio set sf sf12
radio get sf
radio set cr 4/5
radio get cr
radio set bw 125
radio get bw
radio set crc on
radio get crc
radio tx 0102030405060708090A0B0C0D0E0F
radio tx 0102030405060708090A0B0C0D0E0F


P2P_03_receive_packets wrote:
sys get ver
mac pause
radio set pwr 15
radio get pwr
radio set freq 868100000
radio get freq
radio set sf sf12
radio get sf
radio set cr 4/5
radio get cr
radio set bw 125
radio get bw
radio set crc on
radio get crc
radio set wdt 10000
radio rx 0
radio get snr
radio set wdt 10000
radio rx 0
radio get snr
radio set wdt 10000
radio rx 0
radio get snr
radio set wdt 10000
radio rx 0
radio get snr
radio set wdt 10000


If you see radio get snr command, the packet is received.

Sorry for the mistake and the delay with the process.

Regards


Top
 Profile  
 
 Post subject: Re: LoRa Wan Not working properly
PostPosted: Fri Apr 20, 2018 12:54 pm 

Joined: Thu Apr 12, 2018 5:17 pm
Posts: 9
Hello,

Thanks.

Quote:
Arduino only have one UART so it can't print through the serial monitor and communicate with the modules at the same time. It's for that we include the debug led to know if the functions work instead the print functions.


I see, but what do you mean by:
Quote:
Could you set some print functions in the code to know what function is failing?



About the Serial Monitor, I have posted in April 19 with the frequency of 928000000. But I can post again and compare.

I should get for P2P_01_configure_module wrote:
Quote:
sys get ver
mac pause
radio set pwr 15
radio get pwr
radio set freq 868100000
radio get freq
radio set sf sf12
radio get sf
radio set cr 4/5
radio get cr
radio set bw 125
radio get bw
radio set crc on
radio get crc


But I got:
Code:
sys get ver
mac pause
radio set pwr 15
radio get pwr
radio get freq
radio set sf sf12
radio get sf
radio set cr 4/5
radio get cr
radio set bw 125
radio get bw
radio set crc on
radio get crc


As we can see the freq should be set and showed but it does not.



Your P2P_02_send_packets was:
Quote:
sys get ver
mac pause
radio set pwr 15
radio get pwr
radio set freq 868100000
radio get freq
radio set sf sf12
radio get sf
radio set cr 4/5
radio get cr
radio set bw 125
radio get bw
radio set crc on
radio get crc
radio tx 0102030405060708090A0B0C0D0E0F
radio tx 0102030405060708090A0B0C0D0E0F


I got:
Code:
sys get ver
mac pause
radio set pwr 15
radio get pwr
radio get freq
radio set sf sf12
radio get sf
radio set cr 4/5
radio get cr
radio set bw 125
radio get bw
radio set crc on
radio get crc
radio tx 0102030405060708090A0B0C0D0E0F
radio tx 0102030405060708090A0B0C0D0E0F


Againg the freq issue.



I set another module and upload the P2P_03_receive_packets. The P2P_02_send_packets is powered and running. As you said, I should get:
sys get ver
Quote:
mac pause
radio set pwr 15
radio get pwr
radio set freq 868100000
radio get freq
radio set sf sf12
radio get sf
radio set cr 4/5
radio get cr
radio set bw 125
radio get bw
radio set crc on
radio get crc
radio set wdt 10000
radio rx 0
radio get snr
radio set wdt 10000
radio rx 0
radio get snr
radio set wdt 10000
radio rx 0
radio get snr
radio set wdt 10000


But I got
Code:
sys get ver
mac pause
radio get pwr
radio get freq
radio set sf sf12
radio get sf
radio set cr 4/5
radio get cr
radio set bw 125
radio get bw
radio set crc on
radio get crc
radio set wdt 10000
radio set wdt 10000
radio set wdt 10000
radio set wdt 10000


For this is a difference in the power and freq. Also, I cand get radio get snr also.

Is there anything I can provide for you to understand and help me?


Top
 Profile  
 
 Post subject: Re: LoRa Wan Not working properly
PostPosted: Tue Apr 24, 2018 10:54 am 

Joined: Mon Sep 28, 2009 12:06 pm
Posts: 11366
Hi,

Quote:
I see, but what do you mean by:
Quote:
Quote:
Could you set some print functions in the code to know what function is failing?


Sorry it was a mistake, we didn't notice that Arduino just have a UART and both operations can't be done at the same time

Frequency of 928000000 doesn't work because it's in the limit of operation. Please try to set another frequency, for example 927000000. That frequency works for us.

Regards


Top
 Profile  
 
 Post subject: Re: LoRa Wan Not working properly
PostPosted: Wed Apr 25, 2018 6:29 pm 

Joined: Thu Apr 12, 2018 5:17 pm
Posts: 9
Hello, Thanks for your answer, I'm getting radio get snr on Serial Monitor so I think it's working.

I would like to store the received data in a variable but I didn't understand how it's done.
I read about LoRaWAN._data but was unable to understand how can I use it in my code.
Could you give me a example on how to insert a variable to store the received data inside the loop function?

Regards.


Top
 Profile  
 
 Post subject: Re: LoRa Wan Not working properly
PostPosted: Thu Apr 26, 2018 12:43 pm 

Joined: Mon Sep 28, 2009 12:06 pm
Posts: 11366
Hi,

As the code explain, the data received is saved in LoRaWAN._buffer variable and the length in LoRaWAN._length variable. You can try to do something like that to save data to another variable
Code:
    uint8_t* data;
    data=LoRaWAN._buffer;


Hope this helps.
Regards


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 2 of 2   [ 17 posts ]
Go to page Previous  1, 2


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.