Project

General

Profile

resolved: JNZ, problem receiving rf-packets

Added by Rolf 2 months ago

Just testing RFM69 communication. It works fine between Atmega and Raspberry Pi, both directions, Jeenode Zero to RPi and JNZ to Atm as well. Just the JNZ does not receive properly. It fetches one or two pakets, sometimes even some more, but then stops. The same effect, both with RPI or ATm as sender. Changing the frequeny a bit does not help. System: PC/Linux/folie-V2 --- SerPlus --- JNZ/Forth/rf-listen. Does anyone have similar experience or an idea what's happening?


Replies (14)

RE: JNZ, problem receiving rf-packets - Added by jcw 2 months ago

There are differences in the way the RFM69 is configured, in particular AFC could have an effect. Maybe the two nodes are not matching up optimally in frequency, in which case one might just be able to adjust to it and the other not.

The current register settings for the Forth-based driver are here - we're still experimenting with the best settings to use for maximum success rate between two RFM69's in native mode.

Maybe someone else with good insight in the different tweaks can comment further on this.

RE: JNZ, problem receiving rf-packets - Added by JohnO 2 months ago

I am interested to know if changes in register 0x29 affect your performance Rolf. In the file embello/explore/1608-forth/flib/spi/rf69.fs try changing line 53:

  1E0C h, 2607 h, 29C4 h, 2D05 h, 2E88 h, 2F2D h, 302A h, 37D0 h,

to:

  1E0C h, 2607 h, 29A0 h, 2D05 h, 2E88 h, 2F2D h, 302A h, 37D0 h,

The above will reduce the range of your link but will reduce the impact of noise.

RE: JNZ, problem receiving rf-packets - Added by JohnO 2 months ago

Another area we are looking at is the automatic frequency control (AFC) of the receiver. Comparing the before settings below:

  0200 h, 0302 h, 048A h, 0505 h, 06C3 h, 0B20 h, 1942 h, 1A42 h,
  1E0C h, 2607 h, 29C4 h, 2D05 h, 2E88 h, 2F2D h, 302A h, 37D0 h,
  3842 h, 3C8F h, 3D12 h, 6F20 h, 7102 h, 0 h,  \ sentinel

to these test settings:

  0200 h, 0302 h, 048A h, 0505 h, 06C3 h, **0B00** h, 1942 h, 1A42 h,
  **1E00** h, 2607 h, 29C4 h, 2D05 h, 2E88 h, 2F2D h, 302A h, 37D0 h,
  3842 h, 3C8F h, 3D12 h, 6F20 h, **7100** h,    0 h,  \ sentinel

The above disables the AFC holding the receiver frequency at the initial configured value.

RE: JNZ, problem receiving rf-packets - Added by Rolf 2 months ago

