adjust IS_RFM69HW to IS_RFM69HW_HCW

Include HCW to avoid confusion of HW and HCW modules
This commit is contained in:
LowPowerLab 2017-03-31 12:21:37 -04:00
parent a1ab144f03
commit f8192e1fd3
21 changed files with 68 additions and 62 deletions

View File

@ -42,7 +42,7 @@
//#define FREQUENCY RF69_868MHZ //#define FREQUENCY RF69_868MHZ
#define FREQUENCY RF69_915MHZ //Match this with the version of your Moteino! (others: RF69_433MHZ, RF69_868MHZ) #define FREQUENCY RF69_915MHZ //Match this with the version of your Moteino! (others: RF69_433MHZ, RF69_868MHZ)
#define ENCRYPTKEY "sampleEncryptKey" //has to be same 16 characters/bytes on all nodes, not more not less! #define ENCRYPTKEY "sampleEncryptKey" //has to be same 16 characters/bytes on all nodes, not more not less!
//#define IS_RFM69HW //uncomment only for RFM69HW! Leave out if you have RFM69W! #define IS_RFM69HW_HCW //uncomment only for RFM69HW/HCW! Leave out if you have RFM69W/CW!
//***************************************************************************************************************************** //*****************************************************************************************************************************
#define ENABLE_ATC //comment out this line to disable AUTO TRANSMISSION CONTROL #define ENABLE_ATC //comment out this line to disable AUTO TRANSMISSION CONTROL
#define ATC_RSSI -75 #define ATC_RSSI -75
@ -89,8 +89,8 @@ void setup(void)
pinMode(LED, OUTPUT); pinMode(LED, OUTPUT);
radio.initialize(FREQUENCY,NODEID,NETWORKID); radio.initialize(FREQUENCY,NODEID,NETWORKID);
#ifdef IS_RFM69HW #ifdef IS_RFM69HW_HCW
radio.setHighPower(); //uncomment only for RFM69HW! radio.setHighPower(); //must include this only for RFM69HW/HCW!
#endif #endif
radio.encrypt(ENCRYPTKEY); radio.encrypt(ENCRYPTKEY);

View File

@ -35,6 +35,7 @@
#include <SPIFlash.h> //get it here: https://github.com/lowpowerlab/spiflash #include <SPIFlash.h> //get it here: https://github.com/lowpowerlab/spiflash
#include <SPI.h> //included with Arduino IDE (www.arduino.cc) #include <SPI.h> //included with Arduino IDE (www.arduino.cc)
//For WeatherShield with BME280 see the WeatherNode example
#ifdef WEATHERSHIELD #ifdef WEATHERSHIELD
#include <SFE_BMP180.h> //get it here: https://github.com/LowPowerLab/SFE_BMP180 #include <SFE_BMP180.h> //get it here: https://github.com/LowPowerLab/SFE_BMP180
#include <SI7021.h> //get it here: https://github.com/LowPowerLab/SI7021 #include <SI7021.h> //get it here: https://github.com/LowPowerLab/SI7021
@ -50,7 +51,7 @@
//#define FREQUENCY RF69_868MHZ //#define FREQUENCY RF69_868MHZ
#define FREQUENCY RF69_915MHZ //Match this with the version of your Moteino! (others: RF69_433MHZ, RF69_868MHZ) #define FREQUENCY RF69_915MHZ //Match this with the version of your Moteino! (others: RF69_433MHZ, RF69_868MHZ)
#define ENCRYPTKEY "sampleEncryptKey" //has to be same 16 characters/bytes on all nodes, not more not less! #define ENCRYPTKEY "sampleEncryptKey" //has to be same 16 characters/bytes on all nodes, not more not less!
#define IS_RFM69HW //uncomment only for RFM69HW! Leave out if you have RFM69W! #define IS_RFM69HW_HCW //uncomment only for RFM69HW/HCW! Leave out if you have RFM69W/CW!
//***************************************************************************************************************************** //*****************************************************************************************************************************
#define ENABLE_ATC //comment out this line to disable AUTO TRANSMISSION CONTROL #define ENABLE_ATC //comment out this line to disable AUTO TRANSMISSION CONTROL
#define ATC_RSSI -75 #define ATC_RSSI -75
@ -134,8 +135,8 @@ void setup(void)
pinMode(LED, OUTPUT); pinMode(LED, OUTPUT);
radio.initialize(FREQUENCY,NODEID,NETWORKID); radio.initialize(FREQUENCY,NODEID,NETWORKID);
#ifdef IS_RFM69HW #ifdef IS_RFM69HW_HCW
radio.setHighPower(); //uncomment only for RFM69HW! radio.setHighPower(); //must include this only for RFM69HW/HCW!
#endif #endif
radio.encrypt(ENCRYPTKEY); radio.encrypt(ENCRYPTKEY);

View File

