Hello, If i remember right - when using both scenarious for RF receiving and for RF transmitting, it is approriate to stop receiving for the moments, when a transmission is executed. Unless receiving the very our own transmission is desired of course.
As i understand this behavior is implemented in ZgatewayPilight.ino - to disable the active receiver when transmitting. And aftarwards to enable it.
To better illustrate my doubt - i prepared a patch. Was not able to test it, hopefully will do in a week or two. Reised this quiestion, in case i missed something.
diff --git a/main/ZgatewayRF.ino b/main/ZgatewayRF.ino
index 882e9161..6a387c85 100644
--- a/main/ZgatewayRF.ino
+++ b/main/ZgatewayRF.ino
@@ -236,8 +236,8 @@ void XtoRF(const char* topicOri, JsonObject& RFdata) { // json object decoding
Log.notice(F("RF Protocol:%d" CR), valuePRT);
Log.notice(F("RF Pulse Lgth: %d" CR), valuePLSL);
Log.notice(F("Bits nb: %d" CR), valueBITS);
-# ifdef ZradioCC1101
disableCurrentReceiver();
+# ifdef ZradioCC1101
initCC1101();
int txPower = RFdata["txpower"] | RF_CC1101_TXPOWER;
ELECHOUSE_cc1101.setPA((int)txPower);
diff --git a/main/ZgatewayRF2.ino b/main/ZgatewayRF2.ino
index 8f4ebb93..35c8f4b5 100644
--- a/main/ZgatewayRF2.ino
+++ b/main/ZgatewayRF2.ino
@@ -133,7 +133,7 @@ void rf2Callback(unsigned int period, unsigned long address, unsigned long group
# if simpleReceiving
void XtoRF2(const char* topicOri, const char* datacallback) {
- NewRemoteReceiver::disable();
+ disableCurrentReceiver();
pinMode(RF_EMITTER_GPIO, OUTPUT);
initCC1101();
@@ -235,8 +235,8 @@ void XtoRF2(const char* topicOri, const char* datacallback) {
}
# ifdef ZradioCC1101
ELECHOUSE_cc1101.SetRx(RFConfig.frequency); // set Receive on
- NewRemoteReceiver::enable();
# endif
+ enableActiveReceiver();
}
# endif
@@ -266,7 +266,7 @@ void XtoRF2(const char* topicOri, JsonObject& RF2data) { // json object decoding
valueUNIT = 0;
if (valuePERIOD == 0)
valuePERIOD = 272;
- NewRemoteReceiver::disable();
+ disableCurrentReceiver();
NewRemoteTransmitter transmitter(valueCODE, RF_EMITTER_GPIO, valuePERIOD, RF2_EMITTER_REPEAT);
Log.trace(F("Sending" CR));
if (valueGROUP) {
@@ -283,7 +283,7 @@ void XtoRF2(const char* topicOri, JsonObject& RF2data) { // json object decoding
}
}
Log.notice(F("MQTTtoRF2 OK" CR));
- NewRemoteReceiver::enable();
+ enableActiveReceiver();
success = true;
}