I'm working on my first project with Moteinos and am still pretty new to Arduino programming, so I appreciate the help!
Here's my setup:
- Two battery-powered MoteinoMEGAs that talk to one another sequentially, about 1000 feet apart (RFM69HW 915 MHz)
- One USB powered Moteino that listens to both MEGAs (RFM69HW 915 MHz)
- This setup is used only occasionally (one day out of a month?) so power savings is not a big concern.
Sequence of events:
- Mega #1:
- Broadcasts a 10 character message
- Mega #2:
- Receives broadcast, then:
- start = millis();
- transmits a single character to Mega #1 via sendWithRetry
- Receives acknowledgement
- finish = millis();
- latency = finish - start
- Mega #1
- Broadcasts a 20 character message
- Mega #2
- Broadcasts the latency value
(Note that I am using encryption.)
Question #1:
If I cut the calculated latency value in half, is this an accurate measure of the time it takes the message to get from Mega #2 to Mega #1 (including processing time in the loop)? I get a whole (not halved) latency value of 9 ms while testing on my desktop.
Question set #2:
Based on some of the questions and answers I've read in the forum, can I reduce latency by increasing transmission rate? If so, how do I increase the transmission rate?
Question set #3:
I'm using the simple wire antenna that comes with the Moteinos and have difficulty with the 1000 foot range, in the open with a clear line of sight. I'm using Auto Transmission Control as follows:
Mega #1: #define ENABLE_ATC
Mega #2: #define ENABLE_ATC plus radio.enableAutoPower(-70); in the setup.
Should I really be using ATC in this case?
Would I get more range (and more power consumption) if I don't enable ATC?
I'm not clear on how to use ATC or how to increase transmit power while using ATC. If I want to increase power, which direction should I go (e.g. -60 or -80)?
Question #4:
In examples I've seen both radio.RSSI and radio.readRSSI(). What's the difference?