Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node-nrf silent #52

Open
frinux opened this issue Mar 3, 2016 · 2 comments
Open

node-nrf silent #52

frinux opened this issue Mar 3, 2016 · 2 comments

Comments

@frinux
Copy link

frinux commented Mar 3, 2016

Hi,
I'm trying to set node-nrf on my RaspPi B+, and I can't get it work. The hardware is OK, I used the C++ example code to check:

pi@raspberrypi ~/nrf24l01 $ sudo ./rx
pi@raspberrypi ~/nrf24l01 $ sudo ./rx
================ SPI Configuration ================
CSN Pin      = CE0 (PI Hardware Driven)
CE Pin       = Custom GPIO22
Clock Speed  = 8 Mhz
================ NRF Configuration ================
STATUS       = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1     = 0xccccccccc3 0xcccccccc3c
RX_ADDR_P2-5     = 0x33 0xce 0x3e 0xe3
TX_ADDR      = 0xe7e7e7e7e7
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
Received payload at 2130902 : 18.400000°C, 62.799999 percent

And then I clean with

pi@raspberrypi ~/nrf24l01_nodejs $ sudo modprobe -r spi_bcm2835
pi@raspberrypi ~/nrf24l01_nodejs $ sudo modprobe spi_bcm2835
(or reboot)

My node code is very simple:


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(2)
//  .autoRetransmit({count:15, delay:4000})
    ;

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

But the console is always silent...

What am I doing wrong?

Thanks

@maximov-ru
Copy link

you need something as:

var tx = radio.openPipe('tx', 0xCCCCCCCCC3,{size: 'auto',autoAck:false});
tx.on('ready', function () {
  tx.write(process.stdout);
});

@frinux
Copy link
Author

frinux commented Mar 13, 2016

@maximov-ru why tx? It is normally used to transmit data, and all I want is receive data.
However, I tried but console is always silent:

var tx = radio.openPipe('tx', 0xCCCCCCCCC3);
tx.pipe(process.stdou
```t);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants