MySensors Library & Examples  2.3.2-62-ge298769
Macros
+ Collaboration diagram for RF24:

Detailed Description

These options are specific to the RF24 family of wireless transport modules.

The following chips are supported by this driver:

Vendor Chip
Nordic Semiconductor nRF24L01
nRF24L01+
Beken Corporation BK2401
BK2421
BK2491
Hope Microelectronics RFM70
RFM73
Panchip Microelectronics XN297
Silicon Labs(?) SI24R1

Macros

#define MY_RADIO_NRF24
 Define this to use a RF24-based radio transport for sensor network communication. More...
 
#define MY_RADIO_RF24
 Define this to use a RF24-based radio transport for sensor network communication.
 
#define MY_RF24_ENABLE_ENCRYPTION
 Define this to enable software based AES encryption. More...
 
#define MY_DEBUG_VERBOSE_RF24
 Define this for verbose debug prints related to the RF24 driver.
 
#define MY_RF24_SPI_SPEED   (2*1000000ul)
 Define this if you need to run the SPI clock at a different frequency than the default. More...
 
#define MY_RF24_CE_PIN   (DEFAULT_RF24_CE_PIN)
 Define this to change the chip enable pin from the default.
 
#define MY_RF24_CS_PIN   (DEFAULT_RF24_CS_PIN)
 Define this to change the chip select pin from the default.
 
#define MY_RF24_IRQ_PIN
 Define this to use the IRQ pin of the RF24 module (optional).
 
#define MY_RF24_POWER_PIN
 Define this to use the RF24 power pin (optional).
 
#define MY_RX_MESSAGE_BUFFER_FEATURE
 This enables the receiving buffer feature. More...
 
#define MY_RX_MESSAGE_BUFFER_SIZE
 Define this to change the incoming message buffer size from the default. More...
 
#define MY_RF24_PA_LEVEL   (RF24_PA_HIGH)
 Default RF24 PA level. Override in sketch if needed. More...
 
#define MY_RF24_CHANNEL   (76)
 RF channel for the sensor net, 0-125. More...
 
#define MY_RF24_DATARATE   (RF24_250KBPS)
 RF24 data rate. More...
 
#define MY_RF24_BASE_RADIO_ID   0x00,0xFC,0xE1,0xA8,0xA8
 RF24 radio network identifier. More...
 
#define MY_RF24_ADDR_WIDTH   (5)
 RF24 base address width.
 

Macro Definition Documentation

◆ MY_RADIO_NRF24

#define MY_RADIO_NRF24

Define this to use a RF24-based radio transport for sensor network communication.

Deprecated:
This flag is deprecated and replaced by MY_RADIO_RF24

Definition at line 2737 of file MyConfig.h.

◆ MY_RF24_BASE_RADIO_ID

#define MY_RF24_BASE_RADIO_ID   0x00,0xFC,0xE1,0xA8,0xA8

RF24 radio network identifier.

This acts as base value for sensor nodeId addresses. Change this (or channel) if you have more than one sensor network.

Definition at line 495 of file MyConfig.h.

◆ MY_RF24_CHANNEL

#define MY_RF24_CHANNEL   (76)

RF channel for the sensor net, 0-125.

Frequencies: 2400 Mhz - 2525 Mhz

Channels: 126

See also
https://www.nordicsemi.com/eng/nordic/download_resource/8765/2/42877161/2726
  • 0 => 2400 Mhz (RF24 channel 1)
  • 1 => 2401 Mhz (RF24 channel 2)
  • 76 => 2476 Mhz (RF24 channel 77)
  • 83 => 2483 Mhz (RF24 channel 84)
  • 124 => 2524 Mhz (RF24 channel 125)
  • 125 => 2525 Mhz (RF24 channel 126)

In some countries there might be limitations, in Germany for example only the range 2400,0 - 2483,5 Mhz is allowed.

See also
https://www.bundesnetzagentur.de/SharedDocs/Downloads/DE/Sachgebiete/Telekommunikation/Unternehmen_Institutionen/Frequenzen/Allgemeinzuteilungen/MobilfunkDectWlanCBFunk/2013_10_WLAN_2,4GHz_pdf.pdf

Definition at line 469 of file MyConfig.h.

◆ MY_RF24_DATARATE

#define MY_RF24_DATARATE   (RF24_250KBPS)

RF24 data rate.

  • RF24_250KBPS for 250kbs
  • RF24_1MBPS for 1Mbps
  • RF24_2MBPS for 2Mbps.
Note
nRF24L01, BK2401, BK2421, BK2491 and XN297 does not support RF24_250KBPS
BK2401 does not support RF24_2MBPS

Definition at line 484 of file MyConfig.h.

◆ MY_RF24_ENABLE_ENCRYPTION

#define MY_RF24_ENABLE_ENCRYPTION

Define this to enable software based AES encryption.

All nodes and gateway must have this enabled, and all must be personalized with the same AES key.

See also
personalization
Warning
This driver always sets the initialization vector to 0 so encryption is weak.

Definition at line 2741 of file MyConfig.h.

◆ MY_RF24_PA_LEVEL

#define MY_RF24_PA_LEVEL   (RF24_PA_HIGH)

Default RF24 PA level. Override in sketch if needed.

  • RF24_PA_MIN = -18dBm
  • RF24_PA_LOW = -12dBm
  • RF24_PA_HIGH = -6dBm
  • RF24_PA_MAX = 0dBm

Definition at line 445 of file MyConfig.h.

◆ MY_RF24_SPI_SPEED

#define MY_RF24_SPI_SPEED   (2*1000000ul)

Define this if you need to run the SPI clock at a different frequency than the default.

Default nRF24L01+ SPI speed, 2MHz should be safe for nRF24L01+ clones.

Definition at line 379 of file MyConfig.h.

◆ MY_RX_MESSAGE_BUFFER_FEATURE

#define MY_RX_MESSAGE_BUFFER_FEATURE

This enables the receiving buffer feature.

This feature is currently not supported for anything but RF24. Require MY_RF24_IRQ_PIN to be set.

Note: Not supported on ESP8266, ESP32, STM32, nRF5 and sketches that use SoftSPI. See below issue for details https://github.com/mysensors/MySensors/issues/1128

Definition at line 2742 of file MyConfig.h.

◆ MY_RX_MESSAGE_BUFFER_SIZE

#define MY_RX_MESSAGE_BUFFER_SIZE

Define this to change the incoming message buffer size from the default.

Require MY_RX_MESSAGE_BUFFER_FEATURE to be set.

Definition at line 2743 of file MyConfig.h.