I suggest you work out a simple “link budget”.
Assuming you’re using 2.4GHz.
Analyze one use case: point A to point B. Then other use cases.
line of sight range max = ?
we can calculate
Point A transmitter power: say, 1mW (Xbee). XBee Pro is higher
transmitter’s antenna gain or loss. Cheap board antenna: 0dBi
Radiated power = transmitter power + antenna gain (loss) = 0dBm
Point B’s antenna gain, say, is a 5dBi omni
Line of sight Path length:
20 * Log10 (frequency in MHz) + 20 * Log10 (Distance in Miles) + 36.6
plug in, say, 1/5th mile. You’ll get something like 90dB of path loss
So for ideal line of sight we have
0dBm radiated power minus 90dB of path loss + 5dBi antenna gain = -85dBm received signal strength (RSSI).
Compare that to the receiver sensitivity specs. This comes mostly from the nature of IEEE 802.15.4 (2MHz, O-QPSK). So -85dBm RSSI is good.
Now throw in some impairments:
margin for fading: say, 6dB
RF blockages due to semi-line-of-sight (you have to measure this), but say, 10dB.
Impairments then = 16dB (more propagation loss)
So our -85RSSI goes to -101dBm. That’s too weak.
So to get back into the -85 or so RSSI, we need 16dBi of antenna gain. This can come from one at Point A or some at Point A and some at Point B, totaling 16dBi.
How to get antenna gain? Directionality.
Either horizontal, like a TV antenna or Yagi does. Like a flashlight beam.
Or vertical directionality, like a doughnut pattern.
The choice depends on if things move, or if Point A has to communicate with many point Bs around the compass.
For horizontal, you can get about 12-14dBi gain with a flat panel patch antenna, about 6 inches square. About 30 degree beamwidth.
For vertical directionality, the so-called omni antennas go from 5dBi(about 8" antenna) to 14dBi - this is a 4 ft. antenna at 2.4GHz. About 7 degree vertical beamwidth (the doughnut).
Or both H and V directionality, as in a parabolic dish (hard to aim).
Hope this helps. If you plan and do the math, it will work first try, unless you have path RF obstructions that you didn’t know how to put into the math. Indoors, each drywall wall costs about 3dB. Floors vary widely, concrete, wood, steel pan, etc. You can measure this if you dare.
One can never have too much antenna gain, but it costs $, and the FCC limits max radiated power in the US, as do other countries.
Lots of antennas for sale on the web. Any 2.4GHz antenna, WiFi or not.
Beware though of radio to antenna coax loss. Keep that low by using short and/or low loss coax. Or put it into the link budget numbers and offset it with something else in the budget.