LowPowerLab Forum

Hardware support => Moteino => Topic started by: jeff on July 10, 2016, 11:37:35 PM

Title: PLEASE HELP WITH RFM69 TO PHOTON GATEWAY.
Post by: jeff on July 10, 2016, 11:37:35 PM
I am new to this forum.
I am new to the rfm69 chips. I would greatly appreciate any help.
I have followed the example codes and have been able to
send data struct successfully between two pro min 3.3v 8mhz boards and two
rfm69 915 mhz boards.
Now I am trying to send data from one of these (pro mini) nodes to a particle photon to use it like a gateway to mqtt.
COULD ANYONE PLEASE HELP ME WITH GETTING THE DATA TO SEND PROPERLY.
From searches on the net I did find one post but no examples
on changing the ? bit structure to get the payload to match so the photon can receive the data.

I am getting this message.
"Invalid payload received, not matching Payload struct!".

I found this reply in a particle forum
"I had a similar issue. It is caused by differences in data type lengths between the arduino and photon e.g. INT is 2 bytes on the arduino and 4 on the Photon. There also appear to be issues with data types. I eventually did the following:
1. Changed to uint8_t amd int16_t on both Arduino and Photon
2. kept number of bytes to <= 12
3. Avoided floats etc
4. Added code to debug number of bytes sent and received e.
------------------------>

I am not sure how to do this.
Could anyone help me with a example struct on either side, pro mini side (sender of data from dht11 sensor ) to photon (receiver of the data).

I can get it to work between two pro mini, as stated above.
when I try from a pro mini to to a photon I just gets 00 where the data should be?

My sender struct looks like this.

// CREATE STRUCT FOR WIRELESS TRANSMISSION ON RFM69.
///////////////////////////////////////////////////////////////////////////////////////////////////////////THIS IS THE STRUCT TO SEND/////////////////////
 
 
 

typedef struct {      

  int nodeID;  // NODE ID THIS NODE
  int deviceID;  // sensor ID
  float var2_float;  // sensor data
  float var3_float; //  other sensor data
 
} Payload;
Payload theData;

------------------------------------------->>>>>>>
sending

theData.nodeID = 1;
theData.deviceID = NODEID;
theData.var2_float = f;
theData.var3_float = h;
radio.sendWithRetry(TONODEID,(const void*)(&theData), sizeof(theData));

THANKS SO MUCH FOR YOUR HELP.