I think I've read every topic on this so far and I must have tried every combination.... and I'm stuck, so I'm hoping someone can see my mistake and help me get this sorted
Here is how I setup MySensors on my Raspberry Pi 2 - I followed the guide to install the NRF24L01+ PA/LNA radio with 4.7µ decoupling (and it previously worked on version 1.4 of mysensors)
Here is the contents of my mysGateway.cpp
#include <iostream>
#include <cstdio>
#include <unistd.h>
#define MY_LINUX_CONFIG_FILE "/etc/mysensors.dat"
#define MY_GATEWAY_MAX_CLIENTS 20
#define MY_IS_SERIAL_PTY
#define MY_LINUX_SERIAL_PTY "/dev/ttyMySensorsGateway"
#define MY_LINUX_SERIAL_GROUPNAME "tty"
#include <MySensors.h>
void setup() {}
void presentation() {}
void loop() {}
Here is how I make and then monitor it
./configure --my-gateway=serial --my-rf24-pa-level=RF24_PA_LOW
sudo make all
sudo make install
sudo ./examples_linux/mysGateway -d
Here is my Arduino Node code - It's a simple Uno with a DHT sensor and an NRF24L01+ radio with 4.7µ decoupling
#define MY_DEBUG
#define MY_RADIO_NRF24
#define MY_NODE_ID 5
#define MY_PARENT_NODE_ID 0
#include <SPI.h>
#include <MySensors.h>
#include <DHT.h>
#define CHILD_ID_HUM 0
#define CHILD_ID_TEMP 1
#define HUMIDITY_SENSOR_DIGITAL_PIN 5
DHT dht;
float lastTemp;
float lastHum;
boolean metric = true;
MyMessage msgHum(CHILD_ID_HUM, V_HUM);
MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);
unsigned long pMillis_DHT = 0;
long sCheck_DHT = 10000;
bool requestACK = false;
void setup(){
dht.setup(HUMIDITY_SENSOR_DIGITAL_PIN);
metric = getConfig().isMetric;
}
void presentation(){
// Send the Sketch Version Information to the Gateway
sendSketchInfo("Just Temperature and Humidity", "0.1");
// Register all sensors to gw (they will be created as child devices)
present(CHILD_ID_HUM, S_HUM, "DHT22 Humidity", requestACK);
present(CHILD_ID_TEMP, S_TEMP, "DHT22 Temperature", requestACK);
}
void loop(){
unsigned long currentMillis = millis();
// Check Temp and Humidity
if (currentMillis - pMillis_DHT >= sCheck_DHT){
pMillis_DHT = currentMillis;
float temperature = dht.getTemperature();
if (isnan(temperature)) {
Serial.println("Failed reading temperature from DHT");
} else if (temperature != lastTemp) {
lastTemp = temperature;
if (!metric) {
temperature = dht.toFahrenheit(temperature);
}
send(msgTemp.set(temperature, 1));
#ifdef MY_DEBUG
Serial.print("T: ");
Serial.println(temperature);
#endif
}
// Fetch humidity from DHT sensor
float humidity = dht.getHumidity();
if (isnan(humidity)) {
Serial.println("Failed reading humidity from DHT");
} else if (humidity != lastHum) {
lastHum = humidity;
send(msgHum.set(humidity, 1));
#ifdef MY_DEBUG
Serial.print("H: ");
Serial.println(humidity);
#endif
}
}
}
So far I thought I was doing everything correctly.... but here is my debug output
On Gateway (Rp2) -The last 6 lines continue to repeat
mysGateway: Starting gateway...
mysGateway: Protocol version - 2.0.1-beta
mysGateway: MCO:BGN:INIT GW,CP=RNNG---,VER=2.0.1-beta
mysGateway: TSF:LRT:OK
mysGateway: TSM:INIT
mysGateway: TSM:INIT:TSP OK
mysGateway: TSM:INIT:GW MODE
mysGateway: TSM:READY
mysGateway: MCO:REG:NOT NEEDED
mysGateway: MCO:BGN:STP
mysGateway: MCO:BGN:INIT OK,ID=0,PAR=0,DIS=0,REG=1
mysGateway: TSF:MSG:READ,5-5-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
mysGateway: TSF:MSG:BC
mysGateway: TSF:MSG:FPAR REQ,ID=5
mysGateway: TSF:CKU:OK,FCTRL
mysGateway: TSF:MSG:GWL OK
mysGateway: TSF:MSG:SEND,0-0-5-5,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=OK:0
mysGateway: TSF:MSG:READ,5-5-0,s=255,c=3,t=24,pt=1,l=1,sg=0:1
mysGateway: TSF:MSG:PINGED,ID=5,HP=1
mysGateway: !TSF:MSG:SEND,0-0-5-5,s=255,c=3,t=25,pt=1,l=1,sg=0,ft=0,st=NACK:1
mysGateway: TSF:MSG:READ,5-5-0,s=255,c=3,t=24,pt=1,l=1,sg=0:1
mysGateway: TSF:MSG:PINGED,ID=5,HP=1
mysGateway: !TSF:MSG:SEND,0-0-5-5,s=255,c=3,t=25,pt=1,l=1,sg=0,ft=0,st=NACK:1
mysGateway: TSF:MSG:READ,5-5-0,s=255,c=3,t=24,pt=1,l=1,sg=0:1
mysGateway: TSF:MSG:PINGED,ID=5,HP=1
mysGateway: !TSF:MSG:SEND,0-0-5-5,s=255,c=3,t=25,pt=1,l=1,sg=0,ft=0,st=NACK:1
mysGateway: TSF:MSG:READ,5-5-0,s=255,c=3,t=24,pt=1,l=1,sg=0:1
mysGateway: TSF:MSG:PINGED,ID=5,HP=1
mysGateway: !TSF:MSG:SEND,0-0-5-5,s=255,c=3,t=25,pt=1,l=1,sg=0,ft=0,st=NACK:1
mysGateway: TSF:MSG:READ,5-5-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
mysGateway: TSF:MSG:BC
mysGateway: TSF:MSG:FPAR REQ,ID=5
mysGateway: TSF:CKU:OK,FCTRL
mysGateway: TSF:MSG:GWL OK
mysGateway: !TSF:MSG:SEND,0-0-5-5,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0
mysGateway: TSF:MSG:READ,5-5-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
mysGateway: TSF:MSG:BC
mysGateway: TSF:MSG:FPAR REQ,ID=5
mysGateway: TSF:CKU:OK,FCTRL
mysGateway: TSF:MSG:GWL OK
mysGateway: !TSF:MSG:SEND,0-0-5-5,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0
mysGateway: TSF:MSG:READ,5-5-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
mysGateway: TSF:MSG:BC
mysGateway: TSF:MSG:FPAR REQ,ID=5
mysGateway: TSF:CKU:OK,FCTRL
mysGateway: TSF:MSG:GWL OK
mysGateway: !TSF:MSG:SEND,0-0-5-5,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0
mysGateway: TSF:MSG:READ,5-5-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
mysGateway: TSF:MSG:BC
mysGateway: TSF:MSG:FPAR REQ,ID=5
mysGateway: TSF:CKU:OK,FCTRL
mysGateway: TSF:MSG:GWL OK
On Arduino Node
0 MCO:BGN:INIT NODE,CP=RNNNA--,VER=2.0.1-beta
4 TSM:INIT
10 TSM:INIT:TSP OK
12 TSM:INIT:STATID=5
14 TSF:SID:OK,ID=5
15 TSM:FPAR
51 TSF:MSG:SEND,5-5-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
504 TSF:MSG:READ,0-0-5,s=255,c=3,t=8,pt=1,l=1,sg=0:0
508 TSF:MSG:FPAR PREF
510 TSF:MSG:FPAR OK,ID=0,D=1
514 TSM:FPAR:OK
515 TSM:ID
516 TSM:ID:OK
518 TSM:UPL
553 !TSF:MSG:SEND,5-5-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=NACK:1
2562 TSM:UPL
2567 TSF:MSG:SEND,5-5-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=1,st=OK:1
4574 TSM:UPL
4576 TSF:MSG:SEND,5-5-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
6584 TSM:UPL
6620 !TSF:MSG:SEND,5-5-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=NACK:1
8628 !TSM:UPL:FAIL
8629 TSM:FPAR
8666 TSF:MSG:SEND,5-5-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=1,st=OK:
10673 !TSM:FPAR:NO REPLY
10675 TSM:FPAR
10711 TSF:MSG:SEND,5-5-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
12719 !TSM:FPAR:NO REPLY
12721 TSM:FPAR
12756 TSF:MSG:SEND,5-5-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
14765 !TSM:FPAR:NO REPLY
14767 TSM:FPAR
14802 TSF:MSG:SEND,5-5-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
So I'm totally confused by these messages... it seems like they are hearing each other but are having trouble communicating properly.
HELP!!!