Post by Masondb on Oct 28, 2016 4:18:16 GMT
I have looked through multiple threads and haven't been able to find the answer. I had it communicating over the rfm69 chips to the gateway .ino posted on instructables. I upgraded to 2.4 and I can't get the sensor node and gateway to communicate. The Buno is at 3.3v
This is what I get:
GW Version GW V2.4
433 Mhz...
connecting
no link
MQTT-link OK
Gateway Code
#include <RFM69.h>
#include <SPI.h>
#include <Ethernet.h>
#include <PubSubClient.h>
void mqtt_subs(char* topic, byte* payload, unsigned int length);
#define DEBUGRADIO // uncomment for radio debugging
#define DEBUG // uncomment for MQTT debugging
#define VERSION "GW V2.4"
// Ethernet settings
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xBA, 0xBE }; // MAC address for ethernet
byte mqtt_server[] = { 192, 168, 1, 70}; // MQTT broker address (Mosquitto)
byte ip[] = { 192, 168, 1 , 75 }; // Gateway address (if DHCP fails)
// Wireless settings
#define NODEID 1 // unique node ID in the closed radio network; gateway is 1
#define RFM_SS 8 // Slave Select RFM69 is connected to pin 8
#define NETWORKID 101 // closed radio network ID
//Match frequency to the hardware version of the radio (uncomment one):
#define FREQUENCY RF69_433MHZ
//#define FREQUENCY RF69_868MHZ
//#define FREQUENCY RF69_915MHZ
#define ENCRYPTKEY "masonb99efbc5921" // shared 16-char encryption key is equal on Gateway and nodes
#define IS_RFM69HW // uncomment only for RFM69HW! Leave out if you have RFM69W!
#define ACK_TIME 50 // max # of ms to wait for an ack
// PIN settings
#define MQCON 7 // MQTT Connection indicator
#define R_LED 9 // Radio activity indicator
#define SERIAL_BAUD 115200
typedef struct { // Radio packet structure max 66 bytes
int nodeID; // node identifier
int devID; // device identifier 0 is node; 31 is temperature, 32 is humidity
int cmd; // read or write
long intVal; // integer payload
float fltVal; // floating payload
char payLoad[32]; // char array payload
} Message;
Sensor Node Code
#include <RFM69.h>
#include <SPI.h>
#define NODEID 12 //unique for each node on same network
#define NETWORKID 101 //the same on all nodes that talk to each other
#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 "masonb99efbc5921" //exactly the same 16 characters/bytes on all nodes!
#define IS_RFM69HW //uncomment only for RFM69HW! Leave out if you have RFM69W!
#define ACK_TIME 30 // max # of ms to wait for an ack
#define LED 9 // Moteinos have LEDs on D9
#define SERIAL_BAUD 9600 //must be 9600 for GPS, use whatever if no GPS
boolean debug = 0;
//struct for wireless data transmission
typedef struct {
int nodeID; //node ID (1xx, 2xx, 3xx); 1xx = basement, 2xx = main floor, 3xx = outside
int deviceID; //sensor ID (2, 3, 4, 5)
unsigned long var1_usl; //uptime in ms
float var2_float; //sensor data?
float var3_float; //battery condition?
} Payload;
Payload theData;
char buff[20];
byte sendSize=0;
boolean requestACK = false;
RFM69 radio;
//end RFM69 ------------------------------------------
This is what I get:
GW Version GW V2.4
433 Mhz...
connecting
no link
MQTT-link OK
Gateway Code
#include <RFM69.h>
#include <SPI.h>
#include <Ethernet.h>
#include <PubSubClient.h>
void mqtt_subs(char* topic, byte* payload, unsigned int length);
#define DEBUGRADIO // uncomment for radio debugging
#define DEBUG // uncomment for MQTT debugging
#define VERSION "GW V2.4"
// Ethernet settings
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xBA, 0xBE }; // MAC address for ethernet
byte mqtt_server[] = { 192, 168, 1, 70}; // MQTT broker address (Mosquitto)
byte ip[] = { 192, 168, 1 , 75 }; // Gateway address (if DHCP fails)
// Wireless settings
#define NODEID 1 // unique node ID in the closed radio network; gateway is 1
#define RFM_SS 8 // Slave Select RFM69 is connected to pin 8
#define NETWORKID 101 // closed radio network ID
//Match frequency to the hardware version of the radio (uncomment one):
#define FREQUENCY RF69_433MHZ
//#define FREQUENCY RF69_868MHZ
//#define FREQUENCY RF69_915MHZ
#define ENCRYPTKEY "masonb99efbc5921" // shared 16-char encryption key is equal on Gateway and nodes
#define IS_RFM69HW // uncomment only for RFM69HW! Leave out if you have RFM69W!
#define ACK_TIME 50 // max # of ms to wait for an ack
// PIN settings
#define MQCON 7 // MQTT Connection indicator
#define R_LED 9 // Radio activity indicator
#define SERIAL_BAUD 115200
typedef struct { // Radio packet structure max 66 bytes
int nodeID; // node identifier
int devID; // device identifier 0 is node; 31 is temperature, 32 is humidity
int cmd; // read or write
long intVal; // integer payload
float fltVal; // floating payload
char payLoad[32]; // char array payload
} Message;
Sensor Node Code
#include <RFM69.h>
#include <SPI.h>
#define NODEID 12 //unique for each node on same network
#define NETWORKID 101 //the same on all nodes that talk to each other
#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 "masonb99efbc5921" //exactly the same 16 characters/bytes on all nodes!
#define IS_RFM69HW //uncomment only for RFM69HW! Leave out if you have RFM69W!
#define ACK_TIME 30 // max # of ms to wait for an ack
#define LED 9 // Moteinos have LEDs on D9
#define SERIAL_BAUD 9600 //must be 9600 for GPS, use whatever if no GPS
boolean debug = 0;
//struct for wireless data transmission
typedef struct {
int nodeID; //node ID (1xx, 2xx, 3xx); 1xx = basement, 2xx = main floor, 3xx = outside
int deviceID; //sensor ID (2, 3, 4, 5)
unsigned long var1_usl; //uptime in ms
float var2_float; //sensor data?
float var3_float; //battery condition?
} Payload;
Payload theData;
char buff[20];
byte sendSize=0;
boolean requestACK = false;
RFM69 radio;
//end RFM69 ------------------------------------------