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: arduino with sx1272 lora module
PostPosted: Fri Mar 29, 2019 7:18 pm 

Joined: Thu Mar 28, 2019 2:51 pm
Posts: 4
Can I make for my application as mentioned below requirements at the sender and receiver for establishing Lora communication.

Sender: Arduino with sx1272 Lora module
Recevier: Lora Gate way only.

Here, I am trying to establish connection for 10 transmitter to 1-receiver Model for my application.

I tried with waspmote with Lora module as a transmitter and Lora Gateway module as receiver. This prototype is working. But, this model is not suitable for my application.

Please let me know how to establish connection.


Top
 Profile  
 
 Post subject: Re: arduino with sx1272 lora module
PostPosted: Tue Apr 02, 2019 8:22 am 

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

Did you send data from Arduino follwoing the frame structure of Waspmote?
http://www.libelium.com/downloads/docum ... _guide.pdf

Regards


Top
 Profile  
 
 Post subject: Re: arduino with sx1272 lora module
PostPosted: Thu Apr 04, 2019 12:44 pm 

Joined: Thu Mar 28, 2019 2:51 pm
Posts: 4
Dear Sir,

I worked with arduino +sx1272 lora module, by adding libraries available at cooking hacks.
Here, P2P communication established. which includes the following header files


#include <Wire.h>

// Cooking API libraries
#include <arduinoUtils.h>


// Include the SX1272 and SPI library:
#include "arduinoLoRa.h"
#include <SPI.h>


I did not try with <waspmote.h> header file on Arduino Uno.


Top
 Profile  
 
 Post subject: Re: arduino with sx1272 lora module
PostPosted: Fri Apr 05, 2019 8:40 am 

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

The gateway is waiting for frames in the same structure that the Waspmote device send. So if you want to send frames from Arduino to gateway, you need to create and send frames like Waspmote.

You don't' have to add the Waspmtoe libraries since they don't work with Arduino.

Regards


Top
 Profile  
 
 Post subject: Re: arduino with sx1272 lora module
PostPosted: Tue Apr 09, 2019 6:28 pm 

Joined: Thu Mar 28, 2019 2:51 pm
Posts: 4
Hi

I understood what you conveyed. But I am not knowing how to change in the program. I appreciate you, could you give demo examples or explain how to change in the program.

Suppose At Transmitter code (sx1272 with arduino uno ):

#include <Wire.h>

// Cooking API libraries
#include <arduinoUtils.h>

// Include the SX1272 and SPI library:
#include "arduinoLoRa.h"
#include <SPI.h>

int Numbersample=22;
float x[22]={0.0};
int i;
int e;
char message1 [] = "Building1";
char message2 [] = "count";
in
boolean toggle = false;
unsigned long totalTime;
float output;

/*********SETUP FUNCTION ***********/
void setup()
{
Serial.begin(115200);
pinMode(12, OUTPUT);
// Print a start message
Serial.println(F("SX1272 module and Arduino: receive packets without ACK"));

// Power ON the module
e = sx1272.ON();
Serial.print(F("Setting power ON: state "));
Serial.println(e, DEC);

// Set transmission mode and print the result
e |= sx1272.setMode(4);
Serial.print(F("Setting Mode: state "));
Serial.println(e, DEC);

// Set header
e |= sx1272.setHeaderON();
Serial.print(F("Setting Header ON: state "));
Serial.println(e, DEC);

// Select frequency channel
e |= sx1272.setChannel(CH_10_868);
Serial.print(F("Setting Channel: state "));
Serial.println(e, DEC);

// Set CRC
e |= sx1272.setCRC_ON();
Serial.print(F("Setting CRC ON: state "));
Serial.println(e, DEC);

// Select output power (Max, High or Low)
e |= sx1272.setPower('H');
Serial.print(F("Setting Power: state "));
Serial.println(e, DEC);

// Set the node address and print the result
e |= sx1272.setNodeAddress(8);
Serial.print(F("Setting node address: state "));
Serial.println(e, DEC);

// Print a success message
if (e == 0)
Serial.println(F("SX1272 successfully configured"));
else
Serial.println(F("SX1272 initialization failed"));

analogReference(EXTERNAL); // use AREF for reference voltage
for(i=0;i<Numbersample;i++)
{
x[i]=(analogRead(A0));
}

}
void loop()
{
e = sx1272.sendPacketTimeout(8, message1);
Serial.print(F("Packet sent, state "));
Serial.println(e, DEC);
}

at the reciever (USB Gateway):
/*
* ------ [SX_02b] - RX LoRa --------
*
* Explanation: This example shows how to configure the semtech
* module in LoRa mode and then receive packets with plain-text payloads
*
* Copyright (C) 2014 Libelium Comunicaciones Distribuidas S.L.
* http://www.libelium.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Version: 0.1
* Design: David Gascón
* Implementation: Covadonga Albiñana, Yuri Carmona
*/

// Include this library for transmit with sx1272
#include <WaspSX1272.h>

// status variable
int8_t e;


void setup()
{
// Init USB port
USB.ON();
USB.println(F("SX_02b example"));
USB.println(F("Semtech SX1272 module RX in LoRa"));

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

// Init sx1272 module
sx1272.ON();

// Select frequency channel
e = sx1272.setChannel(CH_10_868);
USB.print(F("Setting Channel CH_10_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 '1'.\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('L');
USB.print(F("Setting Power to 'L'.\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);

delay(1000);

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


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

// 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);
}


}


Top
 Profile  
 
 Post subject: Re: arduino with sx1272 lora module
PostPosted: Thu Apr 11, 2019 10:26 am 

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

First of all, lora gateway has a microcontroller that execute a program to be a gateway. So if you have try to upload a code to the gateway, you will need to recover the gateway. Did you try to upload any code?

You can find in the following link an example code to send a frame from Waspmote. You have to try to do the same for Arduino.
http://www.libelium.com/development/was ... waspframe/

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:


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.