Skip to content

Commit

Permalink
v0.9.22 control for FDY/FDYQ, scopemode for writes, L2/L3/L5 mode, an…
Browse files Browse the repository at this point in the history
…d more
  • Loading branch information
Arnold-n committed Sep 18, 2022
1 parent 62a6d49 commit 74d8eea
Show file tree
Hide file tree
Showing 26 changed files with 3,989 additions and 1,206 deletions.
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1,574 changes: 1,574 additions & 0 deletions Firmware_images/P1P2Monitor-0.9.22-Eseries.ino.hex

Large diffs are not rendered by default.

1,262 changes: 1,262 additions & 0 deletions Firmware_images/P1P2Monitor-0.9.22-Fseries.ino.hex

Large diffs are not rendered by default.

30 changes: 19 additions & 11 deletions Firmware_images/README.md
Expand Up @@ -6,56 +6,64 @@

P1P2Monitor auxiliary control is currently only usable for Daikin E-series. Monitoring is also available for certain F-series models.

[P1P2Monitor v0.9.18](P1P2Monitor-0.9.18.ino.hex)
[P1P2Monitor v0.9.22](P1P2Monitor-0.9.22.ino.hex)

To install (Linux CLI):

```
avrdude -c avrisp -p atmega328p -P net:<IPv4>:328 -e -Uflash:w:P1P2Monitor-0.9.18.ino.hex:i
avrdude -c avrisp -p atmega328p -P net:<IPv4>:328 -e -Uflash:w:P1P2Monitor-0.9.22.ino.hex:i
```

To install (Windows CLI, using avrdude 7.0 for Windows):

```
avrdude.exe -c avrisp -p m328p -P net:<IPv4>:328 -e -Uflash:w:P1P2Monitor-0.9.18.ino.hex:i
avrdude.exe -c avrisp -p m328p -P net:<IPv4>:328 -e -Uflash:w:P1P2Monitor-0.9.22.ino.hex:i
```

## P1P2-bridge-esp8266 firmware for 4MB ESP8266 on P1P2-ESP-Interface

[P1P2-bridge-esp8266 0.9.21 (4MB version) for Daikin E-series](P1P2-bridge-esp8266-0.9.21-Eseries-4MB.ino.bin)
[P1P2-bridge-esp8266 0.9.22 (4MB version) for Daikin E-series](P1P2-bridge-esp8266-0.9.22-Eseries-4MB.ino.bin)

[P1P2-bridge-esp8266 0.9.21 (4MB version) for Daikin F-series](P1P2-bridge-esp8266-0.9.21-Fseries-4MB.ino.bin)
[P1P2-bridge-esp8266 0.9.22 (4MB version) for Daikin F-series](P1P2-bridge-esp8266-0.9.22-Fseries-4MB.ino.bin)

To install OTA (Linux CLI):

```
~/.arduino15/packages/esp8266/tools/python3/3.7.2-post1/python3 -I ~/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/espota.py -i <IPv4> -p 8266 --auth=P1P2MQTT -f P1P2-bridge-esp8266-0.9.21-Eseries-4MB.ino.bin
~/.arduino15/packages/esp8266/tools/python3/3.7.2-post1/python3 -I ~/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/espota.py -i <IPv4> -p 8266 --auth=P1P2MQTT -f P1P2-bridge-esp8266-0.9.22-Eseries-4MB.ino.bin
```
or
```
~/.arduino15/packages/esp8266/tools/python3/3.7.2-post1/python3 -I ~/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/espota.py -i <IPv4> -p 8266 --auth=P1P2MQTT -f P1P2-bridge-esp8266-0.9.21-Fseries-4MB.ino.bin
~/.arduino15/packages/esp8266/tools/python3/3.7.2-post1/python3 -I ~/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/espota.py -i <IPv4> -p 8266 --auth=P1P2MQTT -f P1P2-bridge-esp8266-0.9.22-Fseries-4MB.ino.bin
```

To install over USB with ESP01 programmer (Linux CLI):

