Is it possible to read a Serial input from LoRa, using two emulated SoftwareSerial ports?

I need to read a value that will be sent by LoRa from a secondary node to the primary.

The problem is that, I can't be listening all the time to the LoRa port because I need to listen to GPS and Modem data. So I need to setup an interrupt , so that when the data comes I'll be able to read it.
I don't know for sure if some data comes to the emulated serial port, and you don't tell with Lora.listen(); to pay attention to the port, what happens with the contents? Are they still there?

Thank you for your help.

Can you draw a simple block diagram showing how you want things to be connected?

Very unclear how you have your LoRa device connected or what an 'emulated' serial port is.

However its easy enough to set up a LoRa device to put the DIO0 pin low when a packet arrives, you can either poll the pin or set up for an interrupt.

If you're using SoftwareSerial then you can only listen to one port at a time. You will have no way of knowing when the LoRa is sending data if you're not listening unless it is giving you a signal on another pin. If you're not listening when the data comes then it will be lost.

There are boards with multiple serial UARTs that could listen to all of those things at once. The Mega has 4 serial ports.

Thank you, this was what I wasn't sure if it worked that way. I thought that maybe it worked like a circular buffer, and the data could be there. So I'm planning to set up an interrupt, something similar to what i used with the flasher constructor in order to blink the led, but this time to check if there's new data, which I don't know for sure if it would work because maybe it takes lots of resources,in order to avoid losing data I might have to check at a very fast rate.
Your comment on getting a signal on another pin might work also, if I understood, I can connect in parallel to the virtual SofwareSerial RX pin another IntPin and check for that pin as a hardware interrupt for instance on a positive rising edge ?

The value from the other side (the one that comes from the secondary node - LoRa) will be sent at a interval of 1 minute.

Two LoRa, DRF1276DM modules.
One sends data at a 1 minute interval with a voltage value, a float.
The other node gets that value, but I can't poll all the time because I've the main code running, and I can't halt the process, short explanation, I'm sending lots of AT commands and I can't stop in the middle to check if there's something on the SofwareSerial virtual Rx com port.

Sure

I'm trying to avoid using the only HW interrupt that I have, because it's shared with the programming USB port.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.