Coder Social home page Coder Social logo

Comments (30)

momshaddinury avatar momshaddinury commented on July 17, 2024 3

Actually my problem was solved. I selected Lora normal mode. And now its working

from arduino-lora.

EmbeddedAndMore avatar EmbeddedAndMore commented on July 17, 2024 1

the problem is in line 491 of LoRa.cpp (readRegister method)
in fact the dummy byte for SPI is chosen wrong (0x00) because it's a register address.
in order to make it work for my sx1287 chip i changed it to 0xFE and now it works.

return singleTransfer(address & 0x7f, 0xFE);

hope it help you as well.

from arduino-lora.

sandeepmistry avatar sandeepmistry commented on July 17, 2024

@EmbeddedAndMore interesting, could you please submit a pull request for your recommended change.

@Momshad-Dinury did you get a chance to try @EmbeddedAndMore's suggestion?

from arduino-lora.

momshaddinury avatar momshaddinury commented on July 17, 2024

@sandeepmistry Nope i didn't.
@EmbeddedAndMore Are you asking me to pull a request?

from arduino-lora.

ehsanbalouch avatar ehsanbalouch commented on July 17, 2024

Hi,
I'm using 410-525MHz AI Thinker Ra-01 module with Arduino UNO 3 (TX) and Nano 3 (RX).
I changed the Line 491 in LoRa.cpp , it started recognising the modules but it's not receiving data.
I am using LoRaSender.ino and LoRaReceiver.ino
Can you please help to make it working?

from arduino-lora.

sandeepmistry avatar sandeepmistry commented on July 17, 2024

Closing this as resolved for now.

@ehsanbalouch please open a new issue and open a pull request for the change you made to get things working.

from arduino-lora.

ehsanbalouch avatar ehsanbalouch commented on July 17, 2024

from arduino-lora.

CHAWKI94 avatar CHAWKI94 commented on July 17, 2024

am using a Adafruits feather32u4, i wrote this code and i got a problem is LoRa.Begin() function,

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

int counter = 0;

void setup() {
Serial.begin(9600);
while (!Serial);

Serial.println("LoRa Sender");

if (!LoRa.begin(433E6)) {
Serial.println("Starting LoRa failed!");
while (1);
}
}

void loop() {
Serial.print("Sending packet: ");
Serial.println(counter);

// send packet
LoRa.beginPacket();
LoRa.print("hello ");
LoRa.print(counter);
LoRa.endPacket();

counter++;

delay(5000);
}

on the serial monitor i got this:

LoRa Sender
Starting LoRa failed!

any suggestion please?

from arduino-lora.

ehsanbalouch avatar ehsanbalouch commented on July 17, 2024

from arduino-lora.

shahid44 avatar shahid44 commented on July 17, 2024

I have arduino uno and esp8266 NodeMCU. I want to communicate them with each other with Ra-01 Ai-Thinker 433 MHz. Please help me with codes, connections diagram and libraries.

from arduino-lora.

ehsanbalouch avatar ehsanbalouch commented on July 17, 2024

from arduino-lora.

shahid44 avatar shahid44 commented on July 17, 2024

Now I have tried with two UNO with Ai-Thinker Ra-01 LoRa 433 MHz, I have also corrected line 491 but LoRa sender not sending any packet and receiver not receiving 'Hello' packet.

from arduino-lora.

AwaisSiawa avatar AwaisSiawa commented on July 17, 2024

CAN YOU PLEASE HELP?
I put below code for sender LORA but it said lora sender failed. not sure why. connection is correct. i changed frequency like 433, 868, 915, 434 but still the same error.
please let me know asap

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

int counter = 0;

void setup() {
Serial.begin(9600);
while (!Serial);

Serial.println("LoRa Sender");

if (!LoRa.begin(434E6)) {
Serial.println("Starting LoRa failed!");
while (1);
}

}

void loop() {
Serial.print("Sending packet: ");
Serial.println(counter);

// send packet
LoRa.beginPacket();
LoRa.print("hello ");
LoRa.print(counter);
LoRa.endPacket();

counter++;

delay(5000);
}

from arduino-lora.

ehsanbalouch avatar ehsanbalouch commented on July 17, 2024

from arduino-lora.

IoTThinks avatar IoTThinks commented on July 17, 2024

@AwaisSiawa : Why don't you create new thread with hardware photo...?

from arduino-lora.

alfantamamy avatar alfantamamy commented on July 17, 2024

I got the same problems. I tried connec- ting the Module LoRa sx1278 to Arduino Mega 2560 as sender and receiver. But didn't works ☹️.

This is my schema,
Pin 50 - miso
Pin 51 - mosi
Pin 52 - sck
Pin 53 - nss or ss
Pin 11 - rst
Pin 9 - dio0

Please help me, thank you.

from arduino-lora.

ehsanbalouch avatar ehsanbalouch commented on July 17, 2024

from arduino-lora.

IoTThinks avatar IoTThinks commented on July 17, 2024