```
~/.arduino15/packages/esp8266/tools/python3/3.7.2-post1/python3 -I ~/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/upload.py --chip esp8266 --port /dev/ttyUSB0 --baud 115200 --before default_reset --after hard_reset write_flash 0x0 P1P2-bridge-esp8266-0.9.21-Eseries-4MB.ino.bin
~/.arduino15/packages/esp8266/tools/python3/3.7.2-post1/python3 -I ~/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/upload.py --chip esp8266 --port /dev/ttyUSB0 --baud 115200 --before default_reset --after hard_reset write_flash 0x0 P1P2-bridge-esp8266-0.9.22-Eseries-4MB.ino.bin
```
or
```
~/.arduino15/packages/esp8266/tools/python3/3.7.2-post1/python3 -I ~/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/upload.py --chip esp8266 --port /dev/ttyUSB0 --baud 115200 --before default_reset --after hard_reset write_flash 0x0 P1P2-bridge-esp8266-0.9.21-Eseries-4MB.ino.bin
~/.arduino15/packages/esp8266/tools/python3/3.7.2-post1/python3 -I ~/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/upload.py --chip esp8266 --port /dev/ttyUSB0 --baud 115200 --before default_reset --after hard_reset write_flash 0x0 P1P2-bridge-esp8266-0.9.22-Eseries-4MB.ino.bin
```

