Fix for incoming MQTT status 1
Use pull up resistor for new HC-05 BT modules rx data
This commit is contained in:
parent
775f235ba8
commit
21e17d1a2b
Binary file not shown.
|
@ -51,6 +51,7 @@ CBluetoothESP32HC05::_openSerial(int baudrate)
|
||||||
// Open Serial port on the ESP32
|
// Open Serial port on the ESP32
|
||||||
// best to explicitly specify pins for the pin multiplexer!
|
// best to explicitly specify pins for the pin multiplexer!
|
||||||
HC05_SerialPort.begin(baudrate, SERIAL_8N1, _rxPin, _txPin);
|
HC05_SerialPort.begin(baudrate, SERIAL_8N1, _rxPin, _txPin);
|
||||||
|
pinMode(_rxPin, INPUT_PULLUP); // newer modules seem to be open drian - sort of - need a pullup to work properly anyway
|
||||||
}
|
}
|
||||||
// ^
|
// ^
|
||||||
// |
|
// |
|
||||||
|
|
|
@ -372,7 +372,8 @@ CBluetoothHC05::_decodeMACresponse(char* pResponse, int len)
|
||||||
}
|
}
|
||||||
if (deficit < 0) { // more than 12 digits! - WHOA!
|
if (deficit < 0) { // more than 12 digits! - WHOA!
|
||||||
strcpy(_MAC, "unknown");
|
strcpy(_MAC, "unknown");
|
||||||
_bGotMAC = false;
|
// _bGotMAC = false;
|
||||||
|
_bGotMAC = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// build final colon separated MAC address
|
// build final colon separated MAC address
|
||||||
|
|
|
@ -281,7 +281,7 @@ sHeaterTuning::load()
|
||||||
validatedLoad("lowVolts", lowVolts, 115, u8inBoundsOrZero, 100, 125);
|
validatedLoad("lowVolts", lowVolts, 115, u8inBoundsOrZero, 100, 125);
|
||||||
else
|
else
|
||||||
validatedLoad("lowVolts", lowVolts, 230, u8inBoundsOrZero, 200, 250);
|
validatedLoad("lowVolts", lowVolts, 230, u8inBoundsOrZero, 200, 250);
|
||||||
validatedLoad("pumpCal", pumpCal, 0.02, 0.001, 1);
|
validatedLoad("pumpCal", pumpCal, 0.022, 0.001, 1);
|
||||||
validatedLoad("maxFuelUsage", maxFuelUsage, 0, u16inBounds, 0, 10000);
|
validatedLoad("maxFuelUsage", maxFuelUsage, 0, u16inBounds, 0, 10000);
|
||||||
validatedLoad("warnFuelUsage", warnFuelUsage, 5, u16inBounds, 0, 100);
|
validatedLoad("warnFuelUsage", warnFuelUsage, 5, u16inBounds, 0, 100);
|
||||||
validatedLoad("tempOffset0", DS18B20probe[0].offset, 0.0, -10.0, +10.0);
|
validatedLoad("tempOffset0", DS18B20probe[0].offset, 0.0, -10.0, +10.0);
|
||||||
|
|
|
@ -87,7 +87,7 @@ struct sHeaterTuning : public CESP32_NVStorage {
|
||||||
sysVoltage = 120;
|
sysVoltage = 120;
|
||||||
fanSensor = 1;
|
fanSensor = 1;
|
||||||
glowDrive = 5;
|
glowDrive = 5;
|
||||||
pumpCal = 0.02;
|
pumpCal = 0.022;
|
||||||
maxFuelUsage = 0;
|
maxFuelUsage = 0;
|
||||||
warnFuelUsage = 0;
|
warnFuelUsage = 0;
|
||||||
lowVolts = 115;
|
lowVolts = 115;
|
||||||
|
|
|
@ -134,7 +134,7 @@ void onMqttMessage(char* topic, char* payload, AsyncMqttClientMessageProperties
|
||||||
}
|
}
|
||||||
else if(strcmp(topic, statusTopic) == 0) { // check if incoming topic is our general status
|
else if(strcmp(topic, statusTopic) == 0) { // check if incoming topic is our general status
|
||||||
if(strcmp(szPayload, "1") == 0) {
|
if(strcmp(szPayload, "1") == 0) {
|
||||||
// BasicMQTTmoderator.reset();
|
BasicMQTTmoderator.reset();
|
||||||
MQTTclient.publish(statusTopic, NVstore.getMQTTinfo().qos, true, "online");
|
MQTTclient.publish(statusTopic, NVstore.getMQTTinfo().qos, true, "online");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue