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 in long distance sending and receiving packets
PostPosted: Thu Jan 11, 2018 11:18 am 

Joined: Mon Oct 23, 2017 9:34 am
Posts: 49
Hi,
I am sending and receiving packets in Sx1272.This is my confiiguration


Setting configuration:
----------------------------------------
Setting Channel CH_12_868. state 0
Setting Header ON. state 0
Setting Mode '1'. state 0
Setting CRC ON. state 0
Setting Power to 'H'. state 0
Setting Node Address to '8'. state 0

But according to cooking hacks documentation with this configuration I should receive packets upto 22 km in LOS I guess,but I tested with NLOS with lot of obstructions (from one building to another building) with just 300 meters I didn't get the packets.So I increased packet timeout 5 times.But its the same.

Most importantly does Climatic conditions influence data transfer.


Last edited by karthik22 on Thu Jan 11, 2018 1:04 pm, edited 3 times in total.

Top
 Profile  
 
 Post subject: Re: problem in long distance sending and receiving packets
PostPosted: Thu Jan 11, 2018 11:19 am 

Joined: Mon Oct 23, 2017 9:34 am
Posts: 49
Receiver Code:Please note that I have set packet timeout to 5000 instead of 1000

/*
Taken from cooking hacks
*/

// Put your libraries here (#include ...)
#include <WaspSX1272.h>

// status variable
int8_t e;


void setup()
{
// init USB port
USB.ON();
USB.println(F("SX_12 example"));
USB.println(F("Semtech SX1272 module RX in LoRa getting RSSI and SNR"));

USB.println(F("----------------------------------------"));
USB.println(F("Setting configuration:"));
USB.println(F("----------------------------------------"));

// init SX1272 module
sx1272.ON();

// Select frequency channel
e = sx1272.setChannel(CH_12_868);
USB.print(F("Setting Channel CH_16_868.\t state "));
USB.println(e);

// Select implicit (off) or explicit (on) header mode
e = sx1272.setHeaderON();
USB.print(F("Setting Header ON.\t\t state "));
USB.println(e);

// Select mode: from 1 to 10
e = sx1272.setMode(1);
USB.print(F("Setting Mode '3'.\t\t state "));
USB.println(e);

// Select CRC on or off
e = sx1272.setCRC_ON();
USB.print(F("Setting CRC ON.\t\t\t state "));
USB.println(e);

// Select output power (Max, High or Low)
e = sx1272.setPower('H');
USB.print(F("Setting Power to 'H'.\t\t state "));
USB.println(e);

// Select the node address value: from 2 to 255
e = sx1272.setNodeAddress(8);
USB.print(F("Setting Node Address to '8'.\t state "));
USB.println(e);
USB.println();

delay(1000);

USB.println(F("----------------------------------------"));
USB.println(F("Receiving:"));
USB.println(F("----------------------------------------"));
}


void loop()
{
// receive packet
e = sx1272.receivePacketTimeout(50000);

// check rx status
if( e == 0 )
{
USB.println(F("\nShow packet received: "));

// show packet received
sx1272.showReceivedPacket();
}
else
{
USB.print(F("\nReceiving packet TIMEOUT, state "));
USB.println(e, DEC);
}

///////////////////////////////
// 1. Get SNR
///////////////////////////////
e = sx1272.getSNR();

// check status
if( e == 0 )
{
USB.print(F("Getting SNR \t\t--> OK. "));
USB.print(F("SNR current value is: "));
USB.println(sx1272._SNR);
}
else
{
USB.println(F("Getting SNR --> ERROR"));
}

///////////////////////////////
// 2. Get channel RSSI
///////////////////////////////
e = sx1272.getRSSI();

// check status
if( e == 0 )
{
USB.print(F("Getting RSSI \t\t--> OK. "));
USB.print(F("RSSI current value is: "));
USB.println(sx1272._RSSI);

}
else
{
USB.println(F("Getting RSSI --> ERROR"));
}

///////////////////////////////
// 3. Get last packet received RSSI
///////////////////////////////
e = sx1272.getRSSIpacket();

// check status
if( e == 0 )
{
USB.print(F("Getting RSSI packet \t--> OK. "));
USB.print(F("Last packet RSSI value is: "));
USB.println(sx1272._RSSIpacket);
}
else
{
USB.println(F("Getting RSSI packet --> ERROR"));
}

USB.println();
}


Last edited by karthik22 on Thu Jan 11, 2018 11:22 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: problem in long distance sending and receiving packets
PostPosted: Thu Jan 11, 2018 11:21 am 

Joined: Mon Oct 23, 2017 9:34 am
Posts: 49
Sender code:

/*
Taken from Cooking hacks
*/

// Include the SX1272 and SPI library:
#include "arduPiLoRa.h"

int e;

char message1 [] = "Packet 1, wanting to see if received packet is the same as sent packet";
char message2 [] = "Packet 2, broadcast test";

void setup()
{
// Print a start message
printf("SX1272 module and Raspberry Pi: send packets without ACK\n");

// Power ON the module
e = sx1272.ON();
printf("Setting power ON: state %d\n", e);

// Set transmission mode
e |= sx1272.setMode(4);
printf("Setting Mode: state %d\n", e);

// Set header
e |= sx1272.setHeaderON();
printf("Setting Header ON: state %d\n", e);

// Select frequency channel
e |= sx1272.setChannel(CH_10_868);
printf("Setting Channel: state %d\n", e);

// Set CRC
e |= sx1272.setCRC_ON();
printf("Setting CRC ON: state %d\n", e);

// Select output power (Max, High or Low)
e |= sx1272.setPower('H');
printf("Setting Power: state %d\n", e);

// Set the node address
e |= sx1272.setNodeAddress(3);
printf("Setting Node address: state %d\n", e);

// Print a success message
if (e == 0)
printf("SX1272 successfully configured\n");
else
printf("SX1272 initialization failed\n");

delay(1000);
}

void loop(void)
{
// Send message1 and print the result
e = sx1272.sendPacketTimeout(8, message1);
printf("Packet sent, state %d\n",e);

delay(4000);

// Send message2 broadcast and print the result
e = sx1272.sendPacketTimeout(0, message2);
printf("Packet sent, state %d\n",e);

delay(4000);
}

int main (){
setup();
while(1){
loop();
}
return (0);
}


Top
 Profile  
 
 Post subject: Re: problem in long distance sending and receiving packets
PostPosted: Fri Jan 12, 2018 8:57 am 

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

Normally the transmission is worse in rainy conditions but you should not notice too much difference. Could you please first start the tests with a much shorter distance, a few meters to check the correct operation of the code?

Regards


Top
 Profile  
 
 Post subject: Re: problem in long distance sending and receiving packets
PostPosted: Fri Jan 12, 2018 10:19 am 

Joined: Mon Oct 23, 2017 9:34 am
Posts: 49
Hi Dev,

For the shorter distance there is no problem it works fine.Also the weather is rainy here.In LOS condition there is no problem .Problem arises only in NLOS.

Thank you very much :)


Top
 Profile  
 
 Post subject: Re: problem in long distance sending and receiving packets
PostPosted: Mon Jan 15, 2018 9:17 am 

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

Can you tell us exactly which hardware are you using?

thanks.

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.