Hi John,
thanks for the suggestions. I tried both, with no effect. - just to be sure I did the appropriate thing (I'm still unsecure with this forth/mecrisp environment): edit the file (rf69.fs) as mentioned an then bring it up to JNZ (RAM) by "!s rf69.fs". That's it, Mecrisp wlll rearrange the new rf69.fs to be used. Then "rf-listen". Right? (A !reset switches the system in the old state, because he changes were just held in RAM - ?)

RE: JNZ, problem receiving rf-packets - Added by jcw 2 months ago

To reply on the Forth loading side: yes, that's correct. You will get many harmless "redefined" errors if the rf69 code is already loaded in flash, but your last load will be used for every future reference to words in that file.

Normally, in development mode, code gets compiled to RAM, and lost again on reset. You can check this with compiletoram? . if non-zero, then you're currently compiling to RAM.

Apart from resetting the JNZ, you can also use forgetram before reloading, to get get rid of previous definitions in RAM. Otherwise, each reload will append to what there is and eventually exhaust the RAM space.

RE: JNZ, problem receiving rf-packets - Added by JohnO 2 months ago

Rolf, could you post the output from an "rf." command on one of your modified nodes?

RE: JNZ, problem receiving rf-packets - Added by Rolf 2 months ago

John, here are the results:
The dump (!rf.) just after the start of folie, before starting rf-listen:
0 1 2 3 4 5 6 7 8 9 A B C D E F
00: -- 10 00 02 8A 05 C3 D9 13 00 41 60 02 92 F5 20
10: 24 9F 09 1A 40 B0 7B 9B 08 42 42 40 80 06 5C 00
20: 00 FF 68 00 49 00 07 D9 66 C4 00 00 00 05 88 2D
30: 2A 00 00 00 00 00 00 D0 42 00 00 00 8F 12 00 00
40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00
50: 13 85 88 08 00 00 01 00 1B 09 55 80 70 33 CA 08 ok.

Then rf-listen, I got 2 packets, then silence, the dump:
0 1 2 3 4 5 6 7 8 9 A B C D E F
00: -- 10 00 02 8A 05 C3 D9 13 00 41 60 02 92 F5 20
10: 24 9F 09 1A 40 B0 7B 9B 08 42 42 40 80 06 5C FC
20: D0 FE FE 00 C1 00 07 D8 00 C4 00 00 00 05 88 2D
30: 2A 00 00 00 00 00 00 D0 42 00 00 00 8F 12 00 00
40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00
50: 13 85 88 08 00 00 01 00 1B 09 55 80 70 33 CA 08 ok.

then change #1 (29A0) - it seems to work, receiving pakets! - stopping rf-listen, typing RETURN, dump:
0 1 2 3 4 5 6 7 8 9 A B C D E F
00: -- 10 00 02 8A 05 C3 D9 13 00 41 60 02 92 F5 20
10: 24 9F 09 1A 40 B0 7B 9B 10 42 42 40 80 06 5C 00
20: 00 00 9E 00 4E 00 07 D9 66 A0 00 00 00 05 88 2D
30: 2A 00 00 00 00 00 00 D0 42 00 00 00 8F 12 00 00
40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00
50: 13 85 88 08 00 00 01 00 1B 09 55 80 70 33 CA 08 ok.

then change #2 (#1 reset to original value), rf-listen, still receiving pakets "endlessly", did not make a dump

switched off power, #2 again, rf-listen, now not receiving packets, here is the dump:
0 1 2 3 4 5 6 7 8 9 A B C D E F
00: -- 10 00 02 8A 05 C3 D9 13 00 41 40 02 92 F5 20
10: 24 9F 09 1A 40 B0 7B 9B 08 42 42 40 80 06 50 FC
20: A8 FD C8 00 BF 00 07 D8 00 C4 00 00 00 05 88 2D
30: 2A 00 00 00 00 00 00 D0 42 00 00 00 8F 12 00 00
40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00
50: 13 85 88 08 00 00 01 00 1B 09 55 80 70 33 CA 08 ok.

RE: JNZ, problem receiving rf-packets - Added by Rolf 2 months ago

Additional information: I kept the file with change #1 to be able to reset the system in a working state, but !reset and !s rf69.fs (the good one, #1) did NOT do it! Then I switched off power and tried with file #1 again, success! - register contents not affected by reset?

RE: JNZ, problem receiving rf-packets - Added by jcw 2 months ago

A µC reset does not reset the radio - only a power cycle does.

(apologies for initially posting this reply in the wrong thread)

RE: JNZ, problem receiving rf-packets - Added by jcw 2 months ago

If you comment out the rf-init from rf-listen, over here, then you could experiment with different register values more easily: stop rf-listen py pressing <enter>, change a register, and call rf-listen to start listening again.

Changing a value can be done as follows:

$A0 $29 rf!

This stores (hex) A0 in register number (hex) 29. You can then check it with rf., as you've been doing.

Also useful is 123 rf-txtest, which sends a packet with the ASCII version of the number, i.e. hex bytes 31, 32, and 33. It too does an rf-init, so you'll lose any modified register settings unless you disable the rf-init call in there as well.

RE: resoved: JNZ, problem receiving rf-packets - Added by Rolf 2 months ago

To see if yesterdays result is reproducable, I tested again. Yes it is, Johns hint #1 was the key: setting register $29 to $A0 solves the problem. For curiosity I looked in the RF69 manual: $29 "RSSI (received signal strenght indication) treshold control". As I understand, signals below this treshold are ignored, reducing the value from $E4 to $AO allows to receive signals with lower amplitude.

Thanks John and Jean-Claude for help and valuable advices, jeelabs is fun.

RE: resolved: JNZ, problem receiving rf-packets - Added by jcw 2 months ago

Great - thanks for that final summary. I've changed $C4 to $A0 in the flib/spi/rf69.fs file on GitHub.

RE: resolved: JNZ, problem receiving rf-packets - Added by rolfhand 2 months ago

Hi, another Rolf here. Started with the same problem as TS, changing register $29 to $ $A0 did the job, side by side on a breadboard. But now the range is limited to about 1 meter. I am using tiny 83mm wires as antenna. I will try if changing rf-power helps.

RE: resolved: JNZ, problem receiving rf-packets - Added by Rolf 2 months ago

Hi, Rolf, thats useful. I made a very limited number of experiments, the distance between sender and receiver 3 m, rf-power set to 15. Did not change this up to now.

    (1-14/14)