Thanks so much for taking the time to help me.
I tried this. still getting 0,0,0,0 RSSI = 0
Works with the pro mini together. but pro min to the phton this is what I am getting . SO CLOSE.
This is my code. I know it is a chop job but it is working, just the start.
sensor side/ pro min.
// Example testing sketch for various DHT humidity/temperature sensors
// Written by ladyada, public domain
// TESTED WITH PRO MIN CLONE RED 3.3V 8MHZ
// Uncomment whatever type you're using!
#define DHTTYPE DHT11 // DHT 11
//define DHTTYPE DHT22 // DHT 22 (AM2302), AM2321
//#define DHTTYPE DHT21 // DHT 21 (AM2301)
// Connect pin 1 (on the left) of the sensor to +5V
// NOTE: If using a board with 3.3V logic like an Arduino Due connect pin 1
// to 3.3V instead of 5V!
// Connect pin 2 of the sensor to whatever your DHTPIN is
// Connect pin 4 (on the right) of the sensor to GROUND
// Connect a 10K resistor from pin 2 (data) to pin 1 (power) of the sensor
// Initialize DHT sensor.
// Note that older versions of this library took an optional third parameter to
// tweak the timings for faster processors. This parameter is no longer needed
// as the current DHT reading algorithm adjusts itself to work on faster procs.
// TEMPERATURE/ HUMIDITY INFO------------------------>>>>>
// INCLUDE DHT11 LIBRARIES
#include "DHT.h"
#define DHTPIN 4 // what digital pin we're connected to
DHT dht(DHTPIN, DHTTYPE);
//_____________________________________________________________________
// RFM69 SET UP
// Include the RFM69 and SPI libraries:
#include <RFM69.h>
#include <RFM69registers.h>
#include <RFM69_ATC.h>
#include <SPI.h>
// Addresses for this node. CHANGE THESE FOR EACH NODE!
#define NETWORKID 100 // Must be the same for all nodes
#define NODEID 1 // My node ID
#define TONODEID 2 // Destination node ID
// RFM69 frequency, uncomment the frequency of your module:
//#define FREQUENCY RF69_433MHZ
#define FREQUENCY RF69_915MHZ
// AES encryption (or not):
#define ENCRYPT false // Set to "true" to use encryption
#define ENCRYPTKEY "TOPSECRETPASSWRD" // Use the same 16-byte key on all nodes
// Use ACKnowledge when sending messages (or not):
#define USEACK false // Request ACKs or not
// Packet sent/received indicator LED (optional):
#define LED 13 // LED positive pin
//#define GND 8 // LED ground pin
// CREATE STRUCT FOR WIRELESS TRANSMISSION ON RFM69.
///////////////////////////////////////////////////////////////////////////////////////////////////////////THIS IS THE STRUCT TO SEND/////////////////////
// swithed it to uint8-t to talk to photon// we will see ???
typedef struct {
uint16_t nodeID; // changed from int
uint16_t sensorID;// changed from int
//unsigned long var1_usl;
uint16_t var2_float; //changed from float var2_float
uint16_t var3_float; //hanged from float var3_float
} Payload;
Payload theData;
//int nodeID; // NODE ID THIS NODE
//int deviceID; // sensor ID ex. temp is sensory 1 on this NODE.(NODE IS THE SENSOR POND LIKE 12 CAN BE THE NODE FOR GREEN HOUSE)
//float var2_float; // sensor data
//float var3_float; // other sensor data
//} Payload;
//Payload theData;
char buff[20]; // I THINK THIS CREATES BUFF FOR DATA
byte send=0;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Create a library object for our RFM69HCW module:
RFM69 radio;
void setup() {
pinMode(13, OUTPUT);// blink led
// START SERIAL --------------------------------------------------
Serial.begin(9600);
Serial.println("DHTxx test!");
//-------------------------------------------------------------
// START dht SENSORE
dht.begin();
//RFM69 initialize-------------------------------------------
radio.initialize(FREQUENCY,NODEID,NETWORKID);
//#ifdef IS_RFM69HW
radio.setHighPower(); //uncomment only for RFM69HW!
//#endif
//radio.encrypt(ENCRYPTKEY);
char buff[50];
sprintf(buff, "\nTransmitting at %d Mhz...", FREQUENCY==RF69_433MHZ ? 433 : FREQUENCY==RF69_868MHZ ? 868 : 915);
Serial.println(buff);
//theData.nodeID = NODEID; //this node id should be the same for all devices in this node
//end RFM--------------------------------------------
}
void loop() {
// DEVICE # TEMP/HUMIDITY // SENSOR #1
// Wait a few seconds between measurements.
//delay(2000);
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius (the default)
float t = dht.readTemperature();
// Read temperature as Fahrenheit (isFahrenheit = true)
float f = dht.readTemperature(true);
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index in Fahrenheit (the default)
float hif = dht.computeHeatIndex(f, h);
// Compute heat index in Celsius (isFahreheit = false)
float hic = dht.computeHeatIndex(t, h, false);
Serial.print("Humidity: ");
Serial.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hic);
Serial.print(" *C ");
Serial.print(hif);
Serial.println(" *F");
delay(1000);
// NOW SEND THE DAM TEMP/HUMIDTY DATA!!!!!!!
theData.nodeID = 1;
theData.sensorID = NODEID;
theData.var2_float = f;// changed from .var2_float if .var3 if sending to photon.
theData.var3_float = h;// changed from .var3_float if .var3 if sending to photon.
radio.sendWithRetry(TONODEID,(const void*)(&theData), sizeof(theData));
digitalWrite(13,HIGH);
delay(300);
digitalWrite(13,LOW);
}
RX SIDE / PHOTON.
#include <SPI.h>
#include <RFM69.h>
#include <RFM69registers.h>
#include <RFM69_ATC.h>
// NODE 2 RX.
// RFM69HCW Example Sketch
// Send serial input characters from one RFM69 node to another
// Based on RFM69 library sample code by Felix Rusu
// http://LowPowerLab.com/contact
// Modified for RFM69HCW by Mike Grusin, 4/16
// This sketch will show you the basics of using an
// RFM69HCW radio module. SparkFun's part numbers are:
// 915MHz:
// See the hook-up guide for wiring instructions:
// Uses the RFM69 library by Felix Rusu, LowPowerLab.com
// Original library:
// SparkFun repository:
// Include the RFM69 and SPI libraries:
//#include <RFM69.h>
//#include <SPI.h>
// Addresses for this node. CHANGE THESE FOR EACH NODE!
#define NETWORKID 100 // Must be the same for all nodes
#define MYNODEID 2 // My node ID
#define TONODEID 1 // Destination node ID
// RFM69 frequency, uncomment the frequency of your module:
//#define FREQUENCY RF69_433MHZ
#define FREQUENCY RF69_915MHZ
// AES encryption (or not):
#define ENCRYPT false // Set to "true" to use encryption
#define ENCRYPTKEY "TOPSECRETPASSWRD" // Use the same 16-byte key on all nodes
// Use ACKnowledge when sending messages (or not):
#define USEACK false // Request ACKs or not
// Packet sent/received indicator LED (optional):
#define LED 13 // LED positive pin
#define GND 8 // LED ground pin
// Create a library object for our RFM69HCW module:
RFM69 radio;
//////////////////////////////////////////STRUCT TO RECEIVE, SAME ON OTHERSIDE///////////////////
//typedef struct {
// int nodeID;
// int sensorID;
//unsigned long var1_usl;
// float var2_float;
// float var3_float;
//} Payload;
//Payload theData;
typedef struct {
uint16_t nodeID; // changed from int
uint16_t sensorID;// changed from int
//unsigned long var1_usl;
uint16_t var2_float; //changed from float var2_float
uint16_t var3_float; //hanged from float var3_float
} Payload;
Payload theData;
//////////////////////////////////////////////////////////////////////////////////////////////////////////
void setup()
{
// Open a serial port
Serial.begin(9600);
Serial.print("Node ");
Serial.print(MYNODEID,DEC);
Serial.println(" ready");
// Set up the indicator LED (optional):
pinMode(LED,OUTPUT);
digitalWrite(LED,LOW);
pinMode(GND,OUTPUT);
digitalWrite(GND,LOW);
// Initialize the RFM69HCW:
//RFM69 initialize-------------------------------------------
radio.initialize(FREQUENCY,MYNODEID,NETWORKID);
//#ifdef IS_RFM69HW
radio.setHighPower(); //uncomment only for RFM69HW!
//#endif
//radio.encrypt(ENCRYPTKEY);
char buff[50];
sprintf(buff, "\nTransmitting at %d Mhz...", FREQUENCY==RF69_433MHZ ? 433 : FREQUENCY==RF69_868MHZ ? 868 : 915);
Serial.println(buff);
//---------------------------------------------------------------------
//byte ackCount=0;
}
void loop()
{
if (radio.receiveDone())
{
if (radio.DATALEN != sizeof(Payload))
{
Serial.println("Invalid payload received, not matching Payload struct!");
}
else
{
theData = *(Payload*)radio.DATA; //assume radio.DATA actually contains our struct and not something else
Serial.print(theData.nodeID);
Serial.print(", ");
Serial.print(theData.sensorID);
Serial.print(", ");
//Serial.print(theData.var1_usl);
//Serial.print(", ");
Serial.print(theData.var2_float);
Serial.print(", ");
//Serial.print(" var2(temperature)=");
//Serial.print(", ");
Serial.print(theData.var3_float);
//printFloat(theData.var2_float, 5); Serial.print(", "); printFloat(theData.var3_float, 5);
Serial.print(", RSSI= ");
Serial.println(radio.RSSI);
}//
if (radio.ACK_REQUESTED)
{
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");
}//
}//end if radio.ACK_REQESTED
Blink(LED,10);
}
void Blink(byte PIN, int DELAY_MS)
// Blink an LED for a given number of ms
{
digitalWrite(PIN,HIGH);
delay(DELAY_MS);
digitalWrite(PIN,LOW);
}
________________________________________________________________++++++
THANKS AGAIN FOR YOUR HELP.