I can get the Moteino reading the temp sensor and serial print this to serial monitor.
Sending it to the RFlink is failing. Domoticz does not see the device. I am not a good coder, so I am just trying all kinds of examples but all work on the Moteino side, but none get recognized as a device in Domoticz through RFlink.
I tried to make my own really easy example, but I cannot get the temperature into a variable and then use that with a radio.sendWithRetry command.
Is there anyone who knows how to deal with this, or is there anyone who has an example in which moteino actually communicates with Domoticz? In that case i could learn how to adjust that example to my case.
any help is appriciated!
The sketch I have now:
Code: Select all
#include <OneWire.h>
#include <DallasTemperature.h>
#include <RFM69.h>
#define PIN 14
OneWire oneWire(PIN);
DallasTemperature sensors(&oneWire);
RFM69 radio;
#define NODEID 100
#define NETWORKID 10
#define GATEWAYID 1
void setup(void)
{
Serial.begin(9600);
sensors.begin();
radio.initialize(RF69_433MHZ, NODEID, NETWORKID);
radio.setPowerLevel(25);
}
void loop(void)
{
sensors.requestTemperatures();
Serial.print(sensors.getTempCByIndex(0));
radio.sendWithRetry(GATEWAYID, 21 , 16); // Cant get this to work. The 21 should be the actual read temp. But probably all radio parameters are wrong.
Serial.print(GATEWAYID);
}