Enable transmit outside of CC1101 (#1039)

See:
https://community.openmqttgateway.com/t/esp32-esp8266-fail-to-send-rf-signal/1618/11
This commit is contained in:
Florian authored and GitHub committed 2021-07-27 05:29:15 -05:00
1 parent 2d82cacd05
commit 72f3960c13
1 file changed
+3 -3
+3 -3
View File
@@ -118,9 +118,9 @@ void RFtoMQTT() {
void MQTTtoRF(char* topicOri, char* datacallback) {
# ifdef ZradioCC1101 // set Receive off and Transmitt on
ELECHOUSE_cc1101.SetTx(receiveMhz);
# endif
mySwitch.disableReceive();
mySwitch.enableTransmit(RF_EMITTER_GPIO);
# endif
SIGNAL_SIZE_UL_ULL data = STRTO_UL_ULL(datacallback, NULL, 10); // we will not be able to pass values > 4294967295 on Arduino boards
// RF DATA ANALYSIS
@@ -194,10 +194,10 @@ void MQTTtoRF(char* topicOri, JsonObject& RFdata) { // json object decoding
if (validFrequency((int)trMhz)) {
ELECHOUSE_cc1101.SetTx(trMhz);
Log.notice(F("Transmit mhz: %F" CR), trMhz);
mySwitch.disableReceive();
mySwitch.enableTransmit(RF_EMITTER_GPIO);
}
# endif
mySwitch.disableReceive();
mySwitch.enableTransmit(RF_EMITTER_GPIO);
mySwitch.setRepeatTransmit(valueRPT);
mySwitch.setProtocol(valuePRT, valuePLSL);
mySwitch.send(data, valueBITS);