1 parent
d63636bf31
commit
c0879e8d22
3 files changed
+13
-7
No files matched your search
+4
-5
@@ -107,7 +107,7 @@ RF supported protocols
|
|||||||
#define pubIRunknownPrtcl false // key to avoid mqtt publication of unknown IR protocol (set to true if you want to publish unknown protocol)
|
#define pubIRunknownPrtcl false // key to avoid mqtt publication of unknown IR protocol (set to true if you want to publish unknown protocol)
|
||||||
|
|
||||||
#ifdef ESP8266 //IR supported protocols on ESP8266, all supported per default
|
#ifdef ESP8266 //IR supported protocols on ESP8266, all supported per default
|
||||||
#define IR_Raw
|
#define IR_GC
|
||||||
#define IR_COOLIX
|
#define IR_COOLIX
|
||||||
#define IR_Whynter
|
#define IR_Whynter
|
||||||
#define IR_LG
|
#define IR_LG
|
||||||
@@ -117,7 +117,6 @@ RF supported protocols
|
|||||||
#define IR_Sharp
|
#define IR_Sharp
|
||||||
#define IR_SAMSUNG
|
#define IR_SAMSUNG
|
||||||
#else //IR supported protocols on arduino uncomment if you want to send with this protocol, NEC protocol is available per default
|
#else //IR supported protocols on arduino uncomment if you want to send with this protocol, NEC protocol is available per default
|
||||||
//#define IR_Raw
|
|
||||||
//#define IR_COOLIX
|
//#define IR_COOLIX
|
||||||
//#define IR_Whynter
|
//#define IR_Whynter
|
||||||
//#define IR_LG
|
//#define IR_LG
|
||||||
@@ -125,7 +124,7 @@ RF supported protocols
|
|||||||
//#define IR_DISH
|
//#define IR_DISH
|
||||||
//#define IR_RC5
|
//#define IR_RC5
|
||||||
//#define IR_Sharp
|
//#define IR_Sharp
|
||||||
#define IR_SAMSUNG
|
//#define IR_SAMSUNG
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*----------------------BT topics-------------------------*/
|
/*----------------------BT topics-------------------------*/
|
||||||
@@ -145,8 +144,8 @@ RF supported protocols
|
|||||||
//IMPORTANT NOTE: On arduino UNO connect IR emitter pin to D9 , comment #define IR_USE_TIMER2 and uncomment #define IR_USE_TIMER1 on library <library>IRremote/IRremoteInt.h so as to free pin D3 for RF RECEIVER PIN
|
//IMPORTANT NOTE: On arduino UNO connect IR emitter pin to D9 , comment #define IR_USE_TIMER2 and uncomment #define IR_USE_TIMER1 on library <library>IRremote/IRremoteInt.h so as to free pin D3 for RF RECEIVER PIN
|
||||||
//RF PIN definition
|
//RF PIN definition
|
||||||
#define RF_RECEIVER_PIN 1 // 1 = D3 on arduino
|
#define RF_RECEIVER_PIN 1 // 1 = D3 on arduino
|
||||||
#define BT_RX 10
|
#define BT_RX 5
|
||||||
#define BT_TX 11
|
#define BT_TX 6
|
||||||
#endif
|
#endif
|
||||||
//RF number of signal repetition
|
//RF number of signal repetition
|
||||||
#define RF_EMITTER_REPEAT 20
|
#define RF_EMITTER_REPEAT 20
|
||||||
|
|||||||
+9
-2
@@ -19,6 +19,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|||||||
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
||||||
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
Thanks to wolass https://github.com/wolass for suggesting me HM 10 and dinosd https://github.com/dinosd/BLE_PROXIMITY for inspiring me how to implement the gateway
|
||||||
*/
|
*/
|
||||||
#ifdef ZgatewayBT
|
#ifdef ZgatewayBT
|
||||||
#include <SoftwareSerial.h>
|
#include <SoftwareSerial.h>
|
||||||
@@ -26,6 +28,7 @@ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFT
|
|||||||
#define STRING_MSG "OK+DISC:"
|
#define STRING_MSG "OK+DISC:"
|
||||||
#define QUESTION_MSG "AT+DISI?"
|
#define QUESTION_MSG "AT+DISI?"
|
||||||
#define RESPONSE_MSG "OK+DISIS"
|
#define RESPONSE_MSG "OK+DISIS"
|
||||||
|
#define SETUP_MSG "OK+RESET"
|
||||||
#define TimeBtw_Read 10000
|
#define TimeBtw_Read 10000
|
||||||
|
|
||||||
SoftwareSerial softserial(BT_RX, BT_TX);
|
SoftwareSerial softserial(BT_RX, BT_TX);
|
||||||
@@ -56,9 +59,9 @@ boolean BTtoMQTT() {
|
|||||||
for (int i=0;i<device_number;i++){
|
for (int i=0;i<device_number;i++){
|
||||||
String onedevice = discResult.substring(0,78);
|
String onedevice = discResult.substring(0,78);
|
||||||
onedevice.replace(STRING_MSG,"");
|
onedevice.replace(STRING_MSG,"");
|
||||||
String company = onedevice.substring(0,8);
|
/*String company = onedevice.substring(0,8);
|
||||||
String uuid = onedevice.substring(9,41);
|
String uuid = onedevice.substring(9,41);
|
||||||
String others = onedevice.substring(42,52);
|
String others = onedevice.substring(42,52);*/
|
||||||
String mac = onedevice.substring(53,65);
|
String mac = onedevice.substring(53,65);
|
||||||
String rssi = onedevice.substring(66,70);
|
String rssi = onedevice.substring(66,70);
|
||||||
String mactopic = subjectBTtoMQTT + mac;
|
String mactopic = subjectBTtoMQTT + mac;
|
||||||
@@ -71,6 +74,10 @@ boolean BTtoMQTT() {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if (discResult.indexOf(SETUP_MSG)>=0)
|
||||||
|
{
|
||||||
|
trc(F("Connection OK to HM-10"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (millis() > (time1 + TimeBtw_Read)) {//retriving value of adresses and rssi
|
if (millis() > (time1 + TimeBtw_Read)) {//retriving value of adresses and rssi
|
||||||
time1 = millis();
|
time1 = millis();
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 275 KiB |
Reference in new issue
Block a user