Hello again, Just a small update in case someone wants to try this out. I have two patches to apply to get this working for me. The first, RFM69-Library-AVR-syncword.patch, is to apply against fermitron2048/packetdemod and the second, RFM69.patch, is to apply against nayem-cosmic/RFM69-Library-AVR. My thanks to both nayem-cosmic and fermitron2048 for their work writing these pieces of software.
Take care. Chris On Thu, Feb 3, 2022 at 12:40 PM Chris Gorman <chrisjohgor...@gmail.com> wrote: > > Hello All, > > I have two rfm69 boards [1] connected to two avrs and they are sending > messages to each other over the airway. Once I got this working I > thought it would be fun to inspect the messages being sent with my > rtl_sdr. I can confirm the message is being sent over serial on the > receiver. > > I went searching on the internet for a way to decode the transmission > and found some scripts to use gnuradio to do packetdemod on rfm69 > boards [2]. The problem with this setup is it requires me to modify > the code to the rfm69 [3] to prevent whitening. My software to run > the avrs isn't the same as the author of the packetdemod's and I can't > apply his patch. I have looked at the code to see if I am using > whitening, but as far as I can tell I am not. Regardless when I run > the packetdemod script, I get 'Invalid packets" instead of my message. > > In my inbox this morning I found an email with a reference to packet > communications with gnuradio [4] and am wondering if I should be using > this method to decode the transmission between the two rfm69's? I > will try it out anyway as it seems interesting, but is this the > correct direction to analyze the transmission between two boards like > the rfm69s? > > Thanks in advance, > > Chris > > [1] https://www.sparkfun.com/products/12775 > [2] https://github.com/fermitron2048/packetdemod > [3] https://github.com/nayem-cosmic/RFM69-Library-AVR > [4] https://wiki.gnuradio.org/index.php?title=Packet_Communications
diff --git a/packetdemod.py b/packetdemod.py index 1825c64..bdaf828 100644 --- a/packetdemod.py +++ b/packetdemod.py @@ -126,7 +126,7 @@ def parsepacket(bits): invalid_packets += 1 return syncword = (ord(bytes[0])<<8) + ord(bytes[1]) - if(syncword != 0x2d21): + if(syncword != 0x2dd4): print("Invalid packet") invalid_packets += 1 return @@ -192,7 +192,7 @@ def decode(values = []): # Align to sync word for beginning of packet for i in range(1,50): - syncword = [0,0,1,0,1,1,0,1,0,0,1,0,0,0,0,1] + syncword = [0,0,1,0,1,1,0,1,1,1,0,1,0,1,0,0] tmpbits = bits[i:] if(cmp(syncword,tmpbits[:16].tolist()) == 0): bits = bits[i:] diff --git a/radio.py b/radio.py index df67922..25e366f 100644 --- a/radio.py +++ b/radio.py @@ -81,7 +81,7 @@ def parsepacket(bits): invalid_packets += 1 return syncword = (ord(bytes[0])<<8) + ord(bytes[1]) - if(syncword != 0x2d21): + if(syncword != 0x2dd4): print("Invalid packet") invalid_packets += 1 return @@ -147,7 +147,7 @@ def decode(values = []): # Align to sync word for beginning of packet for i in range(1,50): - syncword = [0,0,1,0,1,1,0,1,0,0,1,0,0,0,0,1] + syncword = [0,0,1,0,1,1,0,1,1,1,0,1,0,1,0,0] tmpbits = bits[i:] if(cmp(syncword,tmpbits[:16].tolist()) == 0): bits = bits[i:]
diff --git a/RFM69.c b/RFM69.c index 1a52fc3..83ba45f 100644 --- a/RFM69.c +++ b/RFM69.c @@ -59,11 +59,11 @@ void rfm69_init(uint16_t freqBand, uint8_t nodeID, uint8_t networkID) const uint8_t CONFIG[][2] = { /* 0x01 */ { REG_OPMODE, RF_OPMODE_SEQUENCER_ON | RF_OPMODE_LISTEN_OFF | RF_OPMODE_STANDBY }, - /* 0x02 */ { REG_DATAMODUL, RF_DATAMODUL_DATAMODE_PACKET | RF_DATAMODUL_MODULATIONTYPE_FSK | RF_DATAMODUL_MODULATIONSHAPING_00 }, // no shaping - /* 0x03 */ { REG_BITRATEMSB, RF_BITRATEMSB_55555}, // default: 4.8 KBPS - /* 0x04 */ { REG_BITRATELSB, RF_BITRATELSB_55555}, - /* 0x05 */ { REG_FDEVMSB, RF_FDEVMSB_50000}, // default: 5KHz, (FDEV + BitRate / 2 <= 500KHz) - /* 0x06 */ { REG_FDEVLSB, RF_FDEVLSB_50000}, + /* 0x02 */ { REG_DATAMODUL, RF_DATAMODUL_DATAMODE_PACKET | RF_DATAMODUL_MODULATIONTYPE_OOK | RF_DATAMODUL_MODULATIONSHAPING_00 }, // no shaping + /* 0x03 */ { REG_BITRATEMSB, RF_BITRATEMSB_1200}, // default: 4.8 KBPS + /* 0x04 */ { REG_BITRATELSB, RF_BITRATELSB_1200}, + /* 0x05 */ { REG_FDEVMSB, RF_FDEVMSB_5000}, // default: 5KHz, (FDEV + BitRate / 2 <= 500KHz) + /* 0x06 */ { REG_FDEVLSB, RF_FDEVLSB_5000}, //* 0x07 */ { REG_FRFMSB, RF_FRFMSB_433}, //* 0x08 */ { REG_FRFMID, RF_FRFMID_433},