-
-
Hi,
my NRF24 module adressed properly, sometimes works well, but sometimes goes to some strange state:
it clears all the registers to [0,0,0,0,0] himself, without any command like nrf.init from the Espruino, or other obvious reasons. It is impossible to change this state using nrf.init - adress doesn't change.
In this state module continue sending data on Air, but always saying nrf.sendString("someth") = "true", even if reciever switched off. It returns to normal state only after power off. What can be the problem with It? -
Thank you very much, Gordon, that's quite useful samle. Now i need to synchronise several periodical processes on 4 espruinos. Those processes realised on setInterval's. Could you recomend the rigth way to start the circle on all of them simultaneously, with maximum accuracy, which is principle can be realized with those wireless devices?
-
-
Hi,
I try to setup multiple connection, set the pipe2 address on master as>nrf.setRXAddr([0,0,0,0,3],2) =undefined
but it answers
>nrf.getAddr(0x0C) =[0,0,0,0,0]
and
>nrf.setRXAddr([3,0,0,0,0],2) =undefined >nrf.getAddr(0x0C) =[3,3,3,3,3]
why it set 3,3,3,3,3 instead of 0,0,0,0,3 ?
ewerithing is ok with pipe 1 at the same time...>nrf.setRXAddr([0,0,0,0,2],1) =undefined >nrf.getAddr(0x0B) =[0,0,0,0,2]
what can be wrong?
-
-
-
on my f3discovery i write:
function delays(s){var n=1000; while(n--){}} spi = new SPI(); spi.setup({sck:A5, miso:A6, mosi:A7}); var nrf = require("NRF24L01P").connect( spi, B0, B1 ); function onInit() { nrf.init([0,0,0,0,2], [0,0,0,0,1]); } onInit(); setInterval(function() { nrf.masterHandler(); }, 50); function g1on(){digitalWrite(B9,1);} function g1of(){digitalWrite(B9,0);} //function a1on(){digitalWrite(B8,1);}
it works ok, but if I try to add the last (commented) line it doesnt work -
download process doesn't finish properly. - no "=undefined" string.
process.memory() shows nothing criminal ->process.memory() ={"free":1306,"usage":414,"total":1720,"history":249,"stackEndAddress":536906916,"flash_start":134217728,"flash_binary_end":134371320,"flash_code_start":134445056,"flash_length":262144}
what can be? thanks!
-
-
-
-
Hi, Gordon, Hi all! Good day! It starts working! after
var spi = new SPI()
I've got an answer>nrf.sendCommand("1+2", function(r) { print("=="+r); }); TX not received 30 =undefined ==3
why it says "TX not recieved".... But at least it works! Thanks a lot!
Also>nrf.getAddr(0x0b) =[0,0,0,0,2]
not [2,0,0,02] as before.
Actually, you've recomended new SPI() to Daniel here: http://forum.espruino.com/conversations/244/#comment1930
but i couldn't imagine that it's the way to fix the problem. -
-
-
-
-
-
I thought also, that installed GYRO chip on the board, connected to spi1 can disturb to communication, but its CS signal is in "1" what means that it disabled. And the registers look ok, all but RX_ADDR_P1 and RX_ADDR_P0. Supply of the NRF boards are ok (3.0V took from the F3 boards). NRF's are close to each other.
-
sure, I took code from the site: slave:
SPI1.setup({sck:A5, miso:A6, mosi:A7,baud:100000}); var nrf = require("NRF24L01P").connect( SPI1, B0, B1 ); function onInit() { nrf.init([0,0,0,0,1], [0,0,0,0,2]); } onInit(); setInterval(function() { nrf.slaveHandler(); }, 50);
and master:
SPI1.setup({sck:A5, miso:A6, mosi:A7,baud:100000}); var nrf = require("NRF24L01P").connect( SPI1, B0, B1 ); function onInit() { nrf.init([0,0,0,0,2], [0,0,0,0,1]); } onInit(); setInterval(function() { nrf.masterHandler(); }, 50);
-
Additionaly here is the registers content of master side:
=undefined >nrf.getAddr(0x00) =[0,0,0,0,0] >nrf.getAddr(0x01) =[63,63,63,63,63] >nrf.getAddr(0x02) =[3,3,3,3,3] >nrf.getAddr(0x03) =[3,3,3,3,3] >nrf.getAddr(0x04) =[3,3,3,3,3] >nrf.getAddr(0x05) =[2,2,2,2,2] >nrf.getAddr(0x06) =[0,0,0,0,0] >nrf.getAddr(0x07) =[14,14,14,14,14] >nrf.getAddr(0x08) =[0,0,0,0,0] >nrf.getAddr(0x09) =[0,0,0,0,0] >nrf.getAddr(0x0A) =[1,0,0,0,1] >nrf.getAddr(0x0B) =[2,0,0,0,2] >nrf.getAddr(0x0C) =[195,195,195,195,195] >nrf.getAddr(0x0D) =[196,196,196,196,196] >nrf.getAddr(0x0E) =[197,197,197,197,197] >nrf.getAddr(0x0F) =[198,198,198,198,198] >nrf.getAddr(0x10) =[1,0,0,0,1] >nrf.getAddr(0x11) =[0,0,0,0,0] >nrf.getAddr(0x12) =[0,0,0,0,0] >nrf.getAddr(0x13) =[0,0,0,0,0] >nrf.getAddr(0x14) =[0,0,0,0,0] >nrf.getAddr(0x15) =[0,0,0,0,0] >nrf.getAddr(0x16) =[0,0,0,0,0] >nrf.getAddr(0x17) =[1,1,1,1,1] >
Looks it ok, or maybe some things are wrong?
furthermore:
Finding the problem I discovered the sequence in module code:
masterHandler func waiting for non-zero dataReady func result,
which can be non-zero in case when func getReg(STATUS=7) returns not 14 value, but it returns exactly 14. inside of getReg I see spi.send which returns 14.>nrf.spi.send([7,0],B0)[1] =14
Gordon, does It mean than something is wrong with the SPI settings, or NRF module?
I checked 2 brand-new modules with the same results. -
Thanks a lot, Gordon. I can't still establish connection between 2 NRF's. Sending
nrf.sendCommand("1+2", function(r) { print("=="+r); });
I've always got the Tx timeout subj.
I managed the spi connection, and did as you recomended: nrf.getAddr(0x0b); but here in this topic: http://forum.espruino.com/conversations/244/#comment1930 you told that the answer must be like [0,0,0,0,1], but I've got [1,0,0,0,1]. Is it wrong answer? And what I have to pay attention more to get the connection?
Thanks again. -
#kai could you share your complete listing of NRF24L01 working code for me, please?
-
Hi all!
trying to connect NRF24L01 to my F3Discovery i use the sampleSPI1.setup({sck:A5, miso:A6, mosi:A7,baud:100000}); var nrf = require("NRF24L01P").connect( SPI1, B0, B1 ); function onInit() { nrf.init([0,0,0,0,2], [0,0,0,0,1]); } onInit(); setInterval(function() { nrf.masterHandler(); }, 50
then try nrf.getAddr(nrf.C.RX_ADDR_P1) to check SPI communication and get:
>nrf.getAddr(nrf.C.RX_ADDR_P1) ERROR: Using '.' operator on undefined at line 1 col 17 nrf.getAddr(nrf.C.RX_ADDR_P1) ^
why C is undefined and what wrong with It?
IDE v 0.44.0 espruino 1v63
I tryed "No minification" and "Simple Optimizations" in
communication Settings. -
Thanks, I'm testing it now. I'll report if it helps or not...