Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Does anybody have a Lora breakout board working with the Gra
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Does anybody have a Lora breakout board working with the Gra

by basrijn on Wed Mar 25, 2020 8:55 pm

Hi,

Running into trouble getting a Lora breakout board (https://www.adafruit.com/product/3072) to work with the Grand Central. I can get the board to work fine with a feather. But not with the Grand Central. I've checked the wiring over and over again, but can't find what is wrong. I don't have a scope to check if the wires do what they are supposed to do.

Hoping somebody has this going :)

Bas

basrijn
 
Posts: 81
Joined: Tue Nov 28, 2017 11:24 pm

Re: Does anybody have a Lora breakout board working with the

by jerryn on Wed Mar 25, 2020 9:01 pm

What code are you running? What pins are you using? What errors are you seeing?

I can try to reproduce your setup if you provide the details.

jerryn
 
Posts: 1328
Joined: Sat Sep 14, 2013 9:05 am

Re: Does anybody have a Lora breakout board working with the

by basrijn on Wed Mar 25, 2020 9:26 pm

Hi,

In my setup I have several pieces of hardware connected: a ChronoDot RTC, GPS Ultimate Breakout and a TFT screen. I just wrote the most basic of sketches to test this:

Code: Select all | TOGGLE FULL SIZE
#include <RH_RF95.h>
#include <RHReliableDatagram.h>

////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Configure the LORA modem (RFM9x)
// https://learn.adafruit.com/adafruit-rfm69hcw-and-rfm96-rfm95-rfm98-lora-packet-padio-breakouts
// https://learn.adafruit.com/adafruit-feather-32u4-radio-with-lora-radio-module/
////////////////////////////////////////////////////////////////////////////////////////////////////////////

// Grand Central M4
// MISO = 50
// MOSI = 51
//  SCK = 52

#define RFM95_CS 22
#define RFM95_RST 23
#define RFM95_INT 24

#define CLIENT_ADDRESS 1
#define SERVER_ADDRESS 2

// Change to 434.0 or other frequency, must match RX's freq!
#define RF95_FREQ 915.0

// Singleton instance of the radio driver
RH_RF95 driver(RFM95_CS, RFM95_INT);

// Class to manage message delivery and receipt, using the driver declared above
// RHReliableDatagram manager(driver, CLIENT_ADDRESS);

void setup()
{
  pinMode(RFM95_RST, OUTPUT);
  digitalWrite(RFM95_RST, LOW);

  Serial.begin(115200);
  while (!Serial)
  {
    delay(1);
  }
  delay(100);

  Serial.println("Feather LoRa RX Test!");

  // manual reset
  digitalWrite(RFM95_RST, HIGH); // Reverse on feathers
  delay(10);
  digitalWrite(RFM95_RST, LOW);
  delay(10);

  while (!driver.init())
  {
    Serial.println("LoRa radio init failed");
    delay(1000);
  }
  Serial.println("LoRa radio init OK!");

  // Read some registers to see if they work
  Serial.println(driver.printRegisters());

  driver.setTxPower(23, false);
}

void loop()
{
  Serial.println("Sending packet");
  uint8_t data[] = "Hello";
  driver.send(data, sizeof(data));
  driver.waitPacketSent();
  Serial.println("Done");
  delay(1000);
}


For this to compile on the Metro I need to download the Adafruit_radiohead library instead of the Radiohead from Github (the one PlatformIO pulls in).

I have the MISO, MOSI and SCK tied to 50, 51 and 52 as per the information in the Grand Central article (https://learn.adafruit.com/adafruit-gra ... al/pinouts).

For CS, RST and INT I picked some digital pins that don't seem to be tied to anything else.

If I run the attached code I get:
Code: Select all | TOGGLE FULL SIZE
Feather LoRa RX Test!
LoRa radio init failed
LoRa radio init OK!
1: 0
6: 0
7: 93
8: 55
9: 55
A: 55
B: 55
C: 40
D: 0
E: F
F: 0
10: F5
11: 82
12: 2
13: 40
14: 0
15: 24
16: 0
17: 0
18: 23
19: 9
1A: 84
1B: 2B
1C: 0
1D: 0
1E: 0
1F: F
20: 0
21: 0
22: 0
23: 78
24: 19
25: 4B
26: 0
27: 20
1
Sending packet


And it sits there forever. The fact that it reads the registers suggest that at least some stuff is working :)

