Zgateway rf2 (#94)

* some minor correction after coadcy checks

* Put serial communication speed as a parameter in user_config.h

* complete gateway file

receiving ok
sending ko
#32

* add rfm69 to CI

* change receiver key and minor improvments

#32

now ok on receiving and sending with RFM69

* add schema and tested pinout for RFM69/RF/IR wiring

#32

* RFM69 library add

* Implement newremoteswitchlibrary for KlikAanKlikUit / ClickOnClickOff protocol

#3

* add dependency for CI and link to the library

* compilation error for arduino correction

* Sketch size decrease

* remove nano from CI
This commit is contained in:
Florian authored and GitHub committed 2017-09-01 00:35:26 +02:00
1 parent ba51e340d2
commit f8ede4aa94
8 files changed
+199 -43

No files matched your search

+7 -7
View File
@@ -43,7 +43,7 @@ void setupRF(){
boolean RFtoMQTT(){
if (mySwitch.available()){
trc(F("Receiving RF"));
trc(F("Rcv. RF"));
unsigned long MQTTvalue = 0;
String MQTTprotocol;
String MQTTbits;
@@ -63,7 +63,7 @@ boolean RFtoMQTT(){
trc(value);
boolean result = client.publish(subjectRFtoMQTT,(char *)value.c_str());
if (repeatRFwMQTT){
trc(F("Publishing RF for repeat"));
trc(F("Publish RF for repeat"));
client.publish(subjectMQTTtoRF,(char *)value.c_str());
}
return result;
@@ -94,7 +94,7 @@ void MQTTtoRF(char * topicOri, char * datacallback) {
if (pos2 != -1) {
pos2 = pos2 + strlen(RFpulselengthKey);
valuePLSL = (topic.substring(pos2,pos2 + 3)).toInt();
trc(F("RF Pulse Length:"));
trc(F("RF Pulse Lgth:"));
trc(String(valuePLSL));
}
int pos3 = topic.lastIndexOf(RFbitsKey);
@@ -106,15 +106,15 @@ void MQTTtoRF(char * topicOri, char * datacallback) {
}
if ((topic == subjectMQTTtoRF) && (valuePRT == 0) && (valuePLSL == 0) && (valueBITS == 0)){
trc(F("MQTTtoRF default"));
trc(F("MQTTtoRF dflt"));
mySwitch.setProtocol(1,350);
mySwitch.send(data, 24);
// Acknowledgement to the GTWRF topic
boolean result = client.publish(subjectGTWRFtoMQTT, datacallback);
if (result)trc(F("Ack published"));
if (result)trc(F("Ack pub."));
} else if ((valuePRT != 0) || (valuePLSL != 0)|| (valueBITS != 0)){
trc(F("MQTTtoRF user parameters"));
trc(F("MQTTtoRF usr par."));
if (valuePRT == 0) valuePRT = 1;
if (valuePLSL == 0) valuePLSL = 350;
if (valueBITS == 0) valueBITS = 24;
@@ -126,7 +126,7 @@ void MQTTtoRF(char * topicOri, char * datacallback) {
// Acknowledgement to the GTWRF topic
boolean result = client.publish(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
if (result){
trc(F("MQTTtoRF OK ack published"));
trc(F("MQTTtoRF ack pub."));
trc(String(data));
};
}