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:
1 parent
2d82cacd05
commit
72f3960c13
1 file changed
+3
-3
+3
-3
@@ -118,9 +118,9 @@ void RFtoMQTT() {
|
|||||||
void MQTTtoRF(char* topicOri, char* datacallback) {
|
void MQTTtoRF(char* topicOri, char* datacallback) {
|
||||||
# ifdef ZradioCC1101 // set Receive off and Transmitt on
|
# ifdef ZradioCC1101 // set Receive off and Transmitt on
|
||||||
ELECHOUSE_cc1101.SetTx(receiveMhz);
|
ELECHOUSE_cc1101.SetTx(receiveMhz);
|
||||||
|
# endif
|
||||||
mySwitch.disableReceive();
|
mySwitch.disableReceive();
|
||||||
mySwitch.enableTransmit(RF_EMITTER_GPIO);
|
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
|
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
|
// RF DATA ANALYSIS
|
||||||
@@ -194,10 +194,10 @@ void MQTTtoRF(char* topicOri, JsonObject& RFdata) { // json object decoding
|
|||||||
if (validFrequency((int)trMhz)) {
|
if (validFrequency((int)trMhz)) {
|
||||||
ELECHOUSE_cc1101.SetTx(trMhz);
|
ELECHOUSE_cc1101.SetTx(trMhz);
|
||||||
Log.notice(F("Transmit mhz: %F" CR), trMhz);
|
Log.notice(F("Transmit mhz: %F" CR), trMhz);
|
||||||
mySwitch.disableReceive();
|
|
||||||
mySwitch.enableTransmit(RF_EMITTER_GPIO);
|
|
||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
|
mySwitch.disableReceive();
|
||||||
|
mySwitch.enableTransmit(RF_EMITTER_GPIO);
|
||||||
mySwitch.setRepeatTransmit(valueRPT);
|
mySwitch.setRepeatTransmit(valueRPT);
|
||||||
mySwitch.setProtocol(valuePRT, valuePLSL);
|
mySwitch.setProtocol(valuePRT, valuePLSL);
|
||||||
mySwitch.send(data, valueBITS);
|
mySwitch.send(data, valueBITS);
|
||||||
|
|||||||
Reference in new issue
Block a user