Failure to initiate Ra-02 (AI thinker SZ1278)

Forum,

I have spent two days trying to get my head around this. I have been playing with the units mentioned in the subject for the last two weeks with a high level of success. I actually have five units installed and working very well, four connected to MEGA's and one on an UNO. I'm using the LoRa library by sandeep, v 0.5.0.

Connection is straightforward, I solder the bare unit onto an ESP8266 breakout and connect as follows:
GND-GND
3.3V - VCC
RESET - D9
DI0 - D2
DI1 - D3

NSS - D10
MOSI - D11 (D51 on MEGA)
MISO - D12 (D50 on MEGA)
SCK - D13 (D52 on MEGA)

Now working on a my next project I hooked up another UNO to a Ra-02, flashed the sketch and it keeps on giving this:

LoRa Sender
Starting LoRa failed!

So I check the cables, same thing. Maybe faulty Ra-02, change that, same thing. Take another Ra-02 from a working MEGA, same thing. Bring in new UNO, same thing. Switch to another working Ra-02, same thing. Load the sketch from working examples, same thing. I am posting this here because I have NO IDEA what I'm missing. Tried three different UNO's with three different Ra-02, which all work with the MEGA, but not one with the UNO. And I'm especially baffled because I have a working UNO->Ra-02 combo out in the field pinging as we speak.

Any tips would be appreciated.

Is there any way of debugging these? I cannot find any commands to use for debugging in the documentation.

Thanks in advance,
Hein

Here's the code I use, I tried with an without LoRa.setPins(10, 9, 2); since this is the default connections anyway.

#include <SPI.h>
#include <LoRa.h>

void setup()
{
//  LoRa.setPins(10, 9, 2);
  Serial.begin(9600);
  Serial.println("LoRa Sender");
  if (!LoRa.begin(434E6))
    Serial.println("Starting LoRa failed!");
  else
    Serial.println("Starting LoRa good!");

  LoRa.setSpreadingFactor(12); 
  LoRa.setSyncWord(0xF3);           // ranges from 0-0xFF, default 0x34, see API docs

}

void loop()
{
  LoRa.beginPacket();
  LoRa.print("2.96B");
  LoRa.endPacket();
  digitalWrite(5, HIGH);
  delay(100);
  digitalWrite(5, LOW);
  delay(1000);

  LoRa.beginPacket();
  LoRa.print("1.36H");
  LoRa.endPacket();
  digitalWrite(5, HIGH);
  delay(100);
  digitalWrite(5, LOW);  
  delay(4000);
}

The LoRa devices are 3.3V, so what logic level conversion are you using for the 5V Mega and Unos ?

Are you using the Ra-02 on the Mega and Unos ?

If your not using logic level conversion, switch the boards off now.

I tried two different cheap ebay logic level converters, could not get either of them to work with the Ra-02. I suspected they could not handle the SPI frequency so I lowered it in the sketch using LoRa.setSPIFrequency(1E6); trying 8E6, 4E6 and eventually 1E6, all with no initialising from the Ra-02.

So I hooked it up straight, with VCC onto 3.3V and it worked fine, has been for many days now. I know this is bad practice, but I've given up on trying to get that to work.

Its pointless trying to 'fix' a problem when you dont have the devices connected properly.

Ok, let me step back and look at this again. Logic level converters not working on my Ra-02.

Any ideas what I can try apart from reducing the SPI frequency?

I have these two:

https://www.ebay.co.uk/itm/IIC-I2C-Logic-Level-Converter-Bi-Directional-Module-5V-to-3-3V-For-Arduino-UK/272249807035?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2057872.m2749.l2649

and

Try using a 3.3V Arduino, Pro Mini for instance.

Most of the logic level converters I have tried were fairly marginal on SPI devices, life is short so I stick to 3.3V Arduinos myself.

Done.

That's good advice.

On another point, asking as someone who has only played with one Lora unit, which chip / library combination is the most versatile, or offer the most functionality?

I would like to see a bit more in regards to addressing, CRC checks, etc, which I'm not seeing with the library I mentioned above.

The hardware can do so much, but I'm not sure I use the library that utilises most out of the hardware.

heinburgh:
On another point, asking as someone who has only played with one Lora unit, which chip / library combination is the most versatile, or offer the most functionality?

I would like to see a bit more in regards to addressing, CRC checks, etc, which I'm not seeing with the library I mentioned above.

The hardware can do so much, but I'm not sure I use the library that utilises most out of the hardware.

Most of the LoRa modules are the SPI based Semtech device with all the RF matching bits added, little to choose between them.

Cannot comment on the generic LoRa libraries but they do tend to assume that you will implement your own addressing.

CRC checks mostly go on in the background, you dont have to worry much about them.