Skip to content

Commit

Permalink
add John O's trick to sync on an extra AA from the preamble
Browse files Browse the repository at this point in the history
this change also sends out one more 0xAA preamble byte
  • Loading branch information
jcw committed Apr 8, 2016
1 parent 68f6e42 commit 6f1af25
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions RF69.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#define REG_SYNCCONFIG 0x2E
#define REG_SYNCVALUE1 0x2F
#define REG_SYNCVALUE2 0x30
#define REG_SYNCVALUE3 0x31
#define REG_NODEADRS 0x39
#define REG_PACKETCONFIG2 0x3D
#define REG_AESKEY1 0x3E
Expand Down Expand Up @@ -68,9 +69,10 @@ static ROM_UINT8 configRegs_compat [] ROM_DATA = {
0x1E, 0x2C, // FeiStart, AfcAutoclearOn, AfcAutoOn
0x25, 0x80, // DioMapping1 = SyncAddress (Rx)
// 0x29, 0xDC, // RssiThresh ...
0x2E, 0x88, // SyncConfig = sync on, sync size = 2
0x2F, 0x2D, // SyncValue1 = 0x2D
// 0x30, 0x05, // SyncValue2 = 0x05
0x2E, 0x90, // SyncConfig = sync on, sync size = 3
0x2F, 0xAA, // SyncValue1 = 0xAA
0x30, 0x2D, // SyncValue2 = 0x2D
// 0x31, 0x05, // SyncValue3 = 0x05
0x37, 0x00, // PacketConfig1 = fixed, no crc, filt off
0x38, 0x00, // PayloadLength = 0, unlimited
0x3C, 0x8F, // FifoTresh, not empty, level 15
Expand Down Expand Up @@ -154,7 +156,7 @@ void RF69::configure_compat () {
initRadio(configRegs_compat);
// FIXME doesn't seem to work, nothing comes in but noise for group 0
// writeReg(REG_SYNCCONFIG, group ? 0x88 : 0x80);
writeReg(REG_SYNCVALUE2, group);
writeReg(REG_SYNCVALUE3, group);

writeReg(REG_FRFMSB, frf >> 16);
writeReg(REG_FRFMSB+1, frf >> 8);
Expand Down

1 comment on commit 6f1af25

@sanbee
Copy link

@sanbee sanbee commented on 6f1af25 Jul 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this require that this modified code be used at both Rx and Tx radios? I am using RF69CW radios at both ends, but one (the remote) is running older JeeLib. When I tried updating just the other one (not the remote one) with the latest jeelib from the master branch, the link decidedly became unstable.

I am trying to debug the issue that I see now and is discussed as part of #92 . I have a base station radio which receives packets and also sends out packets (ping-pong). After about 2 days of continuous operation, it (base station radio) freezes (neither receives nor transmits packets). I know it's the radio that's frozen since the rest of the sketch is working (interaction with the sketch via commands over the serial port confirms this). Upon power cycle it works again (for about 2 days). Since the master branch makes the link even more unstable, I am now trying code that would call rf12_initialize() if no packets are receive for 10 sec.

Please sign in to comment.