diff --git a/CHANGELOG.md b/CHANGELOG.md index 5824673..5da7424 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,3 +26,18 @@ All notable changes to this project will be documented in this file. ### Changed - Heater of humidiy sensor only on when humidity is above 96% (was 80%). When heater is on temperature sensor also heats up, so use temperature sensor of BMP280 when heater is on. + +## [0.2.1] - 2024-01-17 + +### Changed + +- Heater algorithm updated. Idea from datasheet of humidity sensor from Temco Controls HUM-M2 humidity sensor module. +- ModBus read register 1: Scaled wind direction by 10 in order to also get the decimal position of the direction + +### Added + +- ModBus read register 12: Raw rain meter +- ModBus read register 13: Temperature from pressure sensor +- ModBus read register 14: Status bits +- ModBus coil register 0 : enable/disable heather algorithm + diff --git a/build-doc/images/smart_heater.odg b/build-doc/images/smart_heater.odg new file mode 100644 index 0000000..b39da35 Binary files /dev/null and b/build-doc/images/smart_heater.odg differ diff --git a/build-doc/images/smart_heater.svg b/build-doc/images/smart_heater.svg new file mode 100644 index 0000000..4c9f22b --- /dev/null +++ b/build-doc/images/smart_heater.svg @@ -0,0 +1,1263 @@ + +image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Smart heater + + + + + + + + Measure humidityMeasure temperature + + + + + + + + RH>95%for more than 1 hour + + + + + + + + RH>95% + + + + + + + + Heater ON + + + + + + + + Wait 10 minutes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Measure humidityMeasure temperature + + + + + + + + + + + + + + + Heater OFF + + + + + + + + Wait 10 minutes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + No + + + + + + Yes + + + + + + No + + + + + + Yes + + + + + + + + + + + + + + + diff --git a/build-doc/images/wind_speed_diagram.svg b/build-doc/images/wind_speed_diagram.svg index 2abd670..1001f69 100644 --- a/build-doc/images/wind_speed_diagram.svg +++ b/build-doc/images/wind_speed_diagram.svg @@ -9,9 +9,9 @@ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.2" - width="125.34mm" - height="165.31999mm" - viewBox="0 0 12534 16531.999" + width="60.926762mm" + height="80.360718mm" + viewBox="0 0 6092.6763 8036.0717" preserveAspectRatio="xMidYMid" fill-rule="evenodd" stroke-width="28.222" @@ -45,7 +45,8 @@ inkscape:window-x="0" inkscape:window-y="0" inkscape:window-maximized="1" - inkscape:current-layer="svg439" /> + inkscape:current-layer="svg439" + inkscape:document-rotation="0" /> @@ -347,7 +348,7 @@ + transform="translate(-3234,-4234.9999)"> @@ -362,7 +363,7 @@ + transform="matrix(0.48609191,0,0,0.48609191,-1572.0212,-2058.5992)"> -

Flow chart under development.

+

When the heater algorithm is active, the temperature is updated every +20 minutes instead of every 2 seconds. Statis bit 0 (ModBus register +30014) indicated if the heater is on or off and status bit 1 gives the +update rate of the main temperature sensor.

+

This algorithm can be enabled by setting the HeaterCoil (see ModBus +secion).

+
+ + +

Temperature

