LowPowerLab Forum

Hardware support => Moteino => Topic started by: K1JOS on June 12, 2014, 01:46:28 PM

Title: Does RFM69HW Require minimal delay between transmissions?
Post by: K1JOS on June 12, 2014, 01:46:28 PM
I am new to Moteino and RFM69HW (433 Mhz) but have a project for a remote magnetometer sensor to report antenna direction compass heading updates while the antenna mast (non-magnetic) rotates the antenna.  The HF radio antennaa operates between 1.8-30 Mhz at power up to 1500 watts.  So first thing I wanted to check out at the site of the antenna was how the Moteino RFM69 signal looked on a spectrum analyzer.  I wrote a simple sketch to transmit a 60 byte packet continuously with some delay.  My spectrum analyzer is capable of seeing such short bursts but I am only picking up what appears to be random clusters of transmissions at 433Mhz with significant periods of no transmission.  Is there a minimal delay needed between sending packets, is the RFM69HW capable of short periods of sustained transmission?  I have the Moteino powered from a separate precision 3.3vdc regulated supply and not the USB port.

Here is the short code I am using:

#include <RFM69.h>
#include <SPI.h>

#define NODEID        1    //unique for each node on same network
#define NETWORKID     100  //the same on all nodes that talk to each other
#define FREQUENCY     RF69_433MHZ
#define IS_RFM69HW    //uncomment only for RFM69HW! Leave out if you have RFM69W!
#define LED           9  // Moteinos have LEDs on D9
#define SERIAL_BAUD   115200

RFM69 radio;

void setup() {
  Serial.begin(SERIAL_BAUD);
  delay(10);
  radio.initialize(FREQUENCY,NODEID,NETWORKID);
  radio.setHighPower();
  delay (10);
}

int theNodeID = 2;
void loop()
{
  // just send a large packet continuously//
  radio.send(theNodeID, "<999999999999999999999999999999999999999999999999999999999999>", 0);  //
  Serial.println("Sent");
  delay(100);
}

Title: Re: Does RFM69HW Require minimal delay between transmissions?
Post by: luisr320 on June 12, 2014, 03:35:33 PM
Have you tried radio.sendWithRetry(DESTINATION_NODE, "12345678", 8, NUM_RETRIES, ACK_TIME)?
The examples sketches have 30 ms of WAITing time after a transmission to allow the transceiver to switch back to receiving mode.

Why don,t you just measure the angle rotation of the mast itself? You could attach an encoder to the mast and count the clicks via pin 3 interrupt...
Title: Re: Does RFM69HW Require minimal delay between transmissions?
Post by: K1JOS on June 12, 2014, 04:18:29 PM
thanks, I need to also control the rotor motor remotely as well.  The mechanical aspects of mating an optical encoder to the rotor or mast to give me 1-2 degrees of heading precision seemed more complex that the magnetometer approach.  In fact I have the magnetometer code all worked out including data smoothing and error checking, etc.  I only need a simple method to pass fixed length data strings  from the sensor to the main control in real time and motor control commands from main control to remote.  The gateway/main controller will ahve a graphic compass touchscreen and after a specific heading is selected it has to turn on the motor (and direction selection) until the desired compass heading is reached.  The motor revolution is pretty slow (one 360 in about 10-15 sec) so the updating rate should be pretty manageable.  I need to understand how I can program the Moteino not to do timed received but I need an interrupt method so when the sensor heading is changing the remote sends an ongoing stream of heading values while checking if the main controller says to shut of the motor (it has a clutch to prevent hysterisis but i need to shut off about 2-3 degrees before target heading is reached).

I am now learning more using the Struct_send and receiver examples and will ask mroe questions here

thanks again !!
Title: Re: Does RFM69HW Require minimal delay between transmissions?
Post by: Felix on June 12, 2014, 04:19:50 PM
There is no minimum delay between transmissions. From what I recall from me analyzing the RF itself, it takes roughly 10-15ms to send a message that is 60bytes or so. Then it takes around 3-6ms to send an ACK back (empty message).
Title: Re: Does RFM69HW Require minimal delay between transmissions?
Post by: K1JOS on June 12, 2014, 09:08:55 PM
Thanks Felix.  I have the Struct_send and Struct_receive example sketches working fine with my magnetometer code overhead. 

what is the purpose of the 'TRANSMITPERIOD' code and the Data.uptime if there is no minimum delay?  Why would you need to shorten or lengthen "currPeriod" based on the TRANSMITPERIOD value?

In my application - 99% of the time there is no need for exchange of data between the Moteinos but as I explained earlier when i need the data i need it in as close to real time while my antenna mast rotates through 360 degrees over about a period of 10 seconds. 

Few questions:
1) Do I have to worry about overheating the RFM69HW for these 10-15 seconds of almost 100% duty cycle?
2) for my 1:1 transceiver needs should I stick to the Struct_send/receive or is there an advantage for me to set this up as a gateway and node?

thanks again.


Title: Re: Does RFM69HW Require minimal delay between transmissions?
Post by: Felix on June 12, 2014, 11:01:24 PM
Transmit period is strictly the interval between transmits in those example sketches. 300ms typically
I don't think you will overheat it, doesn't sound like you are very intense. 10s is long time for what you need to do. If you're worried just decrease power or use the Ws, you can also read the die temp and adjust the output power accordingly, but really .. I would not worry given your requirements.
For the 1:1 transmission you can just use a struct if it's easier to work with it. Whatever works really ... if the number it exceeds 255 then declare an int instead of a byte.