Open Jono72 opened 3 years ago
I'm not Sandeep =))
My advice is to use the exact example codes to run for a while to see if they stop working first.
Hi Ok thanks (sorry bout the name thing :)
Sorry I wasn't clear, When I said DIO2 I ment the input to the Pin 2 on the Mega, I believe that comes from DIO0 on the RFM module (RxDone), If I pull that pin Low when its locked up, the Mega sends once, when I reset all is good. the shield used the RF96 chip, I plan to use the HOPE RF module in my project (100mw), is the library compliant with that module?
But thanks I will try your advice and see what happens.
Regards
John
I am helping him. No problem on that.
HopeRF RFM95/96... modules will work.
Yes, try the examples (sender and receiveCallback) first to see if the issue happens.
Then can try to send async by endPacket(true) to ensure no blocking sending. Dont receive so fast btw. Then view similar issues here.
I mainly use esp32 boards. And so far, they can send and receive for months.
Ok try and see.
Hi IoTThinks
Will do thanks for the advice :)
[ ]
[ ]
Related and solved issue: https://github.com/sandeepmistry/arduino-LoRa/issues/363
For reference: https://github.com/sandeepmistry/arduino-LoRa/issues/307
Hi sanddeepmistry,
Not sure if you can help, I have read issues that my problem may be related to, I am using library for a simple MQTT Lora node (that is going to be used in a private Lora network), I am sending data via MQTT to my node-red hub running on my pi via a dragino gateway, all seems to be fine and data is begin sent and decoded correctly, I also have a heartbeat that is sending back to the node every 30Secs, the idea being that if no heartbeat is detected an LED indicates loss of comms.
The Lora send is called in the main loop and just runs, every thing seems to be ok, but for some reason it just stops, sending and receiving, if I pull DIO2 down it sends, so I know its not my code that is stopping it, rather than the Lora module just stops sending out on DIO2 pin. Once I reset the whole thing resumes and runs from anything 2Hrs to 25Hrs, but always just seems to lockup. I have tried external 3.3v power supply to ensure that the Lora module has enough power to send, I'm just using Lora module and Atmel Mega board for prototyping atm as I design and build my own boards once everything is working.
My code is rather large to put up here as it has multiple files, however I do not use any blocking code or delays and the actual program still runs (just no send or receive): below is a snippet from the Lora send and receive part, I cant see why the Lora module just stops.
include
include "Global.h"
define RE(signal, state) (state=(state<<1)|(signal&1)&3)==1
float tem,hum; char tem_1[8]={"\0"},tem_2[8]={"\0"},tem_3[8]={"\0"},tem_4[8]={"\0"};
uint8_t datasend1[40]; uint8_t datasend2[36]; unsigned int count = 1; unsigned long new_time,old_time=0; char command [64]; char topicIn [64]; static int RiseDI;
//Called once in setup void loraSetup() {
}
void loraformat() {
} //Lora send called in the main loop void loraSenddata() {
}
void onReceive(int packetSize) {
char msg [32];
Serial.print("Received packet : ");
// read packet for (int i = 0; i < packetSize && i < 31; i++) { msg[i] = LoRa.read(); msg[i + 1] = '\0'; }
Serial.println(msg);
//Relay 1 Enable Command char DOstring[32]; sprintf(DOstring,"%d/%s" ,NodeID, "DO1_ON");
if (strcmp(msg, DOstring) == 0) { DigitalIO [4] = HIGH; Serial.println ("Digital Output 1 ON");
}
sprintf(DOstring,"%d/%s" ,NodeID, "DO1_OFF");
if (strcmp(msg, DOstring) == 0) { DigitalIO [4] = LOW; Serial.println ("Digital Output 1 OFF"); } //Relay 3 Pulse On Command
if (strcmp(msg, DOstring) == 0) { (DigitalIO [6]) = true;
}
// Heartbeat Rcv String sprintf(DOstring,"%d/%s" ,NodeID, "heart");
if (strcmp(msg, DOstring) ==0) { Serial.println ("Heart Rcvd"); heart = 1; Serial.println(heart);
}
}