diff --git a/OpenMQTTGateway.ino b/OpenMQTTGateway.ino index e429302..90b150d 100644 --- a/OpenMQTTGateway.ino +++ b/OpenMQTTGateway.ino @@ -628,7 +628,7 @@ void storeValue(long MQTTvalue){ } int getMin(){ - int minimum = ReceivedSignal[0][1]; + unsigned int minimum = ReceivedSignal[0][1]; int minindex=0; for (int i = 0; i < array_size; i++) { @@ -640,7 +640,7 @@ int getMin(){ return minindex; } -boolean isAduplicate(long value){ +boolean isAduplicate(unsigned long value){ trc(F("isAduplicate")); // check if the value has been already sent during the last time_avoid_duplicate for (int i = 0; i < array_size;i++){ diff --git a/User_config.h b/User_config.h index 7ee5848..45a5099 100644 --- a/User_config.h +++ b/User_config.h @@ -34,8 +34,10 @@ /*-------------DEFINE YOUR NETWORK PARAMETERS BELOW----------------*/ //MQTT Parameters definition //#define mqtt_server_name "www.mqtt_broker.com" // instead of defining the server by its IP you can define it by its name, uncomment this line and set the correct MQTT server host name -#define mqtt_user "your_username" // not compulsory only if your broker needs authentication -#define mqtt_pass "your_password" // not compulsory only if your broker needs authentication +char mqtt_user[20] = "your_username"; // not compulsory only if your broker needs authentication +char mqtt_pass[20] = "your_password"; // not compulsory only if your broker needs authentication +char mqtt_server[40] = "192.168.1.17"; +char mqtt_port[6] = "1883"; #define Gateway_Name "OpenMQTTGateway" #define WifiManager_password "your_password" #define version_Topic "home/" Gateway_Name "/version" @@ -45,8 +47,6 @@ #define will_Message "Offline" #define Gateway_AnnouncementMsg "Online" //#define MDNS_SD //comment if you don't want to use mdns for discovering automatically your ip server, please note that MDNS with ESP32 can cause the BLE to not work -char mqtt_server[40] = "192.168.1.17"; -char mqtt_port[6] = "1883"; //set minimu quality of signal so it ignores AP's under that quality #define MinimumWifiSignalQuality 8 diff --git a/ZgatewaySRFB.ino b/ZgatewaySRFB.ino index 911c54f..bc63866 100644 --- a/ZgatewaySRFB.ino +++ b/ZgatewaySRFB.ino @@ -36,7 +36,7 @@ unsigned char _uartpos = 0; void setupSRFB(){ trc(F("ZgatewaySRFB setup done ")); - trc("Serial Baud" + SERIAL_BAUD); + trc("Serial Baud" + String(SERIAL_BAUD)); } void MQTTtoSRFB(char * topicOri, char * datacallback) {