Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/nRF24/RF24
Browse files Browse the repository at this point in the history
  • Loading branch information
TMRh20 committed Feb 27, 2021
2 parents 11298d5 + 124892b commit 2af44fc
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
config-options:
- "--soc=BCM2835 --driver=RPi"
- "--soc=BCM2836 --driver=RPi"
- "--soc=BCM2835 --driver=wiringPi --extra-cflags=-I/usr/local/include"
# - "--soc=BCM2835 --driver=wiringPi --extra-cflags=-I/usr/local/include"
- "--driver=SPIDEV"

steps:
Expand All @@ -28,7 +28,7 @@ jobs:
- name: provide WiringPi
if: ${{ matrix.config-options == '--soc=BCM2835 --driver=wiringPi --extra-cflags=-I/usr/local/include' }}
run: |
git clone https://github.com/CoRfr/WiringPi
git clone https://github.com/WiringPi/WiringPi
cd WiringPi/wiringPi
CC="arm-linux-gnueabihf-gcc -marm -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard" V=1 make -j5
sudo make install
Expand Down
16 changes: 16 additions & 0 deletions COMMON_ISSUES.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,19 @@ Example issues: [#264](https://github.com/nRF24/RF24/issues/264)

For reliability, please use Electrolytic or Tantalum capacitors. Ceramic
capacitors may not be good enough (depending on the manufacturing source).

### my PA/LNA module fails to transmit
You may find variants of the nRF24L01 transceiver that are marketed as “nRF24L01+PA+LNA”. These modules are distinct in the fact that they come with a detachable (SMA-type) antenna. They employ seperate RFX24C01 IC with the antenna for enhanced Power Amplification (PA) and Low Noise Amplification (LNA) features. While they boast greater range with the same functionality, they are subject to a couple lesser known (and lesser advertised) drawbacks:

1. Stronger power source. Below is a chart of advertised current requirements that many MCU boards’ 3V regulators may not be able to provide (after supplying power to internal components).
| Specification | Value |
|:-------------:|:-----:|
| Emission mode current(peak) | 115 mA |
| Receive Mode current(peak) | 45 mA |
| Power-down mode current | 4.2 µA |

2. Needs shielding from electromagnetic interference. Shielding usually works best when it has a path to ground (GND pin), but this connection to the GND pin is not required. It is important that the sheilding does not touch any current carrying parts.
- Professionals tend to use a faraday cage/mesh to implement electromagnetic shielding, but it can be pricey for this scenario.
- A quick do-it-yourself solution (as proof-of-concept) would be to wrap the PA/LNA module with electrical tape and then wrap foil around the electrical tape (for shielding) while being very careful to not let the foil touch any current carrying parts (like the GPIO pins, the antenna mount, and the soldier joints for the antenna mount). <br>
See [![ghetto_shielding_1.png](https://github.com/nRF24/RF24/blob/master/images/ghetto_sheilding_1.png)](https://github.com/nRF24/RF24/blob/master/images/ghetto_sheilding_1.png)
and [![ghetto_shielding_2.png](https://github.com/nRF24/RF24/blob/master/images/ghetto_sheilding_2.png)](https://github.com/nRF24/RF24/blob/master/images/ghetto_sheilding_2.png)
8 changes: 4 additions & 4 deletions RF24.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ void RF24::print_address_register(const char* name, uint8_t reg, uint8_t qty)
printf_P(PSTR("\r\n"));
}

#endif
#endif // !defined(MINIMAL)

/****************************************************************************/

Expand Down Expand Up @@ -754,7 +754,7 @@ bool RF24::begin(void)
write_register(DYNPD, 0); // disable dynamic payloads by default (for all pipes)
dynamic_payloads_enabled = false;
write_register(EN_AA, 0x3F); // enable auto-ack on all pipes
write_register(EN_RXADDR, 0); // close all RX pipes
write_register(EN_RXADDR, 3); // only open RX pipes 0 & 1
setPayloadSize(32); // set static payload size to 32 (max) bytes by default
setAddressWidth(5); // set default address length to (max) 5 bytes

Expand Down Expand Up @@ -1354,8 +1354,8 @@ void RF24::enableAckPayload(void)

IF_SERIAL_DEBUG(printf("FEATURE=%i\r\n", read_register(FEATURE)));

// Enable dynamic payload on pipes 0
write_register(DYNPD, read_register(DYNPD) | _BV(DPL_P0));
// Enable dynamic payload on pipes 0 & 1
write_register(DYNPD, read_register(DYNPD) | _BV(DPL_P1) | _BV(DPL_P0));
dynamic_payloads_enabled = true;
ack_payloads_enabled = true;
}
Expand Down
4 changes: 3 additions & 1 deletion RF24.h
Original file line number Diff line number Diff line change
Expand Up @@ -2174,7 +2174,7 @@ class RF24 {
* | 8 | IRQ | - | - | - | - | - | - |
*
* @li [0] https://learn.sparkfun.com/tutorials/tiny-avr-programmer-hookup-guide/attiny85-use-hints
* @li [1] http://highlowtech.org/?p=1695
* @li [1] http://highlowtech.org/?p=1695 The ATTiny2313 is unsupported due to lack of sufficient memory resources.
* @li [2] http://littlewire.github.io/
* <br><br><br>
*
Expand Down Expand Up @@ -2258,6 +2258,8 @@ class RF24 {
* http://highlowtech.org/?p=1695 <br>
* See the included rf24ping85 example for pin info and usage
*
* @warning The ATTiny2313 is unsupported due to lack of sufficient memory resources
*
* Some versions of Arduino IDE may require a patch to allow use of the full program space on ATTiny<br>
* See https://github.com/TCWORLD/ATTinyCore/tree/master/PCREL%20Patch%20for%20GCC for ATTiny patch
*
Expand Down
4 changes: 2 additions & 2 deletions examples/MulticeiverDemo/MulticeiverDemo.ino
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ uint64_t address[6] = {0x7878787878LL,
// transmit and only 1 node to receive, we will use a negative value in our
// role variable to signify this node is a receiver.
// role variable is used to control whether this node is sending or receiving
char role = 'R'; // 0-5 = TX node; any negative number = RX node
char role = 'R'; // integers 0-5 = TX node; character 'R' or integer 82 = RX node

// For this example, we'll be using a payload containing
// a node ID number and a single integer number that will be incremented
Expand Down Expand Up @@ -195,4 +195,4 @@ void setRole() {
// So, use varying delay between retry attempts and 15 (at most) retry attempts
radio.setRetries(((role * 3) % 12) + 3, 15); // maximum value is 15 for both args
}
} // setRole
} // setRole
2 changes: 1 addition & 1 deletion examples/rf24_ATTiny/rf24ping85/rf24ping85.ino
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ void loop() {
radio.stopListening(); // put in TX mode

radio.writeFast(&payload, sizeof(payload)); // load response to TX FIFO
bool report = radio.txStandBy(150); // keep retrying for 150 ms
radio.txStandBy(150); // keep retrying for 150 ms

radio.startListening(); // put back in RX mode
}
Expand Down
6 changes: 3 additions & 3 deletions examples_linux/multiceiverDemo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ int main(int argc, char** argv) {

// to use different addresses on a pair of radios, we need a variable to
// uniquely identify which address this radio will use to transmit
unsigned int nodeNumber = 'R'; // 0 uses address[0] to transmit, 1 uses address[1] to transmit
unsigned int nodeNumber = 'R'; // integers 0-5 = TX node; character 'R' or integer 82 = RX node

bool foundArgNode = false;
if (argc > 1) {
Expand All @@ -94,7 +94,7 @@ int main(int argc, char** argv) {
else if (strcmp(argv[1], "-n") == 0 || strcmp(argv[1], "--node") == 0) {
// "-n" or "--node" has been specified
foundArgNode = true;
if ((argv[2][0] - 48) < 6) {
if ((argv[2][0] - 48) < 6 && (argv[2][0] - 48) >= 0) {
nodeNumber = argv[2][0] - 48;
}
else if (argv[2][0] == 'R' || argv[2][0] == 'r') {
Expand Down Expand Up @@ -270,4 +270,4 @@ void printHelp(string progName) {
<< " -n {0,1,2,3,4,5,r,R}, --node {0,1,2,3,4,5,r,R}"
<< "\n\t\t\t0-5 specifies the identifying node ID number for the TX role."
<< "\n\t\t\t'r' or 'R' specifies the RX role." << endl;
}
}
Binary file added images/ghetto_sheilding_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ghetto_sheilding_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2af44fc

Please sign in to comment.