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   [ 8 posts ]
Author Message
 Post subject: SX1272 Problems
PostPosted: Tue Jun 06, 2017 9:34 pm 

Joined: Tue Jun 06, 2017 8:58 pm
Posts: 4
For some reason Arduino IDE will not find "SX1272.h" when I compile. I already installed the .zip file provided in the tutorial (by placing the nested folders "arduino-api" and "arduinoLoRa" in the libraries folder of the Arduino IDE). As suggested by a staff member on another thread, I tried redownloading the .zip from the tutorial a few times. No change. Personally, I did not notice a file "SX1272.h" or .cpp in the zip provided in the tutorial either. The tutorial says "For installing libraries, uncompress zip file. It should contain a folder called SX1272." But when I decompress it, this is what I see: https://i.snag.gy/gJk6sV.jpg

Can you provide a link to just the SX1272.h and .cpp files?

Thanks and regards,
Larsima

Here's my code:
Code:
/* 
 *  LoRa 868 / 915MHz SX1272 LoRa module
 * 
 *  Copyright (C) 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:           1.1
 *  Design:            David Gascón
 *  Implementation:    Covadonga Albiñana & Victor Boria
 */
 
// Include the SX1272 and SPI library:
#include "SX1272.h"
#include <SPI.h>

int e;
char my_packet[100];

void setup()
{
  // Open serial communications and wait for port to open:
  Serial.begin(9600);
 
  // Print a start message
  Serial.println(F("SX1272 module and Arduino: receive packets with 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(9);
  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_900);
  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('M');
  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
  Serial.println(F("SX1272 successfully configured"));
  Serial.println();
}

void loop(void)

  // Receive message
  e = sx1272.receivePacketTimeoutACK(10000);
  if ( e == 0 )
  {
    Serial.print(F("Receive packet with ACK, state "));
    Serial.println(e, DEC);

    for (unsigned int i = 0; i < sx1272.packet_received.length; i++)
    {
      my_packet[i] = (char)sx1272.packet_received.data[i];
    }
    Serial.print(F("Message: "));
    Serial.println(my_packet);
  }
  else {
    Serial.print(F("Receive packet with ACK, state "));
    Serial.println(e, DEC);
  }
}


Top
 Profile  
 
 Post subject: Re: SX1272 Problems
PostPosted: Wed Jun 07, 2017 7:28 am 

Joined: Mon Sep 28, 2009 12:06 pm
Posts: 11366
Hello larsima,
You need uncompress the files "arduino-api*.zip" and "arduinoLoRa*.zip" in your library directory. Then you must use the examples provided with the library in the Arduino IDE -> File -> Examples -> arduinoLoRa menu.
The class SX1272 has been renamed to arduinoLoRa for api consistence issues.
Regards


Top
 Profile  
 
 Post subject: Re: SX1272 Problems
PostPosted: Sat Jun 10, 2017 5:19 pm 

Joined: Tue Jun 06, 2017 8:58 pm
Posts: 4
That compiled seemingly perfectly, but I'm still experiencing some issues initializing the module. Here's the serial monitor output:
Code:
SX1272 module and Arduino: send packets without ACK
Setting power ON: state 1
Setting Mode: state 1
Setting Header ON: state -1
Setting Channel: state -1
Setting CRC ON: state -1
Setting Power: state -1
Setting node address: state -1
SX1272 initialization failed
Packet sent, state 1
Packet sent, state 1


Obviously, since it's failing to power it on nothing else will work. What might some causes of this be? I've tried with and without both a logic level shifter (5V to 3.3V) and a reset pin (3) grounded. I'm certain of my setup and can send pictures if needed. It corresponds with staff supplied pinouts.

Thanks


Top
 Profile  
 
 Post subject: Re: SX1272 Problems
PostPosted: Mon Jun 12, 2017 7:12 am 

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

Can you post some photos of your hardware connection?

Remember that our library is developed to work with the multiprotocol shield. Without this shield this library is not directly compatible with our modules.

Regards


Top
 Profile  
 
 Post subject: Re: SX1272 Problems
PostPosted: Sun Jun 25, 2017 7:02 pm 

Joined: Tue Jun 06, 2017 8:58 pm
Posts: 4
Sorry about the delay in response and my apologies in advance as it may very well occur in the future as well.

I've attached 3 pictures. Two of them show each side of the SX1272 isolated so you can see which jumper colors correspond to which pin. The last is an overhead view. For simplicity (and hardware debugging) I've eliminated the logic level shifter which regulates the SPI data to 3.3v/5v.

I'm using the following link as a reference on SPI pins for the Uno board I'm using (Sainsmart): https://www.sainsmart.com/media/wysiwyg/01_2.png

I've also tried this setup with and without the reset pin on the SX1272 grounded (it made no difference as far as the serial monitor goes). Also note that while it appears the heat shrink on Pin 4 causes conductivity to Pin 3, I have tested this and only the MISO pin conducts on that header so this is not a soldering mistake.

Thanks again. Images: http://imgur.com/a/pbHSG


Top
 Profile  
 
 Post subject: Re: SX1272 Problems
PostPosted: Mon Jun 26, 2017 7:18 am 

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

First of all, we don't recommend you to use copies of Arduino UNO, we have never tested them and we can't be sur eif it will work with our products or if it can damage them.

As we said:
libelium-dev wrote:
Remember that our library is developed to work with the multiprotocol shield. Without this shield this library is not directly compatible with our modules.


The library uses the i2c to control the multiprocol shield and the multiprotocol controls the LoRa module. That's why, you cna't us eour library directly without the multiprotocol.

Regards


Top
 Profile  
 
 Post subject: Re: SX1272 Problems
PostPosted: Wed Jun 28, 2017 1:31 am 

Joined: Tue Jun 06, 2017 8:58 pm
Posts: 4
I will order a genuine Uno this weekend but it won't arrive for a couple weeks at which point I will inform on the outcome. Meanwhile, I'll look over the library Libelium made and try to overcome the I2C channeling so that I don't have to use a multiprotocol (if anyone has a library that does not require the MPRS please private msg me).

If, after I get the Uno and test it with a possibly modified library it still does not work then I may have to get a mprs. Mostly avoiding it b/c of costs. I'm developing a prototype for a startup that wants to mass produce the idea of eliminating it is a huge money saver.

Thanks for all the help so far admin.


Top
 Profile  
 
 Post subject: Re: SX1272 Problems
PostPosted: Wed Jun 28, 2017 7:14 am 

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

Waiting news about this. Good luck!

Regards


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 8 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.