There is a note somewhere in the radiohead documents about being careful not to have issues with the SPI flash. And I suspect my issue might be with that, but I lack the skills to dig into that deeper :)

All help very welcome!

Bas

basrijn
 
Posts: 81
Joined: Tue Nov 28, 2017 11:24 pm

Re: Does anybody have a Lora breakout board working with the

by jerryn on Thu Mar 26, 2020 2:34 pm

The RESET line need to be HIGH

your code failed for me then I comments out these lines


Code: Select all | TOGGLE FULL SIZE
  // manual reset
  digitalWrite(RFM95_RST, HIGH); // Reverse on feathers
  //delay(10);
  //digitalWrite(RFM95_RST, LOW);
  //delay(10);


and it works

jerryn
 
Posts: 1328
Joined: Sat Sep 14, 2013 9:05 am

Re: Does anybody have a Lora breakout board working with the

by jerryn on Thu Mar 26, 2020 2:44 pm

I also found that I was not receive packets send by your code and notice that you did not actually set the frequency to 915.0 mHz
You defined it, but did not set it

here is a revised sketch that works for me: (sorry initially posted the wrong sketch -- edited to correct it )

Code: Select all | TOGGLE FULL SIZE
#include <RH_RF95.h>
#include <RHReliableDatagram.h>

////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Configure the LORA modem (RFM9x)
// https://learn.adafruit.com/adafruit-rfm69hcw-and-rfm96-rfm95-rfm98-lora-packet-padio-breakouts
// https://learn.adafruit.com/adafruit-feather-32u4-radio-with-lora-radio-module/
////////////////////////////////////////////////////////////////////////////////////////////////////////////

// Grand Central M4
// MISO = 50
// MOSI = 51
//  SCK = 52

#define RFM95_CS 22
#define RFM95_RST 23
#define RFM95_INT 24

#define CLIENT_ADDRESS 1
#define SERVER_ADDRESS 2

// Change to 434.0 or other frequency, must match RX's freq!
#define RF95_FREQ 915.0

// Singleton instance of the radio driver
RH_RF95 driver(RFM95_CS, RFM95_INT);

// Class to manage message delivery and receipt, using the driver declared above
// RHReliableDatagram manager(driver, CLIENT_ADDRESS);

void setup()
{
  pinMode(RFM95_RST, OUTPUT);
  digitalWrite(RFM95_RST, LOW);

  Serial.begin(115200);
  while (!Serial)
  {
    delay(1);
  }
  delay(100);

  Serial.println("Feather LoRa RX Test!");

  // manual reset
  digitalWrite(RFM95_RST, HIGH); // Reverse on feathers
  //delay(10);
  //digitalWrite(RFM95_RST, LOW);
  //delay(10);

  while (!driver.init())
  {
    Serial.println("LoRa radio init failed");
    delay(1000);
  }
  Serial.println("LoRa radio init OK!");
 // Defaults after init are 434.0MHz, 13dBm, Bw = 125 kHz, Cr = 4/5, Sf = 128chips/symbol, CRC on
  if (!driver.setFrequency(RF95_FREQ)) {
    Serial.println("setFrequency failed");
    while (1);
  }
  // Read some registers to see if they work
  Serial.println(driver.printRegisters());

  driver.setTxPower(23, false);
}

void loop()
{
  Serial.println("Sending packet");
  uint8_t data[] = "Hello";
  driver.send(data, sizeof(data));
  driver.waitPacketSent();
  Serial.println("Done");
  delay(1000);
}


jerryn
 
Posts: 1328
Joined: Sat Sep 14, 2013 9:05 am

Re: Does anybody have a Lora breakout board working with the

by basrijn on Thu Mar 26, 2020 5:52 pm

Hi

Awesome! It's working now!

I did make some changes there, from the breakout info on the webpage I got:

"RST - this is the Reset pin for the radio. It's pulled high by default which is reset. Pull LOW to turn on the radio"

I understood that to mean it needs to below for the radio to be on. So I used that. Never did retest that

Tx again!

Bas

basrijn
 
Posts: 81
Joined: Tue Nov 28, 2017 11:24 pm

Please be positive and constructive with your questions and comments.