nrf24l01+ between arduino and raspberry Pi in NodeJS

Viewed 1728

I'm trying to retrieve my sensor data from my Raspberry Pi using nrf24l01+ network receiver.

I'm sending it from an Arduino nano board. Here is the setting of my Arduino:

STATUS       = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1     = 0xcccccc3ccc 0xcccccc3c3c
RX_ADDR_P2-5     = 0x33 0xce 0x3e 0xe3
TX_ADDR      = 0xcccccccc3c
RX_PW_P0-6   = 0x20 0x20 0x20 0x20 0x20 0x20
EN_AA        = 0x3e
EN_RXADDR    = 0x3f
RF_CH        = 0x5a
RF_SETUP     = 0x07
CONFIG       = 0x0f
DYNPD/FEATURE    = 0x3f 0x04
Data Rate    = 1MBPS
Model        = nRF24L01+
CRC Length   = 16 bits
PA Power     = PA_MAX

My Raspberry Pi is plugged with nrf24l01+ through GPIO. I made sure the connection is OK by using the C++ example given on https://github.com/TMRh20/RF24:

RF24 radio(RPI_BPLUS_GPIO_J8_15,RPI_BPLUS_GPIO_J8_24, BCM2835_SPI_SPEED_8MHZ);

The data is OK. Now i want to use a nodeJS program to get this data. I'm using this library: https://github.com/natevw/node-nrf

The code is very simple, but somehow is not working (console is silent):

var spiDev = "/dev/spidev0.0";
var cePin = 15; //RPI_BPLUS_GPIO_J8_15
var irqPin = null;
var channel = 0x5a; //90

var radio = require('nrf').connect(spiDev, cePin, irqPin);

radio
    .channel(channel)
    .dataRate('1Mbps')
    .crcBytes(1)
//  .autoRetransmit({count:15, delay:4000})
    ;

radio.begin(function () {
    var rx = radio.openPipe('rx', 0xcccccccc3c);
    rx.pipe(process.stdout);
});

I'm wondering what I'm doing wrong. Hardware is OK and the setting seems pretty good, what do you think?

Thanks

1 Answers
Related