I got the same problems. I tried connec- ting the Module LoRa sx1278 to Arduino Mega 2560 as sender and receiver. But didn't works .

This is my schema,
Pin 50 - miso
Pin 51 - mosi
Pin 52 - sck
Pin 53 - nss or ss
Pin 11 - rst
Pin 9 - dio0

Please help me, thank you.

Show us your physical wiring photo.
Show you simplest LoRa code.
And define "not working"

Suddenly, a lot of people raise issue with Arduino Mega, Strange.

from arduino-lora.

alfantamamy avatar alfantamamy commented on July 17, 2024

I understand that these modules are not working easily. First of all your hardware should be good one and then your code must be simplest one. Below is my tested code and works properly. When you run this code, you have to enter T in the Serial Monitor to send the packet. // lora_master.pde // Caution:lora modeule can only work under 3.3V // please make sure the supply of you board is under 3.3V // 5v supply will destroy lora module!! // This code runs in master mode and works with lora_slave.pde // Flow:receive "T" from serial->send a packet->wait for reply // data of packet is " Santech Test 01 TX0 " #include <LORA.h> #include <SPI.h> #include <SoftwareSerial.h> LORA lora; unsigned char tx_buf[]={"Santech Test 01 TX0"}; unsigned char val; unsigned char flag=1; // flag of rx mode unsigned char rx_len; unsigned char rx_buf[20]; void setup() { Serial.begin(9600); if(!lora.init()) { Serial.println("Init fail!"); } flag=0; } void loop() { // val=Serial.read(); // please make sure serial is OK before running this code //if (flag==0){val='T';} //if(val=='T') // tx a packet if receive "T" if (flag==0) { lora.txPacket(tx_buf,sizeof(tx_buf)); lora.rxInit(); // turn to rx mode to wait for reply of slave ... flag=1; // enable rx flag Serial.print("tx: "); Serial.print(millis()); Serial.print("// "); } if(flag==1) { if(lora.waitIrq(LR_RXDONE_MASK)) // wait for RXDONE interrupt { flag=0; // clear rx flag lora.clrInterrupt(); rx_len=lora.rxPacket(rx_buf); // read rx data Serial.write(rx_buf,rx_len); // print out by serial Serial.println(); lora.enterStbyMode(); } } delay(700); } Regards, Ehsan Balouch

On Tue, Apr 7, 2020 at 3:27 PM alfantamamy @.***> wrote: I got the same problems. I tried connec- ting the Module LoRa sx1278 to Arduino Mega 2560 as sender and receiver. But didn't works ☹️. This is my schema, Pin 50 - miso Pin 51 - mosi Pin 52 - sck Pin 53 - nss or ss Pin 11 - rst Pin 9 - dio0 Please help me, thank you. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#25 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE5RTJRGNPHLAU2U2X4ATM3RLL5ZLANCNFSM4DNS7PAQ .

I'll try it, thanks before

from arduino-lora.

alfantamamy avatar alfantamamy commented on July 17, 2024

I got the same problems. I tried connec- ting the Module LoRa sx1278 to Arduino Mega 2560 as sender and receiver. But didn't works .
This is my schema,
Pin 50 - miso
Pin 51 - mosi
Pin 52 - sck
Pin 53 - nss or ss
Pin 11 - rst
Pin 9 - dio0
Please help me, thank you.

Show us your physical wiring photo.
Show you simplest LoRa code.
And define "not working"

Suddenly, a lot of people raise issue with Arduino Mega, Strange.

konsul1
didn't works

from arduino-lora.

alfantamamy avatar alfantamamy commented on July 17, 2024

This is code for the Receiver.

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

#define rst 11
#define dio0 9
#define ss 53

void setup() {
Serial.begin(9600);
while (!Serial);

Serial.println("LoRa Receiver");
LoRa.setPins(rst,dio0);

if (!LoRa.begin(433E6)) {
Serial.println("Starting LoRa failed!");
delay(100);
while (1);
}
}

void loop() {
// try to parse packet
int packetSize = LoRa.parsePacket();
if (packetSize) {
// received a packet
Serial.print("Received packet '");

// read packet
while (LoRa.available()) {
  Serial.print((char)LoRa.read());
}

// print RSSI of packet
Serial.print("' with RSSI ");
Serial.println(LoRa.packetRssi());



delay(1000);

}
}

from arduino-lora.

IoTThinks avatar IoTThinks commented on July 17, 2024

DIO0 is mapping to gpio9 (in your code) or 8 (in your photo)?
The setPins should be LoRa.setPins(ss, reset, dio0);

from arduino-lora.

alfantamamy avatar alfantamamy commented on July 17, 2024

DIO0 is mapping to gpio9 (in your code) or 8 (in your photo)?
The setPins should be LoRa.setPins(ss, reset, dio0);

Dio0 to pin 9.

from arduino-lora.

alfantamamy avatar alfantamamy commented on July 17, 2024

