You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support for changing CC1101 Receive and Transmit Frequency (1technophile#847)
* Support for changing CC1101 Receive and Transmit Frequency
* Docs
* Resolve feedback
* Update Somfy module to use Global receiveMhz
ELECHOUSE_cc1101.SpiStrobe(CC1101_SIDLE); // Idle receiver prior to
setting a new frequency
### Set Transmit and Receive Frequency of CC1101 Transceiver Module
65
+
66
+
Default transmit frequency of the CC1101 module is 433.92 Mhz, and this can be can changed by including the frequency in the transmit message. Parameter is `mhz` and valid values are 300-348 Mhz, 387-464Mhz and 779-928Mhz. Actual frequency support will depend on your CC1101 board.
Default receive frequency of the CC1101 module is 433.92 Mhz, and this can be can changed by sending a message with the frequency. Parameter is `mhz` and valid values are 300-348 Mhz, 387-464Mhz and 779-928Mhz. Actual frequency support will depend on your CC1101 board
Messages received will include the frequency, and when transmitting on a different frequency the module return to the receive frequency afterwards. ie transmit messages on 303.732 Mhz then receive messages on 433.92 Mhz
pub(subjectGTWRFtoMQTT, datacallback); // we acknowledge the sending by publishing the value to an acknowledgement topic, for the moment even if it is a signal repetition we acknowledge also
162
168
}
163
169
# ifdef ZradioCC1101 // set Receive on and Transmitt off
164
-
ELECHOUSE_cc1101.SetRx(CC1101_FREQUENCY);
170
+
ELECHOUSE_cc1101.SpiStrobe(CC1101_SIDLE); // Idle receiver prior to setting a new frequency
# ifdef ZradioCC1101 // set Receive off and Transmitt on
192
+
float trMhz = RFdata["mhz"] | CC1101_FREQUENCY;
193
+
if (validFrequency((int)trMhz)) {
194
+
ELECHOUSE_cc1101.SetTx(trMhz);
195
+
Log.notice(F("Transmit mhz: %F" CR), trMhz);
196
+
mySwitch.disableReceive();
197
+
mySwitch.enableTransmit(RF_EMITTER_GPIO);
198
+
}
199
+
# endif
189
200
mySwitch.setRepeatTransmit(valueRPT);
190
201
mySwitch.setProtocol(valuePRT, valuePLSL);
191
202
mySwitch.send(data, valueBITS);
192
203
Log.notice(F("MQTTtoRF OK" CR));
193
204
pub(subjectGTWRFtoMQTT, RFdata); // we acknowledge the sending by publishing the value to an acknowledgement topic, for the moment even if it is a signal repetition we acknowledge also
194
205
mySwitch.setRepeatTransmit(RF_EMITTER_REPEAT); // Restore the default value
195
206
} else {
207
+
# ifdef ZradioCC1101 // set Receive on and Transmitt off
208
+
float tempMhz = RFdata["mhz"];
209
+
if (tempMhz != 0 && validFrequency((int)tempMhz)) {
210
+
receiveMhz = tempMhz;
211
+
Log.notice(F("Receive mhz: %F" CR), receiveMhz);
212
+
pub(subjectGTWRFtoMQTT, RFdata); // we acknowledge the sending by publishing the value to an acknowledgement topic, for the moment even if it is a signal repetition we acknowledge also
Copy file name to clipboardExpand all lines: main/main.ino
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -493,7 +493,7 @@ void connectMQTT() {
493
493
#ifdef ZgatewayIR
494
494
client.subscribe(subjectMultiGTWIR); // subject on which other OMG will publish, this OMG will store these msg and by the way don't republish them if they have been already published
495
495
#endif
496
-
Log.trace(F("Subscription OK to the subjects" CR));
496
+
Log.trace(F("Subscription OK to the subjects %s" CR), topic2);
0 commit comments