Hi, As advised by Paul, I have tried carrier test example, as I am still unable ping payloads between RPI and Oberon. On RPI, I run a simple example `RF24' program, it steps through all 126 channels, and listens for 128us in each, incrementing carrier count if detected any on that channel. On Oberon I just execute `NRF.Ping' command, that just tries to send 32 byte payload over the wireless. Carriers detected in channels, are reported as a single hex digit From left to right, 0..126 On channel 5, SW := {1,0,0,0,0,0,0,0}; 000033400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 000022300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000123000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000 On channel 85, SW := {1,1,1,0,0,0,0,0}; 000000000000000000000000000000000000000000000000000000000000000000000000000000000000321000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000123000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000435000000000000000000000000000000000000000 I am surprised to see that signal carrier is detected in the spectrum of channels, 4,5,6 and 84,85,86 with similar count??? Many thanks for any insight. -- Tomas Kral <thomas.kral@email.cz>
Hi Tomas,
I am surprised to see that signal carrier is detected in the spectrum of channels, 4,5,6 and 84,85,86 with similar count???
I'm surprised too, I've never seen that before. Is it possible you're transmitting at 2Mbps? That would explain it, according to the datasheet, since 2Mbps transmission has 2MHz channel spacing. Again, I'd advise you to write something at each end which simply dumps the nRF24 registers, so you can verify that your code is programming the chip the way you think it is. HTH, Paul
Tomas Don’t know whether it helps, but according datasheet chapter 6.4 you should wait at least 170us after RX on until you can trust RPD. Jörg
Am 12.04.2018 um 12:23 schrieb Tomas Kral <thomas.kral@email.cz>:
Hi,
As advised by Paul, I have tried carrier test example, as I am still unable ping payloads between RPI and Oberon.
On RPI, I run a simple example `RF24' program, it steps through all 126 channels, and listens for 128us in each, incrementing carrier count if detected any on that channel.
On Oberon I just execute `NRF.Ping' command, that just tries to send 32 byte payload over the wireless.
Carriers detected in channels, are reported as a single hex digit From left to right, 0..126
On channel 5, SW := {1,0,0,0,0,0,0,0}; 000033400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 000022300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000123000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000
On channel 85, SW := {1,1,1,0,0,0,0,0}; 000000000000000000000000000000000000000000000000000000000000000000000000000000000000321000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000123000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000435000000000000000000000000000000000000000
I am surprised to see that signal carrier is detected in the spectrum of channels, 4,5,6 and 84,85,86 with similar count???
Many thanks for any insight.
-- Tomas Kral <thomas.kral@email.cz> -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
Don’t know whether it helps, but according datasheet chapter 6.4 you should wait at least 170us after RX on until you can trust RPD.
Hi, Need to learn about `RPD' first :-) Meanwhile I was able to send a payload to RPI. But, but, it can transfer every 10th packet, all other dropped, why is that? Also, the payload is 32 bytes, of which only 16 received??? Also, RPI receives payloads, only when addresses RX/TX are reversed to Oberon setting, see below??? I checked some parameters on Oberon, I learnt only to read first byte of each register, they see to match RPI setting. ================ SPI Configuration ================ CSN Pin = CE0 (PI Hardware Driven) CE Pin = Custom GPIO25 Clock Speed = 4 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 = 0xc2c2c2c2c2 0xe7e7e7e7e7 RX_ADDR_P2-5 = 0xe6 0xc2 0xe7 0xc2 TX_ADDR = 0xc2c2c2c2c2 RX_PW_P0-6 = 0x20 0x20 0x20 0x20 0x20 0x20 EN_AA = 0x3f EN_RXADDR = 0x3e RF_CH = 0x05 RF_SETUP = 0x07 CONFIG = 0x7f DYNPD/FEATURE = 0x00 0x00 Data Rate = 1MBPS Model = nRF24L01+ CRC Length = 16 bits PA Power = PA_MAX Output below : Recv: size=0 payload=0123456789012345�� pipe=0 Send: size=0 payload= pipe:0 Recv: size=0 payload=0123456789012345�� pipe=0 Send: size=0 payload= pipe:0 Recv: size=0 payload=0123456789012345�� pipe=0 Send: size=0 payload= pipe:0 Recv: size=0 payload=0123456789012345�� pipe=0 Send: size=0 payload= pipe:0 Recv: size=0 payload=0123456789012345�� pipe=0 Send: size=0 payload= pipe:0 Recv: size=0 payload=0123456789012345�� pipe=0 Send: size=0 payload= pipe:0 The ping Oberon code, borrows from SendPacket. PROCEDURE Ping*; VAR plstr: ARRAY 32 OF CHAR; i: INTEGER; payload: ARRAY SubPacket OF BYTE; timeout: BOOLEAN; BEGIN plstr := "0123456789012345678901234567890"; SYSTEM.COPY(SYSTEM.ADR(plstr), SYSTEM.ADR(payload), 4); i := Kernel.Time() + Wait; REPEAT SCC.SPICtrl({netEnable, netSelect}); SCC.SPI(0FFH); SCC.SPICtrl({netE nable}) (*NOP*) UNTIL Kernel.Time() >= i; SCC.Listen(FALSE); SCC.SubSnd(SYSTEM.ADR(payload), timeout); SCC.Listen(TRUE); IF timeout THEN Texts.WriteString(W, " timed") ELSE Texts.WriteString(W, " done") END; Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf) END Ping; -- Tomas Kral <thomas.kral@email.cz>
Hi Tomas,
Meanwhile I was able to send a payload to RPI.
Congratulations! :)
But, but, it can transfer every 10th packet, all other dropped, why is that?
There may be many reasons, you will have to investigate further until you fully understand the detailed principles of operation (took me a while, Felix knows). :) Again, study the register descriptions in the datasheet and check the values - the OBSERVE_TX register may be useful here. Hopefully you have read that the messages are received in a FIFO; the ping program may be flushing this. Try pacing your sending. Consider what happens at both ends when the receive FIFO is full.
Also, the payload is 32 bytes, of which only 16 received???
I can see why from your code - you are only copying 4 words into your transmit buffer.
Also, RPI receives payloads, only when addresses RX/TX are reversed to Oberon setting, see below???
Not sure exactly what you're saying here, but obviously TX on one is RX on the other.
I checked some parameters on Oberon, I learnt only to read first byte of each register, they see[m] to match RPI setting.
For registers 0AH, 0BH and 10H, you can keep reading four more SPI bytes before deselecting the chip, for a total of five bytes, LSB is read first. For registers 0CH, 0DH, 0EH and 0FH, the upper four bytes of the address are defined to be the same as for register 0BH. HTH, well done for not giving up ;-) Cheers, Paul
On Thu, 12 Apr 2018 19:02:19 +0100 Paul Reed <paulreed@paddedcell.com> wrote:
I can see why from your code - you are only copying 4 words into your transmit buffer.
Whatever I do, I can read only from pipe-4, which has the same address as pipe-1. pipe-0 remains for writing only, while all pipes enabled except pipe-0. Strange??? Is the library feature abstracting parent-child relationship for pipes. RX_ADDR_P0-1 = 0xc2c2c2c2c2 0xe7e7e7e7e7 RX_ADDR_P2-5 = 0xe6 0xc2 0xe7 0xc2 EN_RXADDR = 0x3e Output below : Recv: size=31 payload=0123456789012345678901234567890 pipe=4 Recv: size=31 payload=0123456789012345678901234567890 pipe=4 Recv: size=31 payload=0123456789012345678901234567890 pipe=4 Recv: size=31 payload=0123456789012345678901234567890 pipe=4 -- Tomas Kral <thomas.kral@email.cz>
Hi Tomas,
Whatever I do, I can read only from pipe-4, which has the same address as pipe-1. pipe-0 remains for writing only, while all pipes enabled except pipe-0. Strange???
Surely you would want all receiving pipes to have different addresses? I don't know much about all of this, I left the addresses at default and used only pipe 0, but your library has disabled that, for reasons best known to itself... Sounds like you will be fighting this library all of the way, until you understand it - often the case with libraries, in my experience, that once you can use it properly, you might as well have written it :) Cheers, Paul
Tomas The easiest is to only use pipe 0. In case you want to use the chip’s MultiCeiver feature (=handle different pipes) you must follow the note in datasheet chapter 7.6: „The LSByte must be unique for all six pipes.“ Jörg
Am 12.04.2018 um 23:45 schrieb Paul Reed <paulreed@paddedcell.com>:
Hi Tomas,
Whatever I do, I can read only from pipe-4, which has the same address as pipe-1. pipe-0 remains for writing only, while all pipes enabled except pipe-0. Strange???
Surely you would want all receiving pipes to have different addresses? I don't know much about all of this, I left the addresses at default and used only pipe 0, but your library has disabled that, for reasons best known to itself...
Sounds like you will be fighting this library all of the way, until you understand it - often the case with libraries, in my experience, that once you can use it properly, you might as well have written it :)
Cheers, Paul
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
The easiest is to only use pipe 0. Yes, I agree. Is simple what `SSC.Mod' does both reading/writing across
On Fri, 13 Apr 2018 10:46:11 +0300 Jörg <joerg.straube@iaeth.ch> wrote: pipe-0, the only that is enabled. Seems like peer-to-peer(s) talk. Only one talks, while the others listen, then one of them replies.
In case you want to use the chip’s MultiCeiver feature (=handle different pipes) you must follow the note in datasheet chapter 7.6: „The LSByte must be unique for all six pipes.“
This is also the idea of RF24.cpp parent-child pipe abstraction, but cannot be somehow disabled. It shuffles addresses between pipes in calls. radio.startListening radio.stopListening radio.openPipe It is meant easy to the user, but I am slightly confused. -- Tomas Kral <thomas.kral@email.cz>
On Fri, 13 Apr 2018 10:46:11 +0300 Jörg <joerg.straube@iaeth.ch> wrote:
The easiest is to only use pipe 0. Hi,
Some progress made. I can now send payloads back and forth. Best results with `RF24.lib' I have using two pipes, I receive on pipe-1 and send on pipe-0. But, but, outbound 90% loss, inbound 0% loss. Oberon receives much better!!! Packets received on RPI are marked with payload[len-1]:='x'. RPI: --- RX_ADDR_P0-1 = 0xc2c2c2c2c2 0xe7e7e7e7e7 RX_ADDR_P2-5 = 0xc3 0xc4 0xc5 0xc6 Output below : Recv: size=31 payload=0123456789012345678901234567890 pipe=1 Send: size=31 payload=012345678901234567890123456789x pipe:1 Recv: size=31 payload=0123456789012345678901234567890 pipe=1 Send: size=31 payload=012345678901234567890123456789x pipe:1 Oberon: ------ snd-timed snd-timed snd-timed snd-timed 012345678901234567890123456789x rcv-done snd-done snd-timed snd-timed snd-timed snd-timed snd-timed snd-timed snd-timed 012345678901234567890123456789x rcv-done snd-done Ping/Pong procedures, they borrow from `SCC.Mod', just in case you spot something odd. PROCEDURE Pong*; VAR plstr: ARRAY 32 OF CHAR; adr: INTEGER; payload: ARRAY SubPacket OF BYTE; BEGIN IF SCC.Rcvd(Wait) THEN plstr := ""; adr := SYSTEM.ADR(payload); SCC.SubRcv(adr); SYSTEM.COPY(SYSTEM.ADR(payload), SYSTEM.ADR(plstr), 8); Texts.WriteString(W, plstr); Texts.WriteString(W, " rcv-done") ELSE Texts.WriteString(W, " rcv-timed") END; Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf) END Pong; PROCEDURE Ping*; VAR plstr: ARRAY 32 OF CHAR; i: INTEGER; payload: ARRAY SubPacket OF BYTE; timeout: BOOLEAN; BEGIN plstr := "0123456789012345678901234567890"; SYSTEM.COPY(SYSTEM.ADR(plstr), SYSTEM.ADR(payload), 8); i := Kernel.Time() + Wait; REPEAT SCC.SPICtrl({netEnable, netSelect}); SCC.SPI(0FFH); SCC.SPICtrl({netEnable}) (*NOP*) UNTIL Kernel.Time() >= i; SCC.Listen(FALSE); SCC.SubSnd(SYSTEM.ADR(payload), timeout); SCC.Listen(TRUE); IF timeout THEN Texts.WriteString(W, " snd-timed") ELSE Pong(); Texts.WriteString(W, " snd-done") END; Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf) END Ping; -- Tomas Kral <thomas.kral@email.cz>
On Fri, 13 Apr 2018 10:46:11 +0300 Jörg <joerg.straube@iaeth.ch> wrote:
The easiest is to only use pipe 0. Hi,
I worked out a simple code from `rpi-hub.cpp' modified to use only pipe-0 for reading/writing. Attached, if you wished to follow, as I'd learn about experience on your systems. On Oberon end, I just execute `Ping' procedure, that in return calls `Pong'. Outbound 90% loss, inboud 10% loss. This makes me curious how to manage RPI reliable network time server, file server, etc. /* Filename : rpi-hub.cpp * * Author : Stanley Seow * e-mail : stanleyseow@gmail.com * date : 6th Mar 2013 * * 03/17/2013 : Charles-Henri Hallard (http://hallard.me) * Changed to use modified bcm2835 and RF24 library * 14.04.2018 : [tcat] thomas.kral@email.cz * Adapted for RISC-5 Oberon `SCC.Mod' */ #include <cstdlib> #include <iostream> #include <RF24/RF24.h> using namespace std; // Default pipe addresses after radio reset const uint64_t pipes[6] = { 0xe7e7e7e7e7LL, 0xc2c2c2c2c2LL, 0xc3, 0xc4, 0xc5, 0xc6 }; // CE Pin, CSN Pin, SPI Speed // Setup for GPIO 22 CE and CE0 CSN with SPI Speed @ 4Mhz RF24 radio(RPI_V2_GPIO_P1_22, BCM2835_SPI_CS0, BCM2835_SPI_SPEED_4MHZ); int main(int argc, char** argv) { uint8_t len; // Default radio setting radio.begin(); radio.setRetries(50,50); radio.setChannel(5); radio.maskIRQ(1,1,1); // Enable pipe-0 for reading and writing radio.openWritingPipe(pipes[0]); radio.openReadingPipe(0,pipes[0]); // Start listening // Dump radio configuration for debugging radio.startListening(); radio.printDetails(); printf("Output below [Ctrl-C to exit]: \n"); delay(1); while(true) { char receivePayload[32]; uint8_t pipe = 0; // Start listening radio.startListening(); if ( radio.available(&pipe) ) { // Read payload 32 bytes from Oberon len = 32; radio.read( receivePayload, len ); len = strlen(receivePayload); // Display it on screen printf("Recv: size=%i payload=%s pipe=%i\n",len,receivePayload,pipe); // Return payload back, stamped with 'x' radio.stopListening(); receivePayload[len-1]='x'; radio.write(receivePayload,len); printf("Send: size=%i payload=%s pipe:%i\n",len,receivePayload,pipe); } // delayMicroseconds(20); /* 100% of CPU */ delay(1); /* 15% of CPU */ } return 0; } -- Tomas Kral <thomas.kral@email.cz>
Tomas How do you measure „x% loss“? Currently, all your packets contain a constant string. Please enter an increasing number in it and see how many numbers you miss. BTW: You can delete „openReadingPipe“ („openWritingPipe“ does everything you need), and you can call „available()“ without parameter „pipe“. br Jörg
Am 14.04.2018 um 11:20 schrieb Tomas Kral <thomas.kral@email.cz>:
On Fri, 13 Apr 2018 10:46:11 +0300 Jörg <joerg.straube@iaeth.ch> wrote:
The easiest is to only use pipe 0. Hi,
I worked out a simple code from `rpi-hub.cpp' modified to use only pipe-0 for reading/writing. Attached, if you wished to follow, as I'd learn about experience on your systems.
On Oberon end, I just execute `Ping' procedure, that in return calls `Pong'. Outbound 90% loss, inboud 10% loss.
This makes me curious how to manage RPI reliable network time server, file server, etc.
/* Filename : rpi-hub.cpp * * Author : Stanley Seow * e-mail : stanleyseow@gmail.com * date : 6th Mar 2013 * * 03/17/2013 : Charles-Henri Hallard (http://hallard.me) * Changed to use modified bcm2835 and RF24 library * 14.04.2018 : [tcat] thomas.kral@email.cz * Adapted for RISC-5 Oberon `SCC.Mod' */
#include <cstdlib> #include <iostream> #include <RF24/RF24.h>
using namespace std;
// Default pipe addresses after radio reset const uint64_t pipes[6] = { 0xe7e7e7e7e7LL, 0xc2c2c2c2c2LL, 0xc3, 0xc4, 0xc5, 0xc6 };
// CE Pin, CSN Pin, SPI Speed // Setup for GPIO 22 CE and CE0 CSN with SPI Speed @ 4Mhz RF24 radio(RPI_V2_GPIO_P1_22, BCM2835_SPI_CS0, BCM2835_SPI_SPEED_4MHZ);
int main(int argc, char** argv) { uint8_t len;
// Default radio setting radio.begin(); radio.setRetries(50,50); radio.setChannel(5); radio.maskIRQ(1,1,1);
// Enable pipe-0 for reading and writing radio.openWritingPipe(pipes[0]); radio.openReadingPipe(0,pipes[0]);
// Start listening // Dump radio configuration for debugging radio.startListening(); radio.printDetails();
printf("Output below [Ctrl-C to exit]: \n"); delay(1);
while(true) { char receivePayload[32]; uint8_t pipe = 0;
// Start listening radio.startListening();
if ( radio.available(&pipe) ) {
// Read payload 32 bytes from Oberon len = 32; radio.read( receivePayload, len ); len = strlen(receivePayload);
// Display it on screen printf("Recv: size=%i payload=%s pipe=%i\n",len,receivePayload,pipe);
// Return payload back, stamped with 'x' radio.stopListening(); receivePayload[len-1]='x'; radio.write(receivePayload,len); printf("Send: size=%i payload=%s pipe:%i\n",len,receivePayload,pipe); }
// delayMicroseconds(20); /* 100% of CPU */ delay(1); /* 15% of CPU */ } return 0; }
-- Tomas Kral <thomas.kral@email.cz> -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
On Sun, 15 Apr 2018 07:52:05 +0300 Jörg Straube <joerg.straube@iaeth.ch> wrote:
You can delete „openReadingPipe“
Hi Joerg, This is what I have thought too. Actually, "openWritingPipe" on its own, just shuts pipe-0 for reading and sets 32 bits paylod, leaving pipe-1 enabled with setting ZERO payload. EN_RXADDR = 0x02 RX_PW_P0-6 = 0x20 0x00 0x00 0x00 0x00 0x00 Compare to reset defaults. EN_RXADDR = 0x03 RX_PW_P0-6 = 0x00 0x00 0x00 0x00 0x00 0x00 Pipe-0,1 enabled, with zero payloads. -- Tomas Kral <thomas.kral@email.cz>
On Sun, 15 Apr 2018 07:52:05 +0300 Jörg Straube <joerg.straube@iaeth.ch> wrote:
How do you measure „x% loss“? Currently, all your packets contain a constant string. Please enter an increasing number in it and see how many numbers you miss.
Hi, I will improve my code on the above. Today, I have a new observation. When I swap NRF modules between RPI and Oberon, I am getting absolutely no payloads across, this made me suspect one of the modules outside production tolerance, (now please do not laugh), I bought another pair and I am getting absolutely no pings either with these new modules in either socket. Best results now with the old pair, one that likes RPI, the other that does Oberon, and these `SCC.Mod' setting Wait = 5; SendTries = 15; As I experience that the carrier, if not lost, is picked in early number of tries. For the tests, the transmitter and receiver are some 15cm apart, that is the limit of my short USB cable I power Oberon with. I read somewhere that radio can operate at some 50 meters range. I realised I do not quite understand `SCC.SubSnd', the purpose of retransmit loop, as the NRF module does some retransmits on its own. Perhaps the loop just extends number of these default tries? Many thanks. -- Tomas Kral <thomas.kral@email.cz>
Just one remark: You used setRetries(50, 50) in your code. This does not what you think it does... Jörg
Am 16.04.2018 um 18:51 schrieb Tomas Kral <thomas.kral@email.cz>:
On Sun, 15 Apr 2018 07:52:05 +0300 Jörg Straube <joerg.straube@iaeth.ch> wrote:
How do you measure „x% loss“? Currently, all your packets contain a constant string. Please enter an increasing number in it and see how many numbers you miss.
Hi,
I will improve my code on the above.
Today, I have a new observation. When I swap NRF modules between RPI and Oberon, I am getting absolutely no payloads across, this made me suspect one of the modules outside production tolerance, (now please do not laugh), I bought another pair and I am getting absolutely no pings either with these new modules in either socket.
Best results now with the old pair, one that likes RPI, the other that does Oberon, and these `SCC.Mod' setting Wait = 5; SendTries = 15; As I experience that the carrier, if not lost, is picked in early number of tries.
For the tests, the transmitter and receiver are some 15cm apart, that is the limit of my short USB cable I power Oberon with. I read somewhere that radio can operate at some 50 meters range.
I realised I do not quite understand `SCC.SubSnd', the purpose of retransmit loop, as the NRF module does some retransmits on its own. Perhaps the loop just extends number of these default tries?
Many thanks.
-- Tomas Kral <thomas.kral@email.cz> -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
On Mon, 16 Apr 2018 23:20:18 +0200 Jörg <joerg.straube@iaeth.ch> wrote:
You used setRetries(50, 50) Joerg, thank you, just corrected that yesterday, leaving unset to reset defaults, after studying `retransmit loop', as this takes above 50,50 parameters. While chip uses its own default retries.
It slightly improves the response, but still cannot swap modules, between nodes. There is still one that likes Oberon, and the one that does RPI. Does not work vice versa. This makes me think, modules may have to be tested per device, and select only those working best in pairs? -- Tomas Kral <thomas.kral@email.cz>
On Sun, 15 Apr 2018 07:52:05 +0300 Jörg Straube <joerg.straube@iaeth.ch> wrote:
How do you measure „x% loss“? Currently, all your packets contain a constant string. Please enter an increasing number in it and see how many numbers you miss.
Currently I just count packets received from a 100 sent. PROCEDURE Ping100*; VAR i: INTEGER; BEGIN plcnt := 0; (* reset payload count *) FOR i := 1 TO 100 DO Ping END; Texts.WriteString(W, "Ping:"); Texts.WriteInt(W, plcnt, 6); Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf) END Ping100; .. .. 012345678901234567890123456789x rcv-done snd-done 012345678901234567890123456789x rcv-done snd-done snd-timed snd-timed snd-timed Ping: 26 It seems, I cannot get above 30% with my current setup and RF24 lib. -- Tomas Kral <thomas.kral@email.cz>
Hi Tomas,
FOR i := 1 TO 100 DO Ping END;
...but still cannot swap modules, between nodes. There is still one that
...> It seems, I cannot get above 30% with my current setup and RF24 lib. What happens if you put a pause in that loop? likes Oberon, and the one that does RPI. Do all the modules reliably detect a carrier? Cheers, Paul
On Tue, 17 Apr 2018 10:35:38 +0100 Paul Reed <paulreed@paddedcell.com> wrote:
What happens if you put a pause in that loop? I inserted a delay, ... Ping; j := Kernel.Time() + Wait; REPEAT UNTIL Kernel.Time() >= i; ... I cannot see any effect, I got 26-32%, with or without a delay.
Do all the modules reliably detect a carrier?
I need to understand this test first, I have an RPI channel scanner code. Until now, I just executed Ping by hand on Oberon, and on RPI carrier detected also bleeding into neighbouring channels. This is the case with any modules I have had to tests. Only two of them work so far, but only in specific node, Oberon or RPI, not both. The code is this while (i--) { // Select this channel radio.setChannel(i); // Listen for a little radio.startListening(); delayMicroseconds(128); radio.stopListening(); // Did we get a carrier? if ( radio.testCarrier() ) ++values[i]; } bool RF24::testCarrier(void) { return ( read_register(CD) & 1 ); } I may also try measuring signal level in the channel as Joerg suggested. bool RF24::testRPD(void) { return ( read_register(RPD) & 1 ) ; } -- Tomas Kral <thomas.kral@email.cz>
-----Original Message----- From: Oberon [mailto:oberon-bounces@lists.inf.ethz.ch] On Behalf Of Tomas Kral Sent: Tuesday, 17 April 2018 7:52 PM To: oberon@lists.inf.ethz.ch Cc: Oberon@lists.inf.ethz.ch Subject: Re: [Oberon] FPGA - nRF24L01 connection
I inserted a delay, ... Ping; j := Kernel.Time() + Wait; REPEAT UNTIL Kernel.Time() >= i;
Should be j, not i.
Do you have an L01 or an L01+? Strictly speaking „testCarrier()“ should not be used on the L01+ model. You should call „testRPD()“. But as the register both procedures read is the same, it doesn‘t matter practically. - CD is the name for register 9 on L01 - RPD is the name for register 9 on L01+ The internal mechanisms how the chip detects the carrier/RPD is different however. testCarrier() on the L01+ is identical to testRPD(). For clarity, you should call testRPD() on a L01+. On a L01+, you have to wait for at least 170us before you can trust the RPD signal. Your delayMicroseconds is too short to reliably trust the signal. I‘m not sure but this might be the reason of the bleeding effect you observe... br Jörg
Am 17.04.2018 um 12:21 schrieb Tomas Kral <thomas.kral@email.cz>:
On Tue, 17 Apr 2018 10:35:38 +0100 Paul Reed <paulreed@paddedcell.com> wrote:
What happens if you put a pause in that loop? I inserted a delay, ... Ping; j := Kernel.Time() + Wait; REPEAT UNTIL Kernel.Time() >= i; ... I cannot see any effect, I got 26-32%, with or without a delay.
Do all the modules reliably detect a carrier?
I need to understand this test first, I have an RPI channel scanner code. Until now, I just executed Ping by hand on Oberon, and on RPI carrier detected also bleeding into neighbouring channels. This is the case with any modules I have had to tests. Only two of them work so far, but only in specific node, Oberon or RPI, not both.
The code is this while (i--) {
// Select this channel radio.setChannel(i);
// Listen for a little radio.startListening(); delayMicroseconds(128); radio.stopListening();
// Did we get a carrier? if ( radio.testCarrier() ) ++values[i]; }
bool RF24::testCarrier(void) { return ( read_register(CD) & 1 ); }
I may also try measuring signal level in the channel as Joerg suggested.
bool RF24::testRPD(void) { return ( read_register(RPD) & 1 ) ; }
-- Tomas Kral <thomas.kral@email.cz> -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
On Tue, 17 Apr 2018 15:23:46 +0200 Jörg <joerg.straube@iaeth.ch> wrote:
On a L01+, you have to wait for at least 170us before you can trust the RPD signal. Hi Joerg, Thank you, you have pointed this twice, now I understood. The loop can be rewritten for clarity. while (i--) {
// Select this channel radio.setChannel(i); // Listen for a little radio.startListening(); delayMicroseconds(130+40); /* see manual ch6.4. */ radio.stopListening(); // Did we get a carrier? // if ( radio.testCarrier() ) ++values[i]; /* L01 device */ if ( radio.testRPD() ) ++values[i]; /* L01+ device */ } But I am afraid I still see bleeding signal across three channels. I wonder, if at the transmitter node, I could use the continuous wave for the carrier detect test, not sure what purpose is that wave. Also transmitter/receiver nodes are very close to each other, in reality they could be some 70-100meters apart, should I try to lower the signal level, perhaps it incurs some noise of signal being too high? Many thanks so far. -- Tomas Kral <thomas.kral@email.cz>
On Tue, 17 Apr 2018 16:29:36 +0200 Tomas Kral <thomas.kral@email.cz> wrote:
Also transmitter/receiver nodes are very close to each other, in reality they could be some 70-100meters apart, should I try to lower the signal level, perhaps it incurs some noise of signal being too high?
Setting RF_SETUP, PA_LEVEL (RF_PWR), -12dBm, seems to have done it. 012345678901234567890123456789x rcv-done snd-done 012345678901234567890123456789x rcv-done snd-done 012345678901234567890123456789x rcv-done snd-done Ping: 74 74% with Wait = 5; SendTries = 15 in `SSC.Mod' 15% CPU at RPI with loop delay(1) = one sec. -- Tomas Kral <thomas.kral@email.cz>
On Tue, 17 Apr 2018 16:29:36 +0200 Tomas Kral <thomas.kral@email.cz> wrote:
Also transmitter/receiver nodes are very close to each other, in reality they could be some 70-100meters apart, should I try to lower the signal level, perhaps it incurs some noise of signal being too high?
Hi, I have found that there is some influence/correlation of delay and radio signal power. Delay=5; Repeat=50; Power=-12dBm Ping: ~90% Delay=50; Repeat=50; Power=-12dBm Ping: ~15% Delay=5; Repeat=15; Power=0dBm Ping: ~30% Could it be, that my NRF modules have simply some production mistolerance? I put the other two modules back to the manufacturer with claim, as I was not able to spring them to life with my setup. Thank you for your help so far, also for bearing with me :-) -- Tomas Kral <thomas.kral@email.cz>
participants (5)
-
Chris Burrows -
Jörg -
Jörg Straube -
Paul Reed -
Tomas Kral