Fix for incoming MQTT status 1

Use pull up resistor for new HC-05 BT modules rx data
This commit is contained in:
Ray Jones 2020-05-21 07:27:06 +10:00
parent 775f235ba8
commit 21e17d1a2b
6 changed files with 6 additions and 4 deletions

Binary file not shown.

View File

@ -51,6 +51,7 @@ CBluetoothESP32HC05::_openSerial(int baudrate)
// Open Serial port on the ESP32
// best to explicitly specify pins for the pin multiplexer!
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
}
// ^
// |

View File

@ -372,7 +372,8 @@ CBluetoothHC05::_decodeMACresponse(char* pResponse, int len)
}
if (deficit < 0) { // more than 12 digits! - WHOA!
strcpy(_MAC, "unknown");
_bGotMAC = false;
// _bGotMAC = false;
_bGotMAC = true;
}
else {
// build final colon separated MAC address

View File

@ -281,7 +281,7 @@ sHeaterTuning::load()
validatedLoad("lowVolts", lowVolts, 115, u8inBoundsOrZero, 100, 125);
else
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("warnFuelUsage", warnFuelUsage, 5, u16inBounds, 0, 100);
validatedLoad("tempOffset0", DS18B20probe[0].offset, 0.0, -10.0, +10.0);

View File

@ -87,7 +87,7 @@ struct sHeaterTuning : public CESP32_NVStorage {
sysVoltage = 120;
fanSensor = 1;
glowDrive = 5;
pumpCal = 0.02;
pumpCal = 0.022;
maxFuelUsage = 0;
warnFuelUsage = 0;
lowVolts = 115;

View File

@ -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
if(strcmp(szPayload, "1") == 0) {
// BasicMQTTmoderator.reset();
BasicMQTTmoderator.reset();
MQTTclient.publish(statusTopic, NVstore.getMQTTinfo().qos, true, "online");
}
}