Notifications
Clear all

LoRa RFM69

16 Posts
3 Users
0 Reactions
2,891 Views
(@gtmize)
Member
Joined: 2 years ago
Posts: 36
Topic starter  

Adafruit RFM69HCW 433 MHz

following ... 
https://dronebotworkshop.com/lora/
#include <SPI.h>
#include <LoRa.h>

using latest LoRa library

keep getting "Starting LoRa failed!"

 

gary



   
Quote
Topic Tags
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 5 years ago
Posts: 8047
 

Posted by: @gtmize

Adafruit RFM69HCW 433 MHz

following ... 
https://dronebotworkshop.com/lora/
#include <SPI.h>
#include <LoRa.h>

using latest LoRa library

keep getting "Starting LoRa failed!"

 

gary

That is equivalent to 'How deep is the ocean' 

You need to post the code you are running, see the Help on how to post code. Please run an auto format on your code first.

Then show us exactly what output yiou get, NO typing stuff in, use screen grabs NO cameras, use your OS screen grab tools.

Otherwise ....

 


First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, 360, fairly knowledge in PC plus numerous MPU's & MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
(@gtmize)
Member
Joined: 2 years ago
Posts: 36
Topic starter  

/*

  LoRa Demo 1 Sender

  lora-demo1-send.ino

  Sends test packet with packet count

  Requires LoRa Library by Sandeep Mistry - https://github.com/sandeepmistry/arduino-LoRa

  DroneBot Workshop 2023

   https://dronebotworkshop.com

*/

// Include required libraries

#include <SPI.h>

#include <LoRa.h>

// Define the pins used by the LoRa module

const int csPin = 4;     // LoRa radio chip select

const int resetPin = 2;  // LoRa radio reset

const int irqPin = 3;    // Must be a hardware interrupt pin

// Message counter

byte msgCount = 0;

 

void setup() {

  Serial.begin(9600);

  while (!Serial)

    ;

  // Setup LoRa module

  LoRa.setPins(csPin, resetPin, irqPin);

  Serial.println("LoRa Sender Test");

  // Start LoRa module at local frequency

  // 433E6 for Asia

  // 866E6 for Europe

  // 915E6 for North America

 

  if (!LoRa.begin(433E6)) {

    Serial.println("Starting LoRa failed!");

    while (1)

      ;

  }

}

void loop() {

  Serial.print("Sending packet: ");

  Serial.println(msgCount);

  // Send packet

  LoRa.beginPacket();

  LoRa.print("Packet ");

  LoRa.print(msgCount);

  LoRa.endPacket();

  // Increment packet counter

  msgCount++;

  // 5-second delay

  delay(5000);

}

—----------------------------

/*

  LoRa Demo 1 Receiver

  lora-demo1-receive.ino

  Receives and displays contents of test packet

  Requires LoRa Library by Sandeep Mistry - https://github.com/sandeepmistry/arduino-LoRa

  DroneBot Workshop 2023

   https://dronebotworkshop.com

*/

// Include required libraries

#include <SPI.h>

#include <LoRa.h>

// Define the pins used by the LoRa module

const int csPin = 4;     // LoRa radio chip select

const int resetPin = 2;  // LoRa radio reset

const int irqPin = 3;    // Must be a hardware interrupt pin

 

void setup() {

  Serial.begin(9600);

  while (!Serial)

    ;

  // Setup LoRa module

  LoRa.setPins(csPin, resetPin, irqPin);

  Serial.println("LoRa Receiver Test");

  // Start LoRa module at local frequency

  // 433E6 for Asia

  // 866E6 for Europe

  // 915E6 for North America

  if (!LoRa.begin(433E6)) {

    Serial.println("Starting LoRa failed!");

    while (1)

      ;

  }

}

 

void loop() {

  // Try to parse packet

  int packetSize = LoRa.parsePacket();

  if (packetSize) {

    // Received a packet

    Serial.print("Received '");

    // Read packet

    while (LoRa.available()) {

      Serial.print((char)LoRa.read());

    }

    // Print RSSI of packet

    Serial.print("' with RSSI ");

    Serial.println(LoRa.packetRssi());

  }

}



   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 5 years ago
Posts: 2607
 

@gtmize 

LoRa requires a fair bit of power, so try augmenting your power supply to see if that helps.


Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 5 years ago
Posts: 8047
 

@gtmize Don't forget to Auto Format it first, then follow these instructions.

Also, a statement or two of what you expected to happen. Then a similar couple of statements of what actually happened. Obviously if you have any error logs or Serial otput include them.

Screenshot 2024 05 31 at 18.39.59

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, 360, fairly knowledge in PC plus numerous MPU's & MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 5 years ago
Posts: 8047
 

