With reworking the code I did find a few anomalies. On the Node side, the system was blocking on the functions with SPI Flash. I took out all references to SPI Flash on both the Gateway and Node. I further cleaned out a lot of code that was not needed for the operation and streamlined the execution. Now the Node sends a 30 byte packet every 3 seconds to the Gateway without encryption or acknowledgments. The Gateway loops over recieveDone() looking for packets. I now have a high amount of confidence the packet is being sent out, but still can't seem to receive any packets at the Gateway. Lastly, I added the code from ChemE to dump the registers. I have included the updated code for both Node and Gateway and their output from their registers.
Node RegistersTransmitting at 915 Mhz...
Address - HEX - BIN
1 - 0 - 0
2 - 80 - 10000000
3 - 80 - 10000000
4 - 80 - 10000000
5 - 80 - 10000000
6 - 80 - 10000000
7 - 80 - 10000000
8 - 0 - 0
9 - 0 - 0
A - 0 - 0
B - 0 - 0
C - 0 - 0
D - 0 - 0
E - 0 - 0
F - 0 - 0
10 - C0 - 11000000
11 - C0 - 11000000
12 - 0 - 0
13 - 0 - 0
14 - 80 - 10000000
15 - 80 - 10000000
16 - 0 - 0
17 - 0 - 0
18 - C7 - 11000111
19 - C7 - 11000111
1A - C7 - 11000111
1B - C7 - 11000111
1C - 80 - 10000000
1D - 80 - 10000000
1E - 80 - 10000000
1F - 80 - 10000000
20 - 80 - 10000000
21 - 81 - 10000001
22 - 80 - 10000000
23 - 80 - 10000000
24 - 0 - 0
25 - 0 - 0
26 - C - 1100
27 - C - 1100
28 - 0 - 0
29 - 0 - 0
2A - 0 - 0
2B - 0 - 0
2C - F2 - 11110010
2D - F2 - 11110010
2E - 20 - 100000
2F - 20 - 100000
30 - 0 - 0
31 - 0 - 0
32 - 0 - 0
33 - 0 - 0
34 - 0 - 0
35 - 0 - 0
36 - 80 - 10000000
37 - 80 - 10000000
38 - 0 - 0
39 - 0 - 0
3A - 0 - 0
3B - 0 - 0
3C - 0 - 0
3D - 0 - 0
3E - 0 - 0
3F - 0 - 0
40 - 4 - 100
41 - 80 - 10000000
42 - 0 - 0
43 - 82 - 10000010
44 - C0 - 11000000
45 - C0 - 11000000
46 - C0 - 11000000
47 - C0 - 11000000
48 - 0 - 0
49 - 0 - 0
4A - 0 - 0
4B - 0 - 0
4C - C0 - 11000000
4D - C0 - 11000000
4E - 0 - 0
4F - E0 - 11100000
58 - 20 - 100000
5A - 10 - 10000
5C - C0 - 10000000
6F - C0 - 11000000
71 - 0 - 0
DDRB: 44 PORTB: 4 PINB: 12
DDRC: 0 PORTC: 0 PINC: 0
DDRD: 0 PORTD: 0 PIND: 27
SPSR: 0 SPCR: 80 PRR: 0 SREG: 194
Sending[30]: 123 ABCDEFGHIJKLMNOPQRSTUVWXYZ
Gateway RegistersListening at 915 Mhz...
Address - HEX - BIN
1 - 80 - 10000000
2 - 4 - 100
3 - 0 - 0
4 - 0 - 0
5 - 2 - 10
6 - 4 - 100
7 - E1 - 11100001
8 - 80 - 10000000
9 - 0 - 0
A - 4 - 100
B - 0 - 0
C - 2 - 10
D - 83 - 10000011
E - 4 - 100
F - 0 - 0
10 - 3 - 11
11 - 78 - 1111000
12 - 4 - 100
13 - E - 1110
14 - 80 - 10000000
15 - A0 - 10100000
16 - 4 - 100
17 - 94 - 10010100
18 - 0 - 0
19 - 2 - 10
1A - 4 - 100
1B - 0 - 0
1C - 0 - 0
1D - 4 - 100
1E - 4 - 100
1F - 0 - 0
20 - 0 - 0
21 - 0 - 0
22 - 4 - 100
23 - 0 - 0
24 - 0 - 0
25 - 0 - 0
26 - 4 - 100
27 - 80 - 10000000
28 - 81 - 10000001
29 - D8 - 11011000
2A - 4 - 100
2B - 0 - 0
2C - 0 - 0
2D - 3 - 11
2E - 4 - 100
2F - 1 - 1
30 - 40 - 1000000
31 - 0 - 0
32 - 4 - 100
33 - 0 - 0
34 - 0 - 0
35 - 0 - 0
36 - 4 - 100
37 - 80 - 10000000
38 - 0 - 0
39 - 0 - 0
3A - 4 - 100
3B - 0 - 0
3C - 8C - 10001100
3D - 0 - 0
3E - 4 - 100
3F - 41 - 1000001
40 - D3 - 11010011
41 - 60 - 1100000
42 - 4 - 100
43 - 40 - 1000000
44 - 82 - 10000010
45 - 59 - 1011001
46 - 4 - 100
47 - 61 - 1100001
48 - F1 - 11110001
49 - 60 - 1100000
4A - 4 - 100
4B - A - 1010
4C - C3 - 11000011
4D - 70 - 1110000
4E - 4 - 100
4F - 0 - 0
58 - 28 - 101000
5A - 4 - 100
5C - E0 - 11100000
6F - 20 - 100000
71 - 0 - 0
DDRB: 44 PORTB: 4 PINB: 12
DDRC: 0 PORTC: 0 PINC: 0
DDRD: 0 PORTD: 0 PIND: 3
SPSR: 0 SPCR: 80 PRR: 0 SREG: 194
Node Code
// Sample RFM69 sender/node sketch, with ACK and optional encryption, and Automatic Transmission Control
// Sends periodic messages of increasing length to gateway (id=1)
// It also looks for an onboard FLASH chip, if present
// RFM69 library and sample code by Felix Rusu - http://LowPowerLab.com/contact
// Copyright Felix Rusu (2015)
#include <RFM69.h> //get it here: https://www.github.com/lowpowerlab/rfm69
#include <RFM69_ATC.h>//get it here: https://www.github.com/lowpowerlab/rfm69
#include <SPI.h>
//*********************************************************************************************
//************ IMPORTANT SETTINGS - YOU MUST CHANGE/CONFIGURE TO FIT YOUR HARDWARE *************
//*********************************************************************************************
#define NODEID 2 //must be unique for each node on same network (range up to 254, 255 is used for broadcast)
#define NETWORKID 100 //the same on all nodes that talk to each other (range up to 255)
#define GATEWAYID 1
//Match frequency to the hardware version of the radio on your Moteino (uncomment one):
//#define FREQUENCY RF69_433MHZ
//#define FREQUENCY RF69_868MHZ
#define FREQUENCY RF69_915MHZ
#define ENCRYPTKEY "sampleEncryptKey" //exactly the same 16 characters/bytes on all nodes!
#define IS_RFM69HW //uncomment only for RFM69HW! Leave out if you have RFM69W!
//#define ENABLE_ATC //comment out this line to disable AUTO TRANSMISSION CONTROL
//*********************************************************************************************
#define SERIAL_BAUD 115200
int TRANSMITPERIOD = 150; //transmit a packet to gateway so often (in ms)
char payload[] = "123 ABCDEFGHIJKLMNOPQRSTUVWXYZ";
char buff[20];
int sendSize=30;
boolean requestACK = false;
//RFM69_ATC radio;
RFM69 radio;
void setup() {
Serial.begin(SERIAL_BAUD);
radio.initialize(FREQUENCY,NODEID,NETWORKID);
radio.setHighPower(); //uncomment only for RFM69HW!
radio.encrypt(ENCRYPTKEY);
//radio.setFrequency(919000000); //set frequency to some custom frequency
//Auto Transmission Control - dials down transmit power to save battery (-100 is the noise floor, -90 is still pretty good)
//For indoor nodes that are pretty static and at pretty stable temperatures (like a MotionMote) -90dBm is quite safe
//For more variable nodes that can expect to move or experience larger temp drifts a lower margin like -70 to -80 would probably be better
//Always test your ATC mote in the edge cases in your own environment to ensure ATC will perform as you expect
#ifdef ENABLE_ATC
radio.enableAutoPower(-70);
#endif
char buff[50];
sprintf(buff, "\nTransmitting at %d Mhz...", FREQUENCY==RF69_433MHZ ? 433 : FREQUENCY==RF69_868MHZ ? 868 : 915);
Serial.println(buff);
#ifdef ENABLE_ATC
Serial.println("RFM69_ATC Enabled (Auto Transmission Control)\n");
#endif
radio.readAllRegs();
Serial.print("58 - ");
Serial.print(radio.readReg(0x58),HEX);
Serial.print(" - ");
Serial.print(radio.readReg(0x58),BIN);
Serial.print("\n5A - ");
Serial.print(radio.readReg(0x5A),HEX);
Serial.print(" - ");
Serial.print(radio.readReg(0x5A),BIN);
Serial.print("\n5C - ");
Serial.print(radio.readReg(0x5C),HEX);
Serial.print(" - ");
Serial.print(radio.readReg(0x5C),BIN);
Serial.print("\n6F - ");
Serial.print(radio.readReg(0x6F),HEX);
Serial.print(" - ");
Serial.print(radio.readReg(0x6F),BIN);
Serial.print("\n71 - ");
Serial.print(radio.readReg(0x71),HEX);
Serial.print(" - ");
Serial.print(radio.readReg(0x71),BIN);
Serial.print("\nDDRB: ");
Serial.print(DDRB);
Serial.print("\tPORTB: ");
Serial.print(PORTB);
Serial.print("\tPINB: ");
Serial.print(PINB);
Serial.print("\nDDRC: ");
Serial.print(DDRC);
Serial.print("\tPORTC: ");
Serial.print(PORTC);
Serial.print("\tPINC: ");
Serial.print(PINC);
Serial.print("\nDDRD: ");
Serial.print(DDRD);
Serial.print("\tPORTD: ");
Serial.print(PORTD);
Serial.print("\tPIND: ");
Serial.print(PIND);
Serial.print("\nSPSR: ");
Serial.print(SPSR);
Serial.print("\tSPCR: ");
Serial.print(SPCR);
Serial.print("\tPRR: ");
Serial.print(PRR);
Serial.print("\tSREG: ");
Serial.print(SREG);
Serial.println();
//radio.encrypt(ENCRYPTKEY);
}
void loop() {
//check for any received packets
if (radio.receiveDone())
{
Serial.print('[');Serial.print(radio.SENDERID, DEC);Serial.print("] ");
for (byte i = 0; i < radio.DATALEN; i++)
Serial.print((char)radio.DATA[i]);
Serial.print(" [RX_RSSI:");Serial.print(radio.RSSI);Serial.print("]");
if (radio.ACKRequested())
{
radio.sendACK();
Serial.print(" - ACK sent");
}
Serial.println();
}
Serial.print("Sending[");
Serial.print(sendSize);
Serial.print("]: ");
for(byte i = 0; i < sendSize; i++)
Serial.print((char)payload[i]);
radio.send(GATEWAYID, payload, sendSize);
delay(3000);
Serial.println();
}
Gateway Code
// Sample RFM69 receiver/gateway sketch, with ACK and optional encryption, and Automatic Transmission Control
// Passes through any wireless received messages to the serial port & responds to ACKs
// It also looks for an onboard FLASH chip, if present
// RFM69 library and sample code by Felix Rusu - http://LowPowerLab.com/contact
// Copyright Felix Rusu (2015)
#include <RFM69.h> //get it here: https://www.github.com/lowpowerlab/rfm69
#include <RFM69_ATC.h>//get it here: https://www.github.com/lowpowerlab/rfm69
#include <SPI.h> //comes with Arduino IDE (www.arduino.cc)
//*********************************************************************************************
//************ IMPORTANT SETTINGS - YOU MUST CHANGE/CONFIGURE TO FIT YOUR HARDWARE *************
//*********************************************************************************************
#define NODEID 1 //unique for each node on same network
#define NETWORKID 100 //the same on all nodes that talk to each other
//Match frequency to the hardware version of the radio on your Moteino (uncomment one):
//#define FREQUENCY RF69_433MHZ
//#define FREQUENCY RF69_868MHZ
#define FREQUENCY RF69_915MHZ
#define ENCRYPTKEY "sampleEncryptKey" //exactly the same 16 characters/bytes on all nodes!
#define IS_RFM69HW //uncomment only for RFM69HW! Leave out if you have RFM69W!
//#define ENABLE_ATC //comment out this line to disable AUTO TRANSMISSION CONTROL
//*********************************************************************************************
#define SERIAL_BAUD 115200
//RFM69_ATC radio;
RFM69 radio;
bool promiscuousMode = false; //set to 'true' to sniff all packets on the same network
void setup() {
Serial.begin(SERIAL_BAUD);
delay(10);
radio.initialize(FREQUENCY,NODEID,NETWORKID);
radio.setHighPower(); //only for RFM69HW!
//radio.encrypt(ENCRYPTKEY);
//radio.promiscuous(promiscuousMode);
//radio.setFrequency(919000000); //set frequency to some custom frequency
char buff[50];
sprintf(buff, "\nListening at %d Mhz...", FREQUENCY==RF69_433MHZ ? 433 : FREQUENCY==RF69_868MHZ ? 868 : 915);
Serial.println(buff);
#ifdef ENABLE_ATC
Serial.println("RFM69_ATC Enabled (Auto Transmission Control)");
#endif
radio.readAllRegs();
Serial.print("58 - ");
Serial.print(radio.readReg(0x58),HEX);
Serial.print(" - ");
Serial.print(radio.readReg(0x58),BIN);
Serial.print("\n5A - ");
Serial.print(radio.readReg(0x5A),HEX);
Serial.print(" - ");
Serial.print(radio.readReg(0x5A),BIN);
Serial.print("\n5C - ");
Serial.print(radio.readReg(0x5C),HEX);
Serial.print(" - ");
Serial.print(radio.readReg(0x5C),BIN);
Serial.print("\n6F - ");
Serial.print(radio.readReg(0x6F),HEX);
Serial.print(" - ");
Serial.print(radio.readReg(0x6F),BIN);
Serial.print("\n71 - ");
Serial.print(radio.readReg(0x71),HEX);
Serial.print(" - ");
Serial.print(radio.readReg(0x71),BIN);
Serial.print("\nDDRB: ");
Serial.print(DDRB);
Serial.print("\tPORTB: ");
Serial.print(PORTB);
Serial.print("\tPINB: ");
Serial.print(PINB);
Serial.print("\nDDRC: ");
Serial.print(DDRC);
Serial.print("\tPORTC: ");
Serial.print(PORTC);
Serial.print("\tPINC: ");
Serial.print(PINC);
Serial.print("\nDDRD: ");
Serial.print(DDRD);
Serial.print("\tPORTD: ");
Serial.print(PORTD);
Serial.print("\tPIND: ");
Serial.print(PIND);
Serial.print("\nSPSR: ");
Serial.print(SPSR);
Serial.print("\tSPCR: ");
Serial.print(SPCR);
Serial.print("\tPRR: ");
Serial.print(PRR);
Serial.print("\tSREG: ");
Serial.print(SREG);
Serial.println();
}
byte ackCount=0;
uint32_t packetCount = 0;
void loop() {
if (radio.receiveDone())
{
Serial.print("#[");
Serial.print(++packetCount);
Serial.print(']');
Serial.print('[');Serial.print(radio.SENDERID, DEC);Serial.print("] ");
if (promiscuousMode)
{
Serial.print("to [");Serial.print(radio.TARGETID, DEC);Serial.print("] ");
}
for (byte i = 0; i < radio.DATALEN; i++)
Serial.print((char)radio.DATA[i]);
Serial.print(" [RX_RSSI:");Serial.print(radio.RSSI);Serial.print("]");
if (radio.ACKRequested())
{
byte theNodeID = radio.SENDERID;
radio.sendACK();
Serial.print(" - ACK sent.");
// When a node requests an ACK, respond to the ACK
// and also send a packet requesting an ACK (every 3rd one only)
// This way both TX/RX NODE functions are tested on 1 end at the GATEWAY
if (ackCount++%3==0)
{
Serial.print(" Pinging node ");
Serial.print(theNodeID);
Serial.print(" - ACK...");
delay(3); //need this when sending right after reception .. ?
if (radio.sendWithRetry(theNodeID, "ACK TEST", 8, 0)) // 0 = only 1 attempt, no retries
Serial.print("ok!");
else Serial.print("nothing");
}
}
Serial.println();
}
}