Skip to content

Commit 12a5033

Browse files
committed
IR signal forwarding by MQTT
differentiate command subject so as to enable the repeat on another gateway add doc info regarding raw forwarding
1 parent 9249432 commit 12a5033

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

docs/use/ir.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,10 @@ by
110110
`# define JSON_MSG_BUFFER 1280`
111111
`# define mqtt_max_packet_size 1280`
112112

113-
114113
## Repeat the IR signal OpenMQTTGateway receive
115114
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)
116115
`#define repeatIRwMQTT true`
116+
117+
## Raw IR signal forwarding
118+
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)
119+
`#define RawDirectForward true`

main/ZgatewayIR.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ void IRtoMQTT() {
173173
storeValue(MQTTvalue);
174174
if (repeatIRwMQTT) {
175175
Log.trace(F("Pub. IR for rpt" CR));
176-
pubMQTT(subjectMQTTtoIR, MQTTvalue);
176+
pubMQTT(subjectForwardMQTTtoIR, MQTTvalue);
177177
}
178178
}
179179
}

main/config_IR.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,16 @@ extern void MQTTtoIR(char* topicOri, char* datacallback);
3232
extern void MQTTtoIR(char* topicOri, JsonObject& RFdata);
3333
/*-------------------IR topics & parameters----------------------*/
3434
//IR MQTT Subjects
35-
#define subjectGTWIRtoMQTT "/IRtoMQTT"
36-
#define subjectIRtoMQTT "/IRtoMQTT"
37-
#define subjectMQTTtoIR "/commands/MQTTtoIR"
35+
#define subjectGTWIRtoMQTT "/IRtoMQTT"
36+
#define subjectIRtoMQTT "/IRtoMQTT"
37+
#define subjectMQTTtoIR "/commands/MQTTtoIR"
38+
#define subjectForwardMQTTtoIR "home/gateway2/commands/MQTTtoIR"
3839

3940
// subject monitored to listen traffic processed by other gateways to store data and avoid ntuple
4041
#define subjectMultiGTWIR "+/+/IRtoMQTT"
4142
#define IRbitsKey "IRBITS_" // bits will be defined if a subject contains IRbitsKey followed by a value of 2 digits
4243
#define IRRptKey "RPT_" // repeats will be defined if a subject contains IRRptKey followed by a value of 1 digit
43-
#define repeatIRwMQTT false // do we repeat a received signal by using mqtt
44+
#define repeatIRwMQTT false // do we repeat a received signal by using mqtt, we send a command signal to subjectForwardMQTTtoIR
4445
#define repeatIRwNumber 0 // default repeat of the signal
4546
//#define RawDirectForward false // direct repeat of IR signal with raw data
4647
#define RawFrequency 38 // raw frequency sending

0 commit comments

Comments
 (0)