@gtmize I see you are in Durango CO. AFAIK that is not Asia, so you need to change the frequency accordingly. It looks like that was the error you were getting so that is two clues.

 It may help to take a picture of your LORA modules that shows ALL the markings on it in enough magnification and fidelity so that we can tell what kind of hardware you are using but my bet is it is a 915mHz radio to be used in NA. You can use 433mHz if you are a licensed HAM, but if you want to be part of the IoT network etc, use a 915mHz. Also, it isn't RFM69, it's RFM96 433mHz.

For obvious reasons, I am not interested in breaking Federal Communications law especially given my background.

Good luck.

Screenshot 2024 05 31 at 19.17.53
Screenshot 2024 05 31 at 19.18.08

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, 360, fairly knowledge in PC plus numerous MPU's & MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
(@gtmize)
Member
Joined: 2 years ago
Posts: 36
Topic starter  

Its labeled a 433 from Adafruit

do have a Lora system running..?  Seems you were going to order one.



   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 5 years ago
Posts: 8047
 

@gtmize I have several. There is only one error message in your sketch and it is exactly what you are reporting. That particular LORA board if it is 433 first of all is illegal in the USA except for special situations. See if you can exchange for 915MHz modules.

Here is the only code that returns a 0 which is the error condition. It is checking an onboard register for a specific value. This means to me that the boards you have are not valid for this library, and/or this library is enforcing the NA regulations.

Here are some boards I have.

These are on Amazon.ca so change the .ca to .com LINK1 LINK2 Link3 for Link2 you will need to order Flexy Pin adapters from DigiKey? or Mouser?

I think Bill also mentioned another board but being Canadian ordering from the US I didn't look at it (both DigiKey and Mouser have .ca sites with rational shipping and prepaid taxes)

Here is the DigiKey FlexyPin adapter Link

 

  // check version
  uint8_t version = readRegister(REG_VERSION);
  if (version != 0x12) {
    return 0;
  }

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, 360, fairly knowledge in PC plus numerous MPU's & MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
(@gtmize)
Member
Joined: 2 years ago
Posts: 36
Topic starter  

Thanks,

Funny I've been through so Lora boards.   Have you got any to work?   If so which library you using?   Can you share a Hello sketch?



   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 5 years ago
Posts: 8047
 

@gtmize I only got the Flexypin adapter recently, there was a long delay, and I have been too ill to do anything with the bare bones chip. However I have a pair of Heltec modules but that involves a display. They work great.

All I can suggest is to follow Bills (dronebot-workshop) examples (except the multi of course) start with a sender on one board, and a receiver on the other. Load one or the other on one board and let it run, then connect to the other board and see if you get Serial output messages.

The first thing to do however is to get proper frequency boards.


First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, 360, fairly knowledge in PC plus numerous MPU's & MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
(@gtmize)
Member
Joined: 2 years ago
Posts: 36
Topic starter  

I tried Blll's examples no good.  Are you using AT commands to setup the boards?



   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 5 years ago
Posts: 8047
 

@gtmize I have never used AT commands since the Hayes Modem days. Are you still trying to use 433MHz boards?


First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, 360, fairly knowledge in PC plus numerous MPU's & MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 5 years ago
Posts: 8047
 

@gtmize I just double checked the library source code and there are only two return statements in the begin function.

The REG_VERSION (Version Register) is 0x42, maybe you can find a way to read it but the code is clear, the VERSION is WRONG on your board. I think you need a SPI sketch to read it, but I don't know how to set that up off the top of my head. Maybe there is a SPI tool like the I2C tool for investigating that bus.

I am attaching the source code for the Lora begin function and you can see for yourself, maybe my 82 yo eyes missed something, but there is only one way for your sketch to fail the way it fails.


First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, 360, fairly knowledge in PC plus numerous MPU's & MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 5 years ago
Posts: 8047
 

@gtmize AT commands are only for the other board you were using, I think it was RYLR896. It had a AT decoder in front of the LORA board. The RFM96 or 95 are just the LORA board.


First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, 360, fairly knowledge in PC plus numerous MPU's & MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 5 years ago
Posts: 8047
 

@gtmize I checked all the documentation I could find and did find a few interesting points. I will simply list what I found here, it is up to you to determine if you have violated any of these restrictions. NOTE that the first of these is specific to your problem. Since the first thing mentioned is wiring, I have included the detailed wiring requirements. The final screen grab lists some voltage and current warnings.

Since the only line of code that can cause your problem is dependent on SPI working (power related) and working correctly (setPins and setSPIFrequency) I included that info in the 3rd screen grab.

Screenshot 2024 06 03 at 06.56.38
Screenshot 2024 06 03 at 06.58.38
Screenshot 2024 06 03 at 06.59.07

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, 360, fairly knowledge in PC plus numerous MPU's & MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
Page 1 / 2