Bme fixes

This commit is contained in:
Mathieu Maret 2020-02-28 17:16:39 +01:00
parent 1b33362577
commit 0c9e8b977b
5 changed files with 5 additions and 4 deletions

View File

@ -22,7 +22,7 @@ int BME680Setup();
bool BME680IsConnected();
#else //CONFIG_ENABLE_BMP80
int BME680GetMeasure(float &, float &, float&, float &, float &);
int BME680GetMeasure(float &, float &, float&, float &, float &){return -1;};
int BME680Setup(){SKETCH_DEBUG_PRINTLN("BME680 is disabled at build time"); return -1;};
bool BME680IsConnected(){return false;};
#endif

View File

@ -23,7 +23,7 @@ typedef struct {uint8_t updated; int value;} gpioInfo;
struct mqttInfo {
float value;
char *topic;
const char *topic;
uint8_t retain;
uint8_t qos;
};

View File

@ -87,7 +87,7 @@ int MqttBatchPublish(std::vector<struct mqttInfo> tab, ...) {
va_start (args, tab);
vsnprintf(buf, sizeof(buf), (const char *)info.topic, args);
va_end(args);
SKETCH_DEBUG_PRINTFLN("publishing %f for %s\n", info.value, buf);
SKETCH_DEBUG_PRINTF("publishing %f for %s\n", info.value, buf);
Adafruit_MQTT_Publish client(mqtt, buf, info.qos, info.retain);
if (!client.publish(info.value))
SKETCH_DEBUG_PRINTLN("Fail :(");

View File

@ -190,7 +190,7 @@ void WebHandleSave() {
strdup(server.arg("host").c_str()), strdup(server.arg("mqttServer").c_str()), strdup(server.arg("mqttUser").c_str()),
strdup(server.arg("mqttPasswd").c_str()), server.arg("mqttPort").toInt(),
server.arg("ip_config").toInt(), static_cast<uint32_t>(ip), static_cast<uint32_t>(gw),
static_cast<uint32_t>(mask), static_cast<uint32_t>(dns), static_cast<uint32_t>(dns2), server.arg("channel").toInt(), strdup(server.arg("bssid").c_str())
static_cast<uint32_t>(mask), static_cast<uint32_t>(dns), static_cast<uint32_t>(dns2), static_cast<uint8_t>(server.arg("channel").toInt()), strdup(server.arg("bssid").c_str())
};
if (EepromSaveConfig(newConf) < 0) {
WebSendError("Cannot Save Credentials (Too long ?Contains \";\"?)\r\n");

View File

@ -43,6 +43,7 @@
#include "debug_sketch.h"
#include "BMP180.h"
#include "BME680.h"
#include "sensor_DHT.h"
#include "dry_sensor.h"
#include "MQTT.h"