Skip to content

Commit

Permalink
update to v2.6R5 (added ROOM_TEMP_DS18X20_OFFSET)
Browse files Browse the repository at this point in the history
  • Loading branch information
absalom-muc committed Dec 22, 2022
1 parent a2c23bb commit 92ef987
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
2 changes: 2 additions & 0 deletions SW-Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ and how often the sensor should be read. To use reading of the external sensor y
#define TEMP_MEASURE_PERIOD 0 // period in seconds for temperature measurement with the external DS18x20 temperature sensor
// set to e.g. 30 to read the sensor every 30 seconds.
#define ONE_WIRE_BUS 4 // D2, PIN for connecting temperature sensor DS18x20 DQ pin
#define ROOM_TEMP_DS18X20_OFFSET 0.0 // Temperature offset for DS18x20 sensor, can be positive or negative (examples: 0.0, -1.0, 1.5)
```
note: The according libraries [OneWire](https://www.pjrc.com/teensy/td_libs_OneWire.html) and [DallasTemperature](https://github.com/milesburton/Arduino-Temperature-Control-Library) are only used if TEMP_MEASURE_PERIOD > 0.

Expand Down
3 changes: 3 additions & 0 deletions Version.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
MHI-AC-Ctrl by absalom-muc

**v2.6R5** (December 2022, draft version)
- Added ROOM_TEMP_DS18X20_OFFSET

**v2.6R4** (December 2022, draft version)
- Added Enhance resolution of Tsetpoint according to [pull request #123](https://github.com/absalom-muc/MHI-AC-Ctrl/pull/123) by [glsf91](https://github.com/glsf91).

Expand Down
9 changes: 5 additions & 4 deletions src/support.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ void setupWiFi(int& WiFiStatus) {

if(WiFiStatus != WIFI_CONNECT_ONGOING) {
WiFi.scanDelete();
int networksFound = WiFi.scanNetworks();
uint networksFound = WiFi.scanNetworks();
Serial.printf("setupWiFi:%i access points available\n", networksFound);
for (int i = 0; i < networksFound; i++)
for (uint i = 0; i < networksFound; i++)
{
Serial.printf("%2d %25s %2d %ddBm %s %s %02x\n", i + 1, WiFi.SSID(i).c_str(), WiFi.channel(i), WiFi.RSSI(i), WiFi.BSSIDstr(i).c_str(), WiFi.encryptionType(i) == ENC_TYPE_NONE ? "open" : "secured"), (uint)WiFi.encryptionType(i);
Serial.printf("%2d %25s %2d %ddBm %s %s %02x\n", i + 1, WiFi.SSID(i).c_str(), WiFi.channel(i), WiFi.RSSI(i), WiFi.BSSIDstr(i).c_str(), WiFi.encryptionType(i) == ENC_TYPE_NONE ? "open" : "secured"), (uint)WiFi.encryptionType(i);
if((strcmp(WiFi.SSID(i).c_str(), WIFI_SSID) == 0) && (WiFi.RSSI(i)>max_rssi)){
max_rssi = WiFi.RSSI(i);
strongest_AP = i;
Expand Down Expand Up @@ -151,7 +151,7 @@ int MQTTreconnect() {

// for testing publish list of access points with the expected SSID
Serial.printf("%i access points available\n", networksFound); // unlar, warum hier networksFound=0 !!!
for (int i = 0; i < networksFound; i++)
for (uint i = 0; i < networksFound; i++)
{
if(strcmp(WiFi.SSID(i).c_str(), WIFI_SSID) == 0){
strcpy(strtmp, "BSSID:");
Expand Down Expand Up @@ -224,6 +224,7 @@ byte getDs18x20Temperature(int temp_hysterese) {

if (millis() - DS1820Millis > TEMP_MEASURE_PERIOD * 1000) {
int16_t tempR = sensors.getTemp(insideThermometer);
tempR += ROOM_TEMP_DS18X20_OFFSET*128;
int16_t tempR_diff = tempR - tempR_old; // avoid using other functions inside the brackets of abs, see https://www.arduino.cc/reference/en/language/functions/math/abs/
if (abs(tempR_diff) > temp_hysterese) {
tempR_old = tempR;
Expand Down
5 changes: 3 additions & 2 deletions src/support.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "MHI-AC-Ctrl-core.h"
#include "MHI-AC-Ctrl.h"

#define VERSION "2.6R4"
#define VERSION "2.6R5"

#define WIFI_SSID "fb1"
#define WIFI_PASSWORD ""
Expand All @@ -27,9 +27,10 @@
#define OTA_HOSTNAME HOSTNAME // default for the OTA_HOSTNAME is the HOSTNAME
#define OTA_PASSWORD "" // Enter an OTA password if required

#define TEMP_MEASURE_PERIOD 60 // period in seconds for temperature measurement with the external DS18x20 temperature sensor
#define TEMP_MEASURE_PERIOD 0 // period in seconds for temperature measurement with the external DS18x20 temperature sensor
// enter 0 if you don't use the DS18x20
#define ONE_WIRE_BUS 4 // D2, PIN for connecting temperature sensor DS18x20 DQ pin
#define ROOM_TEMP_DS18X20_OFFSET 0.0 // Temperature offset for DS18x20 sensor, can be positive or negative (examples: 0.0, -1.0, 1.5)

//#define ROOM_TEMP_DS18X20 // use room temperature from DS18x20

Expand Down

0 comments on commit 92ef987

Please sign in to comment.