I understand that these modules are not working easily. First of all your hardware should be good one and then your code must be simplest one. Below is my tested code and works properly. When you run this code, you have to enter T in the Serial Monitor to send the packet. // lora_master.pde // Caution:lora modeule can only work under 3.3V // please make sure the supply of you board is under 3.3V // 5v supply will destroy lora module!! // This code runs in master mode and works with lora_slave.pde // Flow:receive "T" from serial->send a packet->wait for reply // data of packet is " Santech Test 01 TX0 " #include <LORA.h> #include <SPI.h> #include <SoftwareSerial.h> LORA lora; unsigned char tx_buf[]={"Santech Test 01 TX0"}; unsigned char val; unsigned char flag=1; // flag of rx mode unsigned char rx_len; unsigned char rx_buf[20]; void setup() { Serial.begin(9600); if(!lora.init()) { Serial.println("Init fail!"); } flag=0; } void loop() { // val=Serial.read(); // please make sure serial is OK before running this code //if (flag==0){val='T';} //if(val=='T') // tx a packet if receive "T" if (flag==0) { lora.txPacket(tx_buf,sizeof(tx_buf)); lora.rxInit(); // turn to rx mode to wait for reply of slave ... flag=1; // enable rx flag Serial.print("tx: "); Serial.print(millis()); Serial.print("// "); } if(flag==1) { if(lora.waitIrq(LR_RXDONE_MASK)) // wait for RXDONE interrupt { flag=0; // clear rx flag lora.clrInterrupt(); rx_len=lora.rxPacket(rx_buf); // read rx data Serial.write(rx_buf,rx_len); // print out by serial Serial.println(); lora.enterStbyMode(); } } delay(700); } Regards, Ehsan Balouch

On Tue, Apr 7, 2020 at 3:27 PM alfantamamy @.***> wrote: I got the same problems. I tried connec- ting the Module LoRa sx1278 to Arduino Mega 2560 as sender and receiver. But didn't works ☹️. This is my schema, Pin 50 - miso Pin 51 - mosi Pin 52 - sck Pin 53 - nss or ss Pin 11 - rst Pin 9 - dio0 Please help me, thank you. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#25 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE5RTJRGNPHLAU2U2X4ATM3RLL5ZLANCNFSM4DNS7PAQ .

in My Arduino can't read #include <LORA.h>
I just used #include <LoRa.h>
are not same?

from arduino-lora.

IoTThinks avatar IoTThinks commented on July 17, 2024

The code is not from this library. Sure not working with this library.

Sx1278 is 3.3v.
If you ever put it into 5v, the chip sx1278 may be already damaged.

from arduino-lora.

alfantamamy avatar alfantamamy commented on July 17, 2024

The code is not from this library. Sure not working with this library.

Sx1278 is 3.3v.
If you ever put it into 5v, the chip sx1278 may be already damaged.

Whats (name) the code on library, I'll download it.

Yeah, I used 3.3v , because on lora board written using 3.3v.

from arduino-lora.

duongvunam avatar duongvunam commented on July 17, 2024

Actually my problem was solved. I selected Lora normal mode. And now its working

i got the same issue. Please help me. How to select LoRa normal mode

from arduino-lora.

EsKliwoN avatar EsKliwoN commented on July 17, 2024

Actually my problem was solved. I selected Lora normal mode. And now its working

how u solve it? and how to selected LoRa to Normal Mode

from arduino-lora.

suryasarafe avatar suryasarafe commented on July 17, 2024

Actually my problem was solved. I selected Lora normal mode. And now its working

how u solve it? and how to selected LoRa to Normal Mode

Same issue here, I try with this code and this working now.

#include <SPI.h>
#include <LoRa.h>
 
#define ss 15
#define rst 16
#define dio0 2
 
void setup() {
  Serial.begin(115200);
  while (!Serial);
 
  Serial.println("LoRa Receiver Callback");
  LoRa.setPins(ss, rst, dio0);
  if (!LoRa.begin(433E6)) {
    Serial.println("Starting LoRa failed!");
    while (1);
  }
}
 
void loop() {
  String str="";
  int packetSize = LoRa.parsePacket(),i=0;
  if (packetSize) {
    Serial.print("Received packet ");
    while (LoRa.available()) 
    {
      str=str+((char)LoRa.read()); 
    }
    Serial.println(str);
  }
}

I'm using nodeMCU and sx1278 (RA-02) this is the wiring

NodeMCU         SX1278
GND             GND
3.3v            3.3v
D0              RST
D8              NSS
D7              MOSI
D6              MISO
D5              SCK

hope this can help,

from arduino-lora.

Axliyor avatar Axliyor commented on July 17, 2024

The code is not from this library. Sure not working with this library.
Sx1278 is 3.3v.
If you ever put it into 5v, the chip sx1278 may be already damaged.

Whats (name) the code on library, I'll download it.

Yeah, I used 3.3v , because on lora board written using 3.3v.

Hi, I have the same problem. But the SPI pins run at 5V on the Arduino Mega. Through this, 5V is entering the ra-02!

from arduino-lora.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.