Comments (14)
Thank you so much @ristomatti ! My eyes are opened. I can't believe I was trying to get signals from a piece of plastic.
from node-nrf24.
I did not test on b+. But in principle it should work. By the trace you show seems is a wiring problem. Have you test a plain cpp version?
from node-nrf24.
I've checked the pins again: Here's my setup.
I haven't tested the cpp version. The docs are terrible. What do you recommend?
Thank you, and sorry if this is irritating.
from node-nrf24.
OMG... am I missing this: https://www.amazon.com/gp/product/B01IK78PQA ?
and the jumpers need to goto the female pins on the chip?
from node-nrf24.
@bjrenfrow Yes, unfortunately you only have the adapter that is required if NRF24L01 modules are used with microcontrollers that use 5V logic (like Arduino Uno or Arduino Mega). The modules expect 3.3V logic signals, that a Raspberry Pi uses. So you won't need or should use the adapter with a Raspberry Pi.
There are a few different types of NRF24L01 radios available. There are the ones you linked, then smaller ones with a lower range that are probably the most common which look like this:
There's also a shielded version of the longer range one you linked that looks like this (antenna is not shown in the picture but it typically comes with a similar longer antenna):
If you need the modules to communicate over longer distances, I would recommend the above one. It is the most expensive one though but from my experience it is much easier to work with. The unshielded modules are more sensitive to external factors like other nearby components or electric devices.
from node-nrf24.
Just one comment, if you are going to use the power adaptor connect VIN with 5V of your PI. The power power adaptor will regulate the voltage down 3.3V.
Without the power adaptor using the 3.3V power of the PI would work but possibly you need to solder some cap on the radio as the power supply of the PI have current and line regulation limitations. Using PA/LNA radios (longer range as you show) will not work stable as this radios require considerable more power.
If you are looking for more permanent solution check the phat I designed. It solves not only wiring but also power issues with dedicated beefe capacitor. Also supports dual radio configuration. Check it here: https://github.com/ludiazv/borosRF2
from node-nrf24.
This is slick. I most likely will want to start producing lots of these, and having a hat I can just plugin will be essential to me. Thanks @ludiazv!
from node-nrf24.
@bjrenfrow I still have some boards for a small batch i made. If you are insterested let me know.
Regards,
from node-nrf24.
Please let me know if I'm abusing this issue channel. I'm stuck on one more thing, if I can get this to work I definitely will be purchasing some units.
I got the arduino to send to the raspberry pi! I want to send something back to the arduino now. The following happens with this code:
PI:
const lib = require('nrf24');
const radio = new lib.nRF24(22, 0);
radio.begin(true);
radio.config({
PALevel: lib.RF24_PA_MAX,
DataRate: lib.RF24_1MBPS,
Channel: 76,
CRCLength: lib.RF24_CRC_16,
}, true);
console.log("Radio connected:" + radio.present());
radio.useWritePipe("0x0F0F0F0F0F");
setInterval(() => {
radio.write(
Buffer.from('Hello'),
(...args) => console.log(args)
);
}, 5000);
Arduino:
//Send.ino
#include<SPI.h>
#include<RF24.h>
// ce, csn pins
RF24 radio(9, 10);
const uint64_t initialReadingPipe = 0x0F0F0F0F0FLL;
void setup(void){
Serial.begin(115200);
delay(1000);
radio.begin();
radio.setCRCLength(RF24_CRC_16);
radio.setPALevel(RF24_PA_MAX);
radio.setChannel(76);
radio.setDataRate(RF24_1MBPS);
radio.setAutoAck(true);
radio.openReadingPipe(1, initialReadingPipe);
radio.powerUp();
radio.startListening();
Serial.println("Start...");
}
void loop(void){
if (radio.available()){
char text[32] = "";
radio.read(&text, sizeof(text));
Serial.println(text);
}
}
The PI outputs:
===========================
Radio details after config:
===========================
STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1 = 0xe7e7e7e7e7 0xc2c2c2c2c2
RX_ADDR_P2-5 = 0xc3 0xc4 0xc5 0xc6
TX_ADDR = 0xe7e7e7e7e7
RX_PW_P0-6 = 0x00 0x00 0x00 0x00 0x00 0x00
EN_AA = 0x3f
EN_RXADDR = 0x03
RF_CH = 0x4c
RF_SETUP = 0x07
CONFIG = 0x7e
DYNPD/FEATURE = 0x00 0x00
Data Rate = 1MBPS
Model = nRF24L01+
CRC Length = 16 bits
PA Power = PA_MAX
IRQ gpio (negative if disabled):-1(0)
Config internals:
check the values as incorrect values fallback to default values.
PALevel:3 DataRate:0 Channel:76 CRCLength:2 Retries:(5+1*250us,15 attempts) PayloadSize:32 AddressWidth:5 AutoAck:1 TxDelay:250 PollBaseTime:35000
===========================
Radio connected:true
[ false, 0, 0, 1, 32, false ]
[ false, 0, 0, 1, 32, false ]
[ false, 0, 0, 1, 32, false ]
[ false, 0, 0, 1, 32, false ]
The Arduino only outputs
start...
Because it sent to the pi, I'm sure everything is wired correctly. Any ideas why I cannot send back to the arduino. Thanks!
from node-nrf24.
@ludiazv how do you mount the borosRF2 onto the pi, it looks like its sitting on top of a special case. Do you have any recommendations?
from node-nrf24.
Hi @bjrenfrow ,
Your code is ok (assuming that you are using current master branch) I tested on my rig and works fine. The only difference is that I use a different pinout for arduinio (7,8 pins for ce & cs) and gpio 24 for the Pi. I used a nano & rpi3b (not b+). So I don't think is sw related.
As for your description, I understood that you can send frames from arduino -> Pi but not from Pi -> arduino. TX problems are usually related with insufficient/poor filtered power to the radio. Specially on PA/LNA radios. They require a lot power to transmit for a brief period. Are your correctly rcv ACKs from the Pi when sending from the ardunino->pi?
Try some of this:
On the hw side:
-
Check again the wiring and try to make shorter the wires specially VCC & GND.
-
Put a big Cap, say 100uf-1000uF close to VCC&GND of the radio:
-
Use other PSU for the radio and do not power the radio from 3.3V rail of the PI (use the adaptors with 5V power).
-
Interchange the radio modules or test with new ones. I think is better to start with cheap clones with on-board antenna.
-
To be sure that your modules are ok. test with 2 arduinos using the gettingstarted example of the library.
on SW side:
- reduce TX power to PA_MIN when testing. if they are close it wont be a problem.
- Reduce payload size.
- Reduce transfer speed to 250KBPS
As regards, the case you need a case with high clearance, or use stackable board based on stand offs and acrylic covers. This case you can adapt the height of the box to your needs. I personally don't use any commercial solution as I normally print a specific case that will fit to the project needs.
One caveat: AVOID metal cases they block radio signals. if metal case is a must use a external antennas.
Regards,
from node-nrf24.
You are a genus! The fix was to #3. You should write a book. I have two way communication now!
If I want to just plug in your module into my bare pi, will these settings work:
from node-nrf24.
In the second box chose "soldered pin headers".
Regards,
from node-nrf24.
Just ordered 5. I will be ordering a lot more if our project is successful. Thanks again for your help.
from node-nrf24.
Related Issues (20)
- Traing to llisten to slave, or prhebs make some radio scanner HOT 7
- Does not work with node 12 HOT 7
- test_simple.js Syntax error HOT 1
- [Question] installation of NRF24 libs HOT 8
- Most settings not being displayed correctly HOT 4
- NPM Install fails HOT 4
- Hardware Not Found HOT 2
- Advanced features - Dyn Payloads + Ack payload HOT 3
- Reading strings and converting C++ structs HOT 2
- build with RPi driver : radio not working or in use HOT 12
- Channel 0 doesn't work HOT 2
- Changing Channel After Initialization HOT 1
- GettingStarted.js cannot read more than the first 4 bytes on the buffer HOT 2
- ASUS Tinker board CE HOT 2
- Error writing to pipe depending on scope HOT 2
- Writing fail on nRF24L01+ with raspberry pi zero W and arduino pro mini HOT 2
- Installation failure on lastest nodejs version (v16) HOT 1
- Sending fails, wrong pin? HOT 1
- Installation falilure HOT 3
- usb adapter HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-nrf24.