Possible to sniff band before sending?

Started by martin321, June 17, 2022, 06:12:04 AM

martin321

Hi,

Im using several RFM69 communicating in pairs at a rate of 20Hz.
The user controls when a node and gateway gets connected.
All pair’s use different networkID.

I would like to make sure that no pair’s send at the exact same time.
Is it possible to get a node that’s about to start sending to confirm that there is no other node sending, ie. check if there is a signal on 433MHz.
If there is I would add a send delay to the node starting up and continue doing this until there is no signal on 433MHZ


Felix

You can read RSSI. The library already does this for you actually if you use packet mode, in RFM69::canSend().

martin321

Hi Felix, thanks for the quick reply.

I've tested both reading RSSI and .canSend().
.canSend() is always false, even when I try to read it just before I use the same radio to send and no other sender is active.

RSSI reads only 0. When reading RSSI there is a delay so that it should eventually sync with another sender.


Felix

That is quite expected unless you have another board with TX set to ON, or can catch a board transmitting a packet right during transmission, which is very hard given that it takes a few ms to transmit a packet.
Just turn on the carrier on another transmitter:

setMode(RF69_MODE_TX)

Then turn it OFF:
setMode(RF69_MODE_STANDBY)

Make sure it has an antenna. That should give you a strong RSSI reading.

martin321

Hi Felix,

so I should check RSSI when starting a node and if this reads 0 it should be safe to start transmitting?


Felix

Yes, but like I said, the library already does that for you before sending a packet.

martin321

Hi Felix,

I found that now, thanks. Set up a test with multiple senders and this caused issues.
The delay if there is another sender is 1000ms, this is to long as the sending is supposed to go at 20Hz.
I've lowered it down to 15 but there are still "crashes".

Would like to create a while loop that checks rssi and put a delay of 2ms if another node is transmitting.

When trying to read in a while loop the rssi never updates, when using .readRSSI()

Is there something else that needs to be called to the radio, so that the rssi register is updated?

Felix

Look at the library how it does this procedure, check out the send() and canSend() functions.