IR signal forwarding by MQTT

differentiate command subject so as to enable the repeat on another gateway
add doc info regarding raw forwarding
This commit is contained in:
Florian committed 2020-06-22 07:04:00 -05:00
1 parent 924943277a
commit 12a5033ca3
3 files changed
+10 -6

No files matched your search

+4 -1
View File
@@ -110,7 +110,10 @@ by
`# define JSON_MSG_BUFFER 1280`
`# define mqtt_max_packet_size 1280`
## Repeat the IR signal OpenMQTTGateway receive
So as to repeat the IR signal received by the gateway once set the following parameter to true in [config_IR.h](https://github.com/1technophile/OpenMQTTGateway/blob/091b317660fd201a30e2cd0e15424a13c5a6bd71/config_IR.h#L37)
`#define repeatIRwMQTT true`
## Raw IR signal forwarding
So as to repeat the raw IR signal received by the gateway, uncomment and set the following parameter to true in [config_IR.h](https://github.com/1technophile/OpenMQTTGateway/blob/091b317660fd201a30e2cd0e15424a13c5a6bd71/config_IR.h#L39)
`#define RawDirectForward true`
+1 -1
View File
@@ -173,7 +173,7 @@ void IRtoMQTT() {
storeValue(MQTTvalue);
if (repeatIRwMQTT) {
Log.trace(F("Pub. IR for rpt" CR));
pubMQTT(subjectMQTTtoIR, MQTTvalue);
pubMQTT(subjectForwardMQTTtoIR, MQTTvalue);
}
}
}
+5 -4
View File
@@ -32,15 +32,16 @@ extern void MQTTtoIR(char* topicOri, char* datacallback);
extern void MQTTtoIR(char* topicOri, JsonObject& RFdata);
/*-------------------IR topics & parameters----------------------*/
//IR MQTT Subjects
#define subjectGTWIRtoMQTT "/IRtoMQTT"
#define subjectIRtoMQTT "/IRtoMQTT"
#define subjectMQTTtoIR "/commands/MQTTtoIR"
#define subjectGTWIRtoMQTT "/IRtoMQTT"
#define subjectIRtoMQTT "/IRtoMQTT"
#define subjectMQTTtoIR "/commands/MQTTtoIR"
#define subjectForwardMQTTtoIR "home/gateway2/commands/MQTTtoIR"
// subject monitored to listen traffic processed by other gateways to store data and avoid ntuple
#define subjectMultiGTWIR "+/+/IRtoMQTT"
#define IRbitsKey "IRBITS_" // bits will be defined if a subject contains IRbitsKey followed by a value of 2 digits
#define IRRptKey "RPT_" // repeats will be defined if a subject contains IRRptKey followed by a value of 1 digit
#define repeatIRwMQTT false // do we repeat a received signal by using mqtt
#define repeatIRwMQTT false // do we repeat a received signal by using mqtt, we send a command signal to subjectForwardMQTTtoIR
#define repeatIRwNumber 0 // default repeat of the signal
//#define RawDirectForward false // direct repeat of IR signal with raw data
#define RawFrequency 38 // raw frequency sending