The temperature is read from the humidity sensor as this sensor gives the most accurate temperature readings. When the heater is on (see @@ -582,8 +592,8 @@ boring.

now, the ModBus address is hard coded as 14 in the software. The values are available in the input registers and can be read via function code 04.

-

Below an example of how to read the wind direction in Python using -the minimalmodbus library.

+

Below an example of how to read the wind direction and enable the +heater algorithm in Python using the minimalmodbus library.

#!/usr/bin/env python3
 import minimalmodbus
 
@@ -592,10 +602,14 @@ instrument = minimalmodbus.Instrument('/dev/ttyUSB1', 14)
 
 # register number, number of decimals, function code
 wind_direction = instrument.read_register(1, 0, 4)
-print(wind_direction)
-

Input registers

-

The measurements and order of the measurements are the same as for -APRS weather reports. But of course we use SI units.

+print(wind_direction) + +# register address, value, function code +instrument.write_bit(0, 1, 5) +

Input registers (read only)

+

Input registers are numbered 30001 to 39999 but have data addresses +0x000 to 0x270E. The measurements and order of the measurements are the +same as for APRS weather reports. But of course we use SI units.

@@ -611,77 +625,77 @@ APRS weather reports. But of course we use SI units.

- + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -705,12 +719,45 @@ from the pressure sensor.

+ + + + + + + + + + + +
3000000 Device ID (0x5758) NO UNIT
3000101 Wind directiondegreesdegrees * 10
3000202 Wind speed (average of 10 minutes) m/s * 100
3000303 Wind gust (peak of last 10 minutes) m/s * 100
3000404 Temperature (two’s complement) degrees Celcius * 100
3000505 Rain last hour l/m2 * 100
3000606 Rain last 24 hours l/m2 * 100
3000707 Rain since midnight NOT IMPLEMENTED
3000808 Humidity percent * 100
3000909 Barometric pressure hPa * 10
3001010 Luminosity W/m2
3001111 Snow fall NOT IMPLEMENTED
3001212 Raw rain counterNOT IMPLEMENTEDl/m2 * 100
3001313 Temperature (two’s complement) degrees Celcius * 100
3001414 Status bits see table below
heater off heater on
1Temp updateevery 2 secevery 20 minutes
2Heater algorithmdisabledenabled

The ModBus registers are 16 bit wide. For better precision, some units are scaled by a factor of 10 or 100. This way, values with up to two decimal points can be stored as 16 bit integer values. Just divide by 10 or 100 to get the floating point values.

+

Output coils (write only)

+

Input registers are numbered 1 to 9999 but have data addresses 0x000 +to 0x270E. The default value is of a register is 0.

+ + + + + + + + + + + + + + + + + +
AddressDescriptionlogic 0logic 1
0Heater algorithmdisabledenabled

Schematic

Schematic

diff --git a/build-doc/weather_station.md b/build-doc/weather_station.md index f9a4e14..78a3b12 100644 --- a/build-doc/weather_station.md +++ b/build-doc/weather_station.md @@ -240,7 +240,11 @@ Via the I²C bus, the humidity value of the sensor is read. As the sensor can be When the humidity rises above 95% for more than an hour the current temperature is stored and the heater is switched on for 10 minutes. Than the heater is switched off again. If after 10 minutes the humidity is still above 95% the heater is turned on again for another 10 minutes. But not before the temperature is measured and stored, as the sensor is now cooled off to ambient temperature. If the humidity is below 95% the sensor is free from moisture and the process is not repeated for another hour. -Flow chart under development. +When the heater algorithm is active, the temperature is updated every 20 minutes instead of every 2 seconds. Statis bit 0 (ModBus register 30014) indicated if the heater is on or off and status bit 1 gives the update rate of the main temperature sensor. + +This algorithm can be enabled by setting the HeaterCoil (see ModBus secion). + +![Heater algorithm](./images/smart_heater.svg "Heater algorithm") ## Temperature @@ -258,7 +262,7 @@ This sensor is still under development. The weather station uses ModBus RTU over a simplex RS-485 line. For now, the ModBus address is hard coded as 14 in the software. The values are available in the input registers and can be read via function code 04. -Below an example of how to read the wind direction in Python using the minimalmodbus library. +Below an example of how to read the wind direction and enable the heater algorithm in Python using the minimalmodbus library. #!/usr/bin/env python3 import minimalmodbus @@ -270,36 +274,49 @@ Below an example of how to read the wind direction in Python using the minimalmo wind_direction = instrument.read_register(1, 0, 4) print(wind_direction) -### Input registers + # register address, value, function code + instrument.write_bit(0, 1, 5) + +### Input registers (read only) -The measurements and order of the measurements are the same as for APRS weather reports. But of course we use SI units. +Input registers are numbered 30001 to 39999 but have data addresses 0x000 to 0x270E. The measurements and order of the measurements are the same as for APRS weather reports. But of course we use SI units. | Address | Description | Units | |---------|-------------------------------------|-----------------------| -| 30000 | Device ID (0x5758) | NO UNIT | -| 30001 | Wind direction | degrees | -| 30002 | Wind speed (average of 10 minutes) | m/s * 100 | -| 30003 | Wind gust (peak of last 10 minutes) | m/s * 100 | -| 30004 | Temperature (two's complement) | degrees Celcius * 100 | -| 30005 | Rain last hour | l/m2 * 100 | -| 30006 | Rain last 24 hours | l/m2 * 100 | -| 30007 | Rain since midnight | NOT IMPLEMENTED | -| 30008 | Humidity | percent * 100 | -| 30009 | Barometric pressure | hPa * 10 | -| 30010 | Luminosity | W/m2 | -| 30011 | Snow fall | NOT IMPLEMENTED | -| 30012 | Raw rain counter | NOT IMPLEMENTED | -| 30013 | Temperature (two's complement) | degrees Celcius * 100 | -| 30014 | Status bits | see table below | +| 00 | Device ID (0x5758) | NO UNIT | +| 01 | Wind direction | degrees * 10 | +| 02 | Wind speed (average of 10 minutes) | m/s * 100 | +| 03 | Wind gust (peak of last 10 minutes) | m/s * 100 | +| 04 | Temperature (two's complement) | degrees Celcius * 100 | +| 05 | Rain last hour | l/m2 * 100 | +| 06 | Rain last 24 hours | l/m2 * 100 | +| 07 | Rain since midnight | NOT IMPLEMENTED | +| 08 | Humidity | percent * 100 | +| 09 | Barometric pressure | hPa * 10 | +| 10 | Luminosity | W/m2 | +| 11 | Snow fall | NOT IMPLEMENTED | +| 12 | Raw rain counter | l/m2 * 100 | +| 13 | Temperature (two's complement) | degrees Celcius * 100 | +| 14 | Status bits | see table below | ^NOTE^ Register 30013 holds the backup temperature reading from the pressure sensor. -| Status bits | Description | logic 0 | logic 1 | -|-------------|---------------|------------|-----------| -| 0 | Heater status | heater off | heater on | +| Status bits | Description | logic 0 | logic 1 | +|-------------|------------------|-------------|------------------| +| 0 | Heater status | heater off | heater on | +| 1 | Temp update | every 2 sec | every 20 minutes | +| 2 | Heater algorithm | disabled | enabled | The ModBus registers are 16 bit wide. For better precision, some units are scaled by a factor of 10 or 100. This way, values with up to two decimal points can be stored as 16 bit integer values. Just divide by 10 or 100 to get the floating point values. +### Output coils (write only) + +Input registers are numbered 1 to 9999 but have data addresses 0x000 to 0x270E. The default value is of a register is 0. + +| Address | Description | logic 0 | logic 1 | +|---------|------------------|----------|---------| +| 0 | Heater algorithm | disabled | enabled | + # Schematic [![Schematic](./images/weather_station_schematic.svg)](./images/weather_station_schematic.pdf) diff --git a/build-doc/weather_station.pdf b/build-doc/weather_station.pdf index f59425d..75769b4 100644 Binary files a/build-doc/weather_station.pdf and b/build-doc/weather_station.pdf differ diff --git a/firmware/weather_station.ino b/firmware/weather_station.ino index 98ab594..9d0a1c8 100644 --- a/firmware/weather_station.ino +++ b/firmware/weather_station.ino @@ -67,9 +67,14 @@ const byte SlaveId = 14; * 30004: Temperature (degrees Celcius) * 30005: Rain last hour (l/m2) * 30006: Rain last 24 hours (l/m2) - * 30007: Rain since midnight (l/m2) + * 30007: Rain since midnight (l/m2) [NOT IMPLEMENTED, always 0] * 30008: Humidity (percent) * 30009: Barometric pressure (hPa) + * 30010: Luminosity (W/m2) + * 30011: Snow fall [NOT IMPLEMENTED, always 0] + * 30012: Raw rainfall counter (mm) + * 30013: Temperature pressure sensor (degrees Celsius) + * 30014: Status bits 0=heater, 1-15: reserved * */ const int SensorIDIreg = 0; @@ -82,6 +87,18 @@ const int SensorRainLast24Ireg = 6; const int SensorRainSinceMidnightIreg = 7; const int SensorHumidityIreg = 8; const int SensorPressureIreg = 9; +const int SensorLuminosityIreg = 10; +const int SensorSnowFallIreg = 11; +const int SensorRainfallRawIreg = 12; +const int SensorTemperatureBackupIreg = 13; +const int SensorStatusBitsIreg = 14; + +/* Modbus Registers Offsets (0-9999) + * Coils + * 0 = Heater algorithm (0 = disable, 1 = enable) + */ +const int HeaterCoil = 0; + // RS-485 serial port #define MySerial Serial // define serial port used, Serial most of the time, or Serial1, Serial2 ... if available const unsigned long Baudrate = 9600; @@ -116,68 +133,153 @@ struct MeasuredData { int RainLast24; int SensorRainSinceMidnight; int Pressure; + int Luminosity; + int StatusBits = 0; + unsigned int RainfallCounter = 0; float Temperature; float Humidity; + float TemperatureBackup; bool HeaterStatus = 0; } MeasuredData; +// State machine implementing smart heater to prevent saturation of the sensor +char HeaterSi7021 (float humidity) +{ + static int state=0; + static unsigned long StatemachineTimer=0; + bool TempValid=1; + bool Heater=0; + + // If Smart heater algorithm is disabled, reset the statemachine forever. + // TempValid bit is also forced to 1, but it could be that we just came out of a heater period. + // We assume that the client on the other side of the ModBus is smart enough to understand. + if (MeasuredData.StatusBits & 0x04) + state = 0; + + switch (state) + { + // Default state: humidity is below 95% + case 0: + Heater = 0; + if (humidity >= 95) { + StatemachineTimer = millis(); + state = 1; + } + break; + // Humidity went above 95%. See if humidity stays above 95% for more than an hour, if so turn on heater + case 1: + if (humidity >= 95) { + if ( (millis() - StatemachineTimer) >= 3.6e+6 ) { + Heater = 1; + TempValid = 0; + StatemachineTimer = millis(); + state = 2; + } else { + Heater = 0; + } + } else { + Heater = 0; + state = 0; + } + break; + + // Heater is now on, let the sensor cook for 10 minutes + case 2: + if ( (millis() - StatemachineTimer) >= 600000 ) { + StatemachineTimer = millis(); + Heater = 0; + state = 3; + } else { + Heater = 1; + } + TempValid = 0; + break; + // Heater is now off, let the sensor cool for 10 minutes + case 3: + if ( (millis() - StatemachineTimer) >= 600000 ) { + TempValid = 1; // Sensor cooled, so we can take a valid temperature reading + if (humidity >= 95) { + // Humidity still above 95%, repeat heating/cooling + Heater = 1; + StatemachineTimer = millis(); + state = 2; + } else { + // Humidity below 95%, reset statemachine + Heater = 0; + state = 0; + } + } else { + Heater = 0; + TempValid = 0; + } + break; + + default: + Heater = 0; + state = 0; + break; + } + + return TempValid<<1 | Heater; + +} // Read Si7021 sensor and process data void ReadSi7021 (void) { + char result=0x2; + si7021.triggerMeasurement(); si7021.getHumidity(MeasuredData.Humidity); - si7021.getTemperature(MeasuredData.Temperature); if (MeasuredData.Humidity>100 || MeasuredData.Humidity<0) MeasuredData.Humidity = 100; + + //If humidity is larger than 95% switch on heater to get more acurate measurement and prevent memory offset + result = HeaterSi7021(MeasuredData.Humidity); + MeasuredData.StatusBits &= 0xFFFC; // Reset heater status bits to zero + MeasuredData.StatusBits |= result; // And set the proper bits to one if there are any. The result is we copied the status bits to the register + + // Scale for more decimal positions when converted to integer value for ModBus + MeasuredData.Humidity *= 100; - //If humidity is larger than 96% switch on heater to get more acurate measurement and prevent memory offset - //Switch off when lower than 94% (hysteresis) - if (MeasuredData.Humidity > 96 && !MeasuredData.HeaterStatus) { - Serial.print(F("Heater on.")); - MeasuredData.HeaterStatus = 1; - si7021.setHeater(MeasuredData.HeaterStatus); + // Temperture readings are valid (as the sensor is not heated) + if (result & 0x2) { + si7021.getTemperature(MeasuredData.Temperature); + // Scale for more decimal positions when converted to integer value for ModBus + MeasuredData.Temperature *= 100; + //Serial.print(F("Valid temp")); } - if (MeasuredData.Humidity < 94 && MeasuredData.HeaterStatus) { - Serial.print(F("Heater off.")); + // Statemachine thinks it is time to switch on the heater + if (result & 0x1) { + //Serial.print(F("Heater on.")); + MeasuredData.HeaterStatus = 1; + + } else { + //Serial.print(F("Heater off.")); MeasuredData.HeaterStatus = 0; - si7021.setHeater(MeasuredData.HeaterStatus); } - - // Scale for more decimal positions when converted to integer value for ModBus - MeasuredData.Humidity *= 100; - MeasuredData.Temperature *= 100; + si7021.setHeater(MeasuredData.HeaterStatus); + } // Read BMP280 void ReadBMP280 (void) { -// MeasuredData.Pressure=0; - bmp280.awaitMeasurement(); - float temperature; - bmp280.getTemperature(temperature); - float pascal; bmp280.getPressure(pascal); - pascal = (pascal - PRESSURE_OFFSET) / 10; // Convert to hPa - MeasuredData.Pressure = pascal; + bmp280.getTemperature(MeasuredData.TemperatureBackup); + // Scale for more decimal positions when converted to integer value for ModBus + MeasuredData.TemperatureBackup *= 100; + bmp280.triggerMeasurement(); - // When humidity is high, the heater of the Si7021 is on. This causes the temperature sensor of the humidity sensor to heat up. - // Use temperature sensor of BMP280 instead. - if (MeasuredData.HeaterStatus) { - bmp280.getTemperature(MeasuredData.Temperature); - // Scale for more decimal positions when converted to integer value for ModBus - MeasuredData.Temperature *= 100; - } - } int MaxOfArray (int array[], unsigned int length) @@ -214,7 +316,8 @@ void ReadSparkfunWeatherStation (void) float tmpRegister; - MeasuredData.WindDirection = weatherMeterKit.getWindDirection(); + tmpRegister = 10*weatherMeterKit.getWindDirection(); // Use float for conversion to degrees times 10, than put it in integer register for ModBus + MeasuredData.WindDirection = tmpRegister; tmpRegister = 100*(weatherMeterKit.getWindSpeed())/3.6; // Use float for conversion to m/s times 100, than put it in integer register for ModBus MeasuredData.WindSpeed = tmpRegister; tmpRegister = 100*weatherMeterKit.getTotalRainfall(); // Use float for conversion to l/m2 times 100, than put it in integer register for ModBus @@ -279,6 +382,9 @@ void ReadSparkfunWeatherStation (void) RainPerHourCounter=0; } RainPerHour[RainPerHourCounter] = MeasuredData.Rain; + // Every time before we reset the TotalRainCounter we add the amount to the RawRainCounter. + // This 16 bit register will eventually overflow, but 655.35mm of rain fall is a lot! + MeasuredData.RainfallCounter += MeasuredData.Rain; // We don't care about the rounding error due to the convertion from float to int weatherMeterKit.resetTotalRainfall(); // Calculate rain fall in the last 24 hours @@ -320,13 +426,22 @@ void setup() { mb.addIreg (SensorRainSinceMidnightIreg); mb.addIreg (SensorHumidityIreg); mb.addIreg (SensorPressureIreg); + mb.addIreg (SensorLuminosityIreg); + mb.addIreg (SensorSnowFallIreg); + mb.addIreg (SensorRainfallRawIreg); + mb.addIreg (SensorTemperatureBackupIreg); + mb.addIreg (SensorStatusBitsIreg); + + // Add HeaterCoil register + mb.addCoil (HeaterCoil); // Set Weather station ID mb.Ireg (SensorIDIreg, 0x5758); // Set unused register to zero mb.Ireg (SensorRainSinceMidnightIreg, 0); + mb.Ireg (SensorSnowFallIreg, 0); - Serial.println(F("Weather station v0.1.0")); + Serial.println(F("Weather station v0.2.1")); Serial.println(F("(C)2024 M.T. Konstapel")); Serial.println(F("This project is free and open source")); Serial.println(F("More details: https://meezenest.nl/mees/")); @@ -346,6 +461,14 @@ void setup() { } } + // The standard library of the Si7021 sets the heater element to the default 3.1mA, but we want the full power + // We could alter the library, but than we break compatibility. So for this one time we do a raw-write to the + // heater register. + const uint8_t SI7021_I2C_ADDRESS =(0x40); + const uint8_t SI7021_CMD_WRITE_HEATER_CONTROL_REG =(0x51); + const uint8_t SI7021_HEATER_FULL_BLAST =(0x0F); // Set heater to 94mA + i2c.writeByte(SI7021_I2C_ADDRESS, SI7021_CMD_WRITE_HEATER_CONTROL_REG, SI7021_HEATER_FULL_BLAST); + // Initialize BMP280 pressure sensor Serial.print(F("Pressure sensor BMP280 ")); if (bmp280.initialize()) @@ -467,11 +590,22 @@ void loop() { mb.Ireg (SensorTemperatureIreg, MeasuredData.Temperature); mb.Ireg (SensorHumidityIreg, MeasuredData.Humidity); mb.Ireg (SensorPressureIreg, MeasuredData.Pressure); + mb.Ireg (SensorTemperatureBackupIreg, MeasuredData.TemperatureBackup); + mb.Ireg (SensorLuminosityIreg, MeasuredData.Luminosity); + mb.Ireg (SensorRainfallRawIreg, MeasuredData.RainfallCounter); + mb.Ireg (SensorStatusBitsIreg, MeasuredData.StatusBits); // Debug wind vane //Serial.print(F("\n Measured ADC: ")); //Serial.print(analogRead(windDirectionPin)); + // enable or disable smart heater + if (mb.Coil (HeaterCoil)) { + MeasuredData.StatusBits |= 0x04; // Set bit + } else { + MeasuredData.StatusBits &= 0x0B; // Reset bit + } + digitalWrite(LED_BUILTIN, LOW); // LED as heartbeat diff --git a/test_software/__pycache__/epever_control.cpython-36.pyc b/test_software/__pycache__/epever_control.cpython-36.pyc index 5fe7fbf..a38d4ad 100644 Binary files a/test_software/__pycache__/epever_control.cpython-36.pyc and b/test_software/__pycache__/epever_control.cpython-36.pyc differ diff --git a/test_software/epever_control.py b/test_software/epever_control.py index bcf0386..4c42a90 100644 --- a/test_software/epever_control.py +++ b/test_software/epever_control.py @@ -52,6 +52,10 @@ class EpeverChargeController(minimalmodbus.Instrument): @retry(wait_fixed=200, stop_max_attempt_number=5) def retriable_read_bit(self, registeraddress, functioncode): return self.read_bit(registeraddress, functioncode) + + @retry(wait_fixed=200, stop_max_attempt_number=5) + def retriable_write_bit(self, registeraddress, data, functioncode): + return self.write_bit(registeraddress, data, functioncode) #Address range 0x3000 def get_id(self): @@ -60,7 +64,7 @@ class EpeverChargeController(minimalmodbus.Instrument): def get_wind_direction(self): """PV array rated current""" - return self.retriable_read_register(1, 0, 4) + return self.retriable_read_register(1, 1, 4) def get_wind_speedl(self): """PV array rated power (low 16 bits)""" @@ -93,3 +97,17 @@ class EpeverChargeController(minimalmodbus.Instrument): def get_pressure(self): """Charging mode: 0x0001 = PWM""" return self.retriable_read_register(9, 1, 4) + + def get_temperature_backup(self): + """Charging mode: 0x0001 = PWM""" + return self.retriable_read_register(13, 2, 4) + + def get_status_bits(self): + """Charging mode: 0x0001 = PWM""" + return self.retriable_read_register(14, 0, 4) + + def enable_heater(self): + self.retriable_write_bit(0, 1, 5) + + def disable_heater(self): + self.retriable_write_bit(0, 0, 5) diff --git a/test_software/weather_station_rs485_client.py b/test_software/weather_station_rs485_client.py index 5509005..62118d8 100644 --- a/test_software/weather_station_rs485_client.py +++ b/test_software/weather_station_rs485_client.py @@ -594,7 +594,9 @@ elif dump_file: dump_all_registers() else: - + status = 1 + print("Enable heater function") + controller.enable_heater() while (1): time.sleep(3) # Sleep for 3 seconds print ("Retrieving all known registers.") @@ -608,6 +610,8 @@ else: rawdat['Temperature'] = controller.get_temperature() rawdat['Humidity'] = controller.get_humidity() rawdat['Pressure'] = controller.get_pressure() + rawdat['Temp backup'] = controller.get_temperature_backup() + rawdat['Status bits'] = controller.get_status_bits() print (json.dumps(rawdat, indent=1, sort_keys=False))