@ -39,7 +39,7 @@
//#define FREQUENCY RF69_868MHZ //#define FREQUENCY RF69_868MHZ
//#define FREQUENCY RF69_915MHZ //#define FREQUENCY RF69_915MHZ
#define ENCRYPTKEY "sampleEncryptKey" //exactly the same 16 characters/bytes on all nodes! #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 IS_RFM69HW_HCW //uncomment only for RFM69HW/HCW! Leave out if you have RFM69W/CW!
//********************************************************************************************* //*********************************************************************************************
//Auto Transmission Control - dials down transmit power to save battery //Auto Transmission Control - dials down transmit power to save battery
//Usually you do not need to always transmit at max output power //Usually you do not need to always transmit at max output power
@ -71,8 +71,8 @@ void setup() {
Serial.begin(SERIAL_BAUD); Serial.begin(SERIAL_BAUD);
delay(10); delay(10);
radio.initialize(FREQUENCY,NODEID,NETWORKID); radio.initialize(FREQUENCY,NODEID,NETWORKID);
#ifdef IS_RFM69HW #ifdef IS_RFM69HW_HCW
radio.setHighPower(); //only for RFM69HW! radio.setHighPower(); //must include this only for RFM69HW/HCW!
#endif #endif
radio.encrypt(ENCRYPTKEY); radio.encrypt(ENCRYPTKEY);
radio.promiscuous(promiscuousMode); radio.promiscuous(promiscuousMode);

View File

@ -51,7 +51,7 @@
#define NETWORKID 250 #define NETWORKID 250
#define FREQUENCY RF69_915MHZ //Match this with the version of your Moteino! (others: RF69_433MHZ, RF69_868MHZ) #define FREQUENCY RF69_915MHZ //Match this with the version of your Moteino! (others: RF69_433MHZ, RF69_868MHZ)
#define ENCRYPTKEY "sampleEncryptKey" //has to be same 16 characters/bytes on all nodes, not more not less! #define ENCRYPTKEY "sampleEncryptKey" //has to be same 16 characters/bytes on all nodes, not more not less!
//#define IS_RFM69HW //uncomment only for RFM69HW! Leave out if you have RFM69W! #define IS_RFM69HW_HCW //uncomment only for RFM69HW/HCW! Leave out if you have RFM69W/CW!
//***************************************************************************************************************************** //*****************************************************************************************************************************
#define ENABLE_ATC //comment out this line to disable AUTO TRANSMISSION CONTROL #define ENABLE_ATC //comment out this line to disable AUTO TRANSMISSION CONTROL
#define ATC_RSSI -75 #define ATC_RSSI -75
@ -98,8 +98,8 @@ void setup(void)
pinMode(LED, OUTPUT); pinMode(LED, OUTPUT);
radio.initialize(FREQUENCY,NODEID,NETWORKID); radio.initialize(FREQUENCY,NODEID,NETWORKID);
#ifdef IS_RFM69HW #ifdef IS_RFM69HW_HCW
radio.setHighPower(); //uncomment only for RFM69HW! radio.setHighPower(); //must include this only for RFM69HW/HCW!
#endif #endif
radio.encrypt(ENCRYPTKEY); radio.encrypt(ENCRYPTKEY);

View File

@ -47,7 +47,7 @@
//#define FREQUENCY RF69_868MHZ //#define FREQUENCY RF69_868MHZ
#define FREQUENCY RF69_915MHZ #define FREQUENCY RF69_915MHZ
//#define FREQUENCY_EXACT 917000000 //#define FREQUENCY_EXACT 917000000
#define IS_RFM69HW //uncomment only for RFM69HW! Leave out if you have RFM69W! #define IS_RFM69HW_HCW //uncomment only for RFM69HW/HCW! Leave out if you have RFM69W/CW!
#define ENCRYPTKEY "sampleEncryptKey" //exactly the same 16 characters/bytes on all nodes! #define ENCRYPTKEY "sampleEncryptKey" //exactly the same 16 characters/bytes on all nodes!
#define SENDEVERYXLOOPS 8 //each loop sleeps 8 seconds, so send status message every this many sleep cycles (default "4" = 32 seconds) #define SENDEVERYXLOOPS 8 //each loop sleeps 8 seconds, so send status message every this many sleep cycles (default "4" = 32 seconds)
//********************************************************************************************* //*********************************************************************************************
@ -95,8 +95,8 @@ void setup() {
Serial.begin(SERIAL_BAUD); Serial.begin(SERIAL_BAUD);
#endif #endif
radio.initialize(FREQUENCY,NODEID,NETWORKID); radio.initialize(FREQUENCY,NODEID,NETWORKID);
#ifdef IS_RFM69HW #ifdef IS_RFM69HW_HCW
radio.setHighPower(); //uncomment only for RFM69HW! radio.setHighPower(); //must include this only for RFM69HW/HCW!
#endif #endif
radio.encrypt(ENCRYPTKEY); radio.encrypt(ENCRYPTKEY);

View File

@ -45,7 +45,7 @@
#define FREQUENCY RF69_915MHZ //Match this with the version of your Moteino! (others: RF69_433MHZ, RF69_868MHZ) #define FREQUENCY RF69_915MHZ //Match this with the version of your Moteino! (others: RF69_433MHZ, RF69_868MHZ)
//#define FREQUENCY_EXACT 917000000 //uncomment and set to a specific frequency in Hz, if commented the center frequency is used //#define FREQUENCY_EXACT 917000000 //uncomment and set to a specific frequency in Hz, if commented the center frequency is used
#define ENCRYPTKEY "sampleEncryptKey" //has to be same 16 characters/bytes on all nodes, not more not less! #define ENCRYPTKEY "sampleEncryptKey" //has to be same 16 characters/bytes on all nodes, not more not less!
#define IS_RFM69HW //uncomment only for RFM69HW! Leave out if you have RFM69W! #define IS_RFM69HW_HCW //uncomment only for RFM69HW/HCW! Leave out if you have RFM69W/CW!
#define ENABLE_ATC //comment out this line to disable AUTO TRANSMISSION CONTROL //more here: http://lowpowerlab.com/blog/2015/11/11/rfm69_atc-automatic-transmission-control/ #define ENABLE_ATC //comment out this line to disable AUTO TRANSMISSION CONTROL //more here: http://lowpowerlab.com/blog/2015/11/11/rfm69_atc-automatic-transmission-control/
//#define ENABLE_WIRELESS_PROGRAMMING //comment out this line to disable Wireless Programming of this gateway node //#define ENABLE_WIRELESS_PROGRAMMING //comment out this line to disable Wireless Programming of this gateway node
#define ENABLE_LCD //comment this out if you don't have or don't want to use the LCD #define ENABLE_LCD //comment this out if you don't have or don't want to use the LCD
@ -671,8 +671,8 @@ void setup() {
radio.initialize(FREQUENCY,NODEID,NETWORKID); radio.initialize(FREQUENCY,NODEID,NETWORKID);
radio.encrypt(ENCRYPTKEY); radio.encrypt(ENCRYPTKEY);
#ifdef IS_RFM69HW #ifdef IS_RFM69HW_HCW
radio.setHighPower(); //only for RFM69HW! radio.setHighPower(); //must include this only for RFM69HW/HCW!
#endif #endif
sprintf(lcdbuff, "Listening @ %dmhz...", FREQUENCY==RF69_433MHZ ? 433 : FREQUENCY==RF69_868MHZ ? 868 : 915); sprintf(lcdbuff, "Listening @ %dmhz...", FREQUENCY==RF69_433MHZ ? 433 : FREQUENCY==RF69_868MHZ ? 868 : 915);

View File

@ -48,7 +48,7 @@
//#define FREQUENCY RF69_433MHZ //#define FREQUENCY RF69_433MHZ
//#define FREQUENCY RF69_868MHZ //#define FREQUENCY RF69_868MHZ
#define FREQUENCY RF69_915MHZ #define FREQUENCY RF69_915MHZ
#define IS_RFM69HW //uncomment only for RFM69HW! Remove/comment if you have RFM69W! #define IS_RFM69HW_HCW //uncomment only for RFM69HW/HCW! Leave out if you have RFM69W/CW!
#define ENCRYPTKEY "sampleEncryptKey" //exactly the same 16 characters/bytes on all nodes! #define ENCRYPTKEY "sampleEncryptKey" //exactly the same 16 characters/bytes on all nodes!
#define ENABLE_ATC //comment out this line to disable AUTO TRANSMISSION CONTROL #define ENABLE_ATC //comment out this line to disable AUTO TRANSMISSION CONTROL
#define ATC_RSSI -75 #define ATC_RSSI -75
@ -106,8 +106,8 @@ void checkBattery(void);
void setup() { void setup() {
Serial.begin(SERIAL_BAUD); Serial.begin(SERIAL_BAUD);
radio.initialize(FREQUENCY,NODEID,NETWORKID); radio.initialize(FREQUENCY,NODEID,NETWORKID);
#ifdef IS_RFM69HW #ifdef IS_RFM69HW_HCW
radio.setHighPower(); //uncomment only for RFM69HW! radio.setHighPower(); //must include this only for RFM69HW/HCW!
#endif #endif
radio.encrypt(ENCRYPTKEY); radio.encrypt(ENCRYPTKEY);

View File

@ -40,7 +40,7 @@
//#define FREQUENCY RF69_868MHZ //#define FREQUENCY RF69_868MHZ
//#define FREQUENCY RF69_915MHZ //#define FREQUENCY RF69_915MHZ
#define ENCRYPTKEY "sampleEncryptKey" //exactly the same 16 characters/bytes on all nodes! #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 IS_RFM69HW_HCW //uncomment only for RFM69HW/HCW! Leave out if you have RFM69W/CW!
//********************************************************************************************* //*********************************************************************************************
//Auto Transmission Control - dials down transmit power to save battery //Auto Transmission Control - dials down transmit power to save battery
//Usually you do not need to always transmit at max output power //Usually you do not need to always transmit at max output power
@ -77,8 +77,8 @@ SPIFlash flash(FLASH_SS, 0xEF30); //EF30 for 4mbit Windbond chip (W25X40CL)
void setup() { void setup() {
Serial.begin(SERIAL_BAUD); Serial.begin(SERIAL_BAUD);
radio.initialize(FREQUENCY,NODEID,NETWORKID); radio.initialize(FREQUENCY,NODEID,NETWORKID);
#ifdef IS_RFM69HW #ifdef IS_RFM69HW_HCW
radio.setHighPower(); //uncomment only for RFM69HW! radio.setHighPower(); //must include this only for RFM69HW/HCW!
#endif #endif
radio.encrypt(ENCRYPTKEY); radio.encrypt(ENCRYPTKEY);
//radio.setFrequency(919000000); //set frequency to some custom frequency //radio.setFrequency(919000000); //set frequency to some custom frequency

View File

@ -44,7 +44,7 @@
//#define FREQUENCY RF69_868MHZ //#define FREQUENCY RF69_868MHZ
#define FREQUENCY RF69_915MHZ #define FREQUENCY RF69_915MHZ
#define ENCRYPTKEY "sampleEncryptKey" //exactly the same 16 characters/bytes on all nodes! #define ENCRYPTKEY "sampleEncryptKey" //exactly the same 16 characters/bytes on all nodes!
#define IS_RFM69HW //uncomment only for RFM69HW! Remove/comment if you have RFM69W! #define IS_RFM69HW_HCW //uncomment only for RFM69HW/HCW! Leave out if you have RFM69W/CW!
//********************************************************************************************* //*********************************************************************************************
#define SERIAL_BAUD 115200 #define SERIAL_BAUD 115200
@ -60,8 +60,8 @@ bool promiscuousMode = true; //set to 'true' to sniff all packets on the same ne
void setup() { void setup() {
Serial.begin(SERIAL_BAUD); Serial.begin(SERIAL_BAUD);
radio.initialize(FREQUENCY,NODEID,NETWORKID); radio.initialize(FREQUENCY,NODEID,NETWORKID);
#ifdef IS_RFM69HW #ifdef IS_RFM69HW_HCW
radio.setHighPower(); //only for RFM69HW! radio.setHighPower(); //must include this only for RFM69HW/HCW!
#endif #endif
radio.encrypt(ENCRYPTKEY); radio.encrypt(ENCRYPTKEY);
radio.promiscuous(promiscuousMode); radio.promiscuous(promiscuousMode);

View File

@ -42,7 +42,7 @@
#define NETWORKID 200 //the network ID of all nodes this node listens/talks to #define NETWORKID 200 //the network ID of all nodes this node listens/talks to
#define FREQUENCY RF69_915MHZ //Match this with the version of your Moteino! (others: RF69_433MHZ, RF69_868MHZ) #define FREQUENCY RF69_915MHZ //Match this with the version of your Moteino! (others: RF69_433MHZ, RF69_868MHZ)
#define ENCRYPTKEY "sampleEncryptKey" //identical 16 characters/bytes on all nodes, not more not less! #define ENCRYPTKEY "sampleEncryptKey" //identical 16 characters/bytes on all nodes, not more not less!
#define IS_RFM69HW //uncomment only for RFM69HW! Leave out if you have RFM69W! #define IS_RFM69HW_HCW //uncomment only for RFM69HW/HCW! Leave out if you have RFM69W/CW!
#define ACK_TIME 30 // # of ms to wait for an ack packet #define ACK_TIME 30 // # of ms to wait for an ack packet
//***************************************************************************************************************************** //*****************************************************************************************************************************
#define ENABLE_ATC //comment out this line to disable AUTO TRANSMISSION CONTROL #define ENABLE_ATC //comment out this line to disable AUTO TRANSMISSION CONTROL
@ -81,8 +81,8 @@ void setup() {
Serial.begin(SERIAL_BAUD); Serial.begin(SERIAL_BAUD);
delay(10); delay(10);
radio.initialize(FREQUENCY,NODEID,NETWORKID); radio.initialize(FREQUENCY,NODEID,NETWORKID);
#ifdef IS_RFM69HW #ifdef IS_RFM69HW_HCW
radio.setHighPower(); //uncomment only for RFM69HW! radio.setHighPower(); //must include this only for RFM69HW/HCW!
#endif #endif
radio.encrypt(ENCRYPTKEY); radio.encrypt(ENCRYPTKEY);

View File

@ -47,7 +47,7 @@
#define NETWORKID 200 //the network ID of all nodes this node listens/talks to #define NETWORKID 200 //the network ID of all nodes this node listens/talks to
#define FREQUENCY RF69_915MHZ //Match this with the version of your Moteino! (others: RF69_433MHZ, RF69_868MHZ) #define FREQUENCY RF69_915MHZ //Match this with the version of your Moteino! (others: RF69_433MHZ, RF69_868MHZ)
#define ENCRYPTKEY "sampleEncryptKey" //identical 16 characters/bytes on all nodes, not more not less! #define ENCRYPTKEY "sampleEncryptKey" //identical 16 characters/bytes on all nodes, not more not less!
#define IS_RFM69HW //uncomment only for RFM69HW! Leave out if you have RFM69W! #define IS_RFM69HW_HCW //uncomment only for RFM69HW/HCW! Leave out if you have RFM69W/CW!
#define ACK_TIME 30 // # of ms to wait for an ack #define ACK_TIME 30 // # of ms to wait for an ack
//***************************************************************************************************************************** //*****************************************************************************************************************************
#define ENABLE_ATC //comment out this line to disable AUTO TRANSMISSION CONTROL #define ENABLE_ATC //comment out this line to disable AUTO TRANSMISSION CONTROL
@ -93,9 +93,8 @@ void setup() {
Serial.begin(SERIAL_BAUD); Serial.begin(SERIAL_BAUD);
delay(10); delay(10);
radio.initialize(FREQUENCY,NODEID,NETWORKID); radio.initialize(FREQUENCY,NODEID,NETWORKID);
#ifdef IS_RFM69HW_HCW
#ifdef IS_RFM69HW radio.setHighPower(); //must include this only for RFM69HW/HCW!
radio.setHighPower(); //uncomment only for RFM69HW!
#endif #endif
radio.encrypt(ENCRYPTKEY); radio.encrypt(ENCRYPTKEY);

View File

@ -43,7 +43,7 @@
#define NETWORKID 250 #define NETWORKID 250
#define FREQUENCY RF69_915MHZ //Match this with the version of your Moteino! (others: RF69_433MHZ, RF69_868MHZ) #define FREQUENCY RF69_915MHZ //Match this with the version of your Moteino! (others: RF69_433MHZ, RF69_868MHZ)
#define ENCRYPTKEY "sampleEncryptKey" //has to be same 16 characters/bytes on all nodes, not more not less! #define ENCRYPTKEY "sampleEncryptKey" //has to be same 16 characters/bytes on all nodes, not more not less!
//#define IS_RFM69HW //uncomment only for RFM69HW! Leave out if you have RFM69W! #define IS_RFM69HW_HCW //uncomment only for RFM69HW/HCW! Leave out if you have RFM69W/CW!
//***************************************************************************************************************************** //*****************************************************************************************************************************
#define ENABLE_ATC //comment out this line to disable AUTO TRANSMISSION CONTROL #define ENABLE_ATC //comment out this line to disable AUTO TRANSMISSION CONTROL
#define ATC_RSSI -75 #define ATC_RSSI -75
@ -112,8 +112,8 @@ void setup() {
#endif #endif
radio.initialize(FREQUENCY,NODEID,NETWORKID); radio.initialize(FREQUENCY,NODEID,NETWORKID);
#ifdef IS_RFM69HW #ifdef IS_RFM69HW_HCW
radio.setHighPower(); //uncomment only for RFM69HW! radio.setHighPower(); //must include this only for RFM69HW/HCW!
#endif #endif
radio.encrypt(ENCRYPTKEY); radio.encrypt(ENCRYPTKEY);
pinMode(LED, OUTPUT); pinMode(LED, OUTPUT);

View File

@ -1,4 +1,4 @@
// Sample RFM69 random temperature sender at fixed intervals (F) // Sample RFM69 random temperature sender at fixed intervals (Fahrenheit)
// ********************************************************************************** // **********************************************************************************
// Copyright Felix Rusu 2016, http://www.LowPowerLab.com/contact // Copyright Felix Rusu 2016, http://www.LowPowerLab.com/contact
// ********************************************************************************** // **********************************************************************************
@ -37,7 +37,7 @@
//Match frequency to the hardware version of the radio on your Moteino (uncomment one): //Match frequency to the hardware version of the radio on your Moteino (uncomment one):
//#define FREQUENCY RF69_433MHZ //#define FREQUENCY RF69_433MHZ
#define FREQUENCY RF69_915MHZ #define FREQUENCY RF69_915MHZ
#define IS_RFM69HW //uncomment only for RFM69HW! Leave out if you have RFM69W! #define IS_RFM69HW_HCW //uncomment only for RFM69HW/HCW! Leave out if you have RFM69W/CW!
#define ENCRYPTKEY "sampleEncryptKey" //exactly the same 16 characters/bytes on all nodes! #define ENCRYPTKEY "sampleEncryptKey" //exactly the same 16 characters/bytes on all nodes!
//***************************************************************************************************************************** //*****************************************************************************************************************************
#define ENABLE_ATC //comment out this line to disable AUTO TRANSMISSION CONTROL #define ENABLE_ATC //comment out this line to disable AUTO TRANSMISSION CONTROL
@ -68,8 +68,8 @@ byte sendSize=0;
void setup() { void setup() {
Serial.begin(SERIAL_BAUD); Serial.begin(SERIAL_BAUD);
radio.initialize(FREQUENCY,NODEID,NETWORKID); radio.initialize(FREQUENCY,NODEID,NETWORKID);
#ifdef IS_RFM69HW #ifdef IS_RFM69HW_HCW
radio.setHighPower(); //uncomment only for RFM69HW! radio.setHighPower(); //must include this only for RFM69HW/HCW!
#endif #endif
radio.encrypt(ENCRYPTKEY); radio.encrypt(ENCRYPTKEY);

View File

@ -50,7 +50,7 @@
#define GATEWAYID 1 //node Id of the receiver we are sending data to #define GATEWAYID 1 //node Id of the receiver we are sending data to
#define NETWORKID 100 //the same on all nodes that talk to each other including this node and the gateway #define NETWORKID 100 //the same on all nodes that talk to each other including this node and the gateway
#define FREQUENCY RF69_915MHZ //others: RF69_433MHZ, RF69_868MHZ (this must match the RFM69 freq you have on your Moteino) #define FREQUENCY RF69_915MHZ //others: RF69_433MHZ, RF69_868MHZ (this must match the RFM69 freq you have on your Moteino)
#define IS_RFM69HW //uncomment only for RFM69HW! Remove/comment if you have RFM69W! #define IS_RFM69HW_HCW //uncomment only for RFM69HW/HCW! Leave out if you have RFM69W/CW!
#define ENCRYPTKEY "sampleEncryptKey" //exactly the same 16 characters/bytes on all nodes! #define ENCRYPTKEY "sampleEncryptKey" //exactly the same 16 characters/bytes on all nodes!
#define SENDLOOPS 80 //default:80 //if no message was sent for this many sleep loops/cycles, then force a send #define SENDLOOPS 80 //default:80 //if no message was sent for this many sleep loops/cycles, then force a send
#define READ_SAMPLES 3 #define READ_SAMPLES 3
@ -118,8 +118,8 @@ void setup() {
#endif #endif
radio.initialize(FREQUENCY,NODEID,NETWORKID); radio.initialize(FREQUENCY,NODEID,NETWORKID);
#ifdef IS_RFM69HW #ifdef IS_RFM69HW_HCW
radio.setHighPower(); //uncomment only for RFM69HW! radio.setHighPower(); //must include this only for RFM69HW/HCW!
#endif #endif
radio.encrypt(ENCRYPTKEY); radio.encrypt(ENCRYPTKEY);
//sprintf(buff, "\nTransmitting at %d Mhz...", FREQUENCY==RF69_433MHZ ? 433 : FREQUENCY==RF69_868MHZ ? 868 : 915); //sprintf(buff, "\nTransmitting at %d Mhz...", FREQUENCY==RF69_433MHZ ? 433 : FREQUENCY==RF69_868MHZ ? 868 : 915);

View File

@ -9,6 +9,7 @@
#define LED 9 #define LED 9
#define SERIAL_BAUD 115200 #define SERIAL_BAUD 115200
#define ACK_TIME 30 // # of ms to wait for an ack #define ACK_TIME 30 // # of ms to wait for an ack
#define IS_RFM69HW_HCW //uncomment only for RFM69HW/HCW! Leave out if you have RFM69W/CW!
RFM69 radio; RFM69 radio;
SPIFlash flash(8, 0xEF30); //EF40 for 16mbit windbond chip SPIFlash flash(8, 0xEF30); //EF40 for 16mbit windbond chip
@ -25,7 +26,9 @@ void setup() {
Serial.begin(SERIAL_BAUD); Serial.begin(SERIAL_BAUD);
delay(10); delay(10);
radio.initialize(FREQUENCY,NODEID,NETWORKID); radio.initialize(FREQUENCY,NODEID,NETWORKID);
//radio.setHighPower(); //uncomment only for RFM69HW! #ifdef IS_RFM69HW_HCW
radio.setHighPower(); //must include this only for RFM69HW/HCW!
#endif
radio.encrypt(KEY); radio.encrypt(KEY);
radio.promiscuous(promiscuousMode); radio.promiscuous(promiscuousMode);
char buff[50]; char buff[50];

View File

@ -10,6 +10,7 @@
#define LED 9 #define LED 9
#define SERIAL_BAUD 115200 #define SERIAL_BAUD 115200
#define ACK_TIME 30 // # of ms to wait for an ack #define ACK_TIME 30 // # of ms to wait for an ack
#define IS_RFM69HW_HCW //uncomment only for RFM69HW/HCW! Leave out if you have RFM69W/CW!
int TRANSMITPERIOD = 300; //transmit a packet to gateway so often (in ms) int TRANSMITPERIOD = 300; //transmit a packet to gateway so often (in ms)
byte sendSize=0; byte sendSize=0;
@ -27,7 +28,9 @@ Payload theData;
void setup() { void setup() {
Serial.begin(SERIAL_BAUD); Serial.begin(SERIAL_BAUD);
radio.initialize(FREQUENCY,NODEID,NETWORKID); radio.initialize(FREQUENCY,NODEID,NETWORKID);
//radio.setHighPower(); //uncomment only for RFM69HW! #ifdef IS_RFM69HW_HCW
radio.setHighPower(); //must include this only for RFM69HW/HCW!
#endif
radio.encrypt(KEY); radio.encrypt(KEY);
char buff[50]; char buff[50];
sprintf(buff, "\nTransmitting at %d Mhz...", FREQUENCY==RF69_433MHZ ? 433 : FREQUENCY==RF69_868MHZ ? 868 : 915); sprintf(buff, "\nTransmitting at %d Mhz...", FREQUENCY==RF69_433MHZ ? 433 : FREQUENCY==RF69_868MHZ ? 868 : 915);

View File

@ -172,7 +172,7 @@ void setup(void)
radio.initialize(CONFIG.frequency,CONFIG.nodeID,CONFIG.networkID); radio.initialize(CONFIG.frequency,CONFIG.nodeID,CONFIG.networkID);
radio.sleep(); radio.sleep();
if (CONFIG.isHW) radio.setHighPower(); //use with RFM69HW ONLY! if (CONFIG.isHW) radio.setHighPower(); //must include this only for RFM69HW/HCW!
if (CONFIG.encryptionKey[0]!=0) radio.encrypt(CONFIG.encryptionKey); if (CONFIG.encryptionKey[0]!=0) radio.encrypt(CONFIG.encryptionKey);
#ifdef ENABLE_ATC #ifdef ENABLE_ATC
@ -543,7 +543,7 @@ void displayMainMenu()
Serial.print (F("| f - set frequency band (set to: "));Serial.print(CONFIG.frequency==RF69_433MHZ?F("433"):CONFIG.frequency==RF69_868MHZ?F("868"):F("915"));Serial.println(F("mhz)")); Serial.print (F("| f - set frequency band (set to: "));Serial.print(CONFIG.frequency==RF69_433MHZ?F("433"):CONFIG.frequency==RF69_868MHZ?F("868"):F("915"));Serial.println(F("mhz)"));
Serial.print (F("| i - set node ID (set to: "));Serial.print(CONFIG.nodeID);Serial.println(F(")")); Serial.print (F("| i - set node ID (set to: "));Serial.print(CONFIG.nodeID);Serial.println(F(")"));
Serial.print (F("| n - set network ID (set to: "));Serial.print(CONFIG.networkID);Serial.println(")"); Serial.print (F("| n - set network ID (set to: "));Serial.print(CONFIG.networkID);Serial.println(")");
Serial.print (F("| w - set RFM69 type (set to: "));Serial.print(CONFIG.isHW?F("HW"):F("W/CW"));Serial.println(F(")")); Serial.print (F("| w - set RFM69 type (set to: "));Serial.print(CONFIG.isHW?F("HW/HCW"):F("W/CW"));Serial.println(F(")"));
Serial.print (F("| e - set encryption key (set to: '"));Serial.print(CONFIG.encryptionKey);Serial.println(F("')")); Serial.print (F("| e - set encryption key (set to: '"));Serial.print(CONFIG.encryptionKey);Serial.println(F("')"));
Serial.print (F("| d - set description (set to: '"));Serial.print(CONFIG.description);Serial.println(F("')")); Serial.print (F("| d - set description (set to: '"));Serial.print(CONFIG.description);Serial.println(F("')"));
Serial.println(F("| s - save CONFIG to EEPROM")); Serial.println(F("| s - save CONFIG to EEPROM"));
@ -571,7 +571,7 @@ void handleMenuInput(char c)
case 'i': Serial.print(F("\r\nEnter node ID (1-255 + <ENTER>): ")); CONFIG.nodeID=0;menu=c; break; case 'i': Serial.print(F("\r\nEnter node ID (1-255 + <ENTER>): ")); CONFIG.nodeID=0;menu=c; break;
case 'n': Serial.print(F("\r\nEnter network ID (0-255 + <ENTER>): ")); CONFIG.networkID=0; menu=c; break; case 'n': Serial.print(F("\r\nEnter network ID (0-255 + <ENTER>): ")); CONFIG.networkID=0; menu=c; break;
case 'e': Serial.print(F("\r\nEnter encryption key (type 16 characters): ")); menu=c; break; case 'e': Serial.print(F("\r\nEnter encryption key (type 16 characters): ")); menu=c; break;
case 'w': Serial.print(F("\r\nIs this RFM69W/CW/HW (0=W/CW, 1=HW): ")); menu=c; break; case 'w': Serial.print(F("\r\nIs this RFM69W/CW/HW (0=W/CW, 1=HW/HCW): ")); menu=c; break;
case 'd': Serial.print(F("\r\nEnter description (10 chars max + <ENTER>): ")); menu=c; break; case 'd': Serial.print(F("\r\nEnter description (10 chars max + <ENTER>): ")); menu=c; break;
case 's': Serial.print(F("\r\nCONFIG saved to EEPROM!")); EEPROM.writeBlock(0, CONFIG); break; case 's': Serial.print(F("\r\nCONFIG saved to EEPROM!")); EEPROM.writeBlock(0, CONFIG); break;
case 'E': Serial.print(F("\r\nErasing EEPROM ... ")); menu=c; break; case 'E': Serial.print(F("\r\nErasing EEPROM ... ")); menu=c; break;
@ -673,7 +673,7 @@ void handleMenuInput(char c)
switch(c) switch(c)
{ {
case '0': Serial.println(F("Set to RFM69W\\CW")); CONFIG.isHW = 0; menu=0; break; case '0': Serial.println(F("Set to RFM69W\\CW")); CONFIG.isHW = 0; menu=0; break;
case '1': Serial.println(F("Set to RFM69HW")); CONFIG.isHW = 1; menu=0; break; case '1': Serial.println(F("Set to RFM69HW\\HCW")); CONFIG.isHW = 1; menu=0; break;
case 27: displayMainMenu();menu=0;break; case 27: displayMainMenu();menu=0;break;
} }
break; break;

View File

@ -62,7 +62,7 @@
//#define FREQUENCY RF69_868MHZ //#define FREQUENCY RF69_868MHZ
#define FREQUENCY RF69_915MHZ #define FREQUENCY RF69_915MHZ
#define ENCRYPTKEY "sampleEncryptKey" //exactly the same 16 characters/bytes on all nodes! #define ENCRYPTKEY "sampleEncryptKey" //exactly the same 16 characters/bytes on all nodes!
#define IS_RFM69HW //uncomment only for RFM69HW! Remove/comment if you have RFM69W! #define IS_RFM69HW_HCW //uncomment only for RFM69HW/HCW! Leave out if you have RFM69W/CW!
//***************************************************************************************************************************** //*****************************************************************************************************************************
#define ENABLE_ATC //comment out this line to disable AUTO TRANSMISSION CONTROL #define ENABLE_ATC //comment out this line to disable AUTO TRANSMISSION CONTROL
#define ATC_RSSI -75 #define ATC_RSSI -75
@ -91,8 +91,8 @@
void setup() { void setup() {
Serial.begin(SERIAL_BAUD); Serial.begin(SERIAL_BAUD);
radio.initialize(FREQUENCY,NODEID,NETWORKID); radio.initialize(FREQUENCY,NODEID,NETWORKID);
#ifdef IS_RFM69HW #ifdef IS_RFM69HW_HCW
radio.setHighPower(); //only for RFM69HW! radio.setHighPower(); //must include this only for RFM69HW/HCW!
#endif #endif
radio.encrypt(ENCRYPTKEY); radio.encrypt(ENCRYPTKEY);

View File

@ -47,7 +47,7 @@
//#define FREQUENCY RF69_868MHZ //#define FREQUENCY RF69_868MHZ
#define FREQUENCY RF69_915MHZ //Match this with the version of your Moteino! (others: RF69_433MHZ, RF69_868MHZ) #define FREQUENCY RF69_915MHZ //Match this with the version of your Moteino! (others: RF69_433MHZ, RF69_868MHZ)
#define ENCRYPTKEY "sampleEncryptKey" //has to be same 16 characters/bytes on all nodes, not more not less! #define ENCRYPTKEY "sampleEncryptKey" //has to be same 16 characters/bytes on all nodes, not more not less!
//#define IS_RFM69HW //uncomment only for RFM69HW! Leave out if you have RFM69W! #define IS_RFM69HW_HCW //uncomment only for RFM69HW/HCW! Leave out if you have RFM69W/CW!
//********************************************************************************************* //*********************************************************************************************
#define ENABLE_ATC //comment out this line to disable AUTO TRANSMISSION CONTROL #define ENABLE_ATC //comment out this line to disable AUTO TRANSMISSION CONTROL
#define ATC_RSSI -75 #define ATC_RSSI -75
@ -114,8 +114,8 @@ void setup(void)
pinMode(LED, OUTPUT); pinMode(LED, OUTPUT);
radio.initialize(FREQUENCY,NODEID,NETWORKID); radio.initialize(FREQUENCY,NODEID,NETWORKID);
#ifdef IS_RFM69HW #ifdef IS_RFM69HW_HCW
radio.setHighPower(); //uncomment only for RFM69HW! radio.setHighPower(); //must include this only for RFM69HW/HCW!
#endif #endif
radio.encrypt(ENCRYPTKEY); radio.encrypt(ENCRYPTKEY);

View File

@ -49,7 +49,7 @@
#define FREQUENCY RF69_915MHZ #define FREQUENCY RF69_915MHZ
#define FREQUENCY_EXACT 916000000 #define FREQUENCY_EXACT 916000000
#define ENCRYPTKEY "sampleEncryptKey" //(16 bytes of your choice - keep the same on all encrypted nodes) #define ENCRYPTKEY "sampleEncryptKey" //(16 bytes of your choice - keep the same on all encrypted nodes)
//#define IS_RFM69HW //uncomment only for RFM69HW! Leave out if you have RFM69W! #define IS_RFM69HW_HCW //uncomment only for RFM69HW/HCW! Leave out if you have RFM69W/CW!
//********************************************************************************************* //*********************************************************************************************
#define ENABLE_ATC //comment out this line to disable AUTO TRANSMISSION CONTROL #define ENABLE_ATC //comment out this line to disable AUTO TRANSMISSION CONTROL
//********************************************************************************************* //*********************************************************************************************
@ -86,8 +86,8 @@ void setup(){
radio.setFrequency(FREQUENCY_EXACT); //set frequency to some custom frequency radio.setFrequency(FREQUENCY_EXACT); //set frequency to some custom frequency
#endif #endif
#ifdef IS_RFM69HW #ifdef IS_RFM69HW_HCW
radio.setHighPower(); //only for RFM69HW! radio.setHighPower(); //must include this only for RFM69HW/HCW!
#endif #endif
Serial.println("Start wireless gateway..."); Serial.println("Start wireless gateway...");

View File

@ -46,7 +46,7 @@
//#define FREQUENCY RF69_433MHZ //#define FREQUENCY RF69_433MHZ
//#define FREQUENCY RF69_868MHZ //#define FREQUENCY RF69_868MHZ
#define FREQUENCY RF69_915MHZ #define FREQUENCY RF69_915MHZ
//#define IS_RFM69HW //uncomment only for RFM69HW! Leave out if you have RFM69W! #define IS_RFM69HW_HCW //uncomment only for RFM69HW/HCW! Leave out if you have RFM69W/CW!
//***************************************************************************************************************************** //*****************************************************************************************************************************
#define ENABLE_ATC //comment out this line to disable AUTO TRANSMISSION CONTROL #define ENABLE_ATC //comment out this line to disable AUTO TRANSMISSION CONTROL
#define ATC_RSSI -75 #define ATC_RSSI -75
@ -98,8 +98,8 @@ void setup() {
radio.enableAutoPower(ATC_RSSI); radio.enableAutoPower(ATC_RSSI);
#endif #endif
#ifdef IS_RFM69HW #ifdef IS_RFM69HW_HCW
radio.setHighPower(); //only for RFM69HW! radio.setHighPower(); //must include this only for RFM69HW/HCW!
#endif #endif
Serial.print("Start node..."); Serial.print("Start node...");
Serial.print("Node ID = "); Serial.print("Node ID = ");