Troubleshooting XRFs

Troubleshooting XRFs

 

Potential issues:

  • No data getting through

  • Data gets garbled

  • XRF cuts out

  • How do I get it out of sleep mode?

  • Useful tests

 

No data getting through

Are they alive?  Pin 6 is the heart beat.  Connect a LED or volt meter and you should see it pulse once a second.

Are they too close?  If XRFs are less than a meter away they can suffer from RF input saturation.  Move them further away to see if this improves things.

Are they too far apart?  The maximum recorded distance between two XRFs is 3km, in perfect test conditions between mountain peaks with a low baud rate.  However, you will struggle to achieve this reliably in real life.  Try moving them closer together to see if this cures your problem, and if so, move them apart a bit at a time to see when their performance drops off.

Are there any solid/metal objects between them?  Whilst XRFs can transmit through solid objects, such as wall, furniture, radiators etc, it does shorten their range.  Try to avoid large, dense objects (when possible).

Are they in sleep mode? If you are using your XRF as a device, try restarting it to see if you get the started messages and a going to sleep message.  

Have you set any type of sleep mode? If so your XRF could be asleep and you are unaware of this.

 

Data gets garbled

Are they too close?  If XRFs are less than a meter away they can suffer from RF input saturation.  Move them further away to see if this improves things.

Are they too far apart?  The maximum recorded distance between two XRFs is 3km, in perfect test conditions between mountain peaks with a low baud rate.  However, you will struggle to achieve this reliably in real life.  Try moving them closer together to see if this cures your problem, and if so, move them apart a bit at a time to see when their performance drops off.

Is the baud rate correct? The default baud rate for XRFs is 9600.  This can be changed, in order to either increase throughput or extend the range, but both XRFs must be set to the same baud rate.  See the ATBD command in http://openmicros.org/index.php/articles/84-xrf-basics/114-xrf-at-command-reference for details on setting the baud rate

Is the antenna folded over the crystal? Having the antenna bent backwards directly over the crystal (the large flat silver block next to IC) can cause interference and give unusual or inconsistent results.  If your XRF is in a constrained area you may need to bend the antenna out of the way, but avoid both sharp bends and bending it directly over the crystal.

 

XRF Cuts out

Are they in sleep mode? If you are using your XRF as a device, try restarting it to see if you get the started messages and a going to sleep message.  

Is it near anything that might generate RF spikes? If items such as mains switches, relays, motors, coils, electro magnets are too close, they can all generate RF spikes which could have a negative impact on an XRF.

Is it being fed with a smooth 3.3v? The XRF is tolerant of voltages between 2 and 3.6 volts.  Exceeding the maximum voltage may cause permanent damage to your XRF.  Operating at below the minimum voltage, or running with an unregulated supply may cause the XRF to cut out or reset unpredictably.

 

How do I get it out of sleep mode?

The aP command aDDINTVLxxxP will cause an XRF in device mode (dependent on firmware) to enter cyclic sleep for a period of xxx Milliseconds (P = T), xxx Seconds (P=S), xxx Hours (P=H) or Days (P = D).  This means that the device will automatically wake up, transmit its data and then go back to sleep again for that period.  On every tenth wake it will also transmit the battery level and stay awake for 100ms.  During this 100ms you can issue the command aDDWAKE----- . which will take it out of cyclic sleep mode. However, it is virtually impossible to do this manually; instead have a micro listen for the battery status and send the WAKE command. 

The other alternative is to restart the XRF.  When it starts up it sends out five aDDSTARTED-- messages, which gives you a better opportunity to send the WAKE command manually.

The aP command aDDSLEEPxxxP will do a one-shot sleep, and the device will wake itself up after that period of time, and then stay awake.  The only way to get it out of this mode is to restart the XRF.

 

Please be aware that either sleep mode will put the whole XRF to sleep.  This includes the radio, so there is no way for it to listen to a WAKE command whilst it is in this mode.

 

Useful tests

If the XRF is connected to a suitable serial port on your PC by FTDI/Prolific/MAX232 type of device and you can send "+++", wait 1 sec, and get "OK" back, then there are more useful tests you can carry out.

 

Remote Echo (to confirm transmit and receive are working) - Leave one XRF connected to the PC, take another and connect 2 x AA batteries to 3v3 (pin1) and GND (pin10). Next, short out pins 2 & 3 - this will create a loop. Using XCM (or almost any terminal program) from your PC, connect at 90600bps 8NI. Anything you type should be sent directly back to you. This confirms that the transmit and receive on both XRFs is working.