To install OTA from Windows with espota.py from [here](https://github.com/esp8266/Arduino.git):

```
yourpath\Arduino-master\tools\espota.py -i <IPv4> -p 8266 --auth=P1P2MQTT -f P1P2-bridge-esp8266-0.9.21-Eseries-4MB.ino.bin
yourpath\Arduino-master\tools\espota.py -i <IPv4> -p 8266 --auth=P1P2MQTT -f P1P2-bridge-esp8266-0.9.22-Eseries-4MB.ino.bin
```

```
yourpath\Arduino-master\tools\espota.py -i <IPv4> -p 8266 --auth=P1P2MQTT -f P1P2-bridge-esp8266-0.9.21-Fseries-4MB.ino.bin
yourpath\Arduino-master\tools\espota.py -i <IPv4> -p 8266 --auth=P1P2MQTT -f P1P2-bridge-esp8266-0.9.22-Fseries-4MB.ino.bin
```

## P1P2-bridge-esp8266 firmware for 1MB ESP01s

Uses MQTT_INPUT_HEXDATA (topic P1P2/R/#) instead of serial for P1/P2 data input, and provides debugging output over 115.2kBaud serial.

[P1P2-bridge-esp8266 0.9.22 (1MB version) for Daikin E-series](P1P2-bridge-esp8266-0.9.22-Eseries-ESP01s.ino.bin)

[P1P2-bridge-esp8266 0.9.22 (1MB version) for Daikin F-series](P1P2-bridge-esp8266-0.9.22-Fseries-ESP01s.ino.bin)

## FOSS notice

These images are built with Arduino BSPs and libraries, for which source code and license information is made available [here](../OSS-dependencies/README.md).
1 change: 1 addition & 0 deletions KnownIssues.md
Expand Up @@ -4,6 +4,7 @@

- MQTT username/password length is limited to 19/39 characters. HA's MQTT server may generate 64-char passwords. Max length will be increased in a next release.
- MQTT reconnect may fail, especially if the WIFI signal is weak (~ -90 dBm), resulting in an ESP8266 reboot
- repeated MQTT reconnects due to poor WiFi may reduce free memory (repeated subscription related)?
- P1P2-bridge-esp8266 is end-of-life and will be replaced by P1P2MQTT, which is more robust and more memory-efficient, and more user friendly

### Hardware related
Expand Down
8 changes: 4 additions & 4 deletions LogicalFormat/Daikin-protocol-EHYHBX08AAV3.md
Expand Up @@ -43,10 +43,10 @@ A description of the restart process follows at the end of this document.

# Packet types 10-1F form communication package between main controller and heat pump

## Packet type 10 - operating status

Packet types 10-16 are part of the regular communication pattern between main controller and heat pump.

## Packet type 10 - operating status

### Packet type 10: request

Header: 000010
Expand Down Expand Up @@ -1000,7 +1000,7 @@ Header: 4000B1
| 1-12 | XX | ASCII "EHYHBH08AAV3" name inside unit | c8
| 13-17 | 00 | ASCII '\0' | c8

# Packet type B8 - counters, #hours, #starts, electricy used, energy produced
# Packet type B8 - counters, #hours, #starts, electricity used, energy produced

Counters for energy consumed and operating hours. The main controller specifies which data type it would like to receive. The heat pump responds with the requested data type counters. A B8 package is only transmitted by the main controller after a manual menu request for these counters. P1P2Monitor can insert B8 requests to poll these counters, but this violates the rule that an auxiliary controller should not act as main controller. But if timed carefully, it works.

Expand Down Expand Up @@ -1088,7 +1088,7 @@ The restart process is initiated by setting byte 16 of packet "000012.." to 0x61

### Initial sequence

During the initial sequence and test patterns, the main controller(or another entity taking over this role) uses address 0x80 instead of 0x40
During the initial sequence and test patterns, the main controller (or another entity taking over this role) uses address 0x80 instead of 0x40

- Request header: 808000, payload empty
- Response header: 400000 payload empty
Expand Down
2 changes: 1 addition & 1 deletion LogicalFormat/README.md
Expand Up @@ -18,7 +18,7 @@ On Daikin Altherma the user interface may be called EKRUCBL (https://www.daikin.

#### Peripherals

There is always at least one peripheral on the P1/P2 bus: the heat pump itself (address 00). Depending on the main controller, one or more external controllers are allowed as additional peripherals (address 0xF0 and higher). An additional peripheral (such as a Daikin LAN adapter BRP069A61 or BRP069A62, a Zennio KLIC-DA KNX adapter, or Realtime Modbus RTD-LT/CA adapter) acts as an auxiliary (or external) controller.
There is always at least one peripheral on the P1/P2 bus: the heat pump itself (address 00). Depending on the main controller, one or more external controllers are allowed as additional peripherals (address 0xF0 and higher). An additional peripheral (such as P1P2Monitor itself, a Daikin LAN adapter BRP069A61 or BRP069A62, a Zennio KLIC-DA KNX adapter, or Realtime Modbus RTD-LT/CA adapter) acts as an auxiliary (or external) controller.

#### How to avoid bus collissions when writing?

Expand Down
20 changes: 13 additions & 7 deletions P1P2MQTT.md
Expand Up @@ -147,7 +147,7 @@ Topics providing information or commands to P1P2MQTT:

Commands to be executed by P1P2MQTT can be given over P1P2/W/\<xxx\> or via telnet:
- "A" Execute hard reset of ATmega328P
- "B" MQTT_server_IPv4 [MQTT_portnr [MQTT_user MQTT_password]] sets MQTT server details.
- "B" [MQTT_server_IPv4 [MQTT_portnr [MQTT_user [MQTT_password [MQTT_INPUT_IPv4-byte4]]]]] sets MQTT server details and, for ESP01s taking input over MQTT, 4th byte of IPv4 of data source (with 0 for subscribing to P1P2/R/#).
- "D0" Reset ESP8266
- "D1" Restart ESP8266
- "S" Display output filter level (replaces previous changed-only mode)
Expand All @@ -165,15 +165,16 @@ Commands to be executed by P1P2MQTT can be given over P1P2/W/\<xxx\> or via teln
- 0x0010 ESP to output raw data over telnet
- 0x0020 to output mqtt individual parameter data over telnet
- 0x0040 to output json data over telnet
- 0x0080 (reserved)
- 0x0080 (reserved for adding time string in R output)
- 0x0100 ESP to output raw data over serial
- 0x0200 to output mqtt individual parameter data over serial
- 0x0400 to output json data over serial
- 0x0800 to output raw binary data over P1P2/X/#
- 0x1000 output timing data (if scope mode is set to 1) via P1P2/R/xxx (with prefix C)
- 0x1000 output timing data (if scope mode is set to 1) via P1P2/R/xxx (with prefixes C and c)
- 0x2000 output packets with errors also over P1P2/R/xxx (with prefix \*)
- 0x4000 (reserved)
- 0x8000 (reserved)
- 0x4000 to use P1P2/R/xxx as input instead of serial (requires MQTT_INPUT_HEXDATA)
- 0x8000 to use P1P2/X/xxx as input instead of serial (requires MQTT_INPUT_BINDAT)
- 0x10000 to include non-HACONFIG parameters in P1P2/P/#
- "V" Display verbosity (and displays software version + compile date/time of both P1P2MQTT and P1P2Monitor)
- "Vx" Sets verbosity (and displays software version + compile date/time of both P1P2MQTT and P1P2Monitor) (for verbosity levels 0-4, see [P1P2Monitor-commands.md](https://github.com/Arnold-n/P1P2Serial/blob/main/P1P2Monitor-commands.md); level 9: ESP8266 ignoring serial input (safe mode))
- "U" Display scope mode (0 off, 1 on)
Expand All @@ -186,8 +187,9 @@ Further, supported but advised not to use, and not really needed (some may be re
- "Hx" Sets crc_feed (default 0x00) (we have not seen any other values so no need to change)

No longer supported:
- "Ux" Diaplay-unknown mode on/off, replaced by 0x0008 contribution in J command
- "Ux" Display-unknown mode on/off, replaced by 0x0008 contribution in J command
- "U" Display display-unknown mode
- ("U" command is now used to switch scope-mode in P1P2Monitor)

#### P1P2Monitor commands (forwarded by P1P2MQTT)

Expand All @@ -196,5 +198,9 @@ All other commands received by P1P2MQTT (as well as the CRC-related G and H comm
- "L0" to stop auxiliary controller
- "C2" to start requesting counters ("C" state info maintained in EEPROM)
- "C0" to stop requesting counters
- "E" for parameter writing, for example,
- "E" for parameter writing for Daikin E-series, for example,
- "E 35002F01" to switch heating on (packet type 0x35, parameter 0x002F, value 0x01). Other allowable formats are space-separated "E 35 2F 1" or shortening the third parameter as in "E35002F1".
- "F" (not released yet) for writing for Daikin F-series, for example,
- "F 38 0 1" to set packet type 38 byte 0 to 0 to power FDY model on
- "F 38 0 0" to power FDY model off
- "F 38 8 51" to set FDY model heating fan mode high
78 changes: 40 additions & 38 deletions P1P2Monitor-commands.md
Expand Up @@ -52,55 +52,57 @@ A few pre-defined parameter writing actions are still available from earlier P1P

## Old parameter write commands (will be outphased):

- Px sets (16-bit) parameter number in packet type 35 to use for Zx command (default PARAM_HC_ONOFF)
- P reports parameter number used for writes to packet type 35
- Qx sets (16-bit) parameter number in packet type 36 to use for Rx command (default PARAM_TEMP)
- Q reports parameter number used for writes to packet type 36
- Mx sets (16-bit) parameter number in packet type 3A to use for Nx command (default PARAM_SYS)
- M reports parameter number used for writes to packet type 3A
- Zx sets heating(/cooling) on/off (1/0) (function can be changed using Px command below to set any 8-bit parameter in packet type 35)
- Z reports status of write action
- Rx sets DHW temperature (function can be changed using Qx command below to set any 16-bit parameter in packet type 36)
- R reports status of write action
- Nx sets 8-bit value of 8-bit parameter selected by Q command) in packet type 3A
- N reports status of write action
- Yx sets DHW on/off (using parameter PARAM_DHW_ONOFF, cannot be changed)
- Y reports status of write action
- Px sets (16-bit) parameter number in packet type 35 to use for Zx command (default PARAM_HC_ONOFF),
- P reports parameter number used for writes to packet type 35,
- Qx sets (16-bit) parameter number in packet type 36 to use for Rx command (default PARAM_TEMP),
- Q reports parameter number used for writes to packet type 36,
- Mx sets (16-bit) parameter number in packet type 3A to use for Nx command (default PARAM_SYS),
- M reports parameter number used for writes to packet type 3A,
- Zx sets heating(/cooling) on/off (1/0) (function can be changed using Px command below to set any 8-bit parameter in packet type 35),
- Z reports status of write action,
- Rx sets DHW temperature (function can be changed using Qx command below to set any 16-bit parameter in packet type 36),
- R reports status of write action,
- Nx sets 8-bit value of 8-bit parameter selected by Q command) in packet type 3A,
- N reports status of write action,
- Yx sets DHW on/off (using parameter PARAM_DHW_ONOFF, cannot be changed), and
- Y reports status of write action.

### Monitor commands:

- V Show verbosity mode (default 3 for interfacing to P1P2MQTT), P1P2Monitor version and date/time of compilation
- Vx Sets verbosity mode (0 minimal, 1 traditional, 2 for P1P2MQTT, 3 like 2 with timing info added, 4 for suppression of hex data)
- U Shows scope mode (default 0 off, 1 on)
- Ux Sets scope mode (default 0 off, 1 on); adds timing info for the start of some of the packets read via serial output and R topic
- \* comment lines starting with an asterisk are ignored (and echoed in verbosity modes 1 and 4)
- V Show verbosity mode (default 3 for interfacing to P1P2MQTT), P1P2Monitor version and date/time of compilation,
- Vx Sets verbosity mode (0 minimal, 1 traditional, 2 for P1P2MQTT, 3 like 2 with timing info added, 4 for suppression of hex data),
- U Shows scope mode (default 0 off, 1 on),
- Ux Sets scope mode (default 0 off, 1 on); adds timing info for the start of some of the packets read via serial output and R topic, and
- \* comment lines starting with an asterisk are ignored (and echoed in verbosity modes 1 and 4).

## Auxiliary controller commands:

- L1 sets auxiliary controller mode on (controller address (0xF0 or 0xF1) is auto-detected after check whether another auxiliary controller is present or not) (can also be set in P1P2Config.h) (controller ID is saved in EEPROM, so this command remains effective after a restart)
- L0 sets auxiliary controller mode off
- L displays current controller_id (0x00 = off; 0xF0/0xF1 is first/secondary auxiliary controller)
- C1 triggers single cycle of 6 B8 packets to request (energy/operation/starts) counters from heat pump
- C2 like C1, but keeps repeating every new minute
- C0 Stop requesting counters
- C Show counter-repeating-request status
- L1 sets auxiliary controller mode on (controller address (0xF0 or 0xF1) is auto-detected after check whether another auxiliary controller is present or not) (can also be set in P1P2Config.h) (controller ID is saved in EEPROM, so this command remains effective after a restart),
- L0 sets auxiliary controller mode off,
- L2 (and L3) switch auxiliary controller mode off (and on) but do not save this change to EEPROM,
- L5 (F-series only) switches auxiliary controller mode partially on: only 00F030 messages are responded to. This enable monitoring which 00F03x packets will be requested. Not saved to EEPROM,
- L displays current controller_id (0x00 = off; 0xF0/0xF1 is first/secondary auxiliary controller),
- C1 triggers single cycle of 6 B8 packets to request (energy/operation/starts) counters from heat pump,
- C2 like C1, but keeps repeating every new minute,
- C0 stop requesting counters, and
- C show counter-repeating-request status.

## Raw data commands:

Commands for raw data writing to the bus (only for reverse engineering purposes), avoid these commands unless you know what you do:
- W\<hex data\> Write raw packet (max 32 bytes (as defined by WB_SIZE)) (no 0x prefix should be used for the hex bytes; hex bytes may be concatenated or separated by white space)
- T Display current delay value (a packet will be written after exactly <delay> ms after the latest start bit, or if the bus has been silent for <delaytimeout> ms)
- Tx sets new delay value in ms, to be used for future packets (default 50 (older versions: 0))
- O Display current delaytimeout value
- Ox sets new delay timeout value in ms, to be used immediately (default 2500)
- W\<hex data\> Write raw packet (max 32 bytes (as defined by WB_SIZE)) (no 0x prefix should be used for the hex bytes; hex bytes may be concatenated or separated by white space),
- T display current delay value (a packet will be written after exactly <delay> ms after the latest start bit, or if the bus has been silent for <delaytimeout> ms),
- Tx sets new delay value in ms, to be used for future packets (default 50 (older versions: 0)),
- O display current delaytimeout value, and
- Ox sets new delay timeout value in ms, to be used immediately (default 2500).

## Miscellaneous

Supported but advised not to use, not really needed (some may be removed in a future version):
- G Display current crc_gen value
- Gx Sets crc_gen (default 0xD9) (we have not seen any other values so no need to change)
- H Display current crc_feed value
- Hx Sets crc_feed (default 0x00) (we have not seen any other values so no need to change)
- X Display current echo status (determines whether bytes written will be echoed on the serial line, and also whether bus errors will be detected during writing)
- Xx sets echo status on/off (recommended to keep on to detect bus errors)
- K instruct ATmega328P to reset itself
- G display current crc_gen value,
- Gx sets crc_gen (default 0xD9) (we have not seen any other values so no need to change),
- H display current crc_feed value,
- Hx sets crc_feed (default 0x00) (we have not seen any other values so no need to change),
- X display current echo status (determines whether bytes written will be echoed on the serial line, and also whether bus errors will be detected during writing),
- Xx sets echo status on/off (recommended to keep on to detect bus errors), and
- K instruct ATmega328P to reset itself.

0 comments on commit 74d8eea

Please sign in to comment.