Flags and interrupts confusion (HELP!) #1066
Replies: 7 comments 6 replies
-
I'm not entirely sure what exactly you're trying to do, but I would suggest to take a look at the SX126x ping pong example which shows handling of both transmit and receive interrupt. As a side note there's also a LoRa APRS example, though that one only transmits. |
Beta Was this translation helpful? Give feedback.
-
hi i want to understand the correct procedure to use radiolib and setflag this is my repository https://github.com/richonguzman/LoRa_APRS_Tracker which sends and receives data over LoRa into and from APRS. the problem I'm experimenting is that when I Tx I also Rx the same packet |
Beta Was this translation helpful? Give feedback.
-
I'll try to tell you. void setFlag(void) { void setup() { viod send() { void receive() { |
Beta Was this translation helpful? Give feedback.
-
@jgromes yes I did ;) So my goal is to have the LoRa Station always listening and only on certain occasions Tx so , if I understand correctly the interrupt goes into blocking Rx when Tx and then leaving the interrupt? |
Beta Was this translation helpful? Give feedback.
-
so Setflag is always triggered by Tx and Rx .... any time Tx comes after Rx ... setflag .... any time Rx after Tx setflag.... but if it was just Rx... to Rx again won't set SetFlag again. right? |
Beta Was this translation helpful? Give feedback.
-
Maybe it will help you understand. I've simplified it a lot for clarity but the essentials are there. `SX1262 radio = new Module(RADIO_CS_PIN, RADIO_DIO1_PIN, RADIO_RST_PIN, RADIO_BUSY_PIN); // RADIO_DIO1_PIN is the interrupt PIN // Let's assume (I know) you're using an ESP32, so I'm omitting the #ifdef directive for the ICACHE part void setup() { void send(String transmitPacket) { String receive() { |
Beta Was this translation helpful? Give feedback.
-
(I read a few pages and examples and come back with this: ) The goal was to be in Rx mode and, only when/during Tx, block que Rx part (to avoid Rx the Tx packet) `#ifndef LORA_EXPLANATION_H_ #include <Arduino.h> extern String packet; SX1262 radio = new Module(RADIO_CS_PIN, RADIO_DIO1_PIN, RADIO_RST_PIN, RADIO_BUSY_PIN); namespace Radio_Utils {
} #endif` does it look right to you? |
Beta Was this translation helpful? Give feedback.
-
Hi
I'm writing LoRa APRS firmware using Radiolib.h for sx126x modules
I've been experimenting lots to only use Radiolib and all boards (and ditch old LoRa.h) but something happened on testing few SX1262 modules:
I need to Tx a packet and then get into Rx packets, nothing crazy there... but after Tx I get always same packet in Rx. The "setFlag" process/function always gets me confused as there is not info about if the setFlag is processed or not and don't know how to process the interrupt/blocking of the Tx and Rx
any help?
Beta Was this translation helpful? Give feedback.
All reactions