 // Process serial communication using Modbus protocol
 void communicate() {
 #ifndef DEBUG
-  // wait for the request 00 03 00 00 00 0A C4 1C
+  // wait for the request 00 03 00 00 00 0E C5 DF
   boolean sendResponse = false;
   while (Serial.available() > 0) {
     byte inByte = (byte)Serial.read();
     
-    if (inByte == 0x1C) {
+    if (inByte == 0xDF) {
       sendResponse = true;
     }
   }
   
   // send response
   if (sendResponse) {
-    memcpy(modbusBuf + 3, (byte*)&dhtH, 4);
-    memcpy(modbusBuf + 7, (byte*)&dhtT, 4);
-    memcpy(modbusBuf + 11, (byte*)&dsT, 12);
+    memcpy(modbusBuf + 3, (byte*)&bmpP, 4);
+    memcpy(modbusBuf + 7, (byte*)&bmpT, 4);
+    memcpy(modbusBuf + 11, (byte*)&dhtH, 4);
+    memcpy(modbusBuf + 15, (byte*)&dhtT, 4);
+    memcpy(modbusBuf + 19, (byte*)&dsT, 12);
     unsigned short crc = CRC16(modbusBuf, MODBUS_BUF_LEN - 2);
-    memcpy(modbusBuf + 23, (byte*)&crc, 2);
+    memcpy(modbusBuf + 31, (byte*)&crc, 2);
     Serial.write(modbusBuf, MODBUS_BUF_LEN);
   }
 #endif

 * DHT11/22 - 1 unit,
 * DS18B20  - 3 units,
 * 
 * Communicates using Modbus RTU:
 * Holding Registers (4x) 40001 - 40010
 * 
 * (c) 2017-2019, Mikhail Shiryaev
 */

#include <DHT.h>               // https://github.com/adafruit/DHT-sensor-library
#include <OneWire.h>           // http://www.pjrc.com/teensy/td_libs_OneWire.html
#include <DallasTemperature.h> // https://github.com/milesburton/Arduino-Temperature-Control-Library

  Serial.begin(9600);
  DEBUG_PRINTLN();
  DEBUG_PRINTLN("SERIAL TH meter started");
  initBMP();
  initDHT();
  initDS();
  DEBUG_